Made changes requested by HL team. Class now inherits from MonoBehaviour instead of Singleton, fixed a spelling error, and regions were removed. Also added the ability to speak SSML which was omitted from the original submission.

--- Assets/HoloToolkit/Speech/Scripts/TextToSpeechManager.cs
+++ Assets/HoloToolkit/Speech/Scripts/TextToSpeechManager.cs
@@ -4,6 +4,7 @@
 using UnityEngine;

 #if WINDOWS_UWP
+using Windows.Foundation;
 using Windows.Media.SpeechSynthesis;
 using Windows.Storage.Streams;
 using System.Threading.Tasks;
@@ -20,61 +21,47 @@
     /// the <see cref="AudioSource"/> you supply in the inspector. This allows you to position the voice
     /// as desired in 3D space. One recommended approach is to place the AudioSource on an empty
     /// GameObject that is a child of Main Camera and position it approximately 0.6 units above the
-    /// camera. This orientation will sound similar to Cortanas speech in the OS.
+    /// camera. This orientation will sound similar to Cortana's speech in the OS.
     /// </remarks>
-    public class TextToSpeechManager : Singleton<TextToSpeechManager>
+    public class TextToSpeechManager : MonoBehaviour
     {
-        #region Region Name
+        // Inspector Variables
+        [Tooltip("The audio source where speech will be played.")]
         public AudioSource audioSource;
-        #endregion // Region Name

-        #region Member Variables
+        // Member Variables
         #if WINDOWS_UWP
         private SpeechSynthesizer synthesizer;
         #endif
-        #endregion // Member Variables

-        #region Internal Methods
-        private void StartSpeech()
-        {
-            try
-            {
-                if (audioSource == null) { throw new InvalidOperationException("An AudioSource is required and should be assigned to 'Audio Source' in the inspector."); }
-                #if WINDOWS_UWP
-                synthesizer = new SpeechSynthesizer();
-                #endif
-            }
-            catch (Exception ex)
-            {
-                Debug.LogError("Could not start Speech Synthesis");
-                Debug.LogException(ex);
-            }
-        }
-        #endregion // Internal Methods
+        // Internal Methods

-        #region Overrides / Event Handlers
-        // Use this for initialization
-        void Start()
-        {
-            // Start speech
-            StartSpeech();
-        }
-        #endregion // Overrides / Event Handlers
-
-
-        #region Public Methods
         /// <summary>
-        /// Speaks the specified text using text-to-speech.
+        /// Logs speech text that normally would have been played.
         /// </summary>
         /// <param name="text">
-        /// The text to speak.
+        /// The speech text.
         /// </param>
-        public void Speak(string text)
+        private void LogSpeech(string text)
+        {
+            Debug.LogFormat("Speech not supported in editor. \"{0}\"", text);
+        }
+
+        #if WINDOWS_UWP
+        /// <summary>
+        /// Executes a function that generates a speech stream and then converts and plays it in Unity.
+        /// </summary>
+        /// <param name="text">
+        /// A raw text version of what's being spoken for use in debug messages when speech isn't supported.
+        /// </param>
+        /// <param name="speakFunc">
+        /// The actual function that will be executed to generate speech.
+        /// </param>
+        private void PlaySpeech(string text, Func<IAsyncOperation<SpeechSynthesisStream>> speakFunc)
         {
             // Make sure there's something to speak
-            if (string.IsNullOrEmpty(text)) { return; }
+            if (speakFunc == null) throw new ArgumentNullException(nameof(speakFunc));

-            #if UNITY_UWP
             if (synthesizer != null)
             {
                 try
@@ -83,8 +70,8 @@
                     // This is good since it frees up Unity to keep running anyway.
                     Task.Run(async () =>
                     {
-                        // Speak text to stream
-                        var speechStream = await synthesizer.SynthesizeTextToStreamAsync(text);
+                        // Speak and get stream
+                        var speechStream = await speakFunc();

                         // Get the size of the original stream
                         var size = speechStream.Size;
@@ -114,7 +101,7 @@

                         // The remainder must be done back on Unity's main thread
                         UnityEngine.WSA.Application.InvokeOnAppThread(() =>
-                            {
+                        {
                             // Convert to an audio clip
                             var clip = wav.ToClip("Speech");

@@ -123,7 +110,7 @@

                             // Play audio
                             audioSource.Play();
-                            }, false);
+                        }, false);
                     });
                 }
                 catch (Exception ex)
@@ -135,13 +122,70 @@
             {
                 Debug.LogErrorFormat("Speech not initialized. \"{0}\"", text);
             }
+        }
+        #endif

-        #else
+        private void StartSpeech()
+        {
+            try
+            {
+                if (audioSource == null) { throw new InvalidOperationException("An AudioSource is required and should be assigned to 'Audio Source' in the inspector."); }
+                #if WINDOWS_UWP
+                synthesizer = new SpeechSynthesizer();
+                #endif
+            }
+            catch (Exception ex)
+            {
+                Debug.LogError("Could not start Speech Synthesis");
+                Debug.LogException(ex);
+            }
+        }

-        Debug.LogFormat("Speech not supported in editor. \"{0}\"", text);
-
-        #endif
+        // MonoBehaviour Methods
+        void Start()
+        {
+            // Start speech
+            StartSpeech();
         }
-        #endregion // Public Methods
+
+        // Public Methods
+
+        /// <summary>
+        /// Speaks the specified SSML markup using text-to-speech.
+        /// </summary>
+        /// <param name="ssml">
+        /// The SSML markup to speak.
+        /// </param>
+        public void SpeakSsml(string ssml)
+        {
+            // Make sure there's something to speak
+            if (string.IsNullOrEmpty(ssml)) { return; }
+
+            // Pass to helper method
+            #if WINDOWS_UWP
+            PlaySpeech(ssml, () => synthesizer.SynthesizeSsmlToStreamAsync(ssml));
+            #else
+            LogSpeech(ssml);
+            #endif
+        }
+
+        /// <summary>
+        /// Speaks the specified text using text-to-speech.
+        /// </summary>
+        /// <param name="text">
+        /// The text to speak.
+        /// </param>
+        public void SpeakText(string text)
+        {
+            // Make sure there's something to speak
+            if (string.IsNullOrEmpty(text)) { return; }
+
+            // Pass to helper method
+            #if WINDOWS_UWP
+            PlaySpeech(text, ()=> synthesizer.SynthesizeTextToStreamAsync(text));
+            #else
+            LogSpeech(text);
+            #endif
+        }
     }
 }


Added settings section in window

Added settings section in window

--- Assets/NativePluginBuilder/Editor/NativePluginBuilder.cs
+++ Assets/NativePluginBuilder/Editor/NativePluginBuilder.cs
@@ -27,7 +27,8 @@
         private static int selectedSection = -1;
         private static AnimBool[] SectionAnimators;

-        public static string lastLogLine;
+		public static string lastLogLine;
+		public static string cmakeVersion;

         [MenuItem("Window/Native Plugin Builder")]
         static void Init()
@@ -67,6 +68,8 @@

         void OnGUI()
         {
+			OnGuiSettings ();
+
             OnGuiPlugins();

             OnGuiNewPlugin();
@@ -78,6 +81,22 @@

         }

+		void OnGuiSettings() {
+			EditorGUILayout.LabelField("Plugins", EditorStyles.boldLabel);
+
+			EditorGUILayout.Space();
+
+			EditorGUILayout.BeginHorizontal();
+			EditorGUILayout.LabelField ("CMake version", cmakeVersion);
+			if (GUILayout.Button("Get Version", GUILayout.Width(110)))
+			{
+				cmakeVersion = CMakeHelper.GetCMakeVersion ();
+			}
+			EditorGUILayout.EndHorizontal();
+
+			EditorGUILayout.Space();
+
+		}

         void OnGuiPlugins()
         {


Add UniTask<UniTask<>>.Unwrap

Add UniTask<UniTask<>>.Unwrap

--- Assets/Plugins/UniRx/Scripts/Async/UniTask.Extensions.cs
+++ Assets/Plugins/UniRx/Scripts/Async/UniTask.Extensions.cs
@@ -264,6 +264,16 @@
             return v;
         }

+        public static async UniTask<T> Unwrap<T>(this UniTask<UniTask<T>> task)
+        {
+            return await await task;
+        }
+
+        public static async UniTask Unwrap<T>(this UniTask<UniTask> task)
+        {
+            await await task;
+        }
+
         class ToCoroutineEnumerator : IEnumerator
         {
             bool completed;


don't modify internal ode data in update()

--- Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
+++ Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
@@ -1311,39 +1311,42 @@
                 m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar {0}, physical actor {1}", m_name, m_uuid);
             }

-
-            //  kluge to keep things in bounds.  ODE lets dead avatars drift away (they should be removed!)
-            bool needfixbody = false;
-
-            if (vec.X < 0.0f)
-                {
-                needfixbody = true;
-                vec.X = CAPSULE_RADIUS;
-                }
-            else if (vec.X > (int)_parent_scene.WorldExtents.X - CAPSULE_RADIUS)
-                {
-                needfixbody = true;
-                vec.X = (int)_parent_scene.WorldExtents.X - CAPSULE_RADIUS;
-                }
-
-            if (vec.Y < 0.0f)
-                {
-                needfixbody = true;
-                vec.Y = CAPSULE_RADIUS;
-                }
-            else if (vec.Y > (int)_parent_scene.WorldExtents.Y - CAPSULE_RADIUS)
-                {
-                needfixbody = true;
-                vec.Y = (int)_parent_scene.WorldExtents.Y - CAPSULE_RADIUS;
-                }
-
-            if (needfixbody)
-                d.BodySetPosition(Body, vec.X, vec.Y, vec.Z);
+            // vec is a ptr into internal ode data better not mess with it

             _position.X = (float)vec.X;
             _position.Y = (float)vec.Y;
             _position.Z = (float)vec.Z;

+            //  kluge to keep things in bounds.  ODE lets dead avatars drift away (they should be removed!)
+
+            bool needfixbody = false;
+
+            if (_position.X < 0.0f)
+                {
+                needfixbody = true;
+                _position.X = CAPSULE_RADIUS;
+                }
+            else if (_position.X > (int)_parent_scene.WorldExtents.X - CAPSULE_RADIUS)
+                {
+                needfixbody = true;
+                _position.X = (int)_parent_scene.WorldExtents.X - CAPSULE_RADIUS;
+                }
+
+            if (_position.Y < 0.0f)
+                {
+                needfixbody = true;
+                _position.Y = CAPSULE_RADIUS;
+                }
+            else if (_position.Y > (int)_parent_scene.WorldExtents.Y - CAPSULE_RADIUS)
+                {
+                needfixbody = true;
+                _position.Y = (int)_parent_scene.WorldExtents.Y - CAPSULE_RADIUS;
+                }
+
+            if (needfixbody)
+                d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
+
+
             // Did we move last? = zeroflag
             // This helps keep us from sliding all over

@@ -1380,8 +1383,6 @@
                     vec.Y = _velocity.Y;
                     vec.Z = _velocity.Z;
                 }
-
-

                 /*
                                 if (vec.X == 0 && vec.Y == 0 && vec.Z == 0)
@@ -1390,40 +1391,46 @@
                                 }
                                 else
                 */
+
+                // vec is a ptr into internal ode data better not mess with it
+
+                _velocity.X = vec.X;
+                _velocity.Y = vec.Y;
+                _velocity.Z = vec.Z;
+
                 needfixbody = false;

-                if (Math.Abs(vec.X) < 0.001 && vec.X != 0)
+                if (Math.Abs(_velocity.X) < 0.001)
                     {
                     needfixbody = true;
-                    vec.X = 0;
-                    }
-                if (Math.Abs(vec.Y) < 0.001 && vec.Y != 0)
+                    _velocity.X = 0;
+                    }
+                if (Math.Abs(_velocity.Y) < 0.001)
                     {
                     needfixbody = true;
-                    vec.Y = 0;
-                    }
-                if (Math.Abs(vec.Z) < 0.001 && vec.Z != 0)
+                    _velocity.Y = 0;
+                    }
+                if (Math.Abs(_velocity.Z) < 0.001)
                     {
                     needfixbody = true;
-                    vec.Z = 0;
+                    _velocity.Z = 0;
                     }

                 if (needfixbody)
-                    d.BodySetLinearVel(Body, vec.X, vec.Y, vec.Z);
-
-                _velocity = new Vector3((float)(vec.X), (float)(vec.Y), (float)(vec.Z));
+                    d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
+

                 const float VELOCITY_TOLERANCE = 0.001f;
                 const float POSITION_TOLERANCE = 0.05f;

                 //Check to see whether we need to trigger the significant movement method in the presence
-                if (!RotationalVelocity.ApproxEquals(m_lastRotationalVelocity, VELOCITY_TOLERANCE) ||
-                    !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
+// avas don't rotate for now                if (!RotationalVelocity.ApproxEquals(m_lastRotationalVelocity, VELOCITY_TOLERANCE) ||
+                if (    !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
                     !Position.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))
                 {
                     // Update the "last" values
                     m_lastPosition = Position;
-                    m_lastRotationalVelocity = RotationalVelocity;
+//                    m_lastRotationalVelocity = RotationalVelocity;
                     m_lastVelocity = Velocity;
                     base.RequestPhysicsterseUpdate();
                     base.TriggerSignificantMovement();


Increased timeout to 10 minutes

Increased timeout to 10 minutes

--- QualityEnforcerBot/Program.cs
+++ QualityEnforcerBot/Program.cs
@@ -16,7 +16,7 @@
 {
     public class Program
     {
-        private const int MinutesBetweenUpdates = 1;
+        private const int MinutesBetweenUpdates = 10;
         private const int MillisecondsBetweenUpdates = MinutesBetweenUpdates * 60 * 1000;

         public const string BaseRepository = "QualityEnforcer/QualityEnforcerBot";


Use CompareExchange value to lookup a user id by email in a guaranteed to be correct fashion. Pass cancellation token

--- RavenDB.Identity/UserStore.cs
+++ RavenDB.Identity/UserStore.cs
@@ -1,4 +1,4 @@
-using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity;
 using Raven.Client.Documents;
 using Raven.Client.Documents.Operations;
 using Raven.Client.Documents.Operations.CompareExchange;
@@ -266,19 +266,19 @@
             // Delete the user and save it. We must save it because deleting is a cluster-wide operation.
             // Only if the deletion succeeds will we remove the cluseter-wide compare/exchange key.
             this.DbSession.Delete(user);
-            await this.DbSession.SaveChangesAsync();
+            await this.DbSession.SaveChangesAsync(cancellationToken);

             return IdentityResult.Success;
         }

         /// <inheritdoc />
         public Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken) =>
-            this.DbSession.LoadAsync<TUser>(userId);
-
-        /// <inheritdoc />
-        public Task<TUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken) =>
+            this.DbSession.LoadAsync<TUser>(userId, cancellationToken);
+
+        /// <inheritdoc />
+        public Task<TUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken) =>
             DbSession.Query<TUser>()
-            .SingleOrDefaultAsync(u => u.UserName == normalizedUserName);
+            .SingleOrDefaultAsync(u => u.UserName == normalizedUserName, token: cancellationToken);

         #endregion

@@ -525,7 +525,7 @@
         public Task SetEmailAsync(TUser user, string email, CancellationToken cancellationToken)
         {
             ThrowIfDisposedOrCancelled(cancellationToken);
-            user.Email = email ?? throw new ArgumentNullException(nameof(email));
+            user.Email = email.ToLowerInvariant() ?? throw new ArgumentNullException(nameof(email));
             return Task.CompletedTask;
         }

@@ -545,8 +545,12 @@
         }

         /// <inheritdoc />
-        public Task<TUser> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken) =>
-            DbSession.Query<TUser>().FirstOrDefaultAsync(u => u.Email == normalizedEmail, cancellationToken);
+        public async Task<TUser> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken)
+        {
+            var getReq = new GetCompareExchangeValueOperation<string>(GetCompareExchangeKeyFromEmail(normalizedEmail));
+            var idResult = await DbSession.Advanced.DocumentStore.Operations.SendAsync(getReq, token: cancellationToken);
+            return await DbSession.LoadAsync<TUser>(idResult.Value, cancellationToken);
+        }

         /// <inheritdoc />
         public Task<string> GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken) =>


reset to java style formating

reset to java style formating

--- Refit-Tests/RequestBuilder.cs
+++ Refit-Tests/RequestBuilder.cs
@@ -55,13 +55,11 @@
         {
             bool shouldDie = true;

-            try
-            {
+            try {
                 var input = typeof(IRestMethodInfoTests);
                 var fixture = new RestMethodInfo(input, input.GetMethods().First(x => x.Name == "GarbagePath"));
             }
-            catch (ArgumentException)
-            {
+            catch (ArgumentException) {
                 shouldDie = false;
             }

@@ -73,13 +71,11 @@
         {
             bool shouldDie = true;

-            try
-            {
+            try {
                 var input = typeof(IRestMethodInfoTests);
                 var fixture = new RestMethodInfo(input, input.GetMethods().First(x => x.Name == "FetchSomeStuffMissingParameters"));
             }
-            catch (ArgumentException)
-            {
+            catch (ArgumentException) {
                 shouldDie = false;
             }

@@ -185,13 +181,11 @@
         {
             bool shouldDie = true;

-            try
-            {
+            try {
                 var input = typeof(IRestMethodInfoTests);
                 var fixture = new RestMethodInfo(input, input.GetMethods().First(x => x.Name == "AsyncOnlyBuddy"));
             }
-            catch (ArgumentException)
-            {
+            catch (ArgumentException) {
                 shouldDie = false;
             }

@@ -266,33 +260,27 @@
                 "FetchSomeStuff",
             };

-            foreach (var v in failureMethods)
-            {
+            foreach (var v in failureMethods) {
                 bool shouldDie = true;

-                try
-                {
+                try {
                     var fixture = new RequestBuilderImplementation(typeof(IDummyHttpApi));
                     fixture.BuildRequestFactoryForMethod(v);
                 }
-                catch (Exception ex)
-                {
+                catch (Exception ex) {
                     shouldDie = false;
                 }
                 Assert.IsFalse(shouldDie);
             }

-            foreach (var v in successMethods)
-            {
+            foreach (var v in successMethods) {
                 bool shouldDie = false;

-                try
-                {
+                try {
                     var fixture = new RequestBuilderImplementation(typeof(IDummyHttpApi));
                     fixture.BuildRequestFactoryForMethod(v);
                 }
-                catch (Exception ex)
-                {
+                catch (Exception ex) {
                     shouldDie = true;
                 }


fixed bugs with the comic sans font and the scaling mode

--- RelicModManager/MainWindow.cs
+++ RelicModManager/MainWindow.cs
@@ -2578,38 +2578,91 @@

         private void fontSizeDefault_CheckedChanged(object sender, EventArgs e)
         {
+            bool wasComicSans = Settings.comicSans;
+            if (Settings.comicSans && Settings.scalingMode == Settings.ScaleMode.dpi)
+            {
+                Settings.comicSans = false;
+                this.Font = Settings.getFont();
+            }
             Settings.scalingMode = Settings.ScaleMode.font;
             Settings.fontSizeforum = Settings.FontSize.regular;
             this.AutoScaleMode = Settings.getAutoScaleMode();
             this.Font = Settings.getFont();
+            if (wasComicSans)
+            {
+                Settings.comicSans = true;
+                this.Font = Settings.getFont();
+            }
         }

         private void fontSizeLarge_CheckedChanged(object sender, EventArgs e)
         {
+            bool wasComicSans = Settings.comicSans;
+            if (Settings.comicSans && Settings.scalingMode == Settings.ScaleMode.dpi)
+            {
+                Settings.comicSans = false;
+                this.Font = Settings.getFont();
+            }
             Settings.scalingMode = Settings.ScaleMode.font;
             Settings.fontSizeforum = Settings.FontSize.large;
             this.AutoScaleMode = Settings.getAutoScaleMode();
             this.Font = Settings.getFont();
+            if (wasComicSans)
+            {
+                Settings.comicSans = true;
+                this.Font = Settings.getFont();
+            }
         }

         private void fontSizeHUD_CheckedChanged(object sender, EventArgs e)
         {
             //DPI->font means scale mode then font
             //font->font means scale mode then font
+
+            //if comic sans font and dpi scale
+            //turn off comic sans
+
+            bool wasComicSans = Settings.comicSans;
+            if (Settings.comicSans && Settings.scalingMode == Settings.ScaleMode.dpi)
+            {
+                Settings.comicSans = false;
+                this.Font = Settings.getFont();
+            }
             Settings.scalingMode = Settings.ScaleMode.font;
             Settings.fontSizeforum = Settings.FontSize.UHD;
             this.AutoScaleMode = Settings.getAutoScaleMode();
             this.Font = Settings.getFont();
+            if (wasComicSans)
+            {
+                Settings.comicSans = true;
+                this.Font = Settings.getFont();
+            }
         }

         private void DPI_CheckedChanged(object sender, EventArgs e)
         {
             //default for all windows is font which means they all go from font->DPI or font->font
             //font->DPI means font then scale mode
+
+            //if comic sans font and font scale
+            //turn off comic sans and set font scale to normal
+
+            bool wasComicSans = Settings.comicSans;
+            if (Settings.comicSans && Settings.scalingMode == Settings.ScaleMode.font)
+            {
+                Settings.comicSans = false;
+                Settings.fontSizeforum = Settings.FontSize.regular;
+                this.Font = Settings.getFont();
+            }
             Settings.fontSizeforum = Settings.FontSize.regular;
             Settings.scalingMode = Settings.ScaleMode.dpi;
             this.Font = Settings.getFont();
             this.AutoScaleMode = Settings.getAutoScaleMode();
+            if (wasComicSans)
+            {
+                Settings.comicSans = true;
+                this.Font = Settings.getFont();
+            }
         }
     }
     //a class for the downloadQueue list, to make a queue of downloads


Inline

Inline

--- src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.FixAllProvider.cs
+++ src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.FixAllProvider.cs
@@ -28,28 +28,27 @@

                 var suppressionFixer = (AbstractSuppressionCodeFixProvider)((WrapperCodeFixProvider)fixAllContext.CodeFixProvider).SuppressionFixProvider;

-                var title = fixAllContext.CodeActionEquivalenceKey;
-                if (!NestedSuppressionCodeAction.IsEquivalenceKeyForGlobalSuppression(fixAllContext.CodeActionEquivalenceKey))
+                if (NestedSuppressionCodeAction.IsEquivalenceKeyForGlobalSuppression(fixAllContext.CodeActionEquivalenceKey))
                 {
-                    // Regular batch fixer will handle getting the document/project fixes here.
-                    var isPragmaWarningSuppression = NestedSuppressionCodeAction.IsEquivalenceKeyForPragmaWarning(fixAllContext.CodeActionEquivalenceKey);
-                    Contract.ThrowIfFalse(isPragmaWarningSuppression || NestedSuppressionCodeAction.IsEquivalenceKeyForRemoveSuppression(fixAllContext.CodeActionEquivalenceKey));
-
-                    var batchFixer = isPragmaWarningSuppression
-                        ? new PragmaWarningBatchFixAllProvider(suppressionFixer)
-                        : RemoveSuppressionCodeAction.GetBatchFixer(suppressionFixer);
-
-                    return await batchFixer.GetFixAsync(fixAllContext).ConfigureAwait(false);
+                    // For global suppressions, we defer to the global suppression system to handle directly.
+                    var title = fixAllContext.CodeActionEquivalenceKey;
+                    return fixAllContext.Document != null
+                        ? GlobalSuppressMessageFixAllCodeAction.Create(
+                            title, suppressionFixer, fixAllContext.Document,
+                            await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false))
+                        : GlobalSuppressMessageFixAllCodeAction.Create(
+                            title, suppressionFixer, fixAllContext.Project,
+                            await fixAllContext.GetProjectDiagnosticsToFixAsync().ConfigureAwait(false));
                 }

-                // For global suppressions, we defer to the global suppression system to handle directly.
-                return fixAllContext.Document != null
-                    ? GlobalSuppressMessageFixAllCodeAction.Create(
-                        title, suppressionFixer, fixAllContext.Document,
-                        await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false))
-                    : GlobalSuppressMessageFixAllCodeAction.Create(
-                        title, suppressionFixer, fixAllContext.Project,
-                        await fixAllContext.GetProjectDiagnosticsToFixAsync().ConfigureAwait(false));
+                var isPragmaWarningSuppression = NestedSuppressionCodeAction.IsEquivalenceKeyForPragmaWarning(fixAllContext.CodeActionEquivalenceKey);
+                Contract.ThrowIfFalse(isPragmaWarningSuppression || NestedSuppressionCodeAction.IsEquivalenceKeyForRemoveSuppression(fixAllContext.CodeActionEquivalenceKey));
+
+                var batchFixer = isPragmaWarningSuppression
+                    ? new PragmaWarningBatchFixAllProvider(suppressionFixer)
+                    : RemoveSuppressionCodeAction.GetBatchFixer(suppressionFixer);
+
+                return await batchFixer.GetFixAsync(fixAllContext).ConfigureAwait(false);
             }
         }
     }


async the sending of message per account

--- src/SFA.DAS.EmployerFinance.MessageHandlers/CommandHandlers/ProcessPeriodEndPaymentsCommandHandler.cs
+++ src/SFA.DAS.EmployerFinance.MessageHandlers/CommandHandlers/ProcessPeriodEndPaymentsCommandHandler.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 using MediatR;
 using NServiceBus;
@@ -21,11 +22,10 @@

         public async Task Handle(ProcessPeriodEndPaymentsCommand message, IMessageHandlerContext context)
         {
+            _logger.Info($"Creating payment queue message for all accounts for period end ref: '{message.PeriodEndRef}'");
             var response = await _mediator.SendAsync(new GetAllEmployerAccountsRequest());

-            var tasks = new List<Task>();
-
-            foreach (var account in response.Accounts)
+            var tasks = response.Accounts.Select(account => Task.Run(async () =>
             {
                 _logger.Info($"Creating payment queue message for account ID: '{account.Id}' period end ref: '{message.PeriodEndRef}'");

@@ -35,8 +35,8 @@
                 sendOptions.RequireImmediateDispatch(); // Circumvent sender outbox
                 sendOptions.SetMessageId($"{nameof(ImportAccountPaymentsCommand)}-{message.PeriodEndRef}-{account.Id}"); // Allow receiver outbox to de-dupe

-                tasks.Add(context.Send(new ImportAccountPaymentsCommand { PeriodEndRef = message.PeriodEndRef, AccountId = account.Id }, sendOptions));
-            }
+                await context.Send(new ImportAccountPaymentsCommand { PeriodEndRef = message.PeriodEndRef, AccountId = account.Id }, sendOptions);
+            }));

             await Task.WhenAll(tasks);


clean up

clean up

--- tests/AspNet.Identity.RavenDB.Tests/Stores/RavenUserRoleStoreFacts.cs
+++ tests/AspNet.Identity.RavenDB.Tests/Stores/RavenUserRoleStoreFacts.cs
@@ -1,131 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Claims;
-using System.Threading.Tasks;
-using AspNet.Identity.RavenDB.Entities;
-using AspNet.Identity.RavenDB.Stores;
-using Microsoft.AspNet.Identity;
-using Raven.Client;
-using Xunit;
-
-namespace AspNet.Identity.RavenDB.Tests.Stores {
-    public class RavenUserRoleStoreFacts : TestBase {
-        [Fact]
-        public async Task GetRoles_Should_Retrieve_Correct_Roles_For_User()
-        {
-            string userName = "Tugberk";
-            string userId = "RavenUsers/1";
-
-            using (IDocumentStore store = CreateEmbeddableStore())
-            using (IAsyncDocumentSession ses = store.OpenAsyncSession())
-            {
-                IUserRoleStore<RavenUser> userRoleStore = new RavenUserStore<RavenUser>(ses);
-                IEnumerable<string> roles = new List<string>
-                {
-                    "Administrator",
-                    "PowerUser"
-                };
-                RavenUser user = new RavenUser
-                {
-                    Id = userId,
-                    UserName = userName
-                };
-
-                foreach (var role in roles)
-                {
-                    user.Claims.Add(
-                        new RavenUserClaim
-                        {
-                            ClaimType = ClaimTypes.Role,
-                            ClaimValue = role
-                        });
-                }
-
-                await ses.StoreAsync(user);
-                await ses.SaveChangesAsync();
-
-                IEnumerable<string> retrievedRoles = await userRoleStore.GetRolesAsync(user);
-
-                Assert.Equal(2, retrievedRoles.Count());
-                Assert.Equal("Administrator", retrievedRoles.ElementAt(0));
-                Assert.Equal("PowerUser", retrievedRoles.ElementAt(1));
-            }
-        }
-
-        [Fact]
-        public async Task AddRole_Should_Add_Correct_Role_To_User()
-        {
-            string userName = "Tugberk";
-            string userId = "RavenUsers/1";
-
-            using (IDocumentStore store = CreateEmbeddableStore())
-            using (IAsyncDocumentSession ses = store.OpenAsyncSession())
-            {
-                IUserRoleStore<RavenUser> userRoleStore = new RavenUserStore<RavenUser>(ses);
-                IEnumerable<string> roles = new List<string>
-                {
-                    "Administrator"
-                };
-                RavenUser user = new RavenUser
-                {
-                    Id = userId,
-                    UserName = userName
-                };
-
-                foreach (var role in roles)
-                {
-                    user.Claims.Add(
-                        new RavenUserClaim
-                        {
-                            ClaimType = ClaimTypes.Role,
-                            ClaimValue = role
-                        });
-                }
-
-                await userRoleStore.AddToRoleAsync(user, "PowerUser");
-
-                Assert.Equal(2, user.Claims.Count());
-                Assert.Equal("Administrator", user.Claims.ElementAt(0).ClaimValue);
-                Assert.Equal("PowerUser", user.Claims.ElementAt(1).ClaimValue);
-            }
-        }
-
-        [Fact]
-        public async Task RemoveRole_Should_Remove_Correct_Role_To_User()
-        {
-            string userName = "Tugberk";
-            string userId = "RavenUsers/1";
-
-            using (IDocumentStore store = CreateEmbeddableStore())
-            using (IAsyncDocumentSession ses = store.OpenAsyncSession())
-            {
-                IUserRoleStore<RavenUser> userRoleStore = new RavenUserStore<RavenUser>(ses);
-                IEnumerable<string> roles = new List<string>
-                {
-                    "Administrator",
-                    "PowerUser"
-                };
-                RavenUser user = new RavenUser
-                {
-                    Id = userId,
-                    UserName = userName
-                };
-
-                foreach (var role in roles)
-                {
-                    user.Claims.Add(
-                        new RavenUserClaim
-                        {
-                            ClaimType = ClaimTypes.Role,
-                            ClaimValue = role
-                        });
-                }
-
-                await userRoleStore.RemoveFromRoleAsync(user, "Administrator");
-
-                Assert.Equal(1, user.Claims.Count());
-                Assert.Equal("PowerUser", user.Claims.ElementAt(0).ClaimValue);
-            }
-        }
-    }
-}


added tests

added tests

--- tests/NLog.UnitTests/Layouts/AllEventPropertiesLayoutRendererTests.cs
+++ tests/NLog.UnitTests/Layouts/AllEventPropertiesLayoutRendererTests.cs
@@ -111,7 +111,7 @@

         [Fact]
-        public void AllEventWithFluent()
+        public void AllEventWithFluent_without_callerInformation()
         {

             var configuration = CreateConfigurationFromString(@"
@@ -135,7 +135,6 @@

             LogManager.Configuration = configuration;

-            // Test=InfoWrite, coolness=200%, a=not b, CallerMemberName=AllEventWithFluent, CallerFilePath=x:\GitHub-304\NLog\tests\NLog.UnitTests\Layouts\AllEventPropertiesLayoutRendererTests.cs, CallerLineNumber=144
             var logger = LogManager.GetCurrentClassLogger();
             logger.Debug()
                 .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
@@ -148,6 +147,48 @@
             base.AssertDebugLastMessage("m","Test=InfoWrite, coolness=200%, a=not b");

         }
+
+        [Fact]
+        public void AllEventWithFluent_with_callerInformation()
+        {
+
+            var configuration = CreateConfigurationFromString(@"
+                <nlog throwExceptions='true' >
+                    <targets>
+                        <target type='Debug'
+                                name='m'
+                               layout='${all-event-properties:IncludeCallerInformation=true}'
+                               >
+
+
+                        </target>
+                    </targets>
+                    <rules>
+                      <logger name='*' writeTo='m'>
+
+                      </logger>
+                    </rules>
+                </nlog>");
+
+
+            LogManager.Configuration = configuration;
+
+
+            var logger = LogManager.GetCurrentClassLogger();
+            logger.Debug()
+                .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
+                .Property("Test", "InfoWrite")
+                .Property("coolness", "200%")
+                .Property("a", "not b")
+                .Write();
+
+
+            base.AssertDebugLastMessageContains("m", "CallerMemberName=");
+            base.AssertDebugLastMessageContains("m", "CallerFilePath=");
+            base.AssertDebugLastMessageContains("m", "CallerLineNumber=");
+
+        }
+

         private static LogEventInfo BuildLogEventWithProperties()
         {


Fix directory path for BreakingChangeAnalyzer

--- tools/StaticAnalysis/BreakingChangeAnalyzer/BreakingChangeAnalyzer.cs
+++ tools/StaticAnalysis/BreakingChangeAnalyzer/BreakingChangeAnalyzer.cs
@@ -113,18 +113,17 @@

                     if (cmdletFiles.Any())
                     {
-                        Directory.SetCurrentDirectory(directory);
-                        foreach (var cmdletFile in cmdletFiles)
+                        foreach (var cmdletFileName in cmdletFiles)
                         {
-                            var helpFileName = Path.GetFileName(cmdletFile);
-                            var cmdletFileName = Path.GetFileName(cmdletFile);
-                            if (File.Exists(cmdletFile))
+                            var cmdletFileFullPath = Path.Combine(directory, Path.GetFileName(cmdletFileName));
+
+                            if (File.Exists(cmdletFileFullPath))
                             {
-                                issueLogger.Decorator.AddDecorator(a => a.AssemblyFileName = cmdletFileName, "AssemblyFileName");
-                                processedHelpFiles.Add(helpFileName);
+                                issueLogger.Decorator.AddDecorator(a => a.AssemblyFileName = cmdletFileFullPath, "AssemblyFileName");
+                                processedHelpFiles.Add(cmdletFileName);
                                 var proxy =
                                     EnvironmentHelpers.CreateProxy<CmdletBreakingChangeLoader>(directory, out _appDomain);
-                                var newModuleMetadata = proxy.GetModuleMetadata(Path.GetFullPath(cmdletFile));
+                                var newModuleMetadata = proxy.GetModuleMetadata(cmdletFileFullPath);

                                 string fileName = cmdletFileName + ".json";
                                 string executingPath =
@@ -146,7 +145,7 @@
                                         string output = "Before filter\nOld module cmdlet count: " + oldModuleMetadata.Cmdlets.Count +
                                                                      "\nNew module cmdlet count: " + newModuleMetadata.Cmdlets.Count;

-                                        output += "\nCmdlet file: " + Path.GetFullPath(cmdletFile);
+                                        output += "\nCmdlet file: " + cmdletFileFullPath;

                                         oldModuleMetadata.FilterCmdlets(cmdletFilter);
                                         newModuleMetadata.FilterCmdlets(cmdletFilter);


更新变量名称

更新变量名称

--- 软件系统浏览器模版/Controllers/HomeController.cs
+++ 软件系统浏览器模版/Controllers/HomeController.cs
@@ -258,21 +258,21 @@
         {
             if (Request.IsAjaxRequest())
             {
-                string announcement = fc["SendMessage"];
+                string SendMessage = fc["SendMessage"];
                 UserAccount account = Session[SessionItemsDescription.UserAccount] as UserAccount;

-                if (announcement.Length > 1000)
+                if (SendMessage.Length > 1000)
                 {
                     ViewData["alertMessage"] = "需要发送的字数超过了1000字！";
                     return PartialView("_MessageDangerPartial");
                 }

-                OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.群发消息, announcement);
+                OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.群发消息, SendMessage);
                 if (result.IsSuccess)
                 {
                     ViewData["alertMessage"] = "消息群发成功！";
-                    UserClient.Announcement = announcement;
+                    UserClient.Announcement = SendMessage;
                     return PartialView("_MessageSuccessPartial");
                 }
                 else
@@ -288,5 +288,7 @@
             }
         }

+
+
     }
 }


unit test file

unit test file

--- unity/3.4/Standalone/UnityUnitTest/Assets/UnitTests/PubnubUnitTest.cs
+++ unity/3.4/Standalone/UnityUnitTest/Assets/UnitTests/PubnubUnitTest.cs
@@ -9,7 +9,7 @@

 namespace PubNubMessaging.Tests
 {
-    public class PubnubUnitTest : MonoBehaviour,  IPubnubUnitTest
+    public class PubnubUnitTest : IPubnubUnitTest
     {
         private bool enableStubTest = true;
         private string _testClassName = "";
@@ -520,12 +520,6 @@
                     break;
             }

-            if (_testClassName == "WhenAMessageIsPublished" && _testCaseName == "ThenComplexMessageObjectShouldReturnSuccessCodeAndInfo")
-            {
-				print(requestUri.AbsolutePath);
-				//print(requestUri.AbsolutePath);
-			}
-
 			if (responseDictionary != null && responseDictionary.ContainsKey(requestUri.AbsolutePath))
             {
 				stubResponse = responseDictionary[requestUri.AbsolutePath];


fixed Sequence Dump/Load mismatch

fixed Sequence Dump/Load mismatch

--- x2/Sequence.cs
+++ x2/Sequence.cs
@@ -101,7 +101,7 @@
         public override void Load(Buffer buffer)
         {
             int numItems;
-            buffer.Read(out numItems);
+            buffer.ReadVariable(out numItems);

             for (int i = 0; i < numItems; ++i)
             {
@@ -113,9 +113,8 @@

         protected override void Dump(Buffer buffer)
         {
-            base.Dump(buffer);
             int numItems = (int)store.Count;
-            buffer.Write(numItems);
+            buffer.WriteVariable(numItems);

             foreach (T item in store)
             {


sorting edges after partition deserialize

--- Applications/DMT.Matcher.Module/Partitioner/MatcherDataDeserializer.cs
+++ Applications/DMT.Matcher.Module/Partitioner/MatcherDataDeserializer.cs
@@ -7,6 +7,7 @@
 using System.Threading.Tasks;
 using System.Xml;
 using DMT.Common.Composition;
+using DMT.Common.Extensions;
 using DMT.Core.Interfaces;
 using DMT.Core.Interfaces.Serialization;
 using DMT.Matcher.Data.Interfaces;
@@ -52,6 +53,7 @@
                 });
             }
             logger.Info("Deserialization finished. Loaded {0} node(s).", model.Nodes.Count);
+            SortEdgesInNodes(model);
             return model;
         }

@@ -79,5 +81,10 @@
             id.Deserialize(reader, null);
             return id;
         }
+
+        private void SortEdgesInNodes(IModel model)
+        {
+            model.Nodes.Cast<IMatchNode>().ForEach(n => n.SortEdges());
+        }
     }
 }


:sparkles: Call method in only Editor

:sparkles: Call method in only Editor

* AudioListener 自動追加の機能はエディタでしか利用しない
* 実機実行時などに無駄に処理が走らないように条件を付けます

--- Assets/Scripts/UnityModule/AnimationEventDispatcher/AudioDispatcher.cs
+++ Assets/Scripts/UnityModule/AnimationEventDispatcher/AudioDispatcher.cs
@@ -56,7 +56,9 @@
         /// </summary>
         /// <remarks>イベント発火ストリームを Subscribe する</remarks>
         private void Start() {
-            SetAudioListenerIfNeeded();
+            if (Application.isEditor) {
+                SetAudioListenerIfNeeded();
+            }
             this.StreamAnimationEvent
                 .Subscribe(
                     (animationEvent) => {


Issue #413

Issue #413

--- Cognifide.PowerShell/Client/Applications/PowerShellMultiValuePrompt.cs
+++ Cognifide.PowerShell/Client/Applications/PowerShellMultiValuePrompt.cs
@@ -376,6 +376,11 @@
             }

             Sitecore.Web.UI.HtmlControls.Control edit;
+            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("info", StringComparison.OrdinalIgnoreCase) > -1)
+            {
+                return new Literal {Text = value.ToString()};
+            }
+
             if (variable["lines"] != null && ((int) variable["lines"] > 1))
             {
                 edit = new Memo();


Redundant adjacent update

Redundant adjacent update

--- Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs
+++ Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs
@@ -185,6 +185,8 @@
             {
                 if(!Tiles.ContainsKey(tile.GridIndices))
                     Tiles.Add(tile.GridIndices, new TileAtmosphere(this, tile.GridIndex, tile.GridIndices, new GasMixture(GetVolumeForCells(1)){Temperature = Atmospherics.T20C}));
+
+                Invalidate(tile.GridIndices);
             }

             foreach (var (_, tile) in Tiles.ToArray())
@@ -246,7 +248,6 @@
                     var otherIndices = indices.Offset(direction.ToDirection());
                     var otherTile = GetTile(otherIndices);
                     AddActiveTile(otherTile);
-                    otherTile?.UpdateAdjacent(direction.GetOpposite());
                 }
             }


speeden up directory checks

speeden up directory checks

--- FluentFTP/Client/FtpClient_FolderUpload.cs
+++ FluentFTP/Client/FtpClient_FolderUpload.cs
@@ -126,8 +126,7 @@

 					// create directory on the server
 					// to ensure we upload the blank remote dirs as well
-					if (!DirectoryExists(remoteFile)) {
-						CreateDirectory(remoteFile);
+					if (CreateDirectory(remoteFile)) {
 						result.IsSuccess = true;
 						result.IsSkipped = false;
 					}


using .size solution for help panel

using .size solution for help panel

--- Documents/Unity3D/Catcheep/Assets/Scripts/gameManager.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/gameManager.cs
@@ -54,7 +54,7 @@

         //edge of screen is a vector3 that holds the screens width (can't get it directly cause of Screen/World point difference)
         Vector3 helpToolsPlateWidth =
-            Camera.main.ScreenToWorldPoint(helpToolsPlate.GetComponent<RectTransform>().sizeDelta);
+            Camera.main.ScreenToWorldPoint(helpToolsPlate.GetComponent<RectTransform>().rect.size);
         edgeOfScreen = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width - helpToolsPlateWidth.x, Screen.height, 0f));
         gameOver = false;
         StartCoroutine(sheepSpawner());
@@ -208,7 +208,7 @@
     void oneSheepyRandom(int index)
     {
         float edges = edgeOfScreen.x - (sheeps[index].GetComponent<SpriteRenderer>().sprite.bounds.extents).x;
-        float xPosition = Random.Range(-edges, edges);
+        float xPosition = edges;//Random.Range(-edges, edges);
         Vector3 spawnPosition = new Vector3(xPosition, transform.position.y, transform.position.z);
         Instantiate(sheeps[index], spawnPosition, Quaternion.identity);
     }


git-svn-id: https://gorgonlib.googlecode.com/svn/branches/2.x@1448 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Gorgon/Gorgon.Graphics/Textures/GorgonTextures.cs
+++ Dorian/Gorgon/Gorgon.Graphics/Textures/GorgonTextures.cs
@@ -1,4 +1,4 @@
-#region MIT.
+#region MIT.
 //
 // Gorgon.
 // Copyright (C) 2012 Michael Winsor
@@ -32,7 +32,7 @@
 using GorgonLibrary.Graphics.Properties;
 using GorgonLibrary.IO;
 using D3D = SharpDX.Direct3D11;
-
+// TODO: Lose the generic parameter on CreateTexture functions, make overloads instead.
 namespace GorgonLibrary.Graphics
 {
 	/// <summary>


Made `StringExtensions.ToPascalCase` use a `StringBuilder`, and changed it to have less specific variable names.

--- Evbpc.Framework/Utilities/Extensions/StringExtensions.cs
+++ Evbpc.Framework/Utilities/Extensions/StringExtensions.cs
@@ -362,14 +362,16 @@
         /// <returns>The resulting PascalCase string.</returns>
         public static string ToPascalCase(this string s)
         {
-            string[] errorWords = s.Split(new char[2] { '-', '_' }, StringSplitOptions.RemoveEmptyEntries);
-            string errorEnumName = string.Empty;
-
-            foreach (string errorWord in errorWords)
-            {
-                errorEnumName += errorWord[0].ToString().ToUpper() + errorWord.Substring(1);
-            }
-            return errorEnumName;
+            string[] words = s.Split(new char[2] { '-', '_' }, StringSplitOptions.RemoveEmptyEntries);
+
+            StringBuilder sb = new StringBuilder();
+
+            foreach (string word in words)
+            {
+                sb.Append(word[0].ToString().ToUpper() + word.Substring(1));
+            }
+
+            return sb.ToString();
         }

         /// <summary>


Change variable name

Change variable name

--- ExpressEntryCalculator.Web/Controllers/HomeController.cs
+++ ExpressEntryCalculator.Web/Controllers/HomeController.cs
@@ -14,9 +14,9 @@
     {
         private readonly ExpressEntryStats _expressEntryStats;

-        public HomeController(IOptions<ExpressEntryStats> expressEntryStats)
-        {
-            _expressEntryStats = expressEntryStats.Value;
+        public HomeController(IOptions<ExpressEntryStats> expressEntryStatsAccessor)
+        {
+            _expressEntryStats = expressEntryStatsAccessor.Value;
         }

         public IActionResult Index()


Refactor CodeGenerationDisplayDriver.

Refactor CodeGenerationDisplayDriver.

--- Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs
+++ Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs
@@ -28,95 +28,97 @@

                     // Building the code for the type.
                     codeBuilder.AppendLine($"_contentDefinitionManager.AlterTypeDefinition(\"{model.Name}\", type => type");
-
                     codeBuilder.AppendLine($"    .DisplayedAs(\"{model.DisplayName}\")");

-                    var contentTypeSettings = model.GetSettings<ContentTypeSettings>();
-                    if (contentTypeSettings.Creatable) codeBuilder.AppendLine("    .Creatable()");
-                    if (contentTypeSettings.Listable) codeBuilder.AppendLine("    .Listable()");
-                    if (contentTypeSettings.Draftable) codeBuilder.AppendLine("    .Draftable()");
-                    if (contentTypeSettings.Versionable) codeBuilder.AppendLine("    .Versionable()");
-                    if (contentTypeSettings.Securable) codeBuilder.AppendLine("    .Securable()");
-                    if (!string.IsNullOrEmpty(contentTypeSettings.Stereotype))
-                    {
-                        codeBuilder.AppendLine($"    .Stereotype(\"{contentTypeSettings.Stereotype}\")");
-                    }
-
+                    GenerateCodeForSettings(codeBuilder, model.GetSettings<ContentTypeSettings>());
                     AddSettingsWithout<ContentTypeSettings>(codeBuilder, model.Settings, 4);
-
-                    foreach (var part in model.Parts)
-                    {
-                        var partSettings = part.GetSettings<ContentTypePartSettings>();
-
-                        codeBuilder.AppendLine($"    .WithPart(\"{part.Name}\", part => part");
-
-                        var partStartingLength = codeBuilder.Length;
-
-                        AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
-                        AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
-                        AddWithLine(codeBuilder, nameof(partSettings.Position), partSettings.Position);
-                        AddWithLine(codeBuilder, nameof(partSettings.DisplayMode), partSettings.DisplayMode);
-                        AddWithLine(codeBuilder, nameof(partSettings.Editor), partSettings.Editor);
-
-                        AddSettingsWithout<ContentTypePartSettings>(codeBuilder, part.Settings, 8);
-
-                        // Checking if anything was added to the part's settings.
-                        if (codeBuilder.Length == partStartingLength)
-                        {
-                            // Remove ", part => part" and the line break.
-                            codeBuilder.Length -= 16;
-                            codeBuilder.Append(")" + Environment.NewLine);
-                        }
-                        else
-                        {
-                            codeBuilder.AppendLine("    )");
-                        }
-                    }
-
+                    GenerateCodeForParts(codeBuilder, model.Parts);
                     codeBuilder.AppendLine(");");

-                    // Building those parts that have fields separately (fields can't be configured inline in types).
-                    var partDefinitions = model.Parts
-                        .Where(part => part.PartDefinition.Fields.Any())
-                        .Select(part => part.PartDefinition);
-                    foreach (var part in partDefinitions)
-                    {
-                        codeBuilder.AppendLine();
-                        codeBuilder.AppendLine($"_contentDefinitionManager.AlterPartDefinition(\"{part.Name}\", part => part");
-
-                        var partSettings = part.GetSettings<ContentPartSettings>();
-                        if (partSettings.Attachable) codeBuilder.AppendLine("    .Attachable()");
-                        if (partSettings.Reusable) codeBuilder.AppendLine("    .Reusable()");
-
-                        AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
-                        AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
-                        AddWithLine(codeBuilder, nameof(partSettings.DefaultPosition), partSettings.DefaultPosition);
-
-                        AddSettingsWithout<ContentPartSettings>(codeBuilder, part.Settings, 4);
-
-                        foreach (var field in part.Fields)
-                        {
-                            codeBuilder.AppendLine($"    .WithField(\"{field.Name}\", field => field");
-                            codeBuilder.AppendLine($"        .OfType(\"{field.FieldDefinition.Name}\")");
-
-                            var fieldSettings = field.GetSettings<ContentPartFieldSettings>();
-                            AddWithLine(codeBuilder, nameof(fieldSettings.DisplayName), fieldSettings.DisplayName);
-                            AddWithLine(codeBuilder, nameof(fieldSettings.Description), fieldSettings.Description);
-                            AddWithLine(codeBuilder, nameof(fieldSettings.Editor), fieldSettings.Editor);
-                            AddWithLine(codeBuilder, nameof(fieldSettings.DisplayMode), fieldSettings.DisplayMode);
-                            AddWithLine(codeBuilder, nameof(fieldSettings.Position), fieldSettings.Position);
-
-                            AddSettingsWithout<ContentPartFieldSettings>(codeBuilder, field.Settings, 8);
-
-                            codeBuilder.AppendLine("    )");
-                        }
-
-                        codeBuilder.AppendLine(");");
-                    }
+                    GenerateCodeForPartsWithFields(codeBuilder, model.Parts);

                     return codeBuilder.ToString();
                 }))
             .Location("Content:7");
+
+
+        private void GenerateCodeForParts(StringBuilder codeBuilder, IEnumerable<ContentTypePartDefinition> parts)
+        {
+            foreach (var part in parts)
+            {
+                var partSettings = part.GetSettings<ContentTypePartSettings>();
+
+                codeBuilder.AppendLine($"    .WithPart(\"{part.Name}\", part => part");
+
+                var partStartingLength = codeBuilder.Length;
+
+                AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
+                AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
+                AddWithLine(codeBuilder, nameof(partSettings.Position), partSettings.Position);
+                AddWithLine(codeBuilder, nameof(partSettings.DisplayMode), partSettings.DisplayMode);
+                AddWithLine(codeBuilder, nameof(partSettings.Editor), partSettings.Editor);
+
+                AddSettingsWithout<ContentTypePartSettings>(codeBuilder, part.Settings, 8);
+
+                // Checking if anything was added to the part's settings.
+                if (codeBuilder.Length == partStartingLength)
+                {
+                    // Remove ", part => part" and the line break.
+                    codeBuilder.Length -= 16;
+                    codeBuilder.Append(")" + Environment.NewLine);
+                }
+                else
+                {
+                    codeBuilder.AppendLine("    )");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Building those parts that have fields separately (fields can't be configured inline in types).
+        /// </summary>
+        private void GenerateCodeForPartsWithFields(
+            StringBuilder codeBuilder,
+            IEnumerable<ContentTypePartDefinition> parts)
+        {
+            var partDefinitions = parts
+                .Where(part => part.PartDefinition.Fields.Any())
+                .Select(part => part.PartDefinition);
+            foreach (var part in partDefinitions)
+            {
+                codeBuilder.AppendLine();
+                codeBuilder.AppendLine($"_contentDefinitionManager.AlterPartDefinition(\"{part.Name}\", part => part");
+
+                var partSettings = part.GetSettings<ContentPartSettings>();
+                if (partSettings.Attachable) codeBuilder.AppendLine("    .Attachable()");
+                if (partSettings.Reusable) codeBuilder.AppendLine("    .Reusable()");
+
+                AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
+                AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
+                AddWithLine(codeBuilder, nameof(partSettings.DefaultPosition), partSettings.DefaultPosition);
+
+                AddSettingsWithout<ContentPartSettings>(codeBuilder, part.Settings, 4);
+
+                foreach (var field in part.Fields)
+                {
+                    codeBuilder.AppendLine($"    .WithField(\"{field.Name}\", field => field");
+                    codeBuilder.AppendLine($"        .OfType(\"{field.FieldDefinition.Name}\")");
+
+                    var fieldSettings = field.GetSettings<ContentPartFieldSettings>();
+                    AddWithLine(codeBuilder, nameof(fieldSettings.DisplayName), fieldSettings.DisplayName);
+                    AddWithLine(codeBuilder, nameof(fieldSettings.Description), fieldSettings.Description);
+                    AddWithLine(codeBuilder, nameof(fieldSettings.Editor), fieldSettings.Editor);
+                    AddWithLine(codeBuilder, nameof(fieldSettings.DisplayMode), fieldSettings.DisplayMode);
+                    AddWithLine(codeBuilder, nameof(fieldSettings.Position), fieldSettings.Position);
+
+                    AddSettingsWithout<ContentPartFieldSettings>(codeBuilder, field.Settings, 8);
+
+                    codeBuilder.AppendLine("    )");
+                }
+
+                codeBuilder.AppendLine(");");
+            }
+        }

         private string ConvertJToken(JToken jToken)
         {
@@ -173,6 +175,20 @@
             }
         }

+
+        private static void GenerateCodeForSettings(StringBuilder codeBuilder, ContentTypeSettings contentTypeSettings)
+        {
+            if (contentTypeSettings.Creatable) codeBuilder.AppendLine("    .Creatable()");
+            if (contentTypeSettings.Listable) codeBuilder.AppendLine("    .Listable()");
+            if (contentTypeSettings.Draftable) codeBuilder.AppendLine("    .Draftable()");
+            if (contentTypeSettings.Versionable) codeBuilder.AppendLine("    .Versionable()");
+            if (contentTypeSettings.Securable) codeBuilder.AppendLine("    .Securable()");
+            if (!string.IsNullOrEmpty(contentTypeSettings.Stereotype))
+            {
+                codeBuilder.AppendLine($"    .Stereotype(\"{contentTypeSettings.Stereotype}\")");
+            }
+        }
+
         private static void AddWithLine(StringBuilder codeBuilder, string name, string value)
         {
             if (!string.IsNullOrEmpty(value))


Switched StandardOutput handling to Stream to prevent getting deadlocks when generating big PDF files. Added silent switch to get nice error message on error instead of progress messages and an error message. Unified ConvertHtml and Convert methods into one method.

--- Rotativa/WkhtmltopdfDriver.cs
+++ Rotativa/WkhtmltopdfDriver.cs
@@ -1,60 +1,52 @@
 using System;
-using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;

 namespace Rotativa
 {
     public class WkhtmltopdfDriver
     {
-        private string cookieName;
-        private string cookieValue;
-
+        /// <summary>
+        /// Converts given HTML string to PDF.
+        /// </summary>
+        /// <param name="wkhtmltopdfPath">Path to wkthmltopdf.</param>
+        /// <param name="html">String containing HTML code that should be converted to PDF.</param>
+        /// <returns>PDF as byte array.</returns>
         public byte[] ConvertHtml(string wkhtmltopdfPath, string html)
         {
-            string switches = " ";
-            switches += "- -";
-
-            var proc = new Process()
-            {
-                StartInfo = new ProcessStartInfo()
-                {
-                    FileName = Path.Combine(wkhtmltopdfPath, "wkhtmltopdf.exe"),
-                    Arguments = switches,
-                    UseShellExecute = false,
-                    RedirectStandardOutput = true,
-                    RedirectStandardError = true,
-                    RedirectStandardInput = true,
-                    WorkingDirectory = wkhtmltopdfPath,
-                    CreateNoWindow = true
-                }
-            };
-            proc.Start();
-            using (var stream = proc.StandardInput)
-            {
-                stream.WriteLine(html);
-            }
-            string output = proc.StandardOutput.ReadToEnd();
-            string error = proc.StandardError.ReadToEnd();
-            if (String.IsNullOrEmpty(output))
-            {
-                throw new Exception(error);
-            }
-            proc.WaitForExit();
-            byte[] buffer = proc.StandardOutput.CurrentEncoding.GetBytes(output);
-            return buffer;
+            return Convert(wkhtmltopdfPath, null, html);
         }

+        /// <summary>
+        /// Converts given URL to PDF.
+        /// </summary>
+        /// <param name="wkhtmltopdfPath">Path to wkthmltopdf.</param>
+        /// <param name="switches">Switches that will be passed to wkhtmltopdf with URL that should be converted to PDF.</param>
+        /// <returns>PDF as byte array.</returns>
         public static byte[] Convert(string wkhtmltopdfPath, string switches)
         {
-            // adding the switch to ouput on stdout
-            switches += " -";
-            var proc = new Process()
+            return Convert(wkhtmltopdfPath, switches, null);
+        }
+
+        /// <summary>
+        /// Converts given URL or HTML string to PDF.
+        /// </summary>
+        /// <param name="wkhtmltopdfPath">Path to wkthmltopdf.</param>
+        /// <param name="switches">Switches that will be passed to wkhtmltopdf with URL that should be converted to PDF.</param>
+        /// <param name="html">String containing HTML code that should be converted to PDF.
+        /// If this variable is set then content of switches variable is ignored.</param>
+        /// <returns>PDF as byte array.</returns>
+        private static byte[] Convert(string wkhtmltopdfPath, string switches, string html)
+        {
+            // switches:
+            //     "-q"  - silent output, only errors - no progress messages
+            //     " -"  - switch output to stdout
+            //     "- -" - switch input to stdin and output to stdout
+            switches = string.IsNullOrEmpty(html) ? "-q " + switches + " -" : "-q - -";
+
+            var proc = new Process
                            {
-                               StartInfo = new ProcessStartInfo()
+                               StartInfo = new ProcessStartInfo
                                                {
                                                    FileName = Path.Combine(wkhtmltopdfPath, "wkhtmltopdf.exe"),
                                                    Arguments = switches,
@@ -67,15 +59,38 @@
                                                }
                            };
             proc.Start();
-            string output = proc.StandardOutput.ReadToEnd();
+
+            // generate PDF from given HTML string, not from URL
+            if (!string.IsNullOrEmpty(html))
+            {
+                using (var sIn = proc.StandardInput)
+                {
+                    sIn.WriteLine(html);
+                }
+            }
+
+            var ms = new MemoryStream();
+            using (var sOut = proc.StandardOutput.BaseStream)
+            {
+                byte[] buffer = new byte[4096];
+                int read;
+
+                while ((read = sOut.Read(buffer, 0, buffer.Length)) > 0)
+                {
+                    ms.Write(buffer, 0, read);
+                }
+            }
+
             string error = proc.StandardError.ReadToEnd();
-            if (String.IsNullOrEmpty(output))
+
+            if (ms.Length == 0)
             {
                 throw new Exception(error);
             }
+
             proc.WaitForExit();
-            byte[] buffer = proc.StandardOutput.CurrentEncoding.GetBytes(output);
-            return buffer;
+
+            return ms.ToArray();
         }
     }
 }


Process seeker - try catch for WMI failures

--- FinesSE/FinesSE.Core/Environment/BrowserProcessSeeker.cs
+++ FinesSE/FinesSE.Core/Environment/BrowserProcessSeeker.cs
@@ -38,12 +38,22 @@

         public static IEnumerable<ChildProcess> GetChildProcesses(int pid, WebDrivers driverType)
         {
-            var query = new ObjectQuery($"select * from win32_process where ParentProcessId={pid}");
-            using (var searcher = new ManagementObjectSearcher(query))
-            using (var collection = searcher.Get())
-                foreach (ManagementObject item in collection)
-                    using (item)
-                        yield return new ChildProcess(item, driverType);
+            var processes = new HashSet<ChildProcess>();
+
+            try
+            {
+                var query = new ObjectQuery($"select * from win32_process where ParentProcessId={pid}");
+                using (var searcher = new ManagementObjectSearcher(query))
+                using (var collection = searcher.Get())
+                    foreach (ManagementObject item in collection)
+                    {
+                        using (item)
+                            processes.Add(new ChildProcess(item, driverType));
+                    }
+            }
+            catch { }
+
+            return processes;
         }
     }
 }


Added debug button check for positions

Added debug button check for positions

--- Client/Systems/VesselPositionSys/VesselPositionUpdate.cs
+++ Client/Systems/VesselPositionSys/VesselPositionUpdate.cs
@@ -253,7 +253,7 @@
                 }

                 var surfacePos = Body.GetWorldSurfacePosition(Vessel.latitude, Vessel.longitude, Vessel.altitude);
-                if (useOrbitDriver || Vessel.packed)
+                if (useOrbitDriver || (Vessel.packed && SettingsSystem.CurrentSettings.Debug1))
                 {
                     Vessel.orbitDriver.updateFromParameters();
                     if (!Vessel.packed)


ILGen manual clean up

ILGen manual clean up

Clean up on this file still crashes

--- Framework.Core/System/Linq/Expressions/Compiler/ILGen.cs
+++ Framework.Core/System/Linq/Expressions/Compiler/ILGen.cs
@@ -34,7 +34,6 @@
         internal static void Emit(this ILGenerator il, OpCode opcode, MethodBase methodBase)
         {
             Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo);
-
             if (methodBase is ConstructorInfo ctor)
             {
                 il.Emit(opcode, ctor);
@@ -48,7 +47,6 @@
         internal static void EmitArray<T>(this ILGenerator il, T[] items, ILocalCache locals)
         {
             Debug.Assert(items != null);
-
             il.EmitPrimitive(items.Length);
             il.Emit(OpCodes.Newarr, typeof(T));
             for (var i = 0; i < items.Length; i++)
@@ -64,7 +62,6 @@
         {
             Debug.Assert(elementType != null);
             Debug.Assert(count >= 0);
-
             il.EmitPrimitive(count);
             il.Emit(OpCodes.Newarr, elementType);
         }
@@ -73,7 +70,6 @@
         {
             Debug.Assert(arrayType != null);
             Debug.Assert(arrayType.IsArray);
-
             if (arrayType.IsSafeArray())
             {
                 il.Emit(OpCodes.Newarr, arrayType.GetElementType());
@@ -100,13 +96,10 @@
             }

             Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void));
-
             var isTypeFromNullable = typeFrom.IsNullable();
             var isTypeToNullable = typeTo.IsNullable();
-
             var nnExprType = typeFrom.GetNonNullable();
             var nnType = typeTo.GetNonNullable();
-
             if
             (
                 typeFrom.IsInterface // interface cast
@@ -124,10 +117,15 @@
             {
                 il.EmitNullableConversion(typeFrom, typeTo, isChecked, locals);
             }
-            else if (!(typeFrom.IsConvertible() && typeTo.IsConvertible()) // primitive runtime conversion
-                     &&
-                     (nnExprType.IsAssignableFrom(nnType) || // down cast
-                      nnType.IsAssignableFrom(nnExprType))) // up cast
+            else if
+            (
+                !(typeFrom.IsConvertible() && typeTo.IsConvertible()) // primitive runtime conversion
+                &&
+                (
+                    nnExprType.IsAssignableFrom(nnType) // down cast
+                    || nnType.IsAssignableFrom(nnExprType) // up cast
+                )
+            )
             {
                 il.EmitCastToType(typeFrom, typeTo);
             }
@@ -212,21 +210,18 @@
         internal static void EmitFieldAddress(this ILGenerator il, FieldInfo fi)
         {
             Debug.Assert(fi != null);
-
             il.Emit(fi.IsStatic ? OpCodes.Ldsflda : OpCodes.Ldflda, fi);
         }

         internal static void EmitFieldGet(this ILGenerator il, FieldInfo fi)
         {
             Debug.Assert(fi != null);
-
             il.Emit(fi.IsStatic ? OpCodes.Ldsfld : OpCodes.Ldfld, fi);
         }

         internal static void EmitFieldSet(this ILGenerator il, FieldInfo fi)
         {
             Debug.Assert(fi != null);
-
             il.Emit(fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, fi);
         }

@@ -255,7 +250,6 @@
         {
             Debug.Assert(index >= 0);
             Debug.Assert(index < ushort.MaxValue);
-
             switch (index)
             {
                 case 0:
@@ -293,7 +287,6 @@
         {
             Debug.Assert(index >= 0);
             Debug.Assert(index < ushort.MaxValue);
-
             if (index <= byte.MaxValue)
             {
                 il.Emit(OpCodes.Ldarga_S, (byte)index);
@@ -308,7 +301,6 @@
         internal static void EmitLoadElement(this ILGenerator il, Type type)
         {
             Debug.Assert(type != null);
-
             if (!type.IsValueType)
             {
                 il.Emit(OpCodes.Ldelem_Ref);
@@ -366,7 +358,6 @@
         internal static void EmitLoadValueIndirect(this ILGenerator il, Type type)
         {
             Debug.Assert(type != null);
-
             switch (type.GetTypeCode())
             {
                 case TypeCode.Byte:
@@ -427,7 +418,6 @@
             Debug.Assert(ci != null);
             Debug.Assert(ci.DeclaringType != null);
             Debug.Assert(!ci.DeclaringType.ContainsGenericParameters);
-
             il.Emit(OpCodes.Newobj, ci);
         }

@@ -506,7 +496,6 @@
         {
             Debug.Assert(index >= 0);
             Debug.Assert(index < ushort.MaxValue);
-
             if (index <= byte.MaxValue)
             {
                 il.Emit(OpCodes.Starg_S, (byte)index);
@@ -571,7 +560,6 @@
         internal static void EmitStoreValueIndirect(this ILGenerator il, Type type)
         {
             Debug.Assert(type != null);
-
             switch (type.GetTypeCode())
             {
                 case TypeCode.Boolean:
@@ -621,14 +609,12 @@
         internal static void EmitString(this ILGenerator il, string value)
         {
             Debug.Assert(value != null);
-
             il.Emit(OpCodes.Ldstr, value);
         }

         internal static void EmitType(this ILGenerator il, Type type)
         {
             Debug.Assert(type != null);
-
             il.Emit(OpCodes.Ldtoken, type);
             il.Emit(OpCodes.Call, CachedReflectionInfo.TypeGetTypeFromHandle);
         }
@@ -673,8 +659,10 @@
                     }

                     return true;
+
                 case Type _:
                     return false;
+
                 case MethodBase mb when ShouldLdtoken(mb):
                     il.Emit(OpCodes.Ldtoken, mb);
                     var dt = mb.DeclaringType;
@@ -694,6 +682,7 @@
                     }

                     return true;
+
                 default:
                     return false;
             }
@@ -718,6 +707,7 @@
                 case TypeCode.Decimal:
                 case TypeCode.String:
                     return true;
+
                 default:
                     return false;
             }
@@ -918,7 +908,6 @@
         {
             var tc = typeTo.GetTypeCode();
             var tf = typeFrom.GetTypeCode();
-
             if (tc == tf)
             {
                 // Between enums of same underlying type, or between such an enum and the underlying type itself.
@@ -956,40 +945,46 @@
                     //     conversion lambda to be omitted in these cases, so we have to handle this case in
                     //     here as well, by using the op_Implicit operator implementation on System.Decimal
                     //     because there are no opcodes for System.Decimal.
-
                     Debug.Assert(typeFrom != typeTo);
-
                     MethodInfo method;
-
                     switch (tf)
                     {
                         case TypeCode.Byte:
                             method = CachedReflectionInfo.DecimalOpImplicitByte;
                             break;
+
                         case TypeCode.SByte:
                             method = CachedReflectionInfo.DecimalOpImplicitSByte;
                             break;
+
                         case TypeCode.Int16:
                             method = CachedReflectionInfo.DecimalOpImplicitInt16;
                             break;
+
                         case TypeCode.UInt16:
                             method = CachedReflectionInfo.DecimalOpImplicitUInt16;
                             break;
+
                         case TypeCode.Int32:
                             method = CachedReflectionInfo.DecimalOpImplicitInt32;
                             break;
+
                         case TypeCode.UInt32:
                             method = CachedReflectionInfo.DecimalOpImplicitUInt32;
                             break;
+
                         case TypeCode.Int64:
                             method = CachedReflectionInfo.DecimalOpImplicitInt64;
                             break;
+
                         case TypeCode.UInt64:
                             method = CachedReflectionInfo.DecimalOpImplicitUInt64;
                             break;
+
                         case TypeCode.Char:
                             method = CachedReflectionInfo.DecimalOpImplicitChar;
                             break;
+
                         default:
                             throw ContractUtils.Unreachable;
                     }
@@ -1046,12 +1041,15 @@
                             }

                             break;
+
                         default:
                             break;
                     }

                     convCode = isChecked
-                        ? isFromUnsigned ? OpCodes.Conv_Ovf_I2_Un : OpCodes.Conv_Ovf_I2
+                        ? isFromUnsigned
+                            ? OpCodes.Conv_Ovf_I2_Un
+                            : OpCodes.Conv_Ovf_I2
                         : OpCodes.Conv_I2;
                     break;

@@ -1077,7 +1075,9 @@
                     }

                     convCode = isChecked
-                        ? isFromUnsigned ? OpCodes.Conv_Ovf_U2_Un : OpCodes.Conv_Ovf_U2
+                        ? isFromUnsigned
+                            ? OpCodes.Conv_Ovf_U2_Un
+                            : OpCodes.Conv_Ovf_U2
                         : OpCodes.Conv_U2;
                     break;

@@ -1097,12 +1097,15 @@
                             }

                             break;
+
                         default:
                             break;
                     }

                     convCode = isChecked
-                        ? isFromUnsigned ? OpCodes.Conv_Ovf_I4_Un : OpCodes.Conv_Ovf_I4
+                        ? isFromUnsigned
+                            ? OpCodes.Conv_Ovf_I4_Un
+                            : OpCodes.Conv_Ovf_I4
                         : OpCodes.Conv_I4;
                     break;

@@ -1123,12 +1126,15 @@
                             }

                             break;
+
                         default:
                             break;
                     }

                     convCode = isChecked
-                        ? isFromUnsigned ? OpCodes.Conv_Ovf_U4_Un : OpCodes.Conv_Ovf_U4
+                        ? isFromUnsigned
+                            ? OpCodes.Conv_Ovf_U4_Un
+                            : OpCodes.Conv_Ovf_U4
                         : OpCodes.Conv_U4;
                     break;

@@ -1139,7 +1145,9 @@
                     }

                     convCode = isChecked
-                        ? isFromUnsigned ? OpCodes.Conv_Ovf_I8_Un : OpCodes.Conv_Ovf_I8
+                        ? isFromUnsigned
+                            ? OpCodes.Conv_Ovf_I8_Un
+                            : OpCodes.Conv_Ovf_I8
                         : isFromUnsigned
                             ? OpCodes.Conv_U8
                             : OpCodes.Conv_I8;
@@ -1152,7 +1160,9 @@
                     }

                     convCode = isChecked
-                        ? isFromUnsigned || tf.IsFloatingPoint() ? OpCodes.Conv_Ovf_U8_Un : OpCodes.Conv_Ovf_U8
+                        ? isFromUnsigned || tf.IsFloatingPoint()
+                            ? OpCodes.Conv_Ovf_U8_Un
+                            : OpCodes.Conv_Ovf_U8
                         : isFromUnsigned || tf.IsFloatingPoint()
                             ? OpCodes.Conv_U8
                             : OpCodes.Conv_I8;


Fix code style issues

Fix code style issues

--- pass-winmenu/src/Program.cs
+++ pass-winmenu/src/Program.cs
@@ -25,7 +25,7 @@
 {
 	internal class Program : Form
 	{
-		private const string Version = "1.4";
+		private const string Version = "1.4.1";
 		private const string EncryptedFileExtension = ".gpg";
 		private const string PlaintextFileExtension = ".txt";
 		private readonly NotifyIcon icon = new NotifyIcon();
@@ -49,7 +49,7 @@
 			{
 				if (string.IsNullOrEmpty(ConfigManager.Config.GpgmeDllPath))
 				{
-					ShowErrorWindow($"Unable to find the GpgME DLL file in its default location. Is GPG installed?\nTo configure a custom location for libgpgme.dll, set 'gpgme-dll-path' in pass-winmenu.yaml.");
+					ShowErrorWindow("Unable to find the GpgME DLL file in its default location. Is GPG installed?\nTo configure a custom location for libgpgme.dll, set 'gpgme-dll-path' in pass-winmenu.yaml.");
 				}
 				else
 				{
@@ -471,7 +471,7 @@
 			var displayNameMap = relativeNames.ToDictionary(val => val.Replace(EncryptedFileExtension, "").Replace(Path.DirectorySeparatorChar.ToString(), ConfigManager.Config.DirectorySeparator));

 			var selection = ShowPasswordMenu(displayNameMap.Keys);
-			if (selection == null) return selection;
+			if (selection == null) return null;
 			return displayNameMap[selection];
 		}


Add check for Patient Official name count

--- GPConnect.Provider.AcceptanceTests/Steps/PatientSteps.cs
+++ GPConnect.Provider.AcceptanceTests/Steps/PatientSteps.cs
@@ -127,6 +127,10 @@
         {
             Patients.ForEach(patient =>
             {
+                var officialNameCount = patient.Name.Count(name => name.Use == HumanName.NameUse.Official);
+
+                officialNameCount.ShouldBe(1, $"The Patient Name should contain 1 Official name but found {officialNameCount}.");
+
                 patient.Name.ShouldNotBeNull("Patient name should not be null");
                 patient.Name.ForEach(name =>
                 {


Rearrange and no exception in constructor

--- Core/System/Threading/Tasks/TaskExceptionHolder.net35.cs
+++ Core/System/Threading/Tasks/TaskExceptionHolder.net35.cs
@@ -27,23 +27,23 @@
         /// Whether we should propagate exceptions on the finalizer.
         private readonly static bool s_failFastOnUnobservedException = ShouldFailFastOnUnobservedException();

+        /// An event handler used to notify of domain unload.
+        private static EventHandler s_adUnloadEventHandler;
+
         /// Whether the AppDomain has started to unload.
         private static volatile bool s_domainUnloadStarted;

-        /// An event handler used to notify of domain unload.
-        private static EventHandler s_adUnloadEventHandler;
-
         /// The task with which this holder is associated.
         private readonly Task m_task;

+        /// An exception that triggered the task to cancel.
+        private ExceptionDispatchInfo m_cancellationException;
+
         ///
         /// The lazily-initialized list of faulting exceptions.  Volatile
         /// so that it may be read to determine whether any exceptions were stored.
         ///
         private volatile List<ExceptionDispatchInfo> m_faultExceptions;
-
-        /// An exception that triggered the task to cancel.
-        private ExceptionDispatchInfo m_cancellationException;

         /// Whether the holder was "observed" and thus doesn't cause finalization behavior.
         private volatile bool m_isHandled;
@@ -57,28 +57,6 @@
             Contract.Requires(task != null, "Expected a non-null task.");
             m_task = task;
             EnsureADUnloadCallbackRegistered();
-        }
-
-        private static bool ShouldFailFastOnUnobservedException()
-        {
-            return false;
-        }
-
-        private static void EnsureADUnloadCallbackRegistered()
-        {
-            if (Volatile.Read(ref s_adUnloadEventHandler) == null)
-            {
-                EventHandler handler = AppDomainUnloadCallback;
-                if (Interlocked.CompareExchange(ref s_adUnloadEventHandler, handler, null) == null)
-                {
-                    AppDomain.CurrentDomain.DomainUnload += handler;
-                }
-            }
-        }
-
-        private static void AppDomainUnloadCallback(object sender, EventArgs e)
-        {
-            s_domainUnloadStarted = true;
         }

         ///
@@ -114,18 +92,7 @@
                         return;
                     }
                 }
-
-                // We will only propagate if this is truly unhandled. The reason this could
-                // ever occur is somewhat subtle: if a Task's exceptions are observed in some
-                // other finalizer, and the Task was finalized before the holder, the holder
-                // will have been marked as handled before even getting here.
-
-                // Give users a chance to keep this exception from crashing the process
-
-                // First, publish the unobserved exception and allow users to observe it
-                var exceptionToThrow = new AggregateException(
-                    "A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.",
-                    m_faultExceptions.Select(exceptionDispatchInfo => exceptionDispatchInfo.SourceException));
+                var exceptionToThrow = CreateAggregateException();
                 var ueea = new UnobservedTaskExceptionEventArgs(exceptionToThrow);
                 TaskScheduler.PublishUnobservedTaskException(m_task, ueea);

@@ -174,41 +141,106 @@
                 AddFaultException(exceptionObject);
         }

-        /// Sets the cancellation exception.
-        /// <param name="exceptionObject">The cancellation exception.</param>
-        /// <remarks>
-        /// Must be called under lock.
-        /// </remarks>
-        private void SetCancellationException(object exceptionObject)
-        {
-            Contract.Requires(exceptionObject != null, "Expected exceptionObject to be non-null.");
-
-            Debug.Assert(m_cancellationException == null,
-                "Expected SetCancellationException to be called only once.");
-            // Breaking this assumption will overwrite a previously OCE,
-            // and implies something may be wrong elsewhere, since there should only ever be one.
-
-            Debug.Assert(m_faultExceptions == null,
-                "Expected SetCancellationException to be called before any faults were added.");
-            // Breaking this assumption shouldn't hurt anything here, but it implies something may be wrong elsewhere.
-            // If this changes, make sure to only conditionally mark as handled below.
-
-            // Store the cancellation exception
-            var oce = exceptionObject as OperationCanceledException;
-            if (oce != null)
-            {
-                m_cancellationException = ExceptionDispatchInfo.Capture(oce);
-            }
-            else
-            {
-                var edi = exceptionObject as ExceptionDispatchInfo;
-                Debug.Assert(edi != null && edi.SourceException is OperationCanceledException,
-                    "Expected an OCE or an EDI that contained an OCE");
-                m_cancellationException = edi;
-            }
-
-            // This is just cancellation, and there are no faults, so mark the holder as handled.
+        ///
+        /// Allocates a new aggregate exception and adds the contents of the list to
+        /// it. By calling this method, the holder assumes exceptions to have been
+        /// "observed", such that the finalization check will be subsequently skipped.
+        ///
+        /// <param name="calledFromFinalizer">Whether this is being called from a finalizer.</param>
+        /// <param name="includeThisException">An extra exception to be included (optionally).</param>
+        /// <returns>The aggregate exception to throw.</returns>
+        internal AggregateException CreateExceptionObject(bool calledFromFinalizer, Exception includeThisException)
+        {
+            var exceptions = m_faultExceptions;
+            Debug.Assert(exceptions != null, "Expected an initialized list.");
+            Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
+
+            // Mark as handled and aggregate the exceptions.
+            MarkAsHandled(calledFromFinalizer);
+
+            // If we're only including the previously captured exceptions,
+            // return them immediately in an aggregate.
+            if (includeThisException == null)
+                return new AggregateException(exceptions.Select(exceptionDispatchInfo => exceptionDispatchInfo.SourceException));
+
+            // Otherwise, the caller wants a specific exception to be included,
+            // so return an aggregate containing that exception and the rest.
+            var combinedExceptions = new Exception[exceptions.Count + 1];
+            for (int i = 0; i < combinedExceptions.Length - 1; i++)
+            {
+                combinedExceptions[i] = exceptions[i].SourceException;
+            }
+            combinedExceptions[combinedExceptions.Length - 1] = includeThisException;
+            return new AggregateException(combinedExceptions);
+        }
+
+        ///
+        /// Gets the ExceptionDispatchInfo representing the singular exception
+        /// that was the cause of the task's cancellation.
+        ///
+        /// <returns>
+        /// The ExceptionDispatchInfo for the cancellation exception.  May be null.
+        /// </returns>
+        internal ExceptionDispatchInfo GetCancellationExceptionDispatchInfo()
+        {
+            var edi = m_cancellationException;
+            Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
+                "Expected the EDI to be for an OperationCanceledException");
+            return edi;
+        }
+
+        ///
+        /// Wraps the exception dispatch infos into a new read-only collection. By calling this method,
+        /// the holder assumes exceptions to have been "observed", such that the finalization
+        /// check will be subsequently skipped.
+        ///
+        internal ReadOnlyCollection<ExceptionDispatchInfo> GetExceptionDispatchInfos()
+        {
+            var exceptions = m_faultExceptions;
+            Debug.Assert(exceptions != null, "Expected an initialized list.");
+            Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
             MarkAsHandled(false);
+            return new ReadOnlyCollection<ExceptionDispatchInfo>(exceptions);
+        }
+
+        ///
+        /// A private helper method that ensures the holder is considered
+        /// handled, i.e. it is not registered for finalization.
+        ///
+        /// <param name="calledFromFinalizer">Whether this is called from the finalizer thread.</param>
+        internal void MarkAsHandled(bool calledFromFinalizer)
+        {
+            if (!m_isHandled)
+            {
+                if (!calledFromFinalizer)
+                {
+                    GC.SuppressFinalize(this);
+                }
+
+                m_isHandled = true;
+            }
+        }
+
+        private static void AppDomainUnloadCallback(object sender, EventArgs e)
+        {
+            s_domainUnloadStarted = true;
+        }
+
+        private static void EnsureADUnloadCallbackRegistered()
+        {
+            if (Volatile.Read(ref s_adUnloadEventHandler) == null)
+            {
+                EventHandler handler = AppDomainUnloadCallback;
+                if (Interlocked.CompareExchange(ref s_adUnloadEventHandler, handler, null) == null)
+                {
+                    AppDomain.CurrentDomain.DomainUnload += handler;
+                }
+            }
+        }
+
+        private static bool ShouldFailFastOnUnobservedException()
+        {
+            return false;
         }

         /// Adds the exception to the fault list.
@@ -306,6 +338,21 @@
             }
         }

+        private AggregateException CreateAggregateException()
+        {
+            // We will only propagate if this is truly unhandled. The reason this could
+            // ever occur is somewhat subtle: if a Task's exceptions are observed in some
+            // other finalizer, and the Task was finalized before the holder, the holder
+            // will have been marked as handled before even getting here.
+
+            // Give users a chance to keep this exception from crashing the process
+
+            // First, publish the unobserved exception and allow users to observe it
+            return new AggregateException(
+                "A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.",
+                m_faultExceptions.Select(exceptionDispatchInfo => exceptionDispatchInfo.SourceException));
+        }
+
         ///
         /// A private helper method that ensures the holder is considered
         /// unhandled, i.e. it is registered for finalization.
@@ -323,84 +370,41 @@
             }
         }

-        ///
-        /// A private helper method that ensures the holder is considered
-        /// handled, i.e. it is not registered for finalization.
-        ///
-        /// <param name="calledFromFinalizer">Whether this is called from the finalizer thread.</param>
-        internal void MarkAsHandled(bool calledFromFinalizer)
-        {
-            if (!m_isHandled)
-            {
-                if (!calledFromFinalizer)
-                {
-                    GC.SuppressFinalize(this);
-                }
-
-                m_isHandled = true;
-            }
-        }
-
-        ///
-        /// Allocates a new aggregate exception and adds the contents of the list to
-        /// it. By calling this method, the holder assumes exceptions to have been
-        /// "observed", such that the finalization check will be subsequently skipped.
-        ///
-        /// <param name="calledFromFinalizer">Whether this is being called from a finalizer.</param>
-        /// <param name="includeThisException">An extra exception to be included (optionally).</param>
-        /// <returns>The aggregate exception to throw.</returns>
-        internal AggregateException CreateExceptionObject(bool calledFromFinalizer, Exception includeThisException)
-        {
-            var exceptions = m_faultExceptions;
-            Debug.Assert(exceptions != null, "Expected an initialized list.");
-            Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
-
-            // Mark as handled and aggregate the exceptions.
-            MarkAsHandled(calledFromFinalizer);
-
-            // If we're only including the previously captured exceptions,
-            // return them immediately in an aggregate.
-            if (includeThisException == null)
-                return new AggregateException(exceptions.Select(exceptionDispatchInfo => exceptionDispatchInfo.SourceException));
-
-            // Otherwise, the caller wants a specific exception to be included,
-            // so return an aggregate containing that exception and the rest.
-            var combinedExceptions = new Exception[exceptions.Count + 1];
-            for (int i = 0; i < combinedExceptions.Length - 1; i++)
-            {
-                combinedExceptions[i] = exceptions[i].SourceException;
-            }
-            combinedExceptions[combinedExceptions.Length - 1] = includeThisException;
-            return new AggregateException(combinedExceptions);
-        }
-
-        ///
-        /// Wraps the exception dispatch infos into a new read-only collection. By calling this method,
-        /// the holder assumes exceptions to have been "observed", such that the finalization
-        /// check will be subsequently skipped.
-        ///
-        internal ReadOnlyCollection<ExceptionDispatchInfo> GetExceptionDispatchInfos()
-        {
-            var exceptions = m_faultExceptions;
-            Debug.Assert(exceptions != null, "Expected an initialized list.");
-            Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
+        /// Sets the cancellation exception.
+        /// <param name="exceptionObject">The cancellation exception.</param>
+        /// <remarks>
+        /// Must be called under lock.
+        /// </remarks>
+        private void SetCancellationException(object exceptionObject)
+        {
+            Contract.Requires(exceptionObject != null, "Expected exceptionObject to be non-null.");
+
+            Debug.Assert(m_cancellationException == null,
+                "Expected SetCancellationException to be called only once.");
+            // Breaking this assumption will overwrite a previously OCE,
+            // and implies something may be wrong elsewhere, since there should only ever be one.
+
+            Debug.Assert(m_faultExceptions == null,
+                "Expected SetCancellationException to be called before any faults were added.");
+            // Breaking this assumption shouldn't hurt anything here, but it implies something may be wrong elsewhere.
+            // If this changes, make sure to only conditionally mark as handled below.
+
+            // Store the cancellation exception
+            var oce = exceptionObject as OperationCanceledException;
+            if (oce != null)
+            {
+                m_cancellationException = ExceptionDispatchInfo.Capture(oce);
+            }
+            else
+            {
+                var edi = exceptionObject as ExceptionDispatchInfo;
+                Debug.Assert(edi != null && edi.SourceException is OperationCanceledException,
+                    "Expected an OCE or an EDI that contained an OCE");
+                m_cancellationException = edi;
+            }
+
+            // This is just cancellation, and there are no faults, so mark the holder as handled.
             MarkAsHandled(false);
-            return new ReadOnlyCollection<ExceptionDispatchInfo>(exceptions);
-        }
-
-        ///
-        /// Gets the ExceptionDispatchInfo representing the singular exception
-        /// that was the cause of the task's cancellation.
-        ///
-        /// <returns>
-        /// The ExceptionDispatchInfo for the cancellation exception.  May be null.
-        /// </returns>
-        internal ExceptionDispatchInfo GetCancellationExceptionDispatchInfo()
-        {
-            var edi = m_cancellationException;
-            Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
-                "Expected the EDI to be for an OperationCanceledException");
-            return edi;
         }
     }
 }