Document CupCake.Players.Player

Document CupCake.Players.Player

Fix typo in GuardianModeReceiveEvent event handler

--- CupCake.Players/Player.cs
+++ CupCake.Players/Player.cs
@@ -27,93 +27,438 @@
             get { return this.UserId; }
         }

+        /// <summary>
+        /// Gets the player's username.
+        /// </summary>
+        /// <value>
+        /// The player's username.
+        /// </value>
         public string Username { get; private set; }
+
+        /// <summary>
+        /// Gets the player's user identifier.
+        /// </summary>
+        /// <value>
+        /// The player's user identifier.
+        /// </value>
         public int UserId { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether this player has god mode enabled.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this this player has god mode enabled; otherwise, <c>false</c>.
+        /// </value>
         public bool IsGod { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player has guardian mode enabled.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player has guardian mode enabled; otherwise, <c>false</c>.
+        /// </value>
         public bool IsGuardian { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player has moderator mode enabled.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player has moderator mode enabled; otherwise, <c>false</c>.
+        /// </value>
         public bool IsMod { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether this player is dead.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player is dead; otherwise, <c>false</c>.
+        /// </value>
         public bool IsDead { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player is the bot user's friend.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player is the bot user's friend; otherwise, <c>false</c>.
+        /// </value>
         public bool IsMyFriend { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player is a Builder's Club member.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player is a Builder's Club member; otherwise, <c>false</c>.
+        /// </value>
         public bool IsClubMember { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player is disconnected.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player is disconnected; otherwise, <c>false</c>.
+        /// </value>
         public bool IsDisconnected { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether this player has chat access.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player has chat access; otherwise, <c>false</c>.
+        /// </value>
         public bool HasChat { get; private set; }
+
+        /// <summary>
+        /// Gets the player's magic class.
+        /// </summary>
+        /// <value>
+        /// The player's magic class.
+        /// </value>
         public MagicClass MagicClass { get; private set; }
+
+        /// <summary>
+        /// Gets the player's smiley.
+        /// </summary>
+        /// <value>
+        /// The player's smiley.
+        /// </value>
         public Smiley Smiley { get; private set; }

+        /// <summary>
+        /// Gets the player's number of coins.
+        /// </summary>
+        /// <value>
+        /// The player's number of coins.
+        /// </value>
         public int Coins { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player has opened a switch.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player has opened a switch; otherwise, <c>false</c>.
+        /// </value>
         public bool SwitchOpened { get; private set; }

+        /// <summary>
+        /// Gets the x-coordinate of the player's spawn.
+        /// </summary>
+        /// <value>
+        /// The x-coordinate of the player's spawn.
+        /// </value>
         public int SpawnX { get; private set; }
+
+        /// <summary>
+        /// Gets the y-coordinate of the player's spawn.
+        /// </summary>
+        /// <value>
+        /// The y-coordinate of the player's spawn.
+        /// </value>
         public int SpawnY { get; private set; }
+
+        /// <summary>
+        /// Gets the x-coordinate of the player's current position.
+        /// </summary>
+        /// <value>
+        /// The x-coordinate of the player's current position.
+        /// </value>
         public int PosX { get; private set; }
+
+        /// <summary>
+        /// Gets the y-coordinate of the player's current position.
+        /// </summary>
+        /// <value>
+        /// The y-coordinate of the player's current position.
+        /// </value>
         public int PosY { get; private set; }

+        /// <summary>
+        /// Gets the player's horizontal speed.
+        /// </summary>
+        /// <value>
+        /// The player's horizontal speed.
+        /// </value>
         public double SpeedX { get; private set; }
+
+        /// <summary>
+        /// Gets the player's vertical speed.
+        /// </summary>
+        /// <value>
+        /// The player's vertical speed
+        /// </value>
         public double SpeedY { get; private set; }
+
+        /// <summary>
+        /// Gets the player's horizontal speed modifier.
+        /// </summary>
+        /// <value>
+        /// The player's horizontal speed modifier.
+        /// </value>
         public double ModifierX { get; private set; }
+
+        /// <summary>
+        /// Gets the player's vertical speed modifier.
+        /// </summary>
+        /// <value>
+        /// The player's vertical speed modifier.
+        /// </value>
         public double ModifierY { get; private set; }
+
+        /// <summary>
+        /// Gets the player's horizontal speed direction.
+        /// </summary>
+        /// <value>
+        /// The player's horizontal speed direction.
+        /// </value>
+        public double Horizontal { get; private set; }
+
+        /// <summary>
+        /// Gets the player's vertical speed direction.
+        /// </summary>
+        /// <value>
+        /// The player's vertical speed direction.
+        /// </value>
         public double Vertical { get; private set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether the player is pressing spacebar.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is pressing spacebar; otherwise, <c>false</c>.
+        /// </value>
         public bool SpaceDown { get; set; }

-        public double Horizontal { get; private set; }
+        /// <summary>
+        /// Gets the player's latest regular chat message.
+        /// </summary>
+        /// <value>
+        /// The player's latest regular chat message.
+        /// </value>
         public string Say { get; private set; }

+        /// <summary>
+        /// Gets the player's latest AutoText chat message.
+        /// </summary>
+        /// <value>
+        /// The player's latest AutoText chat message.
+        /// </value>
         public string AutoText { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether this player has a silver crown.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player has a silver crown; otherwise, <c>false</c>.
+        /// </value>
         public bool HasSilverCrown { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether this player has wooted the level.
+        /// </summary>
+        /// <value>
+        /// <c>true</c> if this player has wooted the level; otherwise, <c>false</c>.
+        /// </value>
         public bool HasWooted { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether the player is using a red aura potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a red aura potion; otherwise, <c>false</c>.
+        /// </value>
         public bool RedAuraPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a blue aura potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a blue aura potion; otherwise, <c>false</c>.
+        /// </value>
         public bool BlueAuraPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a yellow aura potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a yellow aura potion; otherwise, <c>false</c>.
+        /// </value>
         public bool YellowAuraPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a green aura potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a green aura potion; otherwise, <c>false</c>.
+        /// </value>
         public bool GreenAuraPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a jump potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a jump potion; otherwise, <c>false</c>.
+        /// </value>
         public bool JumpPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a fire potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a fire potion; otherwise, <c>false</c>.
+        /// </value>
         public bool FirePotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a curse potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a curse potion; otherwise, <c>false</c>.
+        /// </value>
         public bool CursePotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a protection potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a protection potion; otherwise, <c>false</c>.
+        /// </value>
         public bool ProtectionPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a zombie potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a zombie potion; otherwise, <c>false</c>.
+        /// </value>
         public bool ZombiePotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a respawn potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a respawn potion; otherwise, <c>false</c>.
+        /// </value>
         public bool RespawnPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a levitation potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a levitation potion; otherwise, <c>false</c>.
+        /// </value>
         public bool LevitationPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player is using a flaunt potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a flaunt potion; otherwise, <c>false</c>.
+        /// </value>
         public bool FlauntPotion { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether the player is using a solitude potion.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player is using a solitude potion; otherwise, <c>false</c>.
+        /// </value>
         public bool SolitudePotion { get; private set; }
+
+        /// <summary>
+        /// Gets the player's last used potion.
+        /// </summary>
+        /// <value>
+        /// The player's last used potion.
+        /// </value>
         public Potion LastPotion { get; private set; }
+
+        /// <summary>
+        /// Gets a value indicating whether the player's last potion was enabled.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if the player's last potion was enabled; otherwise, <c>false</c>.
+        /// </value>
         public bool LastPotionEnabled { get; private set; }
+
+        /// <summary>
+        /// Gets the timeout for the player's last potion.
+        /// </summary>
+        /// <value>
+        /// The timeout for the player's last potion.
+        /// </value>
         public int LastPotionTimeout { get; private set; }

+        /// <summary>
+        /// Gets a value indicating whether this player has a crown.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player has a crown; otherwise, <c>false</c>.
+        /// </value>
         public bool HasCrown
         {
             get { return this.Host.PlayerService.CrownPlayer == this; }
         }

+        /// <summary>
+        /// Gets a value indicating whether this player is flying using god mode, guardian mode or moderator mode.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player is flying using god mode, guardian mode or moderator mode; otherwise, <c>false</c>.
+        /// </value>
         public bool IsFlying
         {
             get { return this.IsGod || this.IsGuardian || this.IsMod; }
         }

+        /// <summary>
+        /// Gets a value indicating whether this player is a guest.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this player is a guest; otherwise, <c>false</c>.
+        /// </value>
         public bool IsGuest
         {
             get { return PlayerUtils.IsGuest(this.Username); }
         }

+        /// <summary>
+        /// Gets the player's storage name.
+        /// </summary>
+        /// <value>
+        /// The player's storage name.
+        /// </value>
         public string StorageName
         {
             get { return PlayerUtils.GetStorageName(this.Username); }
         }

+        /// <summary>
+        /// Gets the player's chat name.
+        /// </summary>
+        /// <value>
+        /// The player's chat name.
+        /// </value>
         public string ChatName
         {
             get { return PlayerUtils.GetChatName(this.Username); }
         }

+        /// <summary>
+        /// Gets the x-coordinate of the block that the player is located on.
+        /// </summary>
+        /// <value>
+        /// The x-coordinate of the block that the player is located on.
+        /// </value>
         public int BlockX
         {
             get { return BlockUtils.PosToBlock(this.PosX); }
         }

+        /// <summary>
+        /// Gets the y-coordinate of the block that the player is located on.
+        /// </summary>
+        /// <value>
+        /// The y-coordinate of the block that the player is located on.
+        /// </value>
         public int BlockY
         {
             get { return BlockUtils.PosToBlock(this.PosY); }
@@ -128,7 +473,7 @@
             this.BindPlayerEvent<FaceReceiveEvent, FacePlayerEvent>(this.OnFace);
             this.BindPlayerEvent<MoveReceiveEvent, MovePlayerEvent>(this.OnMove);
             this.BindPlayerEvent<GodModeReceiveEvent, GodModePlayerEvent>(this.OnGodMode);
-            this.BindPlayerEvent<GuardianModeReceiveEvent, GuardianModePlayerEvent>(this.OnGruadianMode);
+            this.BindPlayerEvent<GuardianModeReceiveEvent, GuardianModePlayerEvent>(this.OnGuardianMode);
             this.BindPlayerEvent<ModModeReceiveEvent, ModModePlayerEvent>(this.OnModMode);
             this.BindPlayerEvent<SilverCrownReceiveEvent, SilverCrownPlayerEvent>(this.OnSilverCrown);
             this.BindPlayerEvent<LeftReceiveEvent, LeftPlayerEvent>(this.OnLeft);
@@ -248,7 +593,7 @@
             this.IsGod = e.IsGod;
         }

-        private void OnGruadianMode(object sender, GuardianModeReceiveEvent e)
+        private void OnGuardianMode(object sender, GuardianModeReceiveEvent e)
         {
             this.IsGuardian = e.IsGuardian;
         }


changed FolderPane.RefreshSizes() to async void :(

--- StorageTool/Locations.cs
+++ StorageTool/Locations.cs
@@ -110,19 +110,19 @@
             }
         }

-        public void RefreshSizes()
+        public async void RefreshSizes()
         {
             foreach(LocationsDirInfo dir in FoldersLeft)
             {
-                if(dir.DirSize == 0) Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
+                if(dir.DirSize == 0) await Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
             }
             foreach (LocationsDirInfo dir in FoldersRight)
             {
-                if (dir.DirSize == 0) Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
+                if (dir.DirSize == 0) await Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
             }
             foreach (LocationsDirInfo dir in FoldersUnlinked)
             {
-                if (dir.DirSize == 0) Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
+                if (dir.DirSize == 0) await Task.Factory.StartNew(() => ScanFolderAsync(dir.DirInfo).ContinueWith(task => dir.DirSize = task.Result).ConfigureAwait(false), TaskCreationOptions.LongRunning);
             }

         }


update message

update message

--- DemoActors/CallerActor.cs
+++ DemoActors/CallerActor.cs
@@ -19,7 +19,7 @@

             Receive<int>(m =>
             {
-                Console.WriteLine($"#{m} message recieved");
+                Console.WriteLine($"message #{m} recieved by caller");
                 _asyncCallClient.CallWithDelayedResponse().PipeTo(_receiver);
             });
         }


Allow command line to have a second bite of the cherry..

--- EDDiscovery/EDDOptions.cs
+++ EDDiscovery/EDDOptions.cs
@@ -113,14 +113,15 @@
             UserDatabasePath = appsettings["UserDatabasePath"];
         }

-        private void ProcessOptionsFileOption()     // command line -optionsfile
-        {
+        private void ProcessOptionsFileOption(string basefolder)     // command line -optionsfile
+        {
+            //System.Diagnostics.Debug.WriteLine("OptionFile -optionsfile ");
             ProcessCommandLineOptions((optname, optval) =>              //FIRST pass thru command line options looking
             {                                                           //JUST for -optionsfile
                 if (optname == "-optionsfile" && optval != null)
                 {
-                    if (!File.Exists(optval))   // if it does not exist on its own, may be relative to base folder ..
-                        optval = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, optval);
+                    if (!File.Exists(optval) && !Path.IsPathRooted(optval))  // if it does not exist on its own, may be relative to base folder ..
+                        optval = Path.Combine(basefolder, optval);

                     if (File.Exists(optval))
                         ProcessOptionFile(optval);
@@ -134,6 +135,7 @@

         private void ProcessOptionFile(string optval)       // read file and process options
         {
+            //System.Diagnostics.Debug.WriteLine("OptionFile " + optval);
             foreach (string line in File.ReadAllLines(optval))
             {
                 string[] kvp = line.Split(new char[] { ' ' }, 2).Select(s => s.Trim()).ToArray();
@@ -167,6 +169,7 @@
         private bool ProcessOption(string optname, string optval)
         {
             optname = optname.ToLowerInvariant();
+            //System.Diagnostics.Debug.WriteLine("     Option " + optname);

             if (optname == "-optionsfile")
             {
@@ -232,25 +235,29 @@
         {
             ProcessConfigVariables();

-            ProcessOptionsFileOption();     // go thru the command line looking for -optionfile, then read them
-
-            ProcessCommandLineOptions(ProcessOption);       // do all of the command line
+            ProcessOptionsFileOption(System.AppDomain.CurrentDomain.BaseDirectory);     // go thru the command line looking for -optionfile, use relative base dir
+
+            ProcessCommandLineOptions(ProcessOption);       // do all of the command line..  this sets up the appfolder if its overridden on the command line

             string optval = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "options.txt");      // options in the base folder.
             if (File.Exists(optval))   // try options.txt in the base folder..
                 ProcessOptionFile(optval);

-            SetAppDataDirectory();      // set the app directory
+            SetAppDataDirectory();      // set the app directory, now we have given base dir options to override appfolder, and we have given any -optionfiles on the command line
+
+            ProcessOptionsFileOption(AppDataDirectory);     // go thru the command line looking for -optionfile relative to app folder, then read them

             optval = Path.Combine(AppDataDirectory, "options.txt");      // options in the base folder.
             if (File.Exists(optval))   // try options.txt in the base folder..
                 ProcessOptionFile(optval);

-            // must be last, to override any previous options.. will contain user and system db overrides
+            // db move system option file will contain user and system db overrides
             optval = Path.Combine(AppDataDirectory, "dboptions.txt");   // look for this file in the app folder
             if (File.Exists(optval))
                 ProcessOptionFile(optval);

+            ProcessCommandLineOptions(ProcessOption);       // And then let the command line have a last go at overriding them Again. Optionfiles is ignore, appfolder was already done
+
             SetVersionDisplayString();  // then set the version display string up dependent on options selected

             if (UserDatabasePath == null) UserDatabasePath = Path.Combine(AppDataDirectory, "EDDUser.sqlite");


Removed Monitor and System.Threading dependency.

--- ENetCS/Packet.UserData.cs
+++ ENetCS/Packet.UserData.cs
@@ -20,7 +20,6 @@
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
-using System.Threading;

 namespace ENet
 {
@@ -59,15 +58,7 @@

                     if (callback != null)
                     {
-                        try
-                        {
-                            Monitor.Exit(_userData);
-                            callback(packet);
-                        }
-                        finally
-                        {
-                            Monitor.Enter(_userData);
-                        }
+                        callback(packet);
                     }
                 }
                 finally


You forgot the null checks man

You forgot the null checks man

--- Eavesdrop/Eavesdropper.cs
+++ Eavesdrop/Eavesdropper.cs
@@ -21,13 +21,13 @@
         public static event AsyncEventHandler<RequestInterceptedEventArgs> RequestInterceptedAsync;
         private static Task OnRequestInterceptedAsync(RequestInterceptedEventArgs e)
         {
-            return RequestInterceptedAsync(null, e);
+            return (RequestInterceptedAsync?.Invoke(null, e) ?? Task.CompletedTask);
         }

         public static event AsyncEventHandler<ResponseInterceptedEventArgs> ResponseInterceptedAsync;
         private static Task OnResponseInterceptedAsync(ResponseInterceptedEventArgs e)
         {
-            return ResponseInterceptedAsync(null, e);
+            return (ResponseInterceptedAsync?.Invoke(null, e) ?? Task.CompletedTask);
         }


Remove const

Remove const

--- Editor/AnimatorHandles.cs
+++ Editor/AnimatorHandles.cs
@@ -7,7 +7,6 @@
     public class AnimatorHandles {

         // TODO Convert to properties.
-        private const float FloatPrecision = 0.001f;
         private const int AddButtonH = 25;
         private const int AddButtonV = 10;
         private const int RemoveButtonH = 44;
@@ -151,7 +150,8 @@

             // Set initial arc value to other than zero. If initial value
             // is zero, handle will always return zero.
-            arcValue = Math.Abs(arcValue) < FloatPrecision ? 10f : arcValue;
+            arcValue = Math.Abs(arcValue) < GlobalConstants.FloatPrecision
+                ? 10f : arcValue;

             var scaleHandleSize = handleSize * ScaleHandleSize;
             var newArcValue = Handles.ScaleValueHandle(
@@ -167,7 +167,9 @@
             if (newArcValue > maxDegrees) newArcValue = maxDegrees;
             if (newArcValue < minDegrees) newArcValue = minDegrees;

-            if (Math.Abs(newArcValue - arcValue) > FloatPrecision) {
+            if (Math.Abs(newArcValue - arcValue)
+                > GlobalConstants.FloatPrecision) {
+
                 callback(newArcValue / arcValueMultiplier);
             }
         }


True and False in JsonParser to true and false

--- FileParsing/JsonParser.cs
+++ FileParsing/JsonParser.cs
@@ -63,6 +63,7 @@
                 }
             }
         }
+
         public static class FromString
         {
             public static JsonDict Dictionary(String data)
@@ -356,7 +357,7 @@
             else if (o is double) sw(o.ToString());
             else if (o is int) sw(o.ToString());
             else if (o is long) sw(o.ToString());
-            else if (o is bool) sw(o.ToString());
+            else if (o is bool) sw(((bool)o) ? "true" : "false");
             else if (o is JsonDict) JsonParser.print(o as JsonDict, cw, sw, indent);
             else if (o is object[]) JsonParser.print(o as object[], cw, sw, indent);
             else throw new NotImplementedException("Can't Print JSON");


fix problem with event virtual function in AppFormContainer

--- Forms/AppFormContainer.cs
+++ Forms/AppFormContainer.cs
@@ -8,14 +8,14 @@
 {
     public abstract class AppFormContainer : Form, ApplicationFormInterface
     {
-        public void onOnload() { }
+        public virtual void onOnload() { }

-        public void onPostload() { }
+        public virtual void onPostload() { }

-        public void onNewProject() { }
+        public virtual void onNewProject() { }

-        public void onOpenProject() { }
+        public virtual void onOpenProject() { }

-        public void onSaveProject() { }
+        public virtual void onSaveProject() { }
     }
 }


기초적인 GShapeRule 부모관계 구축

기초적인 GShapeRule 부모관계 구축

--- GCS.WPF/GShapes/GShape.cs
+++ GCS.WPF/GShapes/GShape.cs
@@ -1,9 +1,50 @@
-using System.Windows.Shapes;
+using System.Collections.Generic;
+using System.Windows.Shapes;

 namespace GCS.WPF.GShapes
 {
     public abstract class GShape
     {
+        public abstract class GShapeRule
+        {
+            public GShape gShape;
+            public GShapeRule(GShape shape)
+            {
+                gShape = shape;
+            }
+
+            protected bool _isMoving = false;
+            public void Move()
+            {
+                if (_isMoving) return;
+                _isMoving = true;
+
+                HandleMove();
+
+                Fix();
+                MoveChilds();
+                _isMoving = false;
+            }
+
+            public void MoveChilds()
+            {
+                foreach (var c in gShape.Childs)
+                    c._rule.OnParentMoved();
+            }
+
+            public void OnParentMoved()
+            {
+                if (_isMoving) return;
+                Fix();
+                MoveChilds();
+            }
+
+            public abstract void Fix();
+            public abstract void HandleMove();
+        }
+
         public Shape Control { get; protected set; }
+        public List<GShape> Childs;
+        protected GShapeRule _rule;
     }
 }


Follower's animation now takes the elapsed time into account.

--- Game/Entities/Follower.cs
+++ Game/Entities/Follower.cs
@@ -23,7 +23,7 @@
 			this._separate = new SeparationSteering(world, distance);
 			this._target = target;
 			this._arrive = new ArriveAtSteering(target.Position, distance);
-			_rotationSpeed = 0.15;
+			_rotationSpeed = 10;
 		}

 		public override void Update(double elapsed)
@@ -36,7 +36,7 @@
 			Velocity += acceleration * elapsed;
 			Velocity = Velocity.Truncate(MaxSpeed);
 			Position += Velocity * elapsed;
-			_rotation += _rotationSpeed;
+			_rotation += _rotationSpeed * elapsed;
 		}

 		public override void Paint(System.Drawing.Graphics g)


fix in delayed state change

fix in delayed state change

--- Game1/Game1/GameRunner.cs
+++ Game1/Game1/GameRunner.cs
@@ -60,7 +60,7 @@
                 afc.IsFading = true;

                 // delayed state change
-                int dlyMs = (int)(1000 * Game1.BACKGROUND_STAR_ROTATION_SPEED / Game1.BACKGROUND_ROTATION_SLOWDOWN_SPEED) + 100;
+                int dlyMs = (int)(1000 * (ac.Ampl-afc.FadeTarget)/afc.FadeSpeed) + 150;
                 var stateChangeTask = new ThreadedTask(new DelayedStateChanger(dlyMs, Game1.GlobalStateEnum.STATE_PLAYING_PHASE1));
                 stateChangeTask.Start();
             }


performance improvements

performance improvements

--- Maestro.Core/Container.cs
+++ Maestro.Core/Container.cs
@@ -14,7 +14,7 @@

 		private readonly Guid _id;
 		private readonly ThreadSafeDictionary<Type, Plugin> _plugins;
-		private readonly ThreadSafeDictionary<string, IInstanceBuilder> _instanceBuilderCache;
+		private readonly ThreadSafeDictionary<long, IInstanceBuilder> _instanceBuilderCache;
 		private readonly DefaultSettings _defaultSettings;
 		private long _contextId;
 		private int _configVersion;
@@ -27,7 +27,7 @@
 		{
 			_id = Guid.NewGuid();
 			_plugins = new ThreadSafeDictionary<Type, Plugin>();
-			_instanceBuilderCache = new ThreadSafeDictionary<string, IInstanceBuilder>();
+			_instanceBuilderCache = new ThreadSafeDictionary<long, IInstanceBuilder>();
 			_defaultSettings = new DefaultSettings();
 		}

@@ -174,7 +174,7 @@

 		private bool TryGetInstanceBuilder(Type type, IContext context, out IInstanceBuilder instanceBuilder)
 		{
-			var key = string.Format("{0}>{1}", type.FullName, context.Name);
+			var key = (long)type.GetHashCode() << 32 | context.Name.GetHashCode();

 			if (_instanceBuilderCache.TryGet(key, out instanceBuilder))
 				return true;


fixed default proxy detection

fixed default proxy detection

--- MailRuCloudApi/Account.cs
+++ MailRuCloudApi/Account.cs
@@ -9,7 +9,6 @@
 {
     using System;
     using System.Net;
-    using System.Net.Configuration;
     using System.Text;

     /// <summary>
@@ -63,6 +62,8 @@
         /// <value>Password related with login.</value>
         public string Password { get; set; }

+        public AccountInfo Info { get; set; }
+
         /// <summary>
         /// Authorize on MAIL.RU server.
         /// </summary>
@@ -79,7 +80,9 @@
                 throw new ArgumentException("Password is null or empty.");
             }

+            WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;
             Proxy = WebRequest.DefaultWebProxy;
+

             string reqString = $"Login={LoginName}&Domain={ConstSettings.Domain}&Password={Password}";
             byte[] requestData = Encoding.UTF8.GetBytes(reqString);
@@ -153,5 +156,8 @@
                 throw new Exception();
             }
         }
+
+
+
     }
 }


When folding lines, use Environment.NewLine

--- MimeKit/MailboxAddress.cs
+++ MimeKit/MailboxAddress.cs
@@ -108,7 +108,8 @@
 				}

 				if ((lineLength + route.Length + Address.Length + 3) > Rfc2047.MaxLineLength) {
-					sb.Append ("\n\t<");
+					sb.Append (Environment.NewLine);
+					sb.Append ("\t<");
 					lineLength = 2;
 				} else {
 					sb.Append (" <");
@@ -123,7 +124,8 @@
 				sb.Append ('>');
 			} else if (!string.IsNullOrEmpty (route)) {
 				if ((lineLength + route.Length + Address.Length + 2) > Rfc2047.MaxLineLength) {
-					sb.Append ("\n\t<");
+					sb.Append (Environment.NewLine);
+					sb.Append ("\t<");
 					lineLength = 2;
 				} else {
 					sb.Append ('<');


Changed Property mapping to 'id'

Changed Property mapping to 'id'

--- MpzMail.Api/Model/Link.cs
+++ MpzMail.Api/Model/Link.cs
@@ -27,6 +27,6 @@
         [XmlElement("customField1")]
         public string CustomField { get; set; }
         [XmlElement("actionID")]
-        public int ActionId { get; set; }
+        public int id { get; set; }
     }
 }


Added support for capability group sids.

--- NtApiDotNet/NtSecurity.cs
+++ NtApiDotNet/NtSecurity.cs
@@ -2639,8 +2639,9 @@
                 {
                     foreach (string name in _known_capability_names)
                     {
-                        Sid sid = GetCapabilitySid(name);
-                        known_capabilities.Add(sid, name);
+                        GetCapabilitySids(name, out Sid capability_sid, out Sid capability_group_sid);
+                        known_capabilities.Add(capability_sid, name);
+                        known_capabilities.Add(capability_group_sid, name);
                     }
                 }
                 catch (EntryPointNotFoundException)
@@ -3281,9 +3282,34 @@
                 (sid.SubAuthorities[0] == 3);
         }

+        /// <summary>
+        /// Checks if a SID is a capbility group SID.
+        /// </summary>
+        /// <param name="sid">The sid to check.</param>
+        /// <returns>True if a capability group sid.</returns>
+        public static bool IsCapabilityGroupSid(Sid sid)
+        {
+            return sid.Authority.IsAuthority(SecurityAuthority.Nt) &&
+                sid.SubAuthorities.Count == 9 &&
+                sid.SubAuthorities[0] == 32;
+        }
+
         private static int GetSidSize(int rids)
         {
             return 8 + rids * 4;
+        }
+
+        private static void GetCapabilitySids(string capability_name, out Sid capability_sid, out Sid capability_group_sid)
+        {
+            using (SafeHGlobalBuffer cap_sid = new SafeHGlobalBuffer(GetSidSize(9)),
+                    cap_group_sid = new SafeHGlobalBuffer(GetSidSize(10)))
+            {
+                NtRtl.RtlDeriveCapabilitySidsFromName(
+                    new UnicodeString(capability_name),
+                    cap_group_sid, cap_sid).ToNtException();
+                capability_sid = new Sid(cap_sid);
+                capability_group_sid = new Sid(cap_group_sid);
+            }
         }

         /// <summary>
@@ -3546,7 +3572,7 @@
             return result.ToString();
         }

-        private static string MakeFakeCapabilityName(string name)
+        private static string MakeFakeCapabilityName(string name, bool group)
         {
             List<string> parts = new List<string>();
             if (name.Contains("_"))
@@ -3571,7 +3597,7 @@
                 parts[0] = UpperCaseString(parts[0]);
             }

-            return $@"NAMED CAPABILITIES\{String.Join(" ", parts)}";
+            return $@"NAMED CAPABILITIES{(group ? " GROUP":"")}\{String.Join(" ", parts)}";
         }

         private static SidName GetNameForSidInternal(Sid sid)
@@ -3594,17 +3620,25 @@
                             uint[] sub_authorities = sid.SubAuthorities.ToArray();
                             // Convert to a package SID.
                             sub_authorities[0] = 2;
-                            name = NtSecurity.LookupPackageName(new Sid(sid.Authority, sub_authorities));
+                            name = LookupPackageName(new Sid(sid.Authority, sub_authorities));
                             break;
                         case 5:
-                            name = NtSecurity.LookupDeviceCapabilityName(sid);
+                            name = LookupDeviceCapabilityName(sid);
                             break;
                     }
                 }

                 if (!string.IsNullOrWhiteSpace(name))
                 {
-                    return new SidName(MakeFakeCapabilityName(name), SidNameSource.Capability);
+                    return new SidName(MakeFakeCapabilityName(name, false), SidNameSource.Capability);
+                }
+            }
+            else if (IsCapabilityGroupSid(sid))
+            {
+                name = LookupKnownCapabilityName(sid);
+                if (!string.IsNullOrWhiteSpace(name))
+                {
+                    return new SidName(MakeFakeCapabilityName(name, true), SidNameSource.Capability);
                 }
             }
             else if (IsPackageSid(sid))


Added try catch in RunMethod to output mismatching data to the console.

--- Omise.Examples/Program.cs
+++ Omise.Examples/Program.cs
@@ -73,7 +73,20 @@
         {
             Console.WriteLine($"running: {method.Name}");
             var result = method.Invoke(example, null) as Task;
-            result?.Wait();
+            try
+            {
+                result?.Wait();
+            }
+            catch (Exception ex)
+            {
+                // Get the actual exception.
+                Exception exInner = ex;
+                while (exInner.Message == "One or more errors occurred.")
+                {
+                    exInner = exInner.InnerException;
+                }
+                Console.WriteLine($"Error running {method.Name} task - {exInner.Message}");
+            }
         }

         static void extractExample(Example example)


Moved notify icon disposal earlier in the shutdown process to fend off repeated attempts at shutdown

--- Patchy/MainWindow.xaml.cs
+++ Patchy/MainWindow.xaml.cs
@@ -215,6 +215,8 @@
             }
             e.Cancel = true;
             Visibility = Visibility.Hidden;
+            NotifyIcon.Visible = false;
+            NotifyIcon.Dispose();
         }

         private void WindowClosed(object sender, EventArgs e)
@@ -236,8 +238,6 @@
                 File.WriteAllBytes(SettingsManager.FastResumePath, resume.Encode());
             }
             Client.Shutdown();
-            NotifyIcon.Visible = false;
-            NotifyIcon.Dispose();
         }

         private void TorrentGridSelectionChanged(object sender, SelectionChangedEventArgs e)


trim last slash from apiURL

trim last slash from apiURL

--- PaymillWrapper/Paymill.cs
+++ PaymillWrapper/Paymill.cs
@@ -14,8 +14,21 @@
 {
     public static class Paymill
     {
+        static string _apiUrl = String.Empty;
         public static string ApiKey { get; set; }
-        public static string ApiUrl { get; set; }
+        public static string ApiUrl { get {
+            return _apiUrl;
+        }
+            set
+            {
+                _apiUrl = value;
+                if (value.EndsWith("/"))
+                {
+                   _apiUrl = value.TrimEnd('/');
+                }
+
+            }
+        }
         public static HttpClientRest Client
         {
             get


Add method to subtract points from player

--- PlayerRank/PlayerScore.cs
+++ PlayerRank/PlayerScore.cs
@@ -19,6 +19,11 @@
             Points += points;
         }

+        internal void SubtractPoints(Points points)
+        {
+            Points -= points;
+        }
+
         /// Obsolete V1 API

         [Obsolete("Please use Points instead")]


fix intendation

fix intendation

--- Punku/Strings/Punycode.cs
+++ Punku/Strings/Punycode.cs
@@ -21,7 +21,7 @@
  		 * Punycodes a unicode string
  		 *
  		 * @param input Unicode string
- 	     * @return Punycoded string
+		 * @return Punycoded string
  		 */
 		public static string Encode (string input)
 		{
@@ -126,7 +126,7 @@
 		}

 		/**
-         * Decode a punycoded string
+		 * Decode a punycoded string
  		 *
  		 * @param input Punycode string
  		 * @return Unicode string


Refs #95.  Tabs voor indentatie.

Refs #95.  Tabs voor indentatie.

git-svn-id: 0ffdc289f568b1e7493e560395a00d06174c8a92@926 99b415e2-69d1-4072-8d93-0ed3a15484ab

--- Solution/TestProjecten/Chiro.Gap.Dummies/DummyLedenDao.cs
+++ Solution/TestProjecten/Chiro.Gap.Dummies/DummyLedenDao.cs
@@ -11,43 +11,43 @@
 	/// <summary>
 	/// Fake LedenDao voor tests.  Doet niets.
 	/// </summary>
-	public class DummyLedenDao: DummyDao<Lid>, ILedenDao
+	public class DummyLedenDao : DummyDao<Lid>, ILedenDao
 	{
 		#region ILedenDao Members

 		public IList<Lid> PaginaOphalen(int groepsWerkJaarID)
-        {
-            return new List<Lid>();
-        }
+		{
+			return new List<Lid>();
+		}
 		public IList<Lid> PaginaOphalenVolgensAfdeling(int groepsWerkJaarID, int afdelingsID)
-        {
-            return new List<Lid>();
-        }
+		{
+			return new List<Lid>();
+		}

-        public IList<Lid> AllesOphalen(int groepsWerkJaarID)
-        {
-            return new List<Lid>();
-        }
+		public IList<Lid> AllesOphalen(int groepsWerkJaarID)
+		{
+			return new List<Lid>();
+		}

-        public IList<Lid> PaginaOphalen(int groepsWerkJaarID, int pagina, int paginaGrootte, out int aantalTotaal)
-        {
-            aantalTotaal = 0;
-            return new List<Lid>();
-        }
+		public IList<Lid> PaginaOphalen(int groepsWerkJaarID, int pagina, int paginaGrootte, out int aantalTotaal)
+		{
+			aantalTotaal = 0;
+			return new List<Lid>();
+		}

 		public Lid Ophalen(int gelieerdePersoonID, int groepsWerkJaarID)
 		{
-            return null;
+			return null;
 		}

 		public Lid Ophalen(int gelieerdePersoonID, int groepsWerkJaarID, params System.Linq.Expressions.Expression<Func<Lid, object>>[] paths)
 		{
-            return null;
+			return null;
 		}

 		public Lid OphalenMetDetails(int lidID)
 		{
-            return null;
+			return null;
 		}

 		#endregion


Fixed major seeding

Fixed major seeding

--- Source/Common/Interapp.Common/Constants/ModelConstants.cs
+++ Source/Common/Interapp.Common/Constants/ModelConstants.cs
@@ -11,7 +11,7 @@
         public const int UniversityTuitionFeeMax = 100000;
         public const string UniversityNameRegex = "[A-Z][A-z a-z-'\\.]+";

-        public const int MajorNameMinLength = 10;
+        public const int MajorNameMinLength = 3;
         public const int MajorNameMaxLength = 80;

         public const int EssayTitleMinLength = 2;


Adding locking before populating value in SimpleCacheStruct.

--- Source/CsDebugScript.Engine/Engine/Utility/SimpleCache.cs
+++ Source/CsDebugScript.Engine/Engine/Utility/SimpleCache.cs
@@ -171,8 +171,14 @@
             {
                 if (!Cached)
                 {
-                    value = populateAction();
-                    Cached = true;
+                    lock (populateAction)
+                    {
+                        if (!Cached)
+                        {
+                            value = populateAction();
+                            Cached = true;
+                        }
+                    }
                 }

                 return value;


Update DirectInputPadPlugin.Build.cs

Update DirectInputPadPlugin.Build.cs

UE 4.18

--- Source/DirectInputPadPlugin/DirectInputPadPlugin.Build.cs
+++ Source/DirectInputPadPlugin/DirectInputPadPlugin.Build.cs
@@ -25,6 +25,7 @@
 				{
                     "Core",
                     "CoreUObject",
+		    "ApplicationCore",
                     "Engine",
                     "InputDevice",
 					// ... add other public dependencies that you statically link with here ...
@@ -54,4 +55,4 @@
 				);
 		}
 	}
-}+}


FileAdapters: Improved operation of ProcessLauncher adapter

--- Source/Libraries/Adapters/FileAdapters/ProcessLauncher.cs
+++ Source/Libraries/Adapters/FileAdapters/ProcessLauncher.cs
@@ -31,6 +31,7 @@
 using GSF.Diagnostics;
 using GSF.IO;
 using GSF.Threading;
+using GSF.TimeSeries;
 using GSF.TimeSeries.Adapters;

 namespace FileAdapters
@@ -123,8 +124,34 @@
         /// </summary>
         public const bool DefaultRedirectErrorToHostEnvironment = true;

+        /// <summary>
+        /// Default value for the <see cref="ProcessOutputAsLogMessages"/> property.
+        /// </summary>
+        public const bool DefaultProcessOutputAsLogMessages = false;
+
+        /// <summary>
+        /// Default value for the <see cref="LogMessageTextToken"/> property.
+        /// </summary>
+        public const string DefaultLogMessageTextToken = "msg=";
+
+        /// <summary>
+        /// Default value for the <see cref="LogMessageLevelToken"/> property.
+        /// </summary>
+        public const string DefaultLogMessageLevelToken = "lvl=";
+
+        /// <summary>
+        /// Default value for the <see cref="LogMessageLevelMappingConnectionString"/> property.
+        /// </summary>
+        public const string DefaultLogMessageLevelMappingConnectionString = "info=Info; warn=Waning; error=Error; critical=Critical; debug=Debug";
+
+        /// <summary>
+        /// Default value for the <see cref="ForceKillOnDispose"/> property.
+        /// </summary>
+        public const bool DefaultForceKillOnDispose = false;
+
         // Fields
         private readonly Process m_process;
+        private readonly Dictionary<string, MessageLevel> m_messageLevelMap;
         private bool m_supportsTemporalProcessing;
         private long m_inputLinesProcessed;
         private long m_outputLinesProcessed;
@@ -141,6 +168,7 @@
         public ProcessLauncher()
         {
             m_process = new Process();
+            m_messageLevelMap = new Dictionary<string, MessageLevel>(StringComparer.OrdinalIgnoreCase);
         }

         #endregion
@@ -174,7 +202,7 @@
         /// Gets or sets working directory to use when launching the process.
         /// </summary>
         [ConnectionStringParameter,
-        Description("Define working directory to use when launching the process. Defaults to current working directory as set by hosting environment."),
+        Description("Define working directory to use when launching the process. Defaults to path of executable to launch."),
         DefaultValue(DefaultWorkingDirectory)]
         public string WorkingDirectory { get; set; } = DefaultWorkingDirectory;

@@ -273,6 +301,133 @@
         Description("Define flag that determines if process standard error output should be redirected to the hosting environment."),
         DefaultValue(DefaultRedirectErrorToHostEnvironment)]
         public bool RedirectErrorToHostEnvironment { get; set; } = DefaultRedirectErrorToHostEnvironment;
+
+        /// <summary>
+        /// Gets or sets flag that determines if redirected output should attempt parse as formatted log messages, e.g.: lvl=info msg="log message".
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define flag that determines if redirected output should attempt parse as formatted log messages, e.g.: lvl=info msg=\"log message\"."),
+        DefaultValue(DefaultProcessOutputAsLogMessages)]
+        public bool ProcessOutputAsLogMessages { get; set; } = DefaultProcessOutputAsLogMessages;
+
+        /// <summary>
+        /// Gets or sets token used to find log message text when redirected output is processed as formatted log messages.
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define token used to find log message text when redirected output is processed as formatted log messages."),
+        DefaultValue(DefaultLogMessageTextToken)]
+        public string LogMessageTextToken { get; set; } = DefaultLogMessageTextToken;
+
+        /// <summary>
+        /// Gets or sets token used to find log message level when redirected output is processed as formatted log messages.
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define token used to find log message level when redirected output is processed as formatted log messages."),
+        DefaultValue(DefaultLogMessageLevelToken)]
+        public string LogMessageLevelToken { get; set; } = DefaultLogMessageLevelToken;
+
+        /// <summary>
+        /// Gets or sets log level mappings connecLtion string to use when redirected output is processed as formatted log messages.
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define log level mappings connection string to use when redirected output is processed as formatted log messages. Format is \"log_level_name=GSF.Diagnostics.MessageLevel\", for example: info=Info; warn=Waning; error=Error; critical=Critical; debug=Debug"),
+        DefaultValue(DefaultLogMessageLevelMappingConnectionString)]
+        public string LogMessageLevelMappingConnectionString { get; set; } = DefaultLogMessageLevelMappingConnectionString;
+
+        /// <summary>
+        /// Gets or sets flag that determines if launched process should be forcibly terminated when adapter is disposed.
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define flag that determines if launched process should be forcibly terminated when adapter is disposed."),
+        DefaultValue(DefaultForceKillOnDispose)]
+        public bool ForceKillOnDispose { get; set; } = DefaultForceKillOnDispose;
+
+        #region [ Hidden Properties ]
+
+        // The following common adapter properties are marked as never browse by an
+        // editor since the properties are not used by the ProcessLauncher adapter
+
+        /// <summary>
+        /// Property hidden - not used by <see cref="ProcessLauncher"/>.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new MeasurementKey[] InputMeasurementKeys
+        {
+            get
+            {
+                return base.InputMeasurementKeys;
+            }
+            set
+            {
+                base.InputMeasurementKeys = value;
+            }
+        }
+
+        /// <summary>
+        /// Property hidden - not used by <see cref="ProcessLauncher"/>.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new IMeasurement[] OutputMeasurements
+        {
+            get
+            {
+                return base.OutputMeasurements;
+            }
+            set
+            {
+                base.OutputMeasurements = value;
+            }
+        }
+
+        /// <summary>
+        /// Property hidden - not used by <see cref="ProcessLauncher"/>.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new int FramesPerSecond
+        {
+            get
+            {
+                return base.FramesPerSecond;
+            }
+            set
+            {
+                base.FramesPerSecond = value;
+            }
+        }
+
+        /// <summary>
+        /// Property hidden - not used by <see cref="ProcessLauncher"/>.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new double LagTime
+        {
+            get
+            {
+                return base.LagTime;
+            }
+            set
+            {
+                base.LagTime = value;
+            }
+        }
+
+        /// <summary>
+        /// Property hidden - not used by <see cref="ProcessLauncher"/>.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new double LeadTime
+        {
+            get
+            {
+                return base.LeadTime;
+            }
+            set
+            {
+                base.LeadTime = value;
+            }
+        }
+
+        #endregion

         /// <summary>
         /// Returns the detailed status of the data input source.
@@ -291,72 +446,76 @@

                 status.Append(base.Status);
                 status.AppendLine($"       Executable filename: {FilePath.TrimFileName(FileName, 51)}");
-
-                try
-                {
-                    FileVersionInfo version = m_process.MainModule.FileVersionInfo;
-
-                    status.AppendLine($"   Executable file version: {version.FileVersion}");
-
-                    if (!string.IsNullOrWhiteSpace(version.FileDescription))
-                        status.AppendLine($"    Executable description: {version.FileDescription}");
-
-                    if (!string.IsNullOrWhiteSpace(version.Comments))
-                        status.AppendLine($"       Executable comments: {version.Comments}");
-
-                    if (!string.IsNullOrWhiteSpace(version.CompanyName))
-                        status.AppendLine($"   Executable company name: {version.CompanyName}");
-
-                    if (!string.IsNullOrWhiteSpace(version.LegalCopyright))
-                        status.AppendLine($"      Executable copyright: {version.LegalCopyright}");
-
-                    status.AppendLine($" Executable is debug build: {version.IsDebug}");
-                    status.AppendLine($"       Executable language: {version.Language}");
-
-                    if (!string.IsNullOrWhiteSpace(version.OriginalFilename))
-                        status.AppendLine($"  Executable original name: {version.OriginalFilename}");
-
-                    if (!string.IsNullOrWhiteSpace(version.InternalName))
-                        status.AppendLine($"  Executable internal name: {version.InternalName}");
-
-                    if (!string.IsNullOrWhiteSpace(version.ProductName))
-                        status.AppendLine($"   Executable product name: {version.ProductName}");
-
-                    if (!string.IsNullOrWhiteSpace(version.ProductVersion))
-                        status.AppendLine($"Executable product version: {version.ProductVersion}");
-                }
-                catch
-                {
-                    status.AppendLine("       Version information: [unavailable]");
-                }
-
                 status.AppendLine($"         Working directory: {FilePath.TrimFileName(WorkingDirectory, 51)}");
-                status.AppendLine($"              Process name: {m_process.ProcessName}");
-                status.AppendLine($"             OS Process ID: {m_process.Id}");
-                status.AppendLine($"        Process start time: {m_process.StartTime:yyyy-MM-dd HH:mm:ss.fff}");
-                status.AppendLine($"     Process is responding: {m_process.Responding}");
-                status.AppendLine($"     Process base priority: {m_process.BasePriority}");
-                status.AppendLine($"        Process has exited: {m_process.HasExited}");
-
-                if (m_process.HasExited)
-                {
-                    status.AppendLine($"         Process exit code: {m_process.ExitCode}");
-                    status.AppendLine($"         Process exit time: {m_process.ExitTime:yyyy-MM-dd HH:mm:ss.fff}");
-                    status.AppendLine($"      Total processor time: {m_process.TotalProcessorTime.ToElapsedTimeString()}");
-                    status.AppendLine($"            Total run-time: {(m_process.ExitTime - m_process.StartTime).ToElapsedTimeString()}");
-                }
-                else
-                {
-                    status.AppendLine($"      Process thread count: {m_process.Threads:N0}");
-                    status.AppendLine($"      Process handle count: {m_process.HandleCount:N0}");
-                    status.AppendLine($"      Total processor time: {m_process.TotalProcessorTime.ToElapsedTimeString()}");
-                    status.AppendLine($"            Total run-time: {(DateTime.Now - m_process.StartTime).ToElapsedTimeString()}");
+
+                if (Initialized)
+                {
+                    try
+                    {
+                        FileVersionInfo version = m_process.MainModule.FileVersionInfo;
+
+                        status.AppendLine($"   Executable file version: {version.FileVersion}");
+
+                        if (!string.IsNullOrWhiteSpace(version.FileDescription))
+                            status.AppendLine($"    Executable description: {version.FileDescription}");
+
+                        if (!string.IsNullOrWhiteSpace(version.Comments))
+                            status.AppendLine($"       Executable comments: {version.Comments}");
+
+                        if (!string.IsNullOrWhiteSpace(version.CompanyName))
+                            status.AppendLine($"   Executable company name: {version.CompanyName}");
+
+                        if (!string.IsNullOrWhiteSpace(version.LegalCopyright))
+                            status.AppendLine($"      Executable copyright: {version.LegalCopyright}");
+
+                        status.AppendLine($" Executable is debug build: {version.IsDebug}");
+                        status.AppendLine($"       Executable language: {version.Language}");
+
+                        if (!string.IsNullOrWhiteSpace(version.OriginalFilename))
+                            status.AppendLine($"  Executable original name: {version.OriginalFilename}");
+
+                        if (!string.IsNullOrWhiteSpace(version.InternalName))
+                            status.AppendLine($"  Executable internal name: {version.InternalName}");
+
+                        if (!string.IsNullOrWhiteSpace(version.ProductName))
+                            status.AppendLine($"   Executable product name: {version.ProductName}");
+
+                        if (!string.IsNullOrWhiteSpace(version.ProductVersion))
+                            status.AppendLine($"Executable product version: {version.ProductVersion}");
+                    }
+                    catch
+                    {
+                        status.AppendLine("       Version information: [unavailable]");
+                    }
+
+                    if (m_process.HasExited)
+                    {
+                        status.AppendLine("        Process has exited: True");
+                        status.AppendLine($"         Process exit code: {m_process.ExitCode}");
+                        status.AppendLine($"         Process exit time: {m_process.ExitTime:yyyy-MM-dd HH:mm:ss.fff}");
+                        status.AppendLine($"      Total processor time: {m_process.TotalProcessorTime.ToElapsedTimeString()}");
+                        status.AppendLine($"            Total run-time: {(m_process.ExitTime - ((DateTime)StartTime).ToLocalTime()).ToElapsedTimeString()}");
+                    }
+                    else
+                    {
+                        status.AppendLine($"     Process is responding: {m_process.Responding}");
+                        status.AppendLine($"              Process name: {m_process.ProcessName}");
+                        status.AppendLine($"        Process start time: {m_process.StartTime:yyyy-MM-dd HH:mm:ss.fff}");
+                        status.AppendLine($"             OS Process ID: {m_process.Id}");
+                        status.AppendLine($"     Process base priority: {m_process.BasePriority}");
+                        status.AppendLine($"      Process thread count: {m_process.Threads:N0}");
+                        status.AppendLine($"      Process handle count: {m_process.HandleCount:N0}");
+                        status.AppendLine($"      Total processor time: {m_process.TotalProcessorTime.ToElapsedTimeString()}");
+                        status.AppendLine($"            Total run-time: {(DateTime.Now - m_process.StartTime).ToElapsedTimeString()}");
+                    }
                 }

                 status.AppendLine($"    Initial input filename: {FilePath.TrimFileName(InitialInputFileName, 51)}");
                 status.AppendLine($"     Input lines processed: {m_inputLinesProcessed:N0}");
                 status.AppendLine($"    Output lines processed: {m_outputLinesProcessed:N0}");
                 status.AppendLine($"     Error lines processed: {m_errorLinesProcessed:N0}");
+                status.AppendLine($"   Process as log messages: {ProcessOutputAsLogMessages}");
+                status.AppendLine($"   Forcing kill on dispose: {ForceKillOnDispose}");

                 return status.ToString();
             }
@@ -372,42 +531,34 @@
         /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
         protected override void Dispose(bool disposing)
         {
-            if (!m_disposed)
-            {
-                try
-                {
-                    // This will be done regardless of whether the object is finalized or disposed.
-
-                    if (disposing)
+            if (m_disposed)
+                return;
+
+            try
+            {
+                if (disposing)
+                {
+                    if (ForceKillOnDispose)
                     {
                         try
                         {
-                            m_process.Dispose();
+                            m_process.Kill();
                         }
-                        catch
+                        catch (Exception ex)
                         {
-                            try
-                            {
-                                if (!m_process.HasExited)
-                                    m_process.Kill();
-                            }
-                            catch (Exception ex)
-                            {
-                                OnProcessException(MessageLevel.Warning, new InvalidOperationException($"Failed to stop process launched \"{FileName}\": {ex.Message}", ex));
-                            }
-                        }
-                        finally
-                        {
-                            m_process.OutputDataReceived -= ProcessOutputDataReceived;
-                            m_process.ErrorDataReceived -= ProcessErrorDataReceived;
+                            OnProcessException(MessageLevel.Warning, new InvalidOperationException($"Exception encountered while attempting to stop process launched from \"{FileName}\": {ex.Message}", ex));
                         }
                     }
-                }
-                finally
-                {
-                    m_disposed = true;          // Prevent duplicate dispose.
-                    base.Dispose(disposing);    // Call base class Dispose().
-                }
+
+                    m_process.Dispose();
+                    m_process.OutputDataReceived -= ProcessOutputDataReceived;
+                    m_process.ErrorDataReceived -= ProcessErrorDataReceived;
+                }
+            }
+            finally
+            {
+                m_disposed = true;          // Prevent duplicate dispose.
+                base.Dispose(disposing);    // Call base class Dispose().
             }
         }

@@ -423,12 +574,12 @@
             int initialInputProcessingDelay;
             string setting;

-            ProcessStartInfo startInfo = new ProcessStartInfo();
+            ProcessStartInfo startInfo = m_process.StartInfo;

             // Load required parameters
             if (settings.TryGetValue(nameof(FileName), out setting))
             {
-                setting = setting.Trim();
+                setting = FilePath.GetAbsolutePath(setting.Trim());

                 if (File.Exists(setting))
                 {
@@ -472,6 +623,11 @@
                     throw new DirectoryNotFoundException($"Cannot launch process: specified working directory \"{setting}\" does not exist.");
                 }
             }
+            else
+            {
+                WorkingDirectory = FilePath.GetDirectoryName(FileName);
+                startInfo.WorkingDirectory = WorkingDirectory;
+            }

             if (settings.TryGetValue(nameof(EnvironmentalConnectionString), out setting))
             {
@@ -502,7 +658,7 @@

             if (settings.TryGetValue(nameof(InitialInputFileName), out setting))
             {
-                setting = setting.Trim();
+                setting = FilePath.GetAbsolutePath(setting.Trim());

                 if (File.Exists(setting))
                     InitialInputFileName = setting;
@@ -514,26 +670,47 @@
                 InitialInputProcessingDelay = initialInputProcessingDelay;

             if (settings.TryGetValue(nameof(RedirectOutputToHostEnvironment), out setting))
-            {
                 RedirectOutputToHostEnvironment = setting.ParseBoolean();
-                startInfo.RedirectStandardOutput = RedirectOutputToHostEnvironment;
-            }

             if (settings.TryGetValue(nameof(RedirectErrorToHostEnvironment), out setting))
-            {
                 RedirectErrorToHostEnvironment = setting.ParseBoolean();
-                startInfo.RedirectStandardError = true;
-            }
-
+
+            startInfo.RedirectStandardOutput = RedirectOutputToHostEnvironment;
+            startInfo.RedirectStandardError = RedirectErrorToHostEnvironment;
             startInfo.RedirectStandardInput = true;
-
-            m_process.StartInfo = startInfo;
+            startInfo.UseShellExecute = false;
+
             m_process.EnableRaisingEvents = true;
             m_process.OutputDataReceived += ProcessOutputDataReceived;
             m_process.ErrorDataReceived += ProcessErrorDataReceived;

-            if (!m_process.Start())
-                throw new InvalidOperationException($"Failed to launch process from \"{FileName}\".");
+            if (settings.TryGetValue(nameof(ProcessOutputAsLogMessages), out setting))
+                ProcessOutputAsLogMessages = setting.ParseBoolean();
+
+            if (ProcessOutputAsLogMessages)
+            {
+                if (settings.TryGetValue(nameof(LogMessageTextToken), out setting) && setting.Length > 0)
+                    LogMessageTextToken = setting;
+
+                if (settings.TryGetValue(nameof(LogMessageLevelToken), out setting) && setting.Length > 0)
+                    LogMessageLevelToken = setting;
+
+                if (settings.TryGetValue(nameof(LogMessageLevelMappingConnectionString), out setting))
+                    LogMessageLevelMappingConnectionString = setting;
+
+                foreach (KeyValuePair<string, string> item in LogMessageLevelMappingConnectionString.ParseKeyValuePairs())
+                {
+                    MessageLevel level;
+
+                    if (Enum.TryParse(item.Value, true, out level))
+                        m_messageLevelMap[item.Key] = level;
+                }
+            }
+
+            if (settings.TryGetValue(nameof(ForceKillOnDispose), out setting))
+                ForceKillOnDispose = setting.ParseBoolean();
+
+            m_process.Start();

             if (RedirectOutputToHostEnvironment)
                 m_process.BeginOutputReadLine();
@@ -541,27 +718,28 @@
             if (RedirectErrorToHostEnvironment)
                 m_process.BeginErrorReadLine();

-            if (!string.IsNullOrEmpty(InitialInputFileName))
-            {
-                new Action(() =>
-                {
-                    try
+            if (string.IsNullOrEmpty(InitialInputFileName))
+                return;
+
+            // Send any defined initial input to launched application
+            new Action(() =>
+            {
+                try
+                {
+                    using (StreamReader reader = File.OpenText(InitialInputFileName))
                     {
-                        using (StreamReader reader = File.OpenText(InitialInputFileName))
-                        {
-                            string line;
-
-                            while ((object)(line = reader.ReadLine()) != null)
-                                Input(line);
-                        }
+                        string line;
+
+                        while ((object)(line = reader.ReadLine()) != null)
+                            Input(line);
                     }
-                    catch (Exception ex)
-                    {
-                        OnProcessException(MessageLevel.Warning, new InvalidOperationException($"Failed while sending text from \"{InitialInputFileName}\" to launched process standard input: {ex.Message}", ex));
-                    }
-                })
-                .DelayAndExecute(InitialInputProcessingDelay);
-            }
+                }
+                catch (Exception ex)
+                {
+                    OnProcessException(MessageLevel.Warning, new InvalidOperationException($"Failed while sending text from \"{InitialInputFileName}\" to launched process standard input: {ex.Message}", ex));
+                }
+            })
+            .DelayAndExecute(InitialInputProcessingDelay);
         }

         /// <summary>
@@ -571,13 +749,15 @@
         /// <returns>A short one-line summary of the current status of this <see cref="AdapterBase"/>.</returns>
         public override string GetShortStatus(int maxLength)
         {
+            string filename = FilePath.GetFileName(FileName);
+
             if (m_process.HasExited)
-                return $"Process launched from \"{FileName}\" exited with code {m_process.ExitCode}.".CenterText(maxLength);
+                return $"Process for \"{filename}\" exited with {m_process.ExitCode}.".CenterText(maxLength);

             if (m_process.Responding)
-                return $"Process launched from \"{FileName}\" has been running for {(DateTime.Now - m_process.StartTime).ToElapsedTimeString()}.".CenterText(maxLength);
-
-            return $"Process launched from \"{FileName}\" is not responding...".CenterText(maxLength);
+                return $"Process for \"{filename}\" running for {(DateTime.Now - m_process.StartTime).ToElapsedTimeString()}.".CenterText(maxLength);
+
+            return $"Process for \"{filename}\" is not responding...".CenterText(maxLength);
         }

         /// <summary>
@@ -603,14 +783,83 @@

         private void ProcessOutputDataReceived(object sender, DataReceivedEventArgs e)
         {
-            OnStatusMessage(MessageLevel.Info, e.Data);
+            MessageLevel level = MessageLevel.Info;
+            string status = ProcessOutputAsLogMessages ? ParseLogMessage(e.Data, out level) : e.Data;
+
+            if (string.IsNullOrEmpty(status))
+                return;
+
+            OnStatusMessage(level, status);
             m_outputLinesProcessed++;
         }

         private void ProcessErrorDataReceived(object sender, DataReceivedEventArgs e)
         {
-            OnStatusMessage(MessageLevel.Error, e.Data);
+            MessageLevel level = MessageLevel.Error;
+            string status = ProcessOutputAsLogMessages ? ParseLogMessage(e.Data, out level) : e.Data;
+
+            if (string.IsNullOrEmpty(status))
+                return;
+
+            OnStatusMessage(level, status);
             m_errorLinesProcessed++;
+        }
+
+        private string ParseLogMessage(string message, out MessageLevel level)
+        {
+            int textTokenLength = LogMessageTextToken?.Length ?? 0;
+            int levelTokenLength = LogMessageLevelToken?.Length ?? 0;
+
+            level = MessageLevel.NA;
+
+            if (string.IsNullOrWhiteSpace(message))
+                return "";
+
+            int startIndex, endIndex;
+
+            // Get log level
+            if (levelTokenLength > 0)
+            {
+                // ReSharper disable once AssignNullToNotNullAttribute
+                startIndex = message.IndexOf(LogMessageLevelToken, StringComparison.Ordinal);
+
+                if (startIndex > -1)
+                {
+                    startIndex += levelTokenLength;
+                    endIndex = message.IndexOf(" ", startIndex, StringComparison.Ordinal);
+
+                    if (endIndex > -1)
+                    {
+                        if (!m_messageLevelMap.TryGetValue(message.Substring(startIndex, endIndex - startIndex), out level))
+                            level = MessageLevel.NA;
+                    }
+                }
+            }
+
+            // Get log message
+            if (textTokenLength > 0)
+            {
+                // ReSharper disable once AssignNullToNotNullAttribute
+                startIndex = message.IndexOf(LogMessageTextToken, StringComparison.Ordinal);
+
+                if (startIndex > -1)
+                {
+                    if (message[startIndex + textTokenLength] == '"')
+                    {
+                        startIndex += textTokenLength + 1;
+                        endIndex = message.IndexOf("\"", startIndex, StringComparison.Ordinal);
+                    }
+                    else
+                    {
+                        startIndex += textTokenLength;
+                        endIndex = message.IndexOf(" ", startIndex, StringComparison.Ordinal);
+                    }
+
+                    return message.Substring(startIndex, endIndex - startIndex);
+                }
+            }
+
+            return message;
         }

         #endregion


Fixed bug in GetBlobIfModified AND added a work-around a WindowsAzure client bug (another unit test fixed).

--- Source/Lokad.Cloud.Framework/Azure/BlobStorageProvider.cs
+++ Source/Lokad.Cloud.Framework/Azure/BlobStorageProvider.cs
@@ -76,7 +76,6 @@

 		static Maybe<string> UploadBlobContent(CloudBlob blob, Stream stream, bool overwrite)
 		{
-			// TODO: BUG, need to fix access control, and to retrieve write status in 1 call.
 			var options = overwrite ?
 				new BlobRequestOptions {AccessCondition = AccessCondition.None} :
 				new BlobRequestOptions {AccessCondition = AccessCondition.IfNotModifiedSince(DateTime.MinValue)};
@@ -218,7 +217,7 @@
 					throw;
 				}

-				var deserialized = DeserializeObject(stream, type);
+				var deserialized = Deserialize(stream, type);
 				return (deserialized == null)
 					? Maybe<object>.Empty
 					: Maybe.From(deserialized);
@@ -232,7 +231,7 @@
 			return actual == expected;
 		}

-		object DeserializeObject(Stream stream, Type type)
+		object Deserialize(Stream stream, Type type)
 		{
 			// If the type is transient, then a failed deserialization must be
 			// handled accordingly, otherwise default to built-in behavior
@@ -268,36 +267,52 @@

 		public Maybe<T> GetBlobIfModified<T>(string containerName, string blobName, string oldEtag, out string newEtag)
 		{
-			var container = _blobStorage.GetContainerReference(containerName);
+			// 'oldEtag' is null, then behavior always match simple 'GetBlob'.
+			if(null == oldEtag)
+			{
+				GetBlob<T>(containerName, blobName, out newEtag);
+			}
+
 			newEtag = null;

-			CloudBlockBlob blob;
-
-			try
-			{
-				blob = container.GetBlockBlobReference(blobName);
-
-				if (blob.Properties == null || blob.Properties.ETag == oldEtag)
+			var container = _blobStorage.GetContainerReference(containerName);
+			var blob = container.GetBlobReference(blobName);
+
+			try
+			{
+				var options = new BlobRequestOptions
+				{
+					AccessCondition = AccessCondition.IfNoneMatch(oldEtag)
+				};
+
+				using (var stream = new MemoryStream())
+				{
+					blob.DownloadToStream(stream, options);
+					newEtag = blob.Properties.ETag;
+
+					return (T)Deserialize(stream, typeof(T));
+				}
+			}
+			catch (StorageClientException ex)
+			{
+				// call fails because blob has been modified (usual case)
+				if(ex.ErrorCode == StorageErrorCode.ConditionFailed ||
+					// HACK: BUG in StorageClient 1.0
+					// see http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/4817cafa-12d8-4979-b6a7-7bda053e6b21
+					ex.Message == @"The condition specified using HTTP conditional header(s) is not met.")
 				{
 					return Maybe<T>.Empty;
 				}
-				newEtag = blob.Properties.ETag;
-			}
-			catch (StorageClientException ex)
-			{
+
+				// call fails due to misc problems
 				if (ex.ErrorCode == StorageErrorCode.ContainerNotFound
 					|| ex.ErrorCode == StorageErrorCode.BlobNotFound
 						|| ex.ErrorCode == StorageErrorCode.ResourceNotFound)
 				{
 					return Maybe<T>.Empty;
 				}
-				throw;
-			}
-
-			using (var stream = new MemoryStream())
-			{
-				blob.DownloadToStream(stream);
-				return (T) DeserializeObject(stream, typeof (T));
+
+				throw;
 			}
 		}

@@ -356,7 +371,7 @@
 				using (var rstream = new MemoryStream())
 				{
 					blob.DownloadToStream(rstream);
-					var blobData = DeserializeObject(rstream, typeof(T));
+					var blobData = Deserialize(rstream, typeof(T));
 					input = blobData == null ? Maybe<T>.Empty : (T) blobData;
 				}
 			}


Update MediaDownloaderTest.cs

Update MediaDownloaderTest.cs

--- Src/GoogleApis.Tests/Apis/Download/MediaDownloaderTest.cs
+++ Src/GoogleApis.Tests/Apis/Download/MediaDownloaderTest.cs
@@ -60,7 +60,7 @@
             /// Gets or sets the chunk size to send.
             public int ChunkSize { get; set; }

-            /// Sets the status code to return for simulating errors.
+            /// Gets or sets the status code in case we simulate an error.
             public HttpStatusCode StatusCode { get; set; }

             /// Gets or sets the cancellation token used to cancel a request in the middle.
@@ -231,7 +231,7 @@
                     try
                     {
                         var result = downloader.DownloadAsync(downloadUri, outputStream,
-                                         handler.CancellationTokenSource.Token).Result;
+                            handler.CancellationTokenSource.Token).Result;
                         Assert.AreEqual(0, handler.CancelRequestNum);
                     }
                     catch (AggregateException ex)


Changed development version numbers in AssemblyInfo.cs to match the ones in Build.ps1 because R# 10 now requires that the installed assembly name versions are the same as in the currently copied assemblies

--- Src/ImplicitNullability.Plugin/Properties/AssemblyInfo.cs
+++ Src/ImplicitNullability.Plugin/Properties/AssemblyInfo.cs
@@ -4,9 +4,9 @@
 [assembly: AssemblyDescription(AssemblyConsts.Description)]
 //

-[assembly: AssemblyVersion("0.0.0.1")]
-[assembly: AssemblyFileVersion("0.0.0.1")]
-[assembly: AssemblyInformationalVersion("0.0.0.1-dev")]
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
+[assembly: AssemblyInformationalVersion("0.0.1.0-dev")]

 // ReSharper disable once CheckNamespace
 internal static class AssemblyConsts


[Java] do not generate tuple fields as final (#480)

--- Src/PCompiler/CompilerCore/Backend/Java/TypesGenerator.cs
+++ Src/PCompiler/CompilerCore/Backend/Java/TypesGenerator.cs
@@ -115,7 +115,7 @@
             // Write the fields.
             foreach (var (jType, fieldName) in fields)
             {
-                WriteLine($"public final {jType.TypeName} {fieldName};");
+                WriteLine($"public {jType.TypeName} {fieldName};");
             }
             WriteLine();


Fixed warning SimpleInjector: RegisterSingleton(instance) is obsolete -> use RegisterInstance - please review -

--- Tapeti.SimpleInjector/SimpleInjectorDependencyResolver.cs
+++ Tapeti.SimpleInjector/SimpleInjectorDependencyResolver.cs
@@ -45,7 +45,7 @@
         public void RegisterDefaultSingleton<TService>(TService instance) where TService : class
         {
             if (CanRegisterDefault<TService>())
-                container.RegisterSingleton(instance);
+                container.RegisterInstance(instance);
         }

         public void RegisterDefaultSingleton<TService>(Func<TService> factory) where TService : class


The AddMultipleMembers() family of methods for Twitter Lists were broken. They were only addeing the 1st and last users in any given list (up to 100) of users.

--- Tweetinvi.Controllers/User/UserQueryParameterGenerator.cs
+++ Tweetinvi.Controllers/User/UserQueryParameterGenerator.cs
@@ -84,7 +84,7 @@

             for (int i = 0; i < usersList.Count - 1; ++i)
             {
-                var userDTO = usersList[0];
+                var userDTO = usersList[i];

                 if (userDTO.Id != TweetinviSettings.DEFAULT_ID)
                 {


Added new parameters

Added new parameters

--- src/MtgApiManager.Lib/Service/CardQueryParameter.cs
+++ src/MtgApiManager.Lib/Service/CardQueryParameter.cs
@@ -18,6 +18,12 @@
         /// </summary>
         [JsonPropertyName("cmc")]
         public string Cmc { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether to filter cards based on whether or not they have a specific field available (like imageUrl)
+        /// </summary>
+        [JsonPropertyName("contains")]
+        public string Contains { get; set; }

         /// <summary>
         /// Gets or sets the card colors by color code. [“Red”, “Blue”] becomes [“R”, “U”].
@@ -122,6 +128,12 @@
         public string Power { get; set; }

         /// <summary>
+        /// Gets or sets a value indicating wether to fetch any number of cards (controlled by pageSize) randomly.
+        /// </summary>
+        [JsonPropertyName("random")]
+        public bool Random { get; set; }
+
+        /// <summary>
         /// Gets or sets the rarity of the card. Examples: Common, Uncommon, Rare, Mythic Rare, Special, Basic Land
         /// </summary>
         [JsonPropertyName("rarity")]


Update file tests to be stricter

Update file tests to be stricter

Former-commit-id: c7bf7a25a26c896827148ce0f019cde97c92bc9f

--- Tests/Sharpy/FileTests.cs
+++ Tests/Sharpy/FileTests.cs
@@ -10,7 +10,9 @@
 namespace Tests.Sharpy {
     [TestFixture]
     internal class FileTests {
-        [Test]
+        [Test(
+            Description = "Verify that no name contains number"
+        )]
         public void Name_Contains_No_Numbers() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
@@ -18,7 +20,9 @@
             Assert.IsFalse(containsNumber);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no name contains puncatuation"
+        )]
         public void Name_Contains_No_Punctuations() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
@@ -26,54 +30,68 @@
             Assert.IsFalse(containsPuncation);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no name contains separators"
+        )]
         public void Name_Contains_No_Separator() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
-            var containsSeperator = deserializeObject.Select(name => name.Data).All(s => s.Any(char.IsSeparator));
+            var containsSeperator = deserializeObject
+                .Select(name => name.Data)
+                .All(s => s.Any(char.IsSeparator));
             Assert.IsFalse(containsSeperator);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no name contains symbol"
+        )]
         public void Name_Contains_No_Symbols() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
-            var containsSymbols = deserializeObject.Select(name => name.Data).All(s => s.Any(char.IsSymbol));
+            var containsSymbols = deserializeObject
+                .Select(name => name.Data)
+                .Any(s => s.Any(char.IsSymbol));
             Assert.IsFalse(containsSymbols);
         }

         [Test(
-            Description = "Verify if any string got any white space."
-            )]
+            Description = "Verify that no name contains white space."
+        )]
         public void Name_Contains_No_White_Space() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
-            foreach (var name1 in deserializeObject.Where(name => name.Data.Any(char.IsWhiteSpace))) {
-                Console.WriteLine($"{name1.Data}, {name1.Country}");
-            }
             var containsWhiteSpace = deserializeObject
                 .Select(name => name.Data)
                 .Any(s => s.Any(char.IsWhiteSpace));
             Assert.IsFalse(containsWhiteSpace);
         }

-        [Test]
+        [Test(
+            Description = "Verify that all names starts with upper case"
+        )]
         public void Name_Starts_With_Capital_Letter() {
             var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
                 Encoding.UTF8.GetString(Resources.NamesByOrigin));
-            var startsWithUpperCase = deserializeObject.Select(name => name.Data).All(s => char.IsUpper(s.First()));
+            var startsWithUpperCase = deserializeObject
+                .Select(name => name.Data)
+                .All(s => char.IsUpper(s.First()));
             Assert.IsTrue(startsWithUpperCase);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no username contains number."
+        )]
         public void User_Name_Contains_No_Numbers() {
-            var containsNumber = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
-                .All(s => s.Any(char.IsNumber));
+            var containsNumber = Resources.usernames
+                .Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
+                .Any(s => s.Any(char.IsNumber));
             Assert.IsFalse(containsNumber);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no username contains punctuation."
+        )]
         public void User_Name_Contains_No_Punctuations() {
             var containsPunctuations =
                 Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
@@ -81,26 +99,32 @@
             Assert.IsFalse(containsPunctuations);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no username contains separator."
+        )]
         public void User_Name_Contains_No_Separator() {
             var containsSeparator =
                 Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
-                    .All(s => s.Any(char.IsSeparator));
+                    .Any(s => s.Any(char.IsSeparator));
             Assert.IsFalse(containsSeparator);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no username contains symbol."
+        )]
         public void User_Name_Contains_No_Symbols() {
             var containsSymbols = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
-                .All(s => s.Any(char.IsSymbol));
+                .Any(s => s.Any(char.IsSymbol));
             Assert.IsFalse(containsSymbols);
         }

-        [Test]
+        [Test(
+            Description = "Verify that no username contains white space."
+        )]
         public void User_Name_Contains_No_White_Space() {
             var containsWhitespace =
                 Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
-                    .All(s => s.Any(char.IsWhiteSpace));
+                    .Any(s => s.Any(char.IsWhiteSpace));
             Assert.IsFalse(containsWhitespace);
         }
     }


#5 Updated title and product in AssemblyInfo.cs

--- src/NAppUpdate.Framework/Properties/AssemblyInfo.cs
+++ src/NAppUpdate.Framework/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("NAppUpdate - .NET Application Updater")]
+[assembly: AssemblyTitle("NAppUpdate2 - .NET Application Updater")]
 [assembly: AssemblyDescription("Library for easy and flexible integration of application update mechanism")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Itamar Syn-Hershko")]
-[assembly: AssemblyProduct("NAppUpdate")]
+[assembly: AssemblyProduct("NAppUpdate2")]
 [assembly: AssemblyCopyright("Copyright © 2010-2012 Itamar Syn-Hershko")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Added section-object mapping tests.

Added section-object mapping tests.

--- Tests/SimpleConfigTest.cs
+++ Tests/SimpleConfigTest.cs
@@ -317,6 +317,35 @@
       AssertArraysAreEqual(new[] { "\"first \"second", "third fourth", "fifth" }, section["Setting13"].StringValueArray);
     }

+    sealed class SectionTestObject
+    {
+      public string[] SomeArrayProp { get; set; }
+      public string[] SomeArrayField = null;
+    }
+
+    [Test]
+    public void SectionObjectMapping()
+    {
+      var cfg = new Configuration();
+
+      var section = cfg["Section"];
+      section["SomeArrayProp"].StringValue = "{1,2,3}";
+      section["SomeArrayField"].StringValue = "{4,5,6}";
+
+      var obj = section.ToObject<SectionTestObject>();
+
+      AssertArraysAreEqual(new[] { "1", "2", "3" }, obj.SomeArrayProp);
+      AssertArraysAreEqual(new[] { "4", "5", "6" }, obj.SomeArrayField);
+
+      section = cfg["Section2"];
+      section.Add("SomeArrayProp");
+      section.Add("SomeArrayField");
+      section.GetValuesFrom(obj);
+
+      AssertArraysAreEqual(new[] { "1", "2", "3" }, section["SomeArrayProp"].StringValueArray);
+      AssertArraysAreEqual(new[] { "4", "5", "6" }, section["SomeArrayField"].StringValueArray);
+    }
+
     private static void AssertArraysAreEqual(string[] expected, string[] actual)
     {
       Assert.AreEqual(expected.Length, actual.Length);


Moved the namespace.

Moved the namespace.

--- src/NServiceKit.Razor/Managers/RazorPageResolver.cs
+++ src/NServiceKit.Razor/Managers/RazorPageResolver.cs
@@ -11,14 +11,12 @@
 using NServiceKit.Text;
 using NServiceKit.WebHost.Endpoints.Extensions;
 using NServiceKit.WebHost.Endpoints.Support;
+using System.Web.UI.WebControls;
+using NServiceKit.IO;
+using NServiceKit.Text.Controller;

 namespace NServiceKit.Razor.Managers
 {
-    using System.Web.UI.WebControls;
-
-    using NServiceKit.IO;
-    using NServiceKit.Text.Controller;
-
     /// <summary>Renders the partial delegate.</summary>
     ///
     /// <param name="pageName">  Name of the page.</param>


MixUntil sanity check on load.

MixUntil sanity check on load.

--- WalletWasabi.Gui/Config.cs
+++ WalletWasabi.Gui/Config.cs
@@ -315,6 +315,26 @@
 		{
 			var config = new Config(path);
 			await config.LoadOrCreateDefaultFileAsync();
+
+			// MixUntilAnonymitySet sanity check.
+			if (config.MixUntilAnonymitySet != config.PrivacyLevelFine &&
+				config.MixUntilAnonymitySet != config.PrivacyLevelSome &&
+				config.MixUntilAnonymitySet != config.PrivacyLevelStrong)
+			{
+				if (config.MixUntilAnonymitySet < config.PrivacyLevelSome)
+				{
+					config.MixUntilAnonymitySet = config.PrivacyLevelSome;
+				}
+				else if (config.MixUntilAnonymitySet < config.PrivacyLevelFine)
+				{
+					config.MixUntilAnonymitySet = config.PrivacyLevelFine;
+				}
+				else
+				{
+					config.MixUntilAnonymitySet = config.PrivacyLevelStrong;
+				}
+			}
+
 			return config;
 		}


DPYでｺｹるの修正

DPYでｺｹるの修正

--- TonNurako/Native/Types.cs
+++ TonNurako/Native/Types.cs
@@ -22,9 +22,9 @@
             }
             Widget = ptr;

-            Display = new X11.Display(Native.Xt.XtSports.XtDisplay(ptr));
-            Window = new X11.Window(Native.Xt.XtSports.XtWindow(ptr));
-            Screen = new X11.Screen(Native.Xt.XtSports.XtScreen(ptr));
+            //Display = new X11.Display(Native.Xt.XtSports.XtDisplay(ptr));
+            //Window = new X11.Window(Native.Xt.XtSports.XtWindow(ptr));
+            //Screen = new X11.Screen(Native.Xt.XtSports.XtScreen(ptr));

             Hash = ptr.ToInt64().ToString().GetHashCode();
         }
@@ -41,13 +41,13 @@
         /// Display
         /// </summary>
         /// <returns>Display</returns>
-        public X11.Display Display { get; }
+        public X11.Display Display => new X11.Display(Native.Xt.XtSports.XtDisplay(Widget));

         /// <summary>
         /// Window
         /// </summary>
         /// <returns>Window</returns>
-        public X11.Window Window { get; }
+        public X11.Window Window => new X11.Window(Native.Xt.XtSports.XtWindow(Widget));

         /// <summary>
@@ -62,7 +62,7 @@
         /// Screen
         /// </summary>
         /// <returns>Screen</returns>
-        public X11.Screen Screen { get; }
+        public X11.Screen Screen => new X11.Screen(Native.Xt.XtSports.XtScreen(Widget));

         /// <summary>
         /// Name


Reword 'parsing' to 'scanning' in Scanner exceptions

--- YamlDotNet/Core/Scanner.cs
+++ YamlDotNet/Core/Scanner.cs
@@ -1696,7 +1696,7 @@
                                 }
                                 else
                                 {
-                                    throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a quoted scalar, found unknown escape character.");
+                                    throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a quoted scalar, found unknown escape character.");
                                 }
                                 break;
                         }
@@ -1716,7 +1716,7 @@
                             {
                                 if (!analyzer.IsHex(k))
                                 {
-                                    throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a quoted scalar, did not find expected hexadecimal number.");
+                                    throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a quoted scalar, did not find expected hexadecimal number.");
                                 }
                                 character = ((character << 4) + analyzer.AsHex(k));
                             }
@@ -1725,7 +1725,7 @@

                             if ((character >= 0xD800 && character <= 0xDFFF) || character > 0x10FFFF)
                             {
-                                throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a quoted scalar, found invalid Unicode character escape code.");
+                                throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a quoted scalar, found invalid Unicode character escape code.");
                             }

                             value.Append(char.ConvertFromUtf32(character));
@@ -2208,7 +2208,7 @@

                 if (!(analyzer.Check('%') && analyzer.IsHex(1) && analyzer.IsHex(2)))
                 {
-                    throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a tag, did not find URI escaped octet.");
+                    throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a tag, did not find URI escaped octet.");
                 }

                 // Get the octet.
@@ -2226,7 +2226,7 @@

                     if (width == 0)
                     {
-                        throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a tag, found an incorrect leading UTF-8 octet.");
+                        throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a tag, found an incorrect leading UTF-8 octet.");
                     }

                     charBytes = new byte[width];
@@ -2237,7 +2237,7 @@

                     if ((octet & 0xC0) != 0x80)
                     {
-                        throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a tag, found an incorrect trailing UTF-8 octet.");
+                        throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a tag, found an incorrect trailing UTF-8 octet.");
                     }
                 }

@@ -2255,7 +2255,7 @@

             if (result.Length == 0 || result.Length > 2)
             {
-                throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a tag, found an incorrect UTF-8 sequence.");
+                throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a tag, found an incorrect UTF-8 sequence.");
             }

             return result;
@@ -2303,7 +2303,7 @@

                 if (isDirective && (tagHandle.Length != 1 || tagHandle[0] != '!'))
                 {
-                    throw new SyntaxErrorException(start, cursor.Mark(), "While parsing a tag directive, did not find expected '!'.");
+                    throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a tag directive, did not find expected '!'.");
                 }
             }


Fixed a couple typos in the XML-documentation-comments.

--- UIconEdit/IconFileBase.cs
+++ UIconEdit/IconFileBase.cs
@@ -52,6 +52,7 @@
             _frames = new FrameList(this);
         }

+        #region Load
         /// <summary>
         /// Loads an <see cref="IconFileBase"/> implementation from the specified stream.
         /// </summary>
@@ -507,6 +508,7 @@
                 throw new IconLoadException(IconErrorCode.ResourceOverlap); //If there's any kind of overlap, someone's wrong.
             }
         }
+        #endregion

         /// <summary>
         /// Returns a duplicate of the current instance.
@@ -562,6 +564,7 @@
         /// <returns>In icon files, the number of bits per pixel. In cursor files, the vertical offset of the hotspot from the top, in pixels.</returns>
         protected abstract ushort GetImgY(IconFrame frame);

+        #region Save
         internal void Save(Stream output, IEnumerable<IconFrame> frameCollection)
         {
 #if LEAVEOPEN
@@ -604,7 +607,7 @@
         /// </summary>
         /// <param name="output">The stream to which the file will be written.</param>
         /// <exception cref="InvalidOperationException">
-        /// The current instance contains zero frames, or more than <see cref="ushort.MaxValue"/> frames.
+        /// <see cref="Frames"/> contains zero elements.
         /// </exception>
         /// <exception cref="ArgumentNullException">
         /// <paramref name="output"/> is <c>null</c>.
@@ -636,7 +639,7 @@
         /// </summary>
         /// <param name="path">The file to which the file will be written.</param>
         /// <exception cref="InvalidOperationException">
-        /// <see cref="Frames"/> instance contains zero elements.
+        /// <see cref="Frames"/> contains zero elements.
         /// </exception>
         /// <exception cref="ArgumentNullException">
         /// <paramref name="path"/> is <c>null</c>.
@@ -774,6 +777,7 @@
             writer.Write(offset); //16
             offset += length;
         }
+        #endregion

         private bool isDisposed = false;
         /// <summary>