Multithreading support added to Manager class

--- PART/Source/CPRBroker/Engine/Manager.Base.cs
+++ PART/Source/CPRBroker/Engine/Manager.Base.cs
@@ -114,6 +114,7 @@
         {
             try
             {
+                #region Initialization and loading of data providers
                 // Initialize context
                 BrokerContext.Initialize(facade.ApplicationToken, facade.UserToken, facade.ApplicationTokenRequired, true, false);

@@ -124,12 +125,12 @@
                 }

                 // have a list of data provider types and corresponding methods to call
-                var methodsAndDataProviders =
+                var subMethodRunStates =
                     (
                         from mi in facade.SubMethodInfos
-                        select new
+                        select new SubMethodRunState()
                        {
-                           MethodCallInfo = mi,
+                           SubMethodInfo = mi,
                            DataProviders = DataProviderManager.GetDataProviderList(mi.InterfaceType, mi.LocalDataProviderOption)
                        }
                    ).ToArray();
@@ -137,8 +138,8 @@
                 // Now check that each method call info either has at least one data provider implementation or can be safely ignored.
                 var missingDataProvidersExist = (
                         (
-                            from mi in methodsAndDataProviders
-                            where mi.MethodCallInfo.FailIfNoDataProvider && mi.DataProviders.Count == 0
+                            from mi in subMethodRunStates
+                            where mi.SubMethodInfo.FailIfNoDataProvider && mi.DataProviders.Count == 0
                             select mi
                         ).FirstOrDefault() != null
                     );
@@ -148,67 +149,100 @@
                     Local.Admin.AddNewLog(TraceEventType.Warning, BrokerContext.Current.WebMethodMessageName, TextMessages.NoDataProvidersFound, null, null);
                     return default(TOutput);
                 }
+                #endregion
+
+                #region creation of sub results in threads
+                // Catch the current broker context in a local variable
+                var currentBrokerContext = BrokerContext.Current;

                 // Now create the sub results
-                object[] subResults = new object[methodsAndDataProviders.Length];
-                for (int iSubMethod = 0; iSubMethod < methodsAndDataProviders.Length; iSubMethod++)
-                {
-                    var subMethodInfo = methodsAndDataProviders[iSubMethod];
-                    bool subMethodSucceeded = false;
-                    IDataProvider usedProvider = null;
-
-                    foreach (IDataProvider prov in subMethodInfo.DataProviders)
-                    {
-                        try
-                        {
-                            usedProvider = prov;
-                            object subResult = subMethodInfo.MethodCallInfo.Invoke(prov);
-                            if (subMethodInfo.MethodCallInfo.IsSuccessfulOutput(subResult))
-                            {
-                                subResults[iSubMethod] = subResult;
-                                subMethodSucceeded = true;
-                                break;
-                            }
+                for (int iSubMethod = 0; iSubMethod < subMethodRunStates.Length; iSubMethod++)
+                {
+
+                    subMethodRunStates[iSubMethod].Thread = new Thread(new ParameterizedThreadStart((o) =>
+                        {
+                            // Copy the broker context to this new thread
+                            BrokerContext.Current = currentBrokerContext;
+
+                            SubMethodRunState subMethodInfo = subMethodRunStates[(int)o];
+                            // Loop over data providers until one succeeds
+                            foreach (IDataProvider prov in subMethodInfo.DataProviders)
+                            {
+                                try
+                                {
+                                    subMethodInfo.UsedDataProvider = prov;
+                                    object subResult = subMethodInfo.SubMethodInfo.Invoke(prov);
+                                    if (subMethodInfo.SubMethodInfo.IsSuccessfulOutput(subResult))
+                                    {
+                                        subMethodInfo.Result = subResult;
+                                        subMethodInfo.Succeeded = true;
+                                        break;
+                                    }
+                                }
+                                catch (Exception dataProviderException)
+                                {
+                                    Local.Admin.LogException(dataProviderException);
+                                }
+                            }
+
+                            if (subMethodInfo.Succeeded)
+                            {
+                                if (subMethodInfo.UsedDataProvider is IExternalDataProvider)
+                                {
+                                    try
+                                    {
+                                        subMethodInfo.SubMethodInfo.InvokeUpdateMethod(subMethodInfo.Result);
+                                    }
+                                    catch (Exception updateException)
+                                    {
+                                        string xml = Util.Strings.SerializeObject(subMethodInfo.Result);
+                                        Local.Admin.LogException(updateException);
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                Local.Admin.AddNewLog(TraceEventType.Information, BrokerContext.Current.WebMethodMessageName, TextMessages.AllDataProvidersFailed + subMethodInfo.SubMethodInfo, null, null);
+                            }
+
+                            // Signal the end of processing
+                            subMethodInfo.WaitHandle.Set();
                         }
-                        catch (Exception dataProviderException)
-                        {
-                            Local.Admin.LogException(dataProviderException);
-                        }
-                    }
-                    if (subMethodSucceeded)
-                    {
-                        if (usedProvider is IExternalDataProvider)
-                        {
-                            try
-                            {
-
-                                subMethodInfo.MethodCallInfo.InvokeUpdateMethod(subResults[iSubMethod]);
-                            }
-                            catch (Exception updateException)
-                            {
-                                string xml = Util.Strings.SerializeObject(subResults[iSubMethod]);
-                                Local.Admin.LogException(updateException);
-                            }
-                        }
+                    ));
+                    subMethodRunStates[iSubMethod].Thread.Start(iSubMethod);
+                }
+                #endregion
+
+                #region Threads control
+
+                // Wait for sub results to continue
+                var waitHandles = (from mi in subMethodRunStates select mi.WaitHandle).ToArray();
+                WaitHandle.WaitAll(waitHandles, Config.Properties.Settings.Default.DataProviderMillisecondsTimeout);
+                foreach (var mi in subMethodRunStates)
+                {
+                    mi.Thread.Abort();
+                }
+                #endregion
+
+                #region Final aggregation
+
+                var subResultsFinished = (from mi in subMethodRunStates where !mi.Succeeded select mi).Count() == 0;
+                if (subResultsFinished)
+                {
+                    var subResults = (from mi in subMethodRunStates select mi.Result).ToArray();
+                    var output = facade.AggregationMethod(subResults);
+                    if (facade.IsValidResult(output))
+                    {
+                        Local.Admin.AddNewLog(TraceEventType.Information, BrokerContext.Current.WebMethodMessageName, TextMessages.Succeeded, null, null);
+                        return output;
                     }
                     else
                     {
-                        Local.Admin.AddNewLog(TraceEventType.Information, BrokerContext.Current.WebMethodMessageName, TextMessages.AllDataProvidersFailed + subMethodInfo.MethodCallInfo, null, null);
-                    }
-                }
-
-                // Now that all the results have been created, Gather all in one object
-                var output = facade.AggregationMethod(subResults);
-                if (facade.IsValidResult(output))
-                {
-                    Local.Admin.AddNewLog(TraceEventType.Information, BrokerContext.Current.WebMethodMessageName, TextMessages.Succeeded, null, null);
-                    return output;
-                }
-                else
-                {
-                    string xml = Util.Strings.SerializeObject(output);
-                    Local.Admin.AddNewLog(TraceEventType.Error, BrokerContext.Current.WebMethodMessageName, TextMessages.ResultGatheringFailed, typeof(TOutput).ToString(), xml);
-                }
+                        string xml = Util.Strings.SerializeObject(output);
+                        Local.Admin.AddNewLog(TraceEventType.Error, BrokerContext.Current.WebMethodMessageName, TextMessages.ResultGatheringFailed, typeof(TOutput).ToString(), xml);
+                    }
+                }
+                #endregion

             }
             catch (Exception ex)
@@ -218,6 +252,16 @@
             return default(TOutput);
         }

+        private class SubMethodRunState
+        {
+            public SubMethodInfo SubMethodInfo;
+            public List<IDataProvider> DataProviders;
+            public object Result = null;
+            public Thread Thread;
+            public bool Succeeded = false;
+            public ManualResetEvent WaitHandle = new ManualResetEvent(false);
+            public IDataProvider UsedDataProvider;
+        }

     }


Provide the updater with the filePath of ASB

--- ARKBreedingStats/Updater.cs
+++ ARKBreedingStats/Updater.cs
@@ -150,8 +150,8 @@
             {
                 await src.CopyToAsync(dst);
             }
-
-            Process.Start(newLocation);
+            string filePath = "\"" + Process.GetCurrentProcess().MainModule.FileName + "\"";
+            Process.Start(newLocation, filePath);
         }

         /// <summary>


lots of refactoring

lots of refactoring

added constants and made projectile creation much cleaner

--- SpaceAceWPF/SpaceAceWPF/MainWindow.xaml.cs
+++ SpaceAceWPF/SpaceAceWPF/MainWindow.xaml.cs
@@ -23,6 +23,7 @@

     public partial class MainWindow : Window
     {
+        // Game classes
         private class Projectile
         {
             public System.Windows.Controls.Image image;
@@ -46,10 +47,24 @@
             public int value;
         }

-        // Constants
+        /***** Constants *****/
+        // Speeds
         private const int SHIP_SPEED = 5;
         private const int BASE_MAX_PROJECTILE_SPEED = 6;
         private const int BASE_MIN_PROJECTILE_SPEED = 4;
+        // Thresholds for creation
+        private const int ASTEROID_THRESHOLD_EASY = 975;
+        private const int ASTEROID_THRESHOLD_MEDIUM = 965;
+        private const int ASTEROID_THRESHOLD_HARD = 945;
+        private const int COIN_THRESHOLD = 980;
+        private const int HEALTH_THRESHOLD = 997;
+        // Sizes of projectiles
+        private const int MIN_ASTEROID_WIDTH = 100;
+        private const int MAX_ASTEROID_WIDTH = 250;
+        private const int HEALTH_WIDTH = 80;
+        private const int HEALTH_HEIGHT = 80;
+        private const int COIN_WIDTH = 50;
+        private const int COIN_HEIGHT = 50;

         // Margins may need to change depending on screen size and resolution
         private double Left_Margin = 0;
@@ -476,9 +491,10 @@

                     //Generate asteroids and coins
-                    generateAsteroids();
-                    generateCoins();
-                    generateHealth();
+                    // generateAsteroids();
+                    // generateCoins();
+                    // generateHealth();
+                    generateProjectiles();

                     //Update asteroid and coin positions
                     moveProjectiles(asteroids, this.Asteroid_Grid);
@@ -501,45 +517,75 @@
             }
         }

-        private const int MIN_ASTEROID_WIDTH = 100;
-        private const int MAX_ASTEROID_WIDTH = 250;
-        private const int HEALTH_WIDTH = 80;
-        private const int HEALTH_HEIGHT = 80;
-        private void generateHealth()
-        {
-            // Random rand = new Random();
-
-            if (rand.Next(0, 1000) > 997)
+        private Thickness getRandomEdge()
+        {
+            Thickness loc = new Thickness();
+            loc.Left = Right_Margin + 200;
+            loc.Top = Math.Max(Bottom_Margin - rand.Next(0, (int)Bottom_Margin), Top_Margin);
+            return loc;
+        }
+
+        private Image initializeProjectileImage(Uri spriteUri, bool rotate = false)
+        {
+            Image newImage = new Image();
+
+            newImage.VerticalAlignment = System.Windows.VerticalAlignment.Top;
+            newImage.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
+            newImage.Margin = getRandomEdge();
+
+            TransformedBitmap temp = new TransformedBitmap();
+            BitmapImage bi = new BitmapImage();
+            bi.BeginInit();
+            bi.UriSource = spriteUri;
+            bi.EndInit();
+            temp.BeginInit();
+            temp.Source = bi;
+            RotateTransform transform;
+            if (rotate)
+            {
+                transform = new RotateTransform(rand.Next(0, 3) * 90);
+            }
+            else
+            {
+                transform = new RotateTransform(0);
+            }
+            temp.Transform = transform;
+            temp.EndInit();
+            newImage.Source = temp;
+
+
+            return newImage;
+        }
+        private void generateProjectiles()
+        {
+            // Place any threshold/generation changes that need to occur
+            // based on difficulty in this section
+            int asteroid_threshold;
+            switch (diff)
+            {
+                case Difficulty.easy:
+                    asteroid_threshold = ASTEROID_THRESHOLD_EASY;
+                    break;
+                case Difficulty.med:
+                    asteroid_threshold = ASTEROID_THRESHOLD_MEDIUM;
+                    break;
+                case Difficulty.hard:
+                    asteroid_threshold = ASTEROID_THRESHOLD_HARD;
+                    break;
+                default:
+                    asteroid_threshold = ASTEROID_THRESHOLD_EASY;
+                    break;
+            }
+
+            if (rand.Next(0, 1000) > HEALTH_THRESHOLD)
             {
                 Health newHealth = new Health();
-                newHealth.image = new Image();
-
-                // Randomly place the health somewhere along the edge
-                Thickness loc = newHealth.image.Margin;
-                loc.Left = Right_Margin + 200;
-                newHealth.image.VerticalAlignment = System.Windows.VerticalAlignment.Top;
-                newHealth.image.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
-                loc.Top = Math.Max(Bottom_Margin - rand.Next(0, (int)Bottom_Margin), Top_Margin);
-                newHealth.image.Margin = loc;
+                newHealth.image = initializeProjectileImage(new Uri(@"../../Assets/health.png", UriKind.Relative));

                 //Size the image
                 newHealth.image.Width = HEALTH_HEIGHT;
                 newHealth.image.Height = HEALTH_HEIGHT;

-                // Initialize health's bitmap
-                Uri uri = new Uri(@"../../Assets/health.png", UriKind.Relative);
-                newHealth.bitmap = new TransformedBitmap();
-                BitmapImage bi = new BitmapImage();
-                bi.BeginInit();
-                bi.UriSource = uri;
-                bi.EndInit();
-                newHealth.bitmap.BeginInit();
-                newHealth.bitmap.Source = bi;
-                RotateTransform transform = new RotateTransform(0);
-                newHealth.bitmap.Transform = transform;
-                newHealth.bitmap.EndInit();
-                newHealth.image.Source = newHealth.bitmap;
-
                 // Initialize health's speed
                 newHealth.speed.X = rand.Next(BASE_MIN_PROJECTILE_SPEED, BASE_MAX_PROJECTILE_SPEED) * difficulty_multiplier;
                 newHealth.speed.Y = 0;
@@ -548,137 +594,59 @@
                 newHealth.value = 25;

                 //Add coin to grid
+                newHealth.bitmap = (TransformedBitmap)newHealth.image.Source;
                 healths.Add(newHealth);
                 this.Health_Grid.Children.Add(newHealth.image);
             }
-
-        }
-        private void generateAsteroids()
-        {
-            // Random rand = new Random();
-            // Modify the RHS below to change asteroid creation
-            // frequency
-            int threshold;
-            switch (diff)
-            {
-                case Difficulty.easy:
-                    threshold = 975;
-                    break;
-                case Difficulty.med:
-                    threshold = 965;
-                    break;
-                case Difficulty.hard:
-                    threshold = 945;
-                    break;
-                default:
-                    threshold = 975;
-                    break;
-            }
-            if (rand.Next(0, 1000) > threshold)
+
+            if (rand.Next(0, 1000) > asteroid_threshold)
             {
                 Projectile newAsteroid = new Projectile();
-                newAsteroid.image = new Image();
-                // newAsteroid.Source = this.LargeAsteroidSource.Source;
-                Thickness loc = newAsteroid.image.Margin;
-                loc.Left = Right_Margin + 200;
-                newAsteroid.image.VerticalAlignment = System.Windows.VerticalAlignment.Top;
-                newAsteroid.image.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
-
-                // Randomly place the asteroid somewhere along the edge,
-                // sizes it, sets the image, and the rotation
-                // basically makes it unique
-                loc.Top = Math.Max(Bottom_Margin - rand.Next(0, (int)Bottom_Margin), Top_Margin);
-                newAsteroid.image.Margin = loc;
-                newAsteroid.image.Width = rand.Next(MIN_ASTEROID_WIDTH, MAX_ASTEROID_WIDTH);
-
-                // Determines which sprite the new asteroid will have
+
+                // Determines which image the new asteroid will be
                 int asteroidType = rand.Next(0, 3);
-                Uri uri;
                 switch (asteroidType)
                 {
                     case 0:
-                        // newAsteroid.Source = this.LargeAsteroidSource.Source;
-                        uri = new Uri(@"../../Assets/asteroid_large.png", UriKind.Relative);
+                        newAsteroid.image = initializeProjectileImage(new Uri(@"../../Assets/asteroid_large.png", UriKind.Relative), true);
                         break;
                     case 1:
-                        // newAsteroid.Source = this.MediumAsteroidSource.Source;
-                        uri = new Uri(@"../../Assets/asteroid_small.png", UriKind.Relative);
+                        newAsteroid.image = initializeProjectileImage(new Uri(@"../../Assets/asteroid_small.png", UriKind.Relative), true);
                         break;
                     case 2:
-                        // newAsteroid.Source = this.SmallAsteroidSource.Source;
-                        uri = new Uri(@"../../Assets/asteroid_medium.png", UriKind.Relative);
+                        newAsteroid.image = initializeProjectileImage(new Uri(@"../../Assets/asteroid_medium.png", UriKind.Relative), true);
                         break;
                     default:
-                        // newAsteroid.Source = this.LargeAsteroidSource.Source;
-                        uri = new Uri(@"../../Assets/asteroid_large.png", UriKind.Relative);
+                        newAsteroid.image = initializeProjectileImage(new Uri(@"../../Assets/asteroid_large.png", UriKind.Relative), true);
                         break;

                 }

-                // Set the asteroid's rotation
-                newAsteroid.bitmap = new TransformedBitmap();
-                BitmapImage bi = new BitmapImage();
-                bi.BeginInit();
-                bi.UriSource = uri;
-                bi.EndInit();
-                newAsteroid.bitmap.BeginInit();
-                newAsteroid.bitmap.Source = bi;
-                RotateTransform transform = new RotateTransform(rand.Next(0, 3) * 90);
-                newAsteroid.bitmap.Transform = transform;
-                newAsteroid.bitmap.EndInit();
-                newAsteroid.image.Source = newAsteroid.bitmap;
-
+                newAsteroid.bitmap = (TransformedBitmap)newAsteroid.image.Source;
+                newAsteroid.image.Width = rand.Next(MIN_ASTEROID_WIDTH, MAX_ASTEROID_WIDTH);
                 this.Asteroid_Grid.Children.Add(newAsteroid.image);
                 newAsteroid.speed.X = rand.Next(BASE_MIN_PROJECTILE_SPEED, BASE_MAX_PROJECTILE_SPEED) * difficulty_multiplier;
                 newAsteroid.speed.Y = 0;
                 asteroids.Add(newAsteroid);
             }
-        }
-
-        private const int COIN_WIDTH = 50;
-        private const int COIN_HEIGHT = 50;
-        private void generateCoins()
-        {
-            // Random rand = new Random();
-            // Modify the RHS below to change coin creation
-            // frequency
-            if (rand.Next(0, 1000) > 980)
+
+            if (rand.Next(0, 1000) > COIN_THRESHOLD)
             {
                 Coin newCoin = new Coin();
-                newCoin.image = new Image();
-
-                // Randomly place the coin somewhere along the edge
-                Thickness loc = newCoin.image.Margin;
-                loc.Left = Right_Margin + 200;
-                newCoin.image.VerticalAlignment = System.Windows.VerticalAlignment.Top;
-                newCoin.image.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
-                loc.Top = Math.Max(Bottom_Margin - rand.Next(0, (int)Bottom_Margin), Top_Margin);
-                newCoin.image.Margin = loc;
+                // newCoin.image = new Image();
+                newCoin.image = initializeProjectileImage(new Uri(@"../../Assets/gold_coin.png", UriKind.Relative));

                 //Size the image
                 newCoin.image.Width = COIN_WIDTH;
                 newCoin.image.Height = COIN_HEIGHT;

-                // Initialize coin's bitmap
-                Uri uri = new Uri(@"../../Assets/gold_coin.png", UriKind.Relative);
-                newCoin.bitmap = new TransformedBitmap();
-                BitmapImage bi = new BitmapImage();
-                bi.BeginInit();
-                bi.UriSource = uri;
-                bi.EndInit();
-                newCoin.bitmap.BeginInit();
-                newCoin.bitmap.Source = bi;
-                RotateTransform transform = new RotateTransform(0);
-                newCoin.bitmap.Transform = transform;
-                newCoin.bitmap.EndInit();
-                newCoin.image.Source = newCoin.bitmap;
-
                 // Initialize coin's speed
                 newCoin.speed.X = rand.Next(BASE_MIN_PROJECTILE_SPEED, BASE_MAX_PROJECTILE_SPEED) * difficulty_multiplier;
                 newCoin.speed.Y = 0;

                 //Initialize coin's value
                 newCoin.value = 100;
+                newCoin.bitmap = (TransformedBitmap)newCoin.image.Source;

                 //Add coin to grid
                 coins.Add(newCoin);


Fix build

Fix build

--- SpriteSheetPacker/SpriteSheetPackerForm.cs
+++ SpriteSheetPacker/SpriteSheetPackerForm.cs
@@ -364,7 +364,7 @@

 			Thread buildThread = new Thread(delegate(object obj)
 			{
-				int sspackResult = sspack.Program.Launch(args.ToArray());
+				var sspackResult = sspack.Program.Launch(args.ToArray());
 				(obj as Control).Invoke(new Action<int>(BuildThreadComplete), new[] { (object)sspackResult });
 			})
 			{


Second test of VSTS connection string to local SQL Server instance

--- StankinsTests/TestSenderDBStmtSqlServer.cs
+++ StankinsTests/TestSenderDBStmtSqlServer.cs
@@ -167,7 +167,7 @@
         public async Task TestSenderDBExecuteStoredProcedureWithParamsVSTS()
         {
             #region arrange
-            connectionString = @"Server=(localdb)\MSSQLLocalDB;Trusted_Connection=True;";
+            connectionString = @"Server=(localdb)\ERROR;Trusted_Connection=True;";
             string commandText = "dbo.TestSenderDBExecuteStoredProcedureWithParams";
             string parameters = "@p1=PersonID;@p2=FirstName;@p3=LastName";


refactored and added code to remove the images

--- Code/api/Provider/Parser.cs
+++ Code/api/Provider/Parser.cs
@@ -25,13 +25,21 @@
                     PrettyPrint = true
                 }
             });
-            var content = RemoveStyles(result.ExtractedContent);
+            var content = CleanUp(result.ExtractedContent);
             return new ParserResult()
             {
                 Title = result.ExtractedTitle,
                 Content = content,
                 Url = url
             };
+        }
+
+        private string CleanUp(string content)
+        {
+            var result = string.Empty;
+            result = RemoveStyles(content);
+            result = RemoveImages(result);
+            return result;
         }

         private string RemoveStyles(string content)
@@ -43,5 +51,15 @@
             result = Regex.Replace(result, classExp, string.Empty);
             return result;
         }
+
+        private string RemoveImages(string content)
+        {
+            var result = string.Empty;
+            const string picExp = @"<picture>[\s\S]*</picture>";
+            const string imgExp = @"<img[\s\S]*?>";
+            result = Regex.Replace(content, picExp, string.Empty);
+            result = Regex.Replace(result, imgExp, string.Empty);
+            return result;
+        }
     }
 }


Add support for loading config files across all TweetD*ck variations

--- Configuration/UserConfig.cs
+++ Configuration/UserConfig.cs
@@ -106,6 +106,12 @@

         private class SerializationCompatibilityHandler : SerializationBinder{
             public override Type BindToType(string assemblyName, string typeName){
+                #if DUCK
+                assemblyName = assemblyName.Replace("TweetDick","TweetDuck");
+                #else
+                assemblyName = assemblyName.Replace("TweetDuck","TweetDick");
+                #endif
+
                 typeName = typeName.Replace("TweetDick","TweetDck");
                 return Type.GetType(string.Format("{0}, {1}",typeName,assemblyName));
             }


Fix Travis CI

Fix Travis CI

--- test/Evolve.Test.Utilities/PostgreSqlDockerContainer.cs
+++ test/Evolve.Test.Utilities/PostgreSqlDockerContainer.cs
@@ -6,7 +6,7 @@

         public string Id => _container.Id;
         public string ExposedPort => "5432";
-        public string HostPort => "5432";
+        public string HostPort => "5433";
         public string DbName => "my_database";
         public string DbPwd => "Password12!"; // AppVeyor
         public string DbUser => "postgres";


Repaired w-returned JS

Repaired w-returned JS

--- best-vethack3/Views/Home/Index.cshtml
+++ best-vethack3/Views/Home/Index.cshtml
@@ -1,26 +1,26 @@
 <!DOCTYPE html>

-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <meta name="description" content="">
-  <meta name="author" content="">
-  <title>Oxygen - One Page HTML Template | Themeum</title>
-  <link href="/Content/bootstrap.min.css" rel="stylesheet">
-  <link href="/Content/animate.min.css" rel="stylesheet">
-  <link href="/Content/font-awesome.min.css" rel="stylesheet">
-  <link href="/Content/lightbox.css" rel="stylesheet">
-  <link href="/Content/main.css" rel="stylesheet">
-  <link id="css-preset" href="/Content/presets/preset1.css" rel="stylesheet">
-  <link href="/Content/responsive.css" rel="stylesheet">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+    <title>Oxygen - One Page HTML Template | Themeum</title>
+    <link href="/Content/bootstrap.min.css" rel="stylesheet">
+    <link href="/Content/animate.min.css" rel="stylesheet">
+    <link href="/Content/font-awesome.min.css" rel="stylesheet">
+    <link href="/Content/lightbox.css" rel="stylesheet">
+    <link href="/Content/main.css" rel="stylesheet">
+    <link id="css-preset" href="/Content/presets/preset1.css" rel="stylesheet">
+    <link href="/Content/responsive.css" rel="stylesheet">

-
-
-  <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700' rel='stylesheet' type='text/css'>
-  <link rel="shortcut icon" href="images/favicon.ico">
+
+
+    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700' rel='stylesheet' type='text/css'>
+    <link rel="shortcut icon" href="images/favicon.ico">


Handle edge case if PluginsDirectory is null

Fixes #592

--- PackageExplorer/MefServices/PluginManager.cs
+++ PackageExplorer/MefServices/PluginManager.cs
@@ -111,6 +111,11 @@
                 throw new ArgumentNullException("plugin");
             }

+            if(PluginsDirectory == null)
+            {
+                return null;
+            }
+
             try
             {
                 var pluginInfo = new PluginInfo(plugin.Id, plugin.Version);
@@ -170,6 +175,11 @@
                 throw new ArgumentNullException("plugin");
             }

+            if(PluginsDirectory == null)
+            {
+                return false;
+            }
+
             var targetPath = GetTargetPath(plugin);
             if (Directory.Exists(targetPath))
             {
@@ -196,7 +206,7 @@

         private void EnsurePluginCatalog(AggregateCatalog mainCatalog)
         {
-            if (_pluginCatalog != null)
+            if (_pluginCatalog != null || PluginsDirectory == null)
             {
                 return;
             }
@@ -337,6 +347,11 @@
         {
             try
             {
+                if(PluginsDirectory == null)
+                {
+                    return;
+                }
+
                 var pluginDirectoryInfo = new DirectoryInfo(PluginsDirectory);
                 if (pluginDirectoryInfo.Exists)
                 {


change -lslow/lfast for -yslow/yfast

change -lslow/lfast for -yslow/yfast

--- src/Contest/Program.cs
+++ src/Contest/Program.cs
@@ -43,8 +43,8 @@
 				//================================================
 				// Listing results from previous runs.
 				var listFailing  = args.Any(a => a == "-lf");
-				var listSlow     = args.Any(a => a == "-lslow");
-				var listFast     = args.Any(a => a == "-lfast");
+				var listSlow     = args.Any(a => a == "-yslow");
+				var listFast     = args.Any(a => a == "-yfast");
 				//================================================

 				//clean args list (no flags).


Make LuaDirectory readonly.

Make LuaDirectory readonly.

--- AerospikeDemo/LuaExample.cs
+++ AerospikeDemo/LuaExample.cs
@@ -27,7 +27,7 @@
 {
     public class LuaExample
     {
-        private static string LuaDirectory = @"..\..\udf";
+        private static readonly string LuaDirectory;

         static LuaExample()
         {


remove hash check on monsters override

remove hash check on monsters override

--- TCC.Core/Data/Databases/MonsterDatabase.cs
+++ TCC.Core/Data/Databases/MonsterDatabase.cs
@@ -12,13 +12,7 @@

         protected override string FolderName => "monsters";
         protected override string Extension => "xml";
-        public override bool Exists
-        {
-            get
-            {
-                return base.Exists && File.Exists(OverrideFileFullPath);
-            }
-        }
+        public override bool Exists => base.Exists && File.Exists(OverrideFileFullPath);
         private string OverrideFileFullPath => FullPath.Replace(Language, "override");
         private string OverrideFileRelativePath => RelativePath.Replace(Language, "override");

@@ -36,26 +30,21 @@
         public string GetZoneName(uint zoneId)
         {
             _zones.TryGetValue(zoneId, out var z);
-            return z != null ? z.Name : "Unkown zone";
+            return z != null ? z.Name : "Unknown zone";
         }
         public string GetName(uint templateId, uint zoneId)
         {
-            if (TryGetMonster(templateId, zoneId, out var m)) return m.Name;
-            else return "Unknown";
+            return TryGetMonster(templateId, zoneId, out var m) ? m.Name : "Unknown";
         }
         public ulong GetMaxHP(uint templateId, uint zoneId)
         {
-            if (TryGetMonster(templateId, zoneId, out var m))
-            {
-                return m.MaxHP;
-            }
-            else return 1;
+            return TryGetMonster(templateId, zoneId, out var m) ? m.MaxHP : 1;
         }

         public override void CheckVersion(string customAbsPath = null, string customRelPath = null)
         {
             base.CheckVersion(customAbsPath, customRelPath);
-            base.CheckVersion(OverrideFileFullPath, OverrideFileRelativePath);
+            //base.CheckVersion(OverrideFileFullPath, OverrideFileRelativePath);
         }

         public override void Load()


Ensure exclude paths looks at directories and full names

--- Core/Packages/ZipPackage.cs
+++ Core/Packages/ZipPackage.cs
@@ -20,7 +20,7 @@
         private static readonly string[] AssemblyReferencesExtensions = new[] { ".dll", ".exe", ".winmd" };

         // paths to exclude
-        private static readonly string[] ExcludePaths = new[] { "_rels", "package", "[Content_Types]", ".signature" };
+        private static readonly string[] ExcludePaths = new[] { "_rels/", "package/", "[Content_Types].xml", ".signature.p7s" };

         // We don't store the steam itself, just a way to open the stream on demand
         // so we don't have to hold on to that resource


Added notification handler for when a user clicks a notification. Might not work

--- TaskIt-2017/TaskIt_2017.iOS/AppDelegate.cs
+++ TaskIt-2017/TaskIt_2017.iOS/AppDelegate.cs
@@ -30,7 +30,31 @@
             var settings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null);
             UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);

+            if (options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey))
+            {
+                var localNotification = options[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification;
+                if(localNotification != null)
+                {
+                    HandleAlert(localNotification);
+                }
+            }
+
             return base.FinishedLaunching(app, options);
+        }
+
+        public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
+        {
+            HandleAlert(notification);
+        }
+
+        private void HandleAlert(UILocalNotification notification)
+        {
+            UIAlertController alertController = UIAlertController.Create(notification.AlertAction, notification.AlertBody, UIAlertControllerStyle.Alert);
+            alertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
+            UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(alertController, true, null);
+
+            //Reset the badge icon
+            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
         }
     }
 }


More robustness against disposed forms being accessed.

--- Tibialyzer/Managers/NotificationManager.cs
+++ Tibialyzer/Managers/NotificationManager.cs
@@ -293,41 +293,57 @@

         public static void UpdateLootDisplay() {
             for (int i = 0; i < NotificationFormGroups.Length; i++) {
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is LootDropForm) {
-                    (NotificationFormGroups[i] as LootDropForm).UpdateLoot();
-                }
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
-                    (NotificationFormGroups[i] as SummaryForm).UpdateLoot();
+                try {
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is LootDropForm) {
+                        (NotificationFormGroups[i] as LootDropForm).UpdateLoot();
+                    }
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
+                        (NotificationFormGroups[i] as SummaryForm).UpdateLoot();
+                    }
+                } catch {
+
                 }
             }
         }

         public static void UpdateExperienceDisplay() {
             for (int i = 0; i < NotificationFormGroups.Length; i++) {
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is ExperienceChart) {
-                    (NotificationFormGroups[i] as ExperienceChart).UpdateExperience();
+                try {
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is ExperienceChart) {
+                        (NotificationFormGroups[i] as ExperienceChart).UpdateExperience();
+                    }
+                } catch {
+
                 }
             }
         }

         public static void UpdateDamageDisplay() {
             for (int i = 0; i < NotificationFormGroups.Length; i++) {
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is DamageChart) {
-                    (NotificationFormGroups[i] as DamageChart).UpdateDamage();
-                }
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
-                    (NotificationFormGroups[i] as SummaryForm).UpdateDamage();
+                try {
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is DamageChart) {
+                        (NotificationFormGroups[i] as DamageChart).UpdateDamage();
+                    }
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
+                        (NotificationFormGroups[i] as SummaryForm).UpdateDamage();
+                    }
+                } catch {
+
                 }
             }
         }

         public static void UpdateUsedItemsDisplay() {
             for (int i = 0; i < NotificationFormGroups.Length; i++) {
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
-                    (NotificationFormGroups[i] as SummaryForm).UpdateWaste();
-                }
-                if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is WasteForm) {
-                    (NotificationFormGroups[i] as WasteForm).UpdateWaste();
+                try {
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is SummaryForm) {
+                        (NotificationFormGroups[i] as SummaryForm).UpdateWaste();
+                    }
+                    if (NotificationFormGroups[i] != null && NotificationFormGroups[i] is WasteForm) {
+                        (NotificationFormGroups[i] as WasteForm).UpdateWaste();
+                    }
+                } catch {
+
                 }
             }
         }


Lockout now working

Lockout now working

--- Project.Web/Controllers/AccountController.cs
+++ Project.Web/Controllers/AccountController.cs
@@ -51,7 +51,7 @@
         {
             if (ModelState.IsValid)
             {
-                var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
+                var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: true);
                 switch (result)
                 {
                     case SignInStatus.Success:


Syntax error.

Syntax error.

--- ksp_plugin_adapter/dialog.cs
+++ ksp_plugin_adapter/dialog.cs
@@ -38,7 +38,6 @@

   public static int XCentre { get; } = UnityEngine.Screen.width / 2;
   public static int YCentre { get; } = UnityEngine.Screen.height / 3;
-  }
 }

 }  // namespace ksp_plugin_adapter


Bugfix with missile grid on startup

Bugfix with missile grid on startup

fixed error where no columns existed yet rows were attempting to be
created and added.

--- Pulsar4X/Pulsar4X.UI/Handlers/ClassDesign.cs
+++ Pulsar4X/Pulsar4X.UI/Handlers/ClassDesign.cs
@@ -4853,15 +4853,21 @@
         /// </summary>
         private void BuildMissileDataGrid()
         {
+            if (m_oOptionsPanel.MissileDataGrid.Columns.Count == 0)
+                return;
+
             m_oOptionsPanel.MissileDataGrid.Rows.Clear();

+            if (_CurrnetFaction == null)
+                return;
+
             try
             {
                 for (int loop = 0; loop < _CurrnetFaction.ComponentList.MissileDef.Count; loop++)
                 {
-
                     using (DataGridViewRow NewRow = new DataGridViewRow())
                     {
+
                         /// <summary>
                         /// setup row height. note that by default they are 22 pixels in height!
                         /// </summary>
@@ -4986,7 +4992,7 @@
             }
             catch
             {
-                logger.Error("Something went wrong Creating Rows for Class Design MissileGrid screen...");
+                logger.Error("Something went wrong Creating Rows for Class Design MissileGrid screen..");
             }
         }
         #endregion


Return WWCP*Adapter classes instead of interfaces

--- WWCP_OIOIv3.x_Adapter/CPO/CPOExtentions.cs
+++ WWCP_OIOIv3.x_Adapter/CPO/CPOExtentions.cs
@@ -86,7 +86,7 @@
         /// <param name="OIOIConfigurator">An optional delegate to configure the new OIOI roaming provider after its creation.</param>
         /// <param name="Configurator">An optional delegate to configure the new roaming provider after its creation.</param>
         /// <param name="DNSClient">An optional DNS client to use.</param>
-        public static ICSORoamingProvider
+        public static OIOIv3_x.CPO.WWCPCPOAdapter

             CreateOIOIv3_x_CPORoamingProvider(this RoamingNetwork                                                 RoamingNetwork,
                                               CSORoamingProvider_Id                                               Id,
@@ -214,7 +214,7 @@

             return RoamingNetwork.
                        CreateNewRoamingProvider(NewRoamingProvider,
-                                                Configurator);
+                                                Configurator) as OIOIv3_x.CPO.WWCPCPOAdapter;

         }

@@ -263,7 +263,7 @@
         /// <param name="OIOIConfigurator">An optional delegate to configure the new OIOI roaming provider after its creation.</param>
         /// <param name="Configurator">An optional delegate to configure the new roaming provider after its creation.</param>
         /// <param name="DNSClient">An optional DNS client to use.</param>
-        public static ICSORoamingProvider
+        public static OIOIv3_x.CPO.WWCPCPOAdapter

             CreateOIOIv3_x_CPORoamingProvider(this RoamingNetwork                                          RoamingNetwork,
                                               CSORoamingProvider_Id                                        Id,
@@ -387,7 +387,7 @@

             return RoamingNetwork.
                        CreateNewRoamingProvider(NewRoamingProvider,
-                                                Configurator);
+                                                Configurator) as OIOIv3_x.CPO.WWCPCPOAdapter;

         }


update

update

--- Demos/Texture2D/FormMain.cs
+++ Demos/Texture2D/FormMain.cs
@@ -50,7 +50,6 @@
             var up = new vec3(0, 1, 0);
             var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height);
             this.scene = new Scene(camera)
-
             {
                 RootNode = rootElement,
                 RootControl = rootControl,
@@ -77,6 +76,10 @@

             Match(this.trvSceneGUI, scene.RootControl);
             this.trvSceneGUI.ExpandAll();
+
+            var manipulater = new FirstPerspectiveManipulater();
+            manipulater.Bind(camera, this.winGLCanvas1);
+            manipulater.StepLength = 0.1f;
         }

         private WinCtrlRoot GetRootControl()
@@ -143,6 +146,8 @@
             // note: this tells us that the right way is to render the nearest transparenct object at last.
             var group = new GroupNode(rectangle);//, blend, blend2);

+            var axis = AxisNode.Create();
+            group.Children.Add(axis);
             return group;
         }


added todo

added todo

--- src/ImTools/ImTools.cs
+++ src/ImTools/ImTools.cs
@@ -2769,7 +2769,6 @@
                     entryOrNewBranch = R.AddOrGetEntry(hash, entry);
                     return R.MayTurnToBranch2 && entryOrNewBranch is Branch2Base b2
                         ? new Branch3(L, E, b2.Left, b2.MidEntry, b2.Right)
-                        //? new Branch3RightB2(L, E, b2) // todo: @wip
                         : entryOrNewBranch is Entry ? entryOrNewBranch
                         : new Branch2Right(this, entryOrNewBranch);
                 }
@@ -3537,70 +3536,6 @@
                 return hash == h0 ? B.E0 : B.E1;
             }
         }
-
-        // internal sealed class Branch3RightB2 : Branch3Base
-        // {
-        //     internal readonly Entry E0;
-        //     internal readonly ImHashMap<K, V> L;
-        //     internal readonly Branch2Base RB;
-        //     public override Entry Entry0 => E0;
-        //     public override Entry Entry1 => RB.MidEntry;
-        //     public override ImHashMap<K, V> Left => L;
-        //     public override ImHashMap<K, V> Middle => RB.Left;
-        //     public override ImHashMap<K, V> Right => RB.Right;
-        //     public Branch3RightB2(ImHashMap<K, V> l, Entry e0, Branch2Base rb)
-        //     {
-        //         L = l;
-        //         E0 = e0;
-        //         RB = rb;
-        //     }
-
-        //     internal override Entry GetEntryOrNull(int hash)
-        //     {
-        //         var b = RB;
-        //         var h1 = b.MidEntry.Hash;
-        //         if (hash > h1)
-        //             return b.Right.GetEntryOrNull(hash);
-        //         var h0 = E0.Hash;
-        //         if (hash < E0.Hash)
-        //             return L.GetEntryOrNull(hash);
-        //         return h0 == hash ? E0 : h1 == hash ? b.MidEntry : b.Left.GetEntryOrNull(hash);
-        //     }
-
-        //     internal override ImHashMap<K, V> AddOrGetEntry(int hash, Entry entry)
-        //     {
-        //         var h1 = RB.MidEntry.Hash;
-        //         if (hash > h1)
-        //         {
-        //             var rb = RB;
-        //             var right = rb.Right;
-        //             var newRight = right.AddOrGetEntry(hash, entry);
-        //             return right.MayTurnToBranch2 && newRight is Branch2Base
-        //                 ? new Branch2(new Branch2(L, E0, rb.Left), rb.MidEntry, newRight)
-        //                 : newRight is Entry ? newRight
-        //                 : new Branch3(L, E0, rb.Left, rb.MidEntry, newRight);
-        //         }
-        //         var h0 = E0.Hash;
-        //         if (hash < h0)
-        //         {
-        //             var newLeft = L.AddOrGetEntry(hash, entry);
-        //             return L.MayTurnToBranch2 && newLeft is Branch2Base
-        //                 ? new Branch2(newLeft, E0, RB) // he-he, here is the win of reusing the RB without splitting it
-        //                 : newLeft is Entry ? newLeft
-        //                 : new Branch3RightB2(newLeft, E0, RB); // here here something too
-        //         }
-        //         if (hash > h0 && hash < h1)
-        //         {
-        //             var middle = RB.Left;
-        //             var newMiddle = middle.AddOrGetEntry(hash, entry);
-        //             return middle.MayTurnToBranch2 && newMiddle is Branch2Base b2
-        //                 ? new Branch2(new Branch2(L, E0, b2.Left), b2.MidEntry, new Branch2(b2.Right, RB.MidEntry, RB.Right)) // todo: @perf @mem opportunity to use Branch2blah here
-        //                 : newMiddle is Entry ? newMiddle
-        //                 : new Branch3(L, E0, newMiddle, RB.MidEntry, RB.Right);
-        //         }
-        //         return hash == h0 ? Entry0 : RB.MidEntry;
-        //     }
-        // }
     }

     /// Helper stack wrapper for the array
@@ -5382,6 +5317,21 @@
         }

         // todo: @wip for the ImHashMap<int, V>
+        /// Do something for each entry.
+        /// The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
+        /// So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent calls
+        public static S ForEach<V, S>(this ImHashMap<int, V>[] parts, S state, Action<ImHashMapEntry<int, V>, int, S> handler, MapParentStack parents = null)
+        {
+            if (parents == null)
+                parents = new MapParentStack();
+            foreach (var map in parts)
+            {
+                if (map == ImHashMap<int, V>.Empty)
+                    continue;
+                state = map.ForEach(state, handler, parents);
+            }
+            return state;
+        }

         /// Do something for each entry.
         /// The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.


Now checks for the staff role ID set in settings instead of hardcoded name

--- DiscordBot/Preconditions.cs
+++ DiscordBot/Preconditions.cs
@@ -4,6 +4,7 @@

 using Discord.Commands;
 using Discord.WebSocket;
+using Microsoft.Extensions.DependencyInjection;

 namespace DiscordBot
 {
@@ -28,8 +29,9 @@
         public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
         {
             SocketGuildUser user = context.Message.Author as SocketGuildUser;
+            Settings.Deserialized.Settings settings = services.GetRequiredService<Settings.Deserialized.Settings>();

-            if (user.Roles.Any(x => x.Name == "Staff"))
+            if (user.Roles.Any(x => x.Id == settings.StaffRoleId))
             {
                 return Task.FromResult(PreconditionResult.FromSuccess());
             }


PropertyGrid Bugfixes #FIX: Fixed a bug where deleting or creating a value with a different reflected type than container type wouldn't fire an OnValueChanged event due to the PropertyEditor being replaced.

--- WinForms/PropertyEditing/PropertyEditor.cs
+++ WinForms/PropertyEditing/PropertyEditor.cs
@@ -462,11 +462,15 @@

 			this.setter(objEnum);

+			this.OnValueChanged();
+			this.parentGrid.PostSetValue();
+
+			// If setting the value changed the reflected type of a member value,
+			// this property editor might no longer be appropriate. Let the parent
+			// editor check to be sure. Might remove and dispose this editor, so
+			// it should happen after the set operation is considered "done".
 			if (this.parentEditor != null)
 				this.parentEditor.VerifyReflectedTypeEditors(this.parentEditor.GetValue());
-
-			this.OnValueChanged();
-			this.parentGrid.PostSetValue();
 		}
 		/// <summary>
 		/// Performs a set operation using the PropertyEditors <see cref="Setter"/>.


Throw InvalidOperationException inside viewmodel setters

--- R7.News/ViewModels/NewsEntryViewModelBase.cs
+++ R7.News/ViewModels/NewsEntryViewModelBase.cs
@@ -49,97 +49,97 @@
         public int EntryId
         {
             get { return NewsEntry.EntryId; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public int PortalId
         {
             get { return NewsEntry.PortalId; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public int ContentItemId
         {
             get { return NewsEntry.ContentItemId; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public int? AgentModuleId
         {
             get { return NewsEntry.AgentModuleId; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public string Url
         {
             get { return NewsEntry.Url; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public DateTime? StartDate
         {
             get { return NewsEntry.StartDate; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public DateTime? EndDate
         {
             get { return NewsEntry.EndDate; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public DateTime? ThresholdDate
         {
             get { return NewsEntry.ThresholdDate; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public DateTime? DueDate
         {
             get { return NewsEntry.DueDate; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public string Title
         {
             get { return NewsEntry.Title; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public string Description
         {
             get { return NewsEntry.Description; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public int ThematicWeight
         {
             get { return NewsEntry.ThematicWeight; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public int StructuralWeight
         {
             get { return NewsEntry.StructuralWeight; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public ContentItem ContentItem
         {
             get { return NewsEntry.ContentItem; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public ModuleInfo AgentModule
         {
             get { return NewsEntry.AgentModule; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         public ICollection<INewsEntry> Group
         {
             get { return NewsEntry.Group; }
-            set { throw new NotImplementedException (); }
+            set { throw new InvalidOperationException (); }
         }

         #endregion


DialogTransferInvoiceData inprocess transfer invoice grouping.

--- XPump/SubForm/DialogTransferInvoiceData.cs
+++ XPump/SubForm/DialogTransferInvoiceData.cs
@@ -84,10 +84,10 @@

         private void btnOK_Click(object sender, EventArgs e)
         {
-            Console.WriteLine(" ==> doc.prefix : " + this.selected_doctype.prefix);
-            Console.WriteLine(" ==> selected_date_from : " + this.selected_date_from.Value);
-            Console.WriteLine(" ==> selected_date_to : " + this.selected_date_to.Value);
-            Console.WriteLine(" ==> group_bill : " + this.group_bill);
+            //Console.WriteLine(" ==> doc.prefix : " + this.selected_doctype.prefix);
+            //Console.WriteLine(" ==> selected_date_from : " + this.selected_date_from.Value);
+            //Console.WriteLine(" ==> selected_date_to : " + this.selected_date_to.Value);
+            //Console.WriteLine(" ==> group_bill : " + this.group_bill);

             using (xpumpEntities db = DBX.DataSet(this.main_form.working_express_db))
             {
@@ -113,99 +113,176 @@
                     wr.WriteLine("================================");
                 }

-
-                if (!this.group_bill)
+                using (BackgroundWorker wrk = new BackgroundWorker())
                 {
-                    BackgroundWorker wrk = new BackgroundWorker();
                     wrk.WorkerSupportsCancellation = true;
                     wrk.WorkerReportsProgress = true;

-                    this.progressBar1.Maximum = this.artrn.Count;
-                    this.progressBar1.Value = 0;
-
-                    int completed_row = 0;
-                    wrk.DoWork += delegate (object obj, DoWorkEventArgs ev)
+                    if (!this.group_bill)
                     {
-                        this.artrn.ForEach(a =>
-                        {
-                            var insert_result = this.InsertInvoice(this.main_form.working_express_db, a);
-                            if (insert_result.success)
-                            {
-                                using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
-                                {
-                                    sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tcompleted.");
+                        this.progressBar1.Maximum = this.artrn.Count;
+                        this.progressBar1.Value = 0;
+
+                        int completed_row = 0;
+                        wrk.DoWork += delegate (object obj, DoWorkEventArgs ev)
+                        {
+                            this.artrn.ForEach(a =>
+                            {
+                                var insert_result = this.InsertInvoice(this.main_form.working_express_db, a);
+                                if (insert_result.success)
+                                {
+                                    using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
+                                    {
+                                        sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tAdd document completed");
+                                    }
                                 }
-                            }
-                            else
-                            {
-                                using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
-                                {
-                                    sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tError: " + insert_result.err_message);
+                                else
+                                {
+                                    using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
+                                    {
+                                        sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tError: " + insert_result.err_message);
+                                    }
                                 }
-                            }
-
-                            wrk.ReportProgress(++completed_row);
-                        });
-
-                        if(!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.ARTRN))
-                        {
-                            XMessageBox.Show("แฟ้ม ARTRN ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม ARTRN ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
-                        }
-                        if(!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.STCRD))
-                        {
-                            XMessageBox.Show("แฟ้ม STCRD ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม STCRD ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
-                        }
-                        if(!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.ARRCPCQ))
-                        {
-                            XMessageBox.Show("แฟ้ม ARRCPCQ ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม ARRCPCQ ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
-                        }
-                    };
-
-                    wrk.RunWorkerCompleted += delegate (object obj, RunWorkerCompletedEventArgs ev)
+
+                                wrk.ReportProgress(++completed_row);
+                            });
+
+                            if (!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.ARTRN))
+                            {
+                                XMessageBox.Show("แฟ้ม ARTRN ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม ARTRN ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
+                            }
+                            if (!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.STCRD))
+                            {
+                                XMessageBox.Show("แฟ้ม STCRD ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม STCRD ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
+                            }
+                            if (!Helper.Reindex(this.main_form.working_express_db, Helper.DBF_FILENAME_FLAG.ARRCPCQ))
+                            {
+                                XMessageBox.Show("แฟ้ม ARRCPCQ ถูกเปิดใช้อยู่ กรุณาสั่งจัดเรียงข้อมูลแฟ้ม ARRCPCQ ในโปรแกรมเอ็กซ์เพรสอีกครั้ง");
+                            }
+                        };
+
+                        wrk.ProgressChanged += delegate (object obj, ProgressChangedEventArgs ev)
+                        {
+                            this.progressBar1.Value = ev.ProgressPercentage;
+                            var perc = (decimal)(Convert.ToDecimal(ev.ProgressPercentage) / Convert.ToDecimal(this.progressBar1.Maximum)) * 100;
+                            this.lblProgressPercent.Text = perc.ToString("N0") + "%";
+                        };
+
+                        wrk.RunWorkerCompleted += delegate (object obj, RunWorkerCompletedEventArgs ev)
+                        {
+                            MessageBox.Show("completed");
+                        };
+
+                        wrk.RunWorkerAsync();
+                    }
+                    else
                     {
-                        MessageBox.Show("completed");
-                    };
-
-                    wrk.ProgressChanged += delegate (object obj, ProgressChangedEventArgs ev)
-                    {
-                        this.progressBar1.Value = ev.ProgressPercentage;
-                        var perc = (decimal)(Convert.ToDecimal(ev.ProgressPercentage) / Convert.ToDecimal(this.progressBar1.Maximum)) * 100;
-                        this.lblProgressPercent.Text = perc.ToString("N0") + "%";
-                    };
-                    wrk.RunWorkerAsync();
-
-                    //this.artrn.ForEach(a =>
-                    //{
-                    //    DbfInsertResult result = this.InsertInvoice(conn, a);
-                    //    if (!result.success)
-                    //    {
-
-                    //    }
-                    //});
+                        this.progressBar1.Maximum = 1;
+                        this.progressBar1.Value = 0;
+
+                        wrk.DoWork += delegate(object obj, DoWorkEventArgs ev)
+                        {
+                            artrn.GroupBy(a1 => a1.docdat).ToList().ForEach(g1 =>
+                            {
+                                Console.WriteLine("=> Docdat " + g1.First().docdat);
+                                g1.ToList().GroupBy(a2 => a2.cuscod).ToList().ForEach(g2 =>
+                                {
+                                    Console.WriteLine("  => Cuscod " + g2.First().cuscod);
+
+                                    // Add only one row in artrn
+                                    var insert_result = this.InsertInvoiceGroup(this.main_form.working_express_db, g2);
+                                    if (insert_result.success)
+                                    {
+                                        g2.ToList().ForEach(a =>
+                                        {
+                                            using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
+                                            {
+                                                sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tAdd document completed as a part of " + insert_result.inserted_docnum);
+                                            }
+                                        });
+                                    }
+                                    else
+                                    {
+                                        g2.ToList().ForEach(a =>
+                                        {
+                                            using (StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + @"\Transfer_log\" + log_file_name))
+                                            {
+                                                sw.WriteLine(a.docnum + "\t" + a.docdat.ToString("dd/MM/yyyy", CultureInfo.GetCultureInfo("TH-th")) + "\tError: " + insert_result.err_message);
+                                            }
+                                        });
+                                    }
+
+                                    //g2.ToList().ForEach(a =>
+                                    //{
+                                    //    //Console.WriteLine("     ==> cuscod : " + a.cuscod + " , docdat : " + a.docdat.ToString());
+                                    //    a.docnum = docnum;
+                                    //    int seq = 0;
+                                    //    a.stcrd.ToList().ForEach(s =>
+                                    //    {
+                                    //        s.docnum = docnum;
+                                    //        s.seqnum = (++seq).FillSpaceBeforeNum(3);
+                                    //    });
+
+                                    //    // Add stcrd
+                                    //});
+                                });
+                            });
+
+                        };
+
+                        wrk.ProgressChanged += delegate(object obj, ProgressChangedEventArgs ev)
+                        {
+                            this.progressBar1.Value = ev.ProgressPercentage;
+                            var perc = (decimal)(Convert.ToDecimal(ev.ProgressPercentage) / Convert.ToDecimal(this.progressBar1.Maximum)) * 100;
+                            this.lblProgressPercent.Text = perc.ToString("N0") + "%";
+                        };
+
+                        wrk.RunWorkerCompleted += delegate(object obj, RunWorkerCompletedEventArgs ev)
+                        {
+                            MessageBox.Show("completed");
+                        };
+
+                        wrk.RunWorkerAsync();
+                    }
                 }
-                else
-                {
-
-                }
-
             }
         }

         private DbfInsertResult InsertInvoice(SccompDbf working_express_db, artrn artrn)
         {
-            DbfInsertResult result = new DbfInsertResult { success = false, err_message = string.Empty };
+            DbfInsertResult result = new DbfInsertResult { success = false, err_message = string.Empty, inserted_docnum = string.Empty };
             try
             {
                 using (OleDbConnection conn = new OleDbConnection(@"Provider=VFPOLEDB.1;Data Source=" + working_express_db.abs_path))
                 {
                     using (OleDbCommand cmd = conn.CreateCommand())
                     {
+                        /* Check docnum is exist */
+                        cmd.CommandText = "Select count(docnum) as cnt From artrn Where docnum = ?";
+                        cmd.Parameters.Clear();
+                        cmd.Parameters.AddWithValue("@docnum", artrn.docnum);
+                        conn.Open();
+                        using (OleDbDataAdapter da = new OleDbDataAdapter(cmd))
+                        {
+                            conn.Close();
+                            DataTable dt = new DataTable();
+                            da.Fill(dt);
+                            int existing_row = Convert.ToInt32(dt.Rows[0]["cnt"]);
+                            if(existing_row > 0)
+                            {
+                                result.err_message = "Document number " + artrn.docnum + " is already exist.";
+                                Console.WriteLine(" => Error : " + result.err_message);
+                                return result;
+                            }
+                        }
+
                         /* Artrn */
                         cmd.CommandText = "Insert into artrn (";
                         cmd.CommandText += string.Join(",", artrn.GetType().GetProperties().ToList().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").Select(p => p.Name));
                         cmd.CommandText += ") Values(";
                         cmd.CommandText += string.Join(",", artrn.GetType().GetProperties().ToList().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").Select(p => p.PropertyType == typeof(DateTime?) && p.GetValue(artrn, null) == null ? "{}" : "?"));
                         cmd.CommandText += ")";
+                        cmd.Parameters.Clear();

                         artrn.GetType().GetProperties().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").ToList().ForEach(p =>
                         {
@@ -279,6 +356,137 @@
             return result;
         }

+        private DbfInsertResult InsertInvoiceGroup(SccompDbf working_express_db, IEnumerable<artrn> artrns /* artrn grouping by date and cuscod */)
+        {
+            DbfInsertResult result = new DbfInsertResult { success = false, err_message = string.Empty, inserted_docnum = string.Empty };
+
+            try
+            {
+                using (OleDbConnection conn = new OleDbConnection(@"Provider=VFPOLEDB.1;Data Source=" + this.main_form.working_express_db.abs_path))
+                {
+                    using (OleDbCommand cmd = conn.CreateCommand())
+                    {
+                        string last_docnum = string.Empty;
+                        string prefix = artrns.First().docnum.Substring(0, 2);
+
+                        cmd.CommandText = "Select docnum From artrn Where SUBSTR(docnum,1,2) = ?  Order By docnum DESC TOP 1";
+                        cmd.Parameters.AddWithValue("@prefix", prefix);
+
+                        conn.Open();
+                        using (OleDbDataAdapter da = new OleDbDataAdapter(cmd))
+                        {
+                            DataTable dt = new DataTable();
+                            da.Fill(dt);
+                            last_docnum = dt.Rows.Count > 0 ? dt.Rows[0].Field<string>("docnum") : last_docnum;
+                        }
+                        conn.Close();
+
+                        var docnum = prefix + Helper.CalNextDocnum(last_docnum);
+                        result.inserted_docnum = docnum;
+
+                        /* Artrn */
+                        var dummy_artrn = artrns.First();
+                        dummy_artrn.amount = artrns.Sum(a => a.amount);
+                        dummy_artrn.total = artrns.Sum(a => a.total);
+                        dummy_artrn.netamt = artrns.Sum(a => a.netamt);
+                        dummy_artrn.netval = artrns.Sum(a => a.netval);
+                        dummy_artrn.vatamt = artrns.Sum(a => a.vatamt);
+                        dummy_artrn.cshrcv = artrns.Sum(a => a.cshrcv);
+                        dummy_artrn.chqrcv = artrns.Sum(a => a.chqrcv);
+
+                        cmd.CommandText = "Insert into artrn (";
+                        cmd.CommandText += string.Join(",", dummy_artrn.GetType().GetProperties().ToList().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").Select(p => p.Name));
+                        cmd.CommandText += ") Values(";
+                        cmd.CommandText += string.Join(",", dummy_artrn.GetType().GetProperties().ToList().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").Select(p => p.PropertyType == typeof(DateTime?) && p.GetValue(dummy_artrn, null) == null ? "{}" : "?"));
+                        cmd.CommandText += ")";
+                        cmd.Parameters.Clear();
+
+                        dummy_artrn.GetType().GetProperties().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "arrcpcq" && p.Name.ToLower() != "stcrd").ToList().ForEach(p =>
+                        {
+                            if (!(p.PropertyType == typeof(System.DateTime?) && p.GetValue(dummy_artrn, null) == null))
+                            {
+                                if (p.Name.ToLower() == "docnum")
+                                {
+                                    cmd.Parameters.AddWithValue("@" + p.Name, docnum);
+                                }
+                                else
+                                {
+                                    cmd.Parameters.AddWithValue("@" + p.Name, p.GetValue(dummy_artrn, null));
+                                }
+                            }
+                        });
+
+                        conn.Open();
+                        cmd.ExecuteNonQuery();
+                        conn.Close();
+
+                        artrns.ToList().ForEach(a =>
+                        {
+                            /* Stcrd */
+                            int seq = 0;
+                            a.stcrd.OrderBy(st => st.id).ToList().ForEach(st =>
+                            {
+                                st.seqnum = (++seq).FillSpaceBeforeNum(3);
+
+                                cmd.CommandText = "Insert into stcrd (";
+                                cmd.CommandText += string.Join(", ", st.GetType().GetProperties().Where(s => s.Name.ToLower() != "id" && s.Name.ToLower() != "artrn" && s.Name.ToLower() != "artrn_id").ToList().Select(s => s.Name));
+                                cmd.CommandText += ") Values(";
+                                cmd.CommandText += string.Join(", ", st.GetType().GetProperties().Where(s => s.Name.ToLower() != "id" && s.Name.ToLower() != "artrn" && s.Name.ToLower() != "artrn_id").ToList().Select(s => s.PropertyType == typeof(DateTime?) && s.GetValue(st, null) == null ? "{}" : "?"));
+                                cmd.CommandText += ")";
+
+                                cmd.Parameters.Clear();
+                                st.GetType().GetProperties().Where(s => s.Name.ToLower() != "id" && s.Name.ToLower() != "artrn" && s.Name.ToLower() != "artrn_id").ToList().ForEach(s =>
+                                {
+                                    if (!(s.PropertyType == typeof(System.DateTime?) && s.GetValue(st, null) == null))
+                                    {
+                                        if(s.Name.ToLower() == "docnum")
+                                        {
+                                            cmd.Parameters.AddWithValue("@" + s.Name, docnum);
+                                        }
+                                        else
+                                        {
+                                            cmd.Parameters.AddWithValue("@" + s.Name, s.GetValue(st, null));
+                                        }
+                                    }
+                                });
+
+                                conn.Open();
+                                cmd.ExecuteNonQuery();
+                                conn.Close();
+                            });
+                        });
+
+                        /* Arrcpcq */
+                        artrns.ToList().ForEach(a =>
+                        {
+                            a.arrcpcq.OrderBy(q => q.id).ToList().ForEach(q =>
+                            {
+                                cmd.CommandText = "Insert into arrcpcq (rcpnum, chqnum, rcvamt, userid, chgdat) Values(?, ?, ?, ?, ?)";
+                                cmd.Parameters.Clear();
+                                cmd.Parameters.AddWithValue("@rcpnum", docnum);
+                                cmd.Parameters.AddWithValue("@chqnum", q.chqnum);
+                                cmd.Parameters.AddWithValue("@rcvamt", q.rcvamt);
+                                cmd.Parameters.AddWithValue("@userid", q.userid);
+                                cmd.Parameters.AddWithValue("@chgdat", q.chgdat);
+
+                                conn.Open();
+                                cmd.ExecuteNonQuery();
+                                conn.Close();
+                            });
+                        });
+
+                        result.success = true;
+                        return result;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                result.err_message = ex.Message;
+                return result;
+            }
+        }
+
         protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
         {
             if(keyData == Keys.F9)
@@ -302,5 +510,6 @@
     {
         public bool success { get; set; }
         public string err_message { get; set; }
+        public string inserted_docnum { get; set; }
     }
 }


Fix for issue #5

Fix for issue #5

--- R7.University.Launchpad/EditEmployee.ascx.cs
+++ R7.University.Launchpad/EditEmployee.ascx.cs
@@ -131,11 +131,17 @@
 							checkIsPublished.Checked = item.IsPublished;
 							// checkIsDeleted.Checked = item.IsDeleted;

+
 							// set photo
 							if (!Utils.IsNull (item.PhotoFileID))
-								pickerPhoto.FilePath = FileManager.Instance.GetUrl (
-									FileManager.Instance.GetFile (item.PhotoFileID.Value))
+							{
+								var photo = FileManager.Instance.GetFile (item.PhotoFileID.Value);
+								if (photo != null)
+								{
+									pickerPhoto.FilePath = FileManager.Instance.GetUrl (photo)
 										.Remove (0, PortalSettings.HomeDirectory.Length);
+								}
+							}

 							//	Utils.Message(this, MessageSeverity.Info, item.PhotoURL.Replace("File=",""));


[GTK] Properly render stock and custom icons in ImageView

--- Xwt.Gtk/Xwt.GtkBackend/ImageViewBackend.cs
+++ Xwt.Gtk/Xwt.GtkBackend/ImageViewBackend.cs
@@ -25,6 +25,7 @@
 // THE SOFTWARE.
 using System;
 using Xwt.Backends;
+using Xwt.Drawing;

 namespace Xwt.GtkBackend
 {
@@ -41,14 +42,16 @@
 			set { base.Widget = value; }
 		}

-		public void SetImage (object nativeImage)
+		public void SetImage (Image image)
 		{
-			if (nativeImage == null)
+			if (image == null)
 				throw new ArgumentNullException ("nativeImage");

-			Gdk.Pixbuf pbuf = nativeImage as Gdk.Pixbuf;
+			Gdk.Pixbuf pbuf = Toolkit.GetBackend (image) as Gdk.Pixbuf;
 			if (pbuf == null)
-				throw new ArgumentException ("nativeImage is not of the expected type", "nativeImage");
+				pbuf = Toolkit.GetBackend (image.ToBitmap ()) as Gdk.Pixbuf;
+			if (pbuf == null)
+				throw new ArgumentException ("image is not of the expected type", "image");

 			Widget.Pixbuf = pbuf;
 		}


Moved the buttons around to prevent overlap and text wrapping

--- RelicModManager/ModSelectionList.Designer.cs
+++ RelicModManager/ModSelectionList.Designer.cs
@@ -105,9 +105,9 @@
             //
             // continueButton
             //
-            this.continueButton.Location = new System.Drawing.Point(907, 420);
+            this.continueButton.Location = new System.Drawing.Point(900, 420);
             this.continueButton.Name = "continueButton";
-            this.continueButton.Size = new System.Drawing.Size(73, 41);
+            this.continueButton.Size = new System.Drawing.Size(80, 41);
             this.continueButton.TabIndex = 5;
             this.continueButton.Text = "Continue";
             this.continueButton.UseVisualStyleBackColor = true;
@@ -115,9 +115,9 @@
             //
             // cancelButton
             //
-            this.cancelButton.Location = new System.Drawing.Point(831, 420);
+            this.cancelButton.Location = new System.Drawing.Point(812, 420);
             this.cancelButton.Name = "cancelButton";
-            this.cancelButton.Size = new System.Drawing.Size(70, 41);
+            this.cancelButton.Size = new System.Drawing.Size(82, 41);
             this.cancelButton.TabIndex = 6;
             this.cancelButton.Text = "Cancel";
             this.cancelButton.UseVisualStyleBackColor = true;
@@ -143,7 +143,7 @@
             //
             // loadConfigButton
             //
-            this.loadConfigButton.Location = new System.Drawing.Point(577, 420);
+            this.loadConfigButton.Location = new System.Drawing.Point(561, 420);
             this.loadConfigButton.Name = "loadConfigButton";
             this.loadConfigButton.Size = new System.Drawing.Size(113, 41);
             this.loadConfigButton.TabIndex = 9;
@@ -153,7 +153,7 @@
             //
             // saveConfigButton
             //
-            this.saveConfigButton.Location = new System.Drawing.Point(696, 420);
+            this.saveConfigButton.Location = new System.Drawing.Point(677, 420);
             this.saveConfigButton.Name = "saveConfigButton";
             this.saveConfigButton.Size = new System.Drawing.Size(129, 41);
             this.saveConfigButton.TabIndex = 10;
@@ -172,7 +172,7 @@
             //
             // clearSelectionsButton
             //
-            this.clearSelectionsButton.Location = new System.Drawing.Point(467, 420);
+            this.clearSelectionsButton.Location = new System.Drawing.Point(451, 420);
             this.clearSelectionsButton.Name = "clearSelectionsButton";
             this.clearSelectionsButton.Size = new System.Drawing.Size(104, 41);
             this.clearSelectionsButton.TabIndex = 13;
@@ -214,7 +214,7 @@
             //
             this.expandAllButton.Location = new System.Drawing.Point(831, 12);
             this.expandAllButton.Name = "expandAllButton";
-            this.expandAllButton.Size = new System.Drawing.Size(149, 40);
+            this.expandAllButton.Size = new System.Drawing.Size(149, 34);
             this.expandAllButton.TabIndex = 16;
             this.expandAllButton.Text = "Expand Current Tab";
             this.expandAllButton.UseVisualStyleBackColor = true;
@@ -224,7 +224,7 @@
             //
             this.colapseAllButton.Location = new System.Drawing.Point(676, 12);
             this.colapseAllButton.Name = "colapseAllButton";
-            this.colapseAllButton.Size = new System.Drawing.Size(149, 40);
+            this.colapseAllButton.Size = new System.Drawing.Size(149, 34);
             this.colapseAllButton.TabIndex = 17;
             this.colapseAllButton.Text = "Collapse Current Tab";
             this.colapseAllButton.UseVisualStyleBackColor = true;


Closes dapplo/Dapplo.Log#1

Closes dapplo/Dapplo.Log#1

--- Dapplo.Log/LogSource.cs
+++ Dapplo.Log/LogSource.cs
@@ -82,7 +82,10 @@
 #else
 			var directorySeparatorChar = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? '\\' : '/';
 #endif
-			var pathParts = sourceFilePath.Split(directorySeparatorChar);
+
+            sourceFilePath = sourceFilePath.Replace('\\', directorySeparatorChar).Replace('/', directorySeparatorChar);
+
+            var pathParts = sourceFilePath.Split(directorySeparatorChar);

 			var typeName = Path.GetFileNameWithoutExtension(pathParts.Last());
 			var leftovers = sourceFilePath.Substring(0, sourceFilePath.LastIndexOf(typeName, StringComparison.Ordinal)-1);


distance on earth

distance on earth

--- bstrkr.mobile/bstrkr.core/Spatial/GeoPoint.cs
+++ bstrkr.mobile/bstrkr.core/Spatial/GeoPoint.cs
@@ -4,6 +4,8 @@
 {
 	public struct GeoPoint
 	{
+		private const double R = 6371.0d;
+
 		private static GeoPoint EmptyLocation = new GeoPoint(0, 0);

 		public GeoPoint(double latitude, double longitude)
@@ -19,6 +21,25 @@
 		public static GeoPoint Empty
 		{
 			get { return EmptyLocation; }
+		}
+
+		public static double ToRadians(double degrees)
+		{
+			return (degrees * Math.PI) / 180;
+		}
+
+		public double Distance(GeoPoint point)
+		{
+			var lat1 = ToRadians(this.Latitude);
+			var lat2 = ToRadians(point.Latitude);
+			var latDelta = ToRadians(point.Latitude - this.Latitude);
+			var lonDelta = ToRadians(point.Longitude - this.Longitude);
+
+			var a = Math.Sin(latDelta / 2.0) * Math.Sin(latDelta / 2.0) +
+			        Math.Cos(lat1) * Math.Cos(lat2) * Math.Sin(lonDelta / 2.0) * Math.Sin(lonDelta / 2.0);
+			var c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
+
+			return R * c;
 		}

 		public override string ToString()
@@ -42,5 +63,6 @@
 			return this.Latitude.Equals(geoPoint.Latitude) &&
 				   this.Longitude.Equals(geoPoint.Longitude);
 		}
+
 	}
 }


Wrap type in quotes in error message.

Wrap type in quotes in error message.

--- Dasher/DasherContext.cs
+++ Dasher/DasherContext.cs
@@ -83,7 +83,7 @@
                 // to allow control over the order of registered type providers.
                 if (found != null)
                 {
-                    errors.Add($"Multiple type providers exist for type {type}.");
+                    errors.Add($"Multiple type providers exist for type \"{type}\".");
                     provider = null;
                     return false;
                 }


added Stack<T>.ctor(int capacity)

added Stack<T>.ctor(int capacity)

--- Runtime/CoreLib/Collections/Generic/Stack.cs
+++ Runtime/CoreLib/Collections/Generic/Stack.cs
@@ -16,7 +16,17 @@
 	[IncludeGenericArguments(false)]
 	public sealed class Stack<T> {

-		[IntrinsicProperty]
+        [InlineCode("[]")]
+        public Stack()
+        {
+        }
+
+        [InlineCode("[]")]
+        public Stack(int capacity)
+        {
+        }
+
+        [IntrinsicProperty]
 		[ScriptName("length")]
 		public int Count {
 			get {