changed structure of ApplyButton_Click() logic to make more sense when handling user confirmation. Put all "Database" methods together and changed them all into Object methods, that then typecast into package and category methods

--- RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
@@ -612,70 +612,77 @@
         private void ApplyButton_Click(object sender, RoutedEventArgs e)
         {
             //check if we should ask a confirm first
-            if ((EditorSettings.ShowConfirmationOnPackageApply && MessageBox.Show("Confirm to apply changes?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes) || !EditorSettings.ShowConfirmationOnPackageApply)
-            {
-                //first make sure databaseTreeView selected item is treeviewitem
-                if (DatabaseTreeView.SelectedItem is TreeViewItem selectedTreeViewItem)
-                {
-                    if (selectedTreeViewItem.Header is EditorComboBoxItem editorSelectedItem)
-                    {
-                        SaveApplyDatabaseObject(editorSelectedItem.Package, null);
-                        selectedTreeViewItem.Header = null;
-                        selectedTreeViewItem.Header = new EditorComboBoxItem(editorSelectedItem.Package, editorSelectedItem.Package.PackageName);
-                    }
-                    else if(selectedTreeViewItem.Header is Category cat)
-                    {
-                        SaveApplyDatabaseObject(null, cat);
-                        //detach and retach the header to update the UI
-                        selectedTreeViewItem.Header = null;
-                        selectedTreeViewItem.Header = cat;
-                    }
+            if(EditorSettings.ShowConfirmationOnPackageApply)
+            {
+                if(MessageBox.Show("Confirm to apply changes?", "", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
+                    return;
+            }
+            //first make sure databaseTreeView selected item is treeviewitem
+            if (DatabaseTreeView.SelectedItem is TreeViewItem selectedTreeViewItem)
+            {
+                if (selectedTreeViewItem.Header is EditorComboBoxItem editorSelectedItem)
+                {
+                    ApplyDatabaseObject(editorSelectedItem.Package);
+                    selectedTreeViewItem.Header = null;
+                    selectedTreeViewItem.Header = new EditorComboBoxItem(editorSelectedItem.Package, editorSelectedItem.Package.PackageName);
+                }
+                else if (selectedTreeViewItem.Header is Category cat)
+                {
+                    ApplyDatabaseObject(cat);
+                    //detach and retach the header to update the UI
+                    selectedTreeViewItem.Header = null;
+                    selectedTreeViewItem.Header = cat;
                 }
             }
         }

         private void DatabaseTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
         {
-            //check to make sure it's a package item or category item
-            if (DatabaseTreeView.SelectedItem is TreeViewItem selectedTreeViewItem && selectedTreeViewItem.Header is EditorComboBoxItem editorSelectedItem)
+            //check to make sure it's a TreeViewItem (should always be)
+            if (DatabaseTreeView.SelectedItem is TreeViewItem selectedTreeViewItem)
             {
                 //if the mouse is not over, then it was not user initiated
                 if (!(selectedTreeViewItem.IsMouseOver || Keyboard.IsKeyDown(Key.Enter)))
                     return;
-                SelectDatabaseTreeViewItem(editorSelectedItem.Package, null);
-            }
-            else if (DatabaseTreeView.SelectedItem is TreeViewItem selectedCatTVI && selectedCatTVI.Header is Category category)
-            {
-                if (!(selectedCatTVI.IsMouseOver || Keyboard.IsKeyDown(Key.Enter)))
-                    return;
-                SelectDatabaseTreeViewItem(null, category);
-            }
-        }
-
-        private void SelectDatabaseTreeViewItem(DatabasePackage package, Category category)
-        {
-            //this can be programmatic OR user initiated
-            if (package != null)
-            {
-                //check if we should save the item before updating what the current entry is
-                if (EditorSettings.SaveSelectionBeforeLeave && SelectedItem != null)
-                {
-                    SaveApplyDatabaseObject(SelectedItem, null);
-                }
-                //set the item as the new selectedItem
-                SelectedItem = package;
-                //display the new selectedItem
-                ShowDatabasePackage(SelectedItem);
-            }
-            else
-            {
-                //check if we should save the item before updating what the current entry is
-                if (EditorSettings.SaveSelectionBeforeLeave)
-                {
-                    SaveApplyDatabaseObject(null, category);
-                }
+                SelectDatabaseObject(selectedTreeViewItem.Header);
+            }
+        }
+
+        private void SelectDatabaseObject(object obj)
+        {
+            //check if we should save the item before updating what the current entry is
+            if (EditorSettings.SaveSelectionBeforeLeave && SelectedItem != null)
+            {
+                ApplyDatabaseObject(obj);
+            }
+            if (obj is Category category)
+                SelectDatabaseCategory(category);
+            else if (obj is DatabasePackage package)
+                SelectDatabasePackage(package);
+        }
+
+        private void SelectDatabaseCategory(Category category)
+        {
+            //set the item as the new selectedItem
+            //SelectedItem = package;
+            //display the new selectedItem
+            ShowDatabaseObject(SelectedItem);
+        }
+
+        private void SelectDatabasePackage(DatabasePackage package)
+        {
+            //set the item as the new selectedItem
+            SelectedItem = package;
+            //display the new selectedItem
+            ShowDatabaseObject(SelectedItem);
+        }
+
+        private void ShowDatabaseObject(object obj)
+        {
+            if (obj is Category category)
                 ShowDatabaseCategory(category);
-            }
+            else if (obj is DatabasePackage package)
+                ShowDatabasePackage(package);
         }

         private void ShowDatabaseCategory(Category category)
@@ -775,25 +782,31 @@
             }
         }

-        private void SaveApplyDatabaseObject(DatabasePackage package, Category category)
-        {
-            if(package != null)
-                Logging.Debug("SaveApplyDatabaseObject(), selectedItem is null = {0}, package save apply target = {1}", (SelectedItem == null), package.PackageName);
-            else
-                Logging.Debug("SaveApplyDatabaseObject(), selectedItem is null = {0}, package save apply target = null (category)", (SelectedItem == null));
-            if (category != null)
-            {
-                category.Name = PackageNameDisplay.Text;
-                category.Dependencies.Clear();
-                foreach (DatabaseLogic logic in PackageDependenciesDisplay.Items)
-                    category.Dependencies.Add(logic);
-                //if user requests apply to also save to disk, then do that now
-                if (EditorSettings.ApplyBehavior == ApplyBehavior.ApplyTriggersSave)
-                {
-                    SaveDatabaseButton_Click(null, null);
-                }
-                return;
-            }
+        private void ApplyDatabaseObject(object obj)
+        {
+            if (obj is Category category)
+                ApplyDatabaseCategory(category);
+            else if (obj is DatabasePackage package)
+                ApplyDatabasePackage(package);
+        }
+
+        private void ApplyDatabaseCategory(Category category)
+        {
+            Logging.Debug("ApplyDatabaseCategory(), category saving= {0}", category.Name);
+            category.Name = PackageNameDisplay.Text;
+            category.Dependencies.Clear();
+            foreach (DatabaseLogic logic in PackageDependenciesDisplay.Items)
+                category.Dependencies.Add(logic);
+            //if user requests apply to also save to disk, then do that now
+            if (EditorSettings.ApplyBehavior == ApplyBehavior.ApplyTriggersSave)
+            {
+                SaveDatabaseButton_Click(null, null);
+            }
+        }
+
+        private void ApplyDatabasePackage(DatabasePackage package)
+        {
+            Logging.Debug("ApplyDatabasePackage(), package saving = {0}", package.PackageName);
             //save everything from the UI into the package
             //save package elements first
             package.PackageName = PackagePackageNameDisplay.Text;
@@ -991,7 +1004,7 @@
                 //this will cause it in the UI to be highlighted, but internal selection code will reject it because it's not "user initiated"
                 realItemToMove.IsSelected = true;
                 //so make it programatically selected this one time
-                SelectDatabaseTreeViewItem(packageToMove, null);
+                SelectDatabaseObject(packageToMove);
             }
         }

@@ -1320,12 +1333,12 @@
             //if save triggers apply, then do it
             if (EditorSettings.ApplyBehavior == ApplyBehavior.SaveTriggersApply && SelectedItem != null)
             {
-                SaveApplyDatabaseObject(SelectedItem, null);
+                ApplyDatabaseObject(SelectedItem);
             }
             else if (EditorSettings.ApplyBehavior == ApplyBehavior.SaveTriggersApply && DatabaseTreeView.SelectedItem != null &&
                 DatabaseTreeView.SelectedItem is TreeViewItem tvi && tvi.Header is Category cat)
             {
-                SaveApplyDatabaseObject(null, cat);
+                ApplyDatabaseObject(cat);
             }
             //actually save
             XMLUtils.SaveDatabase(DefaultSaveLocationSetting.Text, Settings.WoTClientVersion, Settings.WoTModpackOnlineFolderVersion,
@@ -1338,12 +1351,12 @@
             //if save triggers apply, then do it
             if (EditorSettings.ApplyBehavior == ApplyBehavior.SaveTriggersApply && SelectedItem != null)
             {
-                SaveApplyDatabaseObject(SelectedItem, null);
+                ApplyDatabaseObject(SelectedItem);
             }
             else if (EditorSettings.ApplyBehavior == ApplyBehavior.SaveTriggersApply && DatabaseTreeView.SelectedItem != null &&
                 DatabaseTreeView.SelectedItem is TreeViewItem tvi && tvi.Header is Category cat)
             {
-                SaveApplyDatabaseObject(null, cat);
+                ApplyDatabaseObject(cat);
             }
             if (SaveDatabaseDialog == null)
                 SaveDatabaseDialog = new SaveFileDialog()


fixed issues with dependency adding and removing (thanks gauss)

--- RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
@@ -15,6 +15,7 @@
 using System.Xml;
 using Microsoft.Win32;
 using RelhaxModpack.UIComponents;
+using RelhaxModpack.DatabaseComponents;
 using System.Net;
 using Path = System.IO.Path;

@@ -1648,10 +1649,16 @@
                 MessageBox.Show("Invalid logic selection");
                 return;
             }
-            if (SelectedItem is Dependency dependency)
+            DatabasePackage package = SelectedItem as DatabasePackage;
+            //get it out of the editor combobox item first
+            if(SelectedItem is EditorComboBoxItem editorComboBoxItem)
+            {
+                package = editorComboBoxItem.Package;
+            }
+            if (package is IDatabaseLogic logicalPackage)
             {
                 //check the list of databaselogic in the item, make sure we're not trying to add a duplicate item
-                foreach (DatabaseLogic logic in dependency.Dependencies)
+                foreach (DatabaseLogic logic in logicalPackage.DependenciesProp)
                 {
                     if (logic.PackageName.Equals((LoadedDependenciesList.SelectedItem as Dependency).PackageName))
                     {
@@ -1659,7 +1666,7 @@
                         return;
                     }
                 }
-                dependency.Dependencies.Add(new DatabaseLogic()
+                logicalPackage.DependenciesProp.Add(new DatabaseLogic()
                 {
                     PackageName = (LoadedDependenciesList.SelectedItem as Dependency).PackageName,
                     Logic = (Logic)LoadedLogicsList.SelectedItem,
@@ -1667,24 +1674,18 @@
                 }
                 );
             }
-            else if (SelectedItem is SelectablePackage selectablePackage)
-            {
-                //check the list of databaselogic in the item, make sure we're not trying to add a duplicate item
-                foreach (DatabaseLogic logic in selectablePackage.Dependencies)
-                {
-                    if (logic.PackageName.Equals((LoadedDependenciesList.SelectedItem as Dependency).PackageName))
-                    {
-                        MessageBox.Show("Dependency already exists in package");
-                        return;
-                    }
-                }
-                selectablePackage.Dependencies.Add(new DatabaseLogic()
-                {
-                    PackageName = (LoadedDependenciesList.SelectedItem as Dependency).PackageName,
-                    Logic = (Logic)LoadedLogicsList.SelectedItem,
-                    NotFlag = (bool)DependenciesNotFlag.IsChecked
-                }
-                );
+            else
+            {
+                Logging.Error("SelectedItem is invalid type: {0}", SelectedItem.GetType().ToString());
+                return;
+            }
+
+            //update the UI
+            PackageDependenciesDisplay.Items.Clear();
+            if(package is IDatabaseLogic)
+            {
+                foreach (DatabaseLogic logic in logicalPackage.DependenciesProp)
+                    PackageDependenciesDisplay.Items.Add(logic);
             }
         }

@@ -1696,6 +1697,8 @@
             LoadedLogicsList.SelectedItem = selectedLogic.Logic;
             DependenciesNotFlag.IsChecked = selectedLogic.NotFlag;
             LoadedDependenciesList.SelectedIndex = -1;
+
+            //check if it exits in the list of all loaded dependencies (it should) and if it does select it
             foreach (Dependency dependency in LoadedDependenciesList.Items)
             {
                 if (dependency.PackageName.Equals(selectedLogic.PackageName))
@@ -1708,7 +1711,15 @@

         private void DependenciesRemoveSelected_Click(object sender, RoutedEventArgs e)
         {
+            //remove the selected item from the UI display
             PackageDependenciesDisplay.Items.Remove(PackageDependenciesDisplay.SelectedItem);
+
+            //remove it from the list of logics/dependencies of the selected item
+            DatabasePackage package = (SelectedItem as EditorComboBoxItem).Package;
+            if(package is IDatabaseLogic packageLogic)
+            {
+                packageLogic.DependenciesProp.Remove(PackageDependenciesDisplay.SelectedItem as DatabaseLogic);
+            }
         }

         private void MediaAddMediaButton_Click(object sender, RoutedEventArgs e)


Matrix builder- added default behavior for building a matrix without a sprite

--- Source/Engine/AGS.Engine/Graphics/Logic/GLMatrixBuilder.cs
+++ Source/Engine/AGS.Engine/Graphics/Logic/GLMatrixBuilder.cs
@@ -41,6 +41,7 @@

 		private Matrix4 getModelMatrix(IHasModelMatrix sprite, PointF areaScaling)
 		{
+            if (sprite == null) return Matrix4.Identity;
 			PointF anchorOffsets = getAnchorOffsets (sprite.Anchor, sprite.Width, sprite.Height);
 			Matrix4 anchor = Matrix4.CreateTranslation (new Vector3(-anchorOffsets.X, -anchorOffsets.Y, 0f));
 			Matrix4 scale = Matrix4.CreateScale (new Vector3 (sprite.ScaleX * areaScaling.X,


Fixed bug with the persisting the "name" value.

--- Src/Our.Umbraco.Mortar/DataResolvers/MortarDataResolver.cs
+++ Src/Our.Umbraco.Mortar/DataResolvers/MortarDataResolver.cs
@@ -207,6 +207,12 @@

 			foreach (var propertyValue in propertyValues)
 			{
+				if (propertyValue.Key.InvariantEquals("name"))
+				{
+					propertyItemData.Add(propertyValue.Key, propertyValue.Value);
+					continue;
+				}
+
 				var propertyType = content.ContentType.GetPropertyType(propertyValue.Key);
 				if (propertyType == null)
 					continue;


-исправлены пару тестов

-исправлены пару тестов

--- StackCalc/StackCalculator/StackCalculatorTests/ListTest.cs
+++ StackCalc/StackCalculator/StackCalculatorTests/ListTest.cs
@@ -88,7 +88,7 @@
         [ExpectedException(typeof(EmptyStackException))]
         public void EmptyStackExceptionTest1()
         {
-            var list = new ArrayList();
+            var list = new List();
             list.Pop();
         }

@@ -96,7 +96,7 @@
         [ExpectedException(typeof(EmptyStackException))]
         public void EmptyStackExceptionTest2()
         {
-            var list = new ArrayList();
+            var list = new List();
             list.Peek();
         }
     }


move to authorisation

move to authorisation

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@gmail.com>

--- Terradue.Tep/Terradue/Tep/Controller/Community/GroupTep.cs
+++ Terradue.Tep/Terradue/Tep/Controller/Community/GroupTep.cs
@@ -34,7 +34,7 @@

 @}

-\addtogroup Security
+\addtogroup Authorisation
 @{

 #### Authorisation scheme tailoring for TEP ####
@@ -42,12 +42,12 @@
 As described previously, the portal authorisation mechanism allows a great flexibility for managing users and groups and their permissions with the items in the system.
 In order to enable all the requirements specific to the TEP, the \ref TepCommunity uses the \ref Security components as the following:

-- \ref User is an \ref TEPUser registered via the \ref Authentication mechanism integrated in the portal (e.g. EO-SSO)
-- \ref Group is a \ref TEPGroup regrouping a set of \ref TEPUser put together for organisational purpose. For instance, all Terradue staff users are grouped in the Terradue Group.
+- \ref User is an \ref UserTep registered via the \ref Authentication mechanism integrated in the portal (e.g. EO-SSO)
+- \ref Group is a \ref GroupTep regrouping a set of \ref UserTep put together for organisational purpose. For instance, all Terradue staff users are grouped in the Terradue Group.
 - Domain is named "Thematic Group" and englobes all users, groups and objects having a thematic scope in common. For instance,
 there could be a "Volcanoes" thematic group that would have expert users in volcanoes monitoring, the data collections used for monitoring them (e.g. Sentinel-2 and 3),
 the features related to this domain (e.g. latest most important eruptions) and the all the processing services relative to volcanoes.
-- The inital roles are defined as \ref TEPRole.
+- The inital roles are defined as \ref RoleTep.

 Objects identified and used in TEP are
 - \ref Series called "Data \ref Collection"


Selenium tests for #273

Selenium tests for #273

--- Test/NakedFunctions.Selenium.Test/DevelopmentStoryTests.cs
+++ Test/NakedFunctions.Selenium.Test/DevelopmentStoryTests.cs
@@ -79,6 +79,7 @@
             ImageProperty();
             ImageParameter();
             QueryContributedActionReturningOnlyAContext();
+
             LocalCollectionContributedAction();
             SaveNewChildObjectAndTestItsVisibilityInTheParentsCollection();
             UseOfDeferredFunctionIncludingReload();
@@ -86,9 +87,8 @@
             WithDelete();
             WithMultipleDeletes();
             ObjectActionRenderedWithinCollection();
-            //QueryContributedActionWithCoValidation();
-            //QueryContributedActionWithChoicesFunction();
-
+            QueryContributedActionWithChoicesFunction();
+            QueryContributedActionWithCoValidation();
         }

         //[TestMethod]
@@ -592,7 +592,7 @@
             Assert.AreEqual(3, br.FindElements(By.CssSelector("tbody tr td")).Count(el => el.Text == rnd));
         }

-       // [TestMethod]
+        // [TestMethod]
         public void SaveNewChildObjectAndTestItsVisibilityInTheParentsCollection()
         {
             GeminiUrl("object/object?i1=View&o1=AW.Types.Customer--12211&as1=open&i2=View&o2=AW.Types.Product--707");
@@ -637,7 +637,7 @@
             Assert.AreEqual("£297.41", GetPropertyValue("Total Due"));
         }

-        [TestMethod]
+        //[TestMethod]
         public void UseOfResolveMethodInADeferredFunction()
         {
             GeminiUrl("object/object?i1=View&o1=AW.Types.Customer--12211&as1=open&i2=View&o2=AW.Types.Product--707");
@@ -757,35 +757,36 @@
             Assert.AreEqual("Change A Quantity", change.GetAttribute("value"));
         }

-        [TestMethod, Ignore] //NOT currently working
+        //[TestMethod]
         public void QueryContributedActionWithChoicesFunction()
         {
             GeminiUrl("list?m1=Product_MenuFunctions&a1=AllProducts&pg1=1&ps1=20&s1_=0&c1=List&as1=open&r1=1&d1=AddAnonReviews");
             WaitForTitle("All Products");
+            Reload();
             var option = "select#rating1 option";
             Assert.AreEqual("5", WaitForCssNo(option, 4).Text);
             Assert.AreEqual("1", WaitForCssNo(option, 0).Text);
-            SelectDropDownOnField("select#rating", 2);
+            SelectDropDownOnField("select#rating1", 4);
             var rand = (new Random()).Next(100000).ToString();
             TypeIntoFieldWithoutClearing("#comments1", rand);
             SelectCheckBox("#item1-1");
             Click(OKButton());
-            Thread.Sleep(1000);
-            Reload();
-            WaitForCssNo("tbody tr", 10);
-            Assert.AreEqual(1, br.FindElements(By.CssSelector("tbody tr td")).Count(el => el.Text == rand));
-        }
-
-        [TestMethod, Ignore] //NOT currently working
+            GeminiUrl("object?i1=View&o1=AW.Types.Product--2&c1_ProductReviews=Table");
+            wait.Until(br => br.FindElements(By.CssSelector("tbody tr td")).Any(td => td.Text == rand));
+        }
+
+        //[TestMethod]
         public void QueryContributedActionWithCoValidation()
         {
             GeminiUrl("list?m1=Product_MenuFunctions&a1=AllProducts&pg1=1&ps1=20&s1_=0&c1=List&as1=open&r1=1&d1=AddAnonReviews");
             WaitForTitle("All Products");
-            TypeIntoFieldWithoutClearing("#rating1", "4");
-            Click(OKButton());
-            Thread.Sleep(1000);
+            Reload();
+            SelectDropDownOnField("select#rating1", 3);
+            SelectCheckBox("#item1-1");
+            Click(OKButton());
+            Thread.Sleep(500);
             var expected = "Must provide comments for rating < 5";
-            var actual = WaitForCss(".co-validation");
+            var actual = WaitForCss(".co-validation").Text;
             Assert.AreEqual(expected, actual);
         }
     }


Update NakedObjectsRunSettings.cs

Update NakedObjectsRunSettings.cs

--- Test/NakedObjects.Rest.Test.App/NakedObjectsRunSettings.cs
+++ Test/NakedObjects.Rest.Test.App/NakedObjectsRunSettings.cs
@@ -30,6 +30,8 @@
                     typeof(WithReferenceViewModel),
                     typeof(WithCollectionViewModel),
                     typeof(WithActionViewModel),
+                    typeof(WithAction),
+                    typeof(WithActionObject),
                     typeof(FormViewModel),
                     typeof(MostSimplePersist),
                     typeof(VerySimplePersist),


Update Startup.cs

Update Startup.cs

--- WebApplication_Synced/src/WebApplication_Synced/Startup.cs
+++ WebApplication_Synced/src/WebApplication_Synced/Startup.cs
@@ -18,6 +18,9 @@
             var builder = new ConfigurationBuilder()
                 .AddJsonFile("appsettings.json")
                 .AddEnvironmentVariables();
+
+                //asdasd asdasdasd
+                //asdasda szdfasda

             if (env.IsDevelopment())
             {


Add the missed ContentLength Property

Add the missed ContentLength Property

--- RestSharp/RestRequest.cs
+++ RestSharp/RestRequest.cs
@@ -121,10 +121,13 @@
 		/// <returns>This request</returns>
 		public IRestRequest AddFile (string name, string path)
 		{
+			FileInfo f = new FileInfo (path);
+			long fileLength = f.Length;
 			return AddFile(new FileParameter
 			{
 				Name = name,
 				FileName = Path.GetFileName(path),
+				ContentLength = fileLength,
 				Writer = s =>
 				{
 					using(var file = new StreamReader(path))


PostNewStatus() call tested

PostNewStatus() call tested

--- mastodon/mastodon.Tests/MastodonClientTests.cs
+++ mastodon/mastodon.Tests/MastodonClientTests.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Configuration;
+using System.Linq;
 using System.Net;
 using mastodon.Enums;
 using mastodon.Models;
@@ -131,6 +132,18 @@
         }

         [TestMethod]
+        public void PostNewStatus()
+        {
+            var tokenInfo = GetTokenInfo(AppScopeEnum.Write);
+
+            var client = new MastodonClient(Settings.InstanceUrl);
+            var status = client.PostNewStatus(tokenInfo.access_token, "Cool status for testing purpose");
+            Assert.IsNotNull(status.content);
+            status = client.PostNewStatus(tokenInfo.access_token, "Cool status for testing purpose", -1, null, true, "TESTING SPOILER", StatusVisibilityEnum.Private);
+            Assert.IsNotNull(status.content);
+        }
+
+        [TestMethod]
         public void GetFavorites()
         {
             var tokenInfo = GetTokenInfo(AppScopeEnum.Read);


RootSample - optimization (stop checking square factors when p >= n)

--- projects/RootSample/RootSample.Core/RootTerm.cs
+++ projects/RootSample/RootSample.Core/RootTerm.cs
@@ -35,6 +35,11 @@
             this.c = 1;
             foreach (ushort p in Primes)
             {
+                if (n < p)
+                {
+                    break;
+                }
+
                 int r;
                 while (true)
                 {


Lazy start application so that tests can perform setup.

--- ruibarbo.sampletest/AutomationLayer/TestBase.cs
+++ ruibarbo.sampletest/AutomationLayer/TestBase.cs
@@ -9,10 +9,12 @@
     public class TestBase
     {
         protected Engine Engine;
+        private bool _isStarted;

         [SetUp]
         public void SetUp()
         {
+            _isStarted = false;
             Engine = new Engine();
             Engine.ConfigureElementFactory(x =>
                 {
@@ -25,19 +27,32 @@
                             q.AddRegisteredElementsInAssembly(GetType().Assembly);
                         }));
                 });
-            Engine.Start(new SampleApplication());
         }

         [TearDown]
         public void TearDown()
         {
-            Engine.ShutDown();
+            if (_isStarted)
+            {
+                Engine.ShutDown();
+            }
+
             CollectionAssert.IsEmpty(Engine.UnhandledExceptions);
         }

         protected MainWindow MainWindow
         {
-            get { return Engine.Desktop.FindFirstChild<MainWindow>(By.Name("WndMain")); }
+            get
+            {
+                if (!_isStarted)
+                {
+                    // Lazy start so that tests can perform setup before application is started.
+                    _isStarted = true;
+                    Engine.Start(new SampleApplication());
+                }
+
+                return Engine.Desktop.FindFirstChild<MainWindow>(By.Name("WndMain"));
+            }
         }

         protected MessageBox MessageBox


Fix more physics bugs for > 256 regions.

--- Aurora/Physics/AuroraOpenDynamicsEngine/AODEPhysicsScene.cs
+++ Aurora/Physics/AuroraOpenDynamicsEngine/AODEPhysicsScene.cs
@@ -3651,10 +3651,11 @@
             }
             else
             {
-                heightmapWidth = Constants.RegionSize + 2;
-                heightmapHeight = Constants.RegionSize + 2;
-                heightmapWidthSamples = Constants.RegionSize+2;
-                heightmapHeightSamples = Constants.RegionSize + 2;
+                int rSize = (int)Math.Sqrt(heightMap.Length) > Constants.RegionSize ? (int)Math.Sqrt(heightMap.Length) : Constants.RegionSize;
+                heightmapWidth = rSize + 2;
+                heightmapHeight = rSize + 2;
+                heightmapWidthSamples = rSize + 2;
+                heightmapHeightSamples = rSize + 2;
                 _heightmap = new float[heightmapWidthSamples * heightmapHeightSamples];
                 for (int x = 0; x < (int)Math.Sqrt(heightMap.Length); x++)
                 {


Saving as bytes instead of b64

Saving as bytes instead of b64

--- Automatron/Assets/Automatron/Editor/AutomatronSerializer.cs
+++ Automatron/Assets/Automatron/Editor/AutomatronSerializer.cs
@@ -50,9 +50,9 @@
                 return null;
             }

-            var b64 = File.ReadAllText( path );
+            var buffer = File.ReadAllBytes( path );
             try {
-                var automatron = Deserializer.Deserialize<SerializableAutomatron>( b64 );
+                var automatron = Deserializer.Deserialize<SerializableAutomatron>( buffer );
                 return automatron;
             } catch ( System.Exception ) {
                 return null;
@@ -118,7 +118,7 @@
                 automatron.Lines.Add( line );
             }

-            var b64 = Serializer.SerializeToB64( automatron );
+            var buffer = Serializer.SerializeToBytes( automatron );

             var path = editor.Path;
             if ( !Directory.Exists( path ) ) {
@@ -126,7 +126,7 @@
             }

             var fpath = Path.Combine( path, automatron.Name + ".acfg" );
-            File.WriteAllText( fpath, b64 );
+            File.WriteAllBytes( fpath, buffer );
         }
     }
 }


IModelSpaceHelper

IModelSpaceHelper

--- CSharpGL/0Foundations/OpenGLObjects/Renderer/IModelSpace.cs
+++ CSharpGL/0Foundations/OpenGLObjects/Renderer/IModelSpace.cs
@@ -26,4 +26,30 @@
         /// </summary>
         vec3 Lengths { get; }
     }
+
+    /// <summary>
+    ///
+    /// </summary>
+    public static class IModelSpaceHelper
+    {
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public static BoundingBox GetBoundingBox(this IModelSpace model)
+        {
+            vec3 max, min;
+            {
+                vec3 position = model.OriginalWorldPosition + model.Lengths / 2;
+                max = position;
+            }
+            {
+                vec3 position = model.OriginalWorldPosition - model.Lengths / 2;
+                min = position;
+            }
+
+            return new BoundingBox(min, max);
+        }
+    }
 }


Notify browser control directly instead of using an event.

--- CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs
+++ CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs
@@ -12,9 +12,14 @@
 {
     internal class ParentFormMessageInterceptor : NativeWindow, IDisposable
     {
-        public event EventHandler<EventArgs> Moving;
-
+        /// <summary>
+        /// Keep track of whether a move is in progress.
+        /// </summary>
         private bool isMoving = false;
+
+        /// <summary>
+        /// Used to determine the coordinates involved in the move
+        /// </summary>
         private Rectangle movingRectangle;

         private ChromiumWebBrowser Browser { get; set; }
@@ -159,12 +164,7 @@
         protected virtual void OnMoving()
         {
             isMoving = true;
-            var handler = Moving;
-
-            if (handler != null)
-            {
-                handler(this, null);
-            }
+            Browser.NotifyMoveOrResizeStarted();
             isMoving = false;
         }


Scale pointers in add and sub binops.

Scale pointers in add and sub binops.

--- ArkeOS.Tools.KohlCompiler/IR/IrGenerator.cs
+++ ArkeOS.Tools.KohlCompiler/IR/IrGenerator.cs
@@ -240,8 +240,13 @@

                 case BinaryExpressionNode n:
                     var target = this.CreateTemporaryLocalVariable(type);
-
-                    this.block.PushInstuction(new BasicBlockBinaryOperationInstruction(target, this.ExtractRValue(n.Left), (BinaryOperationType)n.Op.Operator, this.ExtractRValue(n.Right)));
+                    var lhsType = this.symbolTable.GetTypeOfExpression(n.Left, this.functionSymbol);
+                    var rhs = this.ExtractRValue(n.Right);
+
+                    if (lhsType.BaseName == "ptr" && rhs is IntegerRValue r && (n.Op.Operator == Operator.Addition || n.Op.Operator == Operator.Subtraction))
+                        rhs = new IntegerRValue(r.Value * lhsType.TypeArguments.Single().Size);
+
+                    this.block.PushInstuction(new BasicBlockBinaryOperationInstruction(target, this.ExtractRValue(n.Left), (BinaryOperationType)n.Op.Operator, rhs));

                     return target;
             }


use channelId as result

use channelId as result

--- src/wp8/cordova/MpnsRegistration.cs
+++ src/wp8/cordova/MpnsRegistration.cs
@@ -11,45 +11,42 @@
     {
         private Installation installation;
         private IUPSHttpClient client;
-        protected async override Task Register(Installation installation, IUPSHttpClient client)
+        protected async override Task<string> Register(Installation installation, IUPSHttpClient client)
         {
             this.installation = installation;
             this.client = client;
             HttpNotificationChannel channel;
             string channelName = "ToastChannel";

-            await Task.Run(() =>
+            channel = HttpNotificationChannel.Find(channelName);
+
+            if (channel == null)
             {
-                channel = HttpNotificationChannel.Find(channelName);
+                channel = new HttpNotificationChannel(channelName);
+            }

-                if (channel == null)
+            var tcs = new TaskCompletionSource<string>();
+            channel.ChannelUriUpdated += async (s, e) =>
+            {
+                ChannelStore channelStore = new ChannelStore();
+                if (!e.ChannelUri.ToString().Equals(channelStore.Read()))
                 {
-                    channel = new HttpNotificationChannel(channelName);
+                    installation.deviceToken = e.ChannelUri.ToString();
+                    await client.register(installation);
+                    channelStore.Save(installation.deviceToken);
+                    tcs.TrySetResult(installation.deviceToken);
                 }
+            };
+            channel.ErrorOccurred += (s, e) =>
+            {
+                tcs.TrySetException(new Exception(e.Message));
+            };

-                var tcs = new TaskCompletionSource<HttpStatusCode>();
-                channel.ChannelUriUpdated += async (s, e) =>
-                {
-                    ChannelStore channelStore = new ChannelStore();
-                    if (!e.ChannelUri.ToString().Equals(channelStore.Read()))
-                    {
-                        installation.deviceToken = e.ChannelUri.ToString();
-                        channelStore.Save(e.ChannelUri.ToString());
-                        HttpStatusCode result = await client.register(installation);
-                        tcs.TrySetResult(result);
-                    }
-                };
-                channel.ErrorOccurred += (s, e) =>
-                {
-                    tcs.TrySetException(new Exception(e.Message));
-                };
+            channel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);

-                channel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);
-
-                channel.Open();
-                channel.BindToShellToast();
-                return tcs.Task;
-            });
+            channel.Open();
+            channel.BindToShellToast();
+            return await tcs.Task;
         }

         private void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)


The IW_DELIVER_* series of constants.

The IW_DELIVER_* series of constants.

(This file must have been accidentally unchecked in the previous
commit.)

--- CompilerRuntime/InWorldz.Phlox/Compiler/DefaultConstants.cs
+++ CompilerRuntime/InWorldz.Phlox/Compiler/DefaultConstants.cs
@@ -817,6 +817,13 @@

 			// Return codes for iwDeliverInventory and iwDeliverInventoryList
 			{ "IW_DELIVER_OK",      new ConstantSymbol("IW_DELIVER_OK",     SymbolTable.INT, "0") },
+			{ "IW_DELIVER_BADKEY",  new ConstantSymbol("IW_DELIVER_BADKEY", SymbolTable.INT, "1") },
+			{ "IW_DELIVER_MUTED",   new ConstantSymbol("IW_DELIVER_MUTED",  SymbolTable.INT, "2") },
+			{ "IW_DELIVER_ITEM",    new ConstantSymbol("IW_DELIVER_ITEM",   SymbolTable.INT, "3") },
+			{ "IW_DELIVER_PRIM",    new ConstantSymbol("IW_DELIVER_PRIM",   SymbolTable.INT, "4") },
+			{ "IW_DELIVER_USER",    new ConstantSymbol("IW_DELIVER_USER",   SymbolTable.INT, "5") },
+			{ "IW_DELIVER_PERM",    new ConstantSymbol("IW_DELIVER_PERM",   SymbolTable.INT, "6") },
+			{ "IW_DELIVER_NONE",    new ConstantSymbol("IW_DELIVER_NONE",   SymbolTable.INT, "7") },
         };
     }
 }


Remove debugs

Remove debugs

--- Assets/RagePixel2/Editor/Utility/Utility.cs
+++ Assets/RagePixel2/Editor/Utility/Utility.cs
@@ -332,7 +332,6 @@

 		public static void DrawPixelLine (Texture2D texture, Brush brush, IntVector2 p1, IntVector2 p2)
 		{
-			Debug.Log("p1 " + p1 + ", p2 " + p2);
 			foreach (IntVector2 pixel in GetPointsOnLine(p1.x, p1.y, p2.x, p2.y))
 				SetPixelsClamped (texture, pixel - brush.m_BrushPivot, brush.m_Size, brush.m_Colors);
 			texture.Apply ();
@@ -340,7 +339,6 @@

 		public static void SetPixelsClamped(Texture2D texture, IntVector2 position, IntVector2 size, Color[] colors)
 		{
-			Debug.Log(position);
 			IntVector2 min = new IntVector2(
 				Math.Max (Math.Min (position.x, texture.width - 1), 0),
 				Math.Max (Math.Min (position.y, texture.height - 1), 0)
@@ -418,7 +416,7 @@
 				x0 = y0;
 				y0 = t;
 				t = x1; // swap x1 and y1
-				x1 = y1;
+				x1 = y1;
 				y1 = t;
 			}
 			if (x0 > x1)


Changed GetListByTitle to be case insensitive.

--- Core/OfficeDevPnP.Core/AppModelExtensions/ListExtensions.cs
+++ Core/OfficeDevPnP.Core/AppModelExtensions/ListExtensions.cs
@@ -681,10 +681,10 @@
                   ? new ArgumentNullException("listTitle")
                   : new ArgumentException(CoreResources.Exception_Message_EmptyString_Arg, "listTitle");
             }
-            ListCollection lists = web.Lists;
-            IEnumerable<List> results = web.Context.LoadQuery<List>(lists.Where(list => list.Title == listTitle));
+
+            var lists = web.Context.LoadQuery(web.Lists).Where(l => l.Title.Equals(listTitle, StringComparison.InvariantCultureIgnoreCase));
             web.Context.ExecuteQueryRetry();
-            return results.FirstOrDefault();
+            return lists.FirstOrDefault();
         }

         /// <summary>
@@ -1057,7 +1057,7 @@
                                 foreach (var term in ((DefaultColumnTermValue)defaultColumnValueInSamePath).Terms)
                                 {
                                     term.EnsureProperties(t => t.Id, t => t.Name);
-
+
                                     var wssId = list.ParentWeb.GetWssIdForTerm(term);
                                     fieldStringBuilder.AppendFormat("{0};#{1}|{2};#", wssId, term.Name, term.Id);
                                 }


Updated implementation to use the new WebPart.ExportMode property

--- Core/OfficeDevPnP.Core/AppModelExtensions/PageExtensions.cs
+++ Core/OfficeDevPnP.Core/AppModelExtensions/PageExtensions.cs
@@ -410,11 +410,11 @@
                 {
                     var wp = query.First();

-                    var exportMode = (WebPartExportMode)Enum.Parse(typeof(WebPartExportMode), wp.WebPart.Properties["ExportMode"].ToString());
+                    var exportMode = wp.WebPart.ExportMode;
                     var changed = false;
-                    if (exportMode != WebPartExportMode.All)
+                    if (exportMode != WebParts.WebPartExportMode.All)
                     {
-                        wp.WebPart.Properties["ExportMode"] = WebPartExportMode.All;
+                        wp.WebPart.ExportMode = WebParts.WebPartExportMode.All;
                         wp.SaveWebPartChanges();
                         web.Context.ExecuteQueryRetry();
                         changed = true;
@@ -426,7 +426,7 @@

                     if (changed)
                     {
-                        wp.WebPart.Properties["ExportMode"] = exportMode;
+                        wp.WebPart.ExportMode = exportMode;
                         wp.SaveWebPartChanges();
                         web.Context.ExecuteQueryRetry();
                     }


watching ad for ships functions added

watching ad for ships functions added

--- Documents/Unity3D/Catcheep/Assets/Scripts/ShopController.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/ShopController.cs
@@ -169,7 +169,7 @@

     public void shipTwoButton()
     {
-        if (PlayerPrefs.GetInt("money") >= 15000)
+        if (PlayerPrefs.GetInt("money") >= 15000 && PlayerPrefs.GetInt("level") > 5)
         {
             StartCoroutine(objectOpened(DecisionPanel));
             DecisionPanel.transform.GetChild(1).GetComponentInChildren<TextMeshProUGUI>().text =
@@ -193,7 +193,7 @@

     public void shipThreeButton()
     {
-        if (PlayerPrefs.GetInt("money") >= 25000)
+        if (PlayerPrefs.GetInt("money") >= 25000 && PlayerPrefs.GetInt("level") > 10)
         {
             StartCoroutine(objectOpened(DecisionPanel));
             DecisionPanel.transform.GetChild(1).GetComponentInChildren<TextMeshProUGUI>().text =
@@ -217,7 +217,7 @@

     public void shipFourButton()
     {
-        if (PlayerPrefs.GetInt("money") >= 40000)
+        if (PlayerPrefs.GetInt("money") >= 40000 && PlayerPrefs.GetInt("level") > 15)
         {
             StartCoroutine(objectOpened(DecisionPanel));
             DecisionPanel.transform.GetChild(1).GetComponentInChildren<TextMeshProUGUI>().text =
@@ -360,6 +360,18 @@
     {
         ShowRewardedVideo(2);
     }
+    public void shipTwoAdFunction()
+    {
+        ShowRewardedVideo(3);
+    }
+    public void shipThreeAdFunction()
+    {
+        ShowRewardedVideo(4);
+    }
+    public void shipFourAdFunction()
+    {
+        ShowRewardedVideo(5);
+    }
     void ShowRewardedVideo(int index)
     {
         ShowOptions options = new ShowOptions();
@@ -374,8 +386,20 @@
             case 2:
                 options.resultCallback = loveAd;
                 break;
-        }
-        Advertisement.Show("rewardedVideo", options);
+            case 3:
+                options.resultCallback = shipTwoAd;
+                break;
+            case 4:
+                options.resultCallback = shipThreeAd;
+                break;
+            case 5:
+                options.resultCallback = shipFourAd;
+                break;
+        }
+        if (Advertisement.IsReady())
+        {
+            Advertisement.Show("rewardedVideo", options);
+        }
     }

     void hayAd(ShowResult result)
@@ -402,4 +426,25 @@
             HelpToolsGameObject.transform.GetChild(2).transform.GetChild(5).GetComponent<TextMeshProUGUI>().text = "" + PlayerPrefs.GetInt("loveStock");
         }
     }
+    void shipTwoAd(ShowResult result)
+    {
+        if (result == ShowResult.Finished && PlayerPrefs.GetInt("level") > 5)
+        {
+            PlayerPrefs.SetInt("ship", 2);
+        }
+    }
+    void shipThreeAd(ShowResult result)
+    {
+        if (result == ShowResult.Finished && PlayerPrefs.GetInt("level") > 10)
+        {
+            PlayerPrefs.SetInt("ship", 3);
+        }
+    }
+    void shipFourAd(ShowResult result)
+    {
+        if (result == ShowResult.Finished && PlayerPrefs.GetInt("level") > 15)
+        {
+            PlayerPrefs.SetInt("ship", 4);
+        }
+    }
 }


added text showing supply of help tools in shop

--- Documents/Unity3D/Catcheep/Assets/Scripts/ShopController.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/ShopController.cs
@@ -320,7 +320,7 @@

     public void facebook()
     {
-        Application.OpenURL("www.facebook.com/JetLightstudio/");
+        Application.OpenURL("fb://page/344400029290078");
     }

     IEnumerator objectOpened(GameObject objectToOpen)


Stupid SVN renaming.

Stupid SVN renaming.

git-svn-id: 21cdf44b51306c1f0753fc51e774ecf5fc1851ba@734 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Gorgon/Gorgon.Graphics/Geometry/GorgonInputLayout.cs
+++ Dorian/Gorgon/Gorgon.Graphics/Geometry/GorgonInputLayout.cs
@@ -28,21 +28,23 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using D3D = SharpDX.Direct3D11;

 namespace GorgonLibrary.Graphics
 {
 	/// <summary>
-	///
+	/// An input element for a buffer.
 	/// </summary>
+	/// <remarks>This defines the layout of an item of data for a buffer.  Typically this is used with a Vertex buffer to define a specific element for a vertex.</remarks>
 	public class GorgonInputElement
+		: INamedObject
 	{
 		#region Properties.
 		/// <summary>
 		/// Property to return the context of the element.
 		/// </summary>
 		/// <remarks>This is a string value that corresponds to a shader input.  For example, to specify a position, the user would set this to "position".
-		/// These contexts can be named whatever the user wishes.  However, some APIs (such as Direct3D 9) only have a set number of contexts and thus the
-		/// user should pass in one of the pre-defined constants for the context.
+		/// These contexts can be named whatever the user wishes.  This must map to a corresponding element in the shader.
 		/// </remarks>
 		public string Context
 		{
@@ -122,6 +124,22 @@
 		}
 		#endregion

+		#region Method.
+		/// <summary>
+		/// Function to convert this Gorgon input element into a Direct3D input element.
+		/// </summary>
+		/// <returns>The direct 3D input element.</returns>
+		internal D3D.InputElement Convert()
+		{
+			int instanceCount = InstanceCount;
+
+			if (!Instanced)
+				instanceCount = 0;
+
+			return new D3D.InputElement(Context, Index, (SharpDX.DXGI.Format)Format, Offset, Slot, (Instanced ? D3D.InputClassification.PerInstanceData : D3D.InputClassification.PerVertexData), instanceCount);
+		}
+		#endregion
+
 		#region Constructor/Destructor.
 		/// <summary>
 		/// Initializes a new instance of the <see cref="GorgonInputElement"/> class.
@@ -145,5 +163,18 @@
 			InstanceCount = InstanceCount;
 		}
 		#endregion
+
+		#region INamedObject Members
+		/// <summary>
+		/// Property to return the name of this object.
+		/// </summary>
+		string INamedObject.Name
+		{
+			get
+			{
+				return Context;
+			}
+		}
+		#endregion
 	}
 }


Fixing bug when closing the statement when in group by mode

--- BudgetAnalyser/Statement/StatementViewModel.cs
+++ BudgetAnalyser/Statement/StatementViewModel.cs
@@ -352,6 +352,13 @@

         public void UpdateGroupedByBucket()
         {
+            if (Statement == null)
+            {
+                // This can occur if the statement file is closed while viewing in GroupByBucket Mode.
+                GroupedByBucket = new ObservableCollection<TransactionGroupedByBucketViewModel>();
+                return;
+            }
+
             if (SortByBucket)
             {
                 IEnumerable<TransactionGroupedByBucketViewModel> query = Statement.Transactions


Remove IEnableLogger

Remove IEnableLogger

--- Ets.Mobile/Ets.Mobile.ViewModel/Pages/Main/MainViewModel.cs
+++ Ets.Mobile/Ets.Mobile.ViewModel/Pages/Main/MainViewModel.cs
@@ -8,7 +8,7 @@
 namespace Ets.Mobile.ViewModel.Pages.Main
 {
     [DataContract]
-    public partial class MainViewModel : ViewModelBase, IMainViewModel, IEnableLogger, IDisposable
+    public partial class MainViewModel : ViewModelBase, IMainViewModel, IDisposable
     {
         #region IDisposable


Three Examples Added

Three Examples Added

--- Examples.GridDesktop/CSharp/GridDesktop.Examples/Program.cs
+++ Examples.GridDesktop/CSharp/GridDesktop.Examples/Program.cs
@@ -16,8 +16,10 @@
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);

-            //Comment or uncomment the lines to run different examples
+            // Uncomment the one you want to try out
             //Application.Run(new RunExamples());
+
+            //Aspose.Cells for .NET v17.7
             Application.Run(new Form_FindGridDesktopVersionAtRunTime());
             Application.Run(new Form_CustomRowAndCustomColumnCaptionOfGridDesktopWorksheet());
             Application.Run(new Form_RenderPivotTableInGridDesktop());


LoadBMP methods needed fixing

LoadBMP methods needed fixing

--- SDL2-CS-OO/SDLTexture.cs
+++ SDL2-CS-OO/SDLTexture.cs
@@ -70,6 +70,46 @@

         }

+        public static SDLTexture LoadBMP(IntPtr Renderer, string File)
+        {
+
+            IntPtr ptr = SDL.SDL_LoadBMP(File);
+
+            try
+            {
+
+                return new SDLTexture(Renderer, ptr);
+
+            }
+            finally
+            {
+
+                SDL.SDL_FreeSurface(ptr);
+
+            }
+
+        }
+
+        public static SDLTexture LoadBMP(SDLRenderer Renderer, string File)
+        {
+
+            IntPtr ptr = SDL.SDL_LoadBMP(File);
+
+            try
+            {
+
+                return new SDLTexture(Renderer, ptr);
+
+            }
+            finally
+            {
+
+                SDL.SDL_FreeSurface(ptr);
+
+            }
+
+        }
+
         public static IntPtr LoadBMPPtr(IntPtr Renderer, string File)
         {

@@ -78,7 +118,7 @@
             try
             {

-                return new SDLTexture(Renderer, ptr);
+                return SDL.SDL_CreateTextureFromSurface(Renderer, ptr);

             }
             finally
@@ -98,47 +138,7 @@
             try
             {

-                return new SDLTexture(Renderer, ptr);
-
-            }
-            finally
-            {
-
-                SDL.SDL_FreeSurface(ptr);
-
-            }
-
-        }
-
-        public static SDLTexture LoadBMP(IntPtr Renderer, string File)
-        {
-
-            IntPtr ptr = SDL.SDL_LoadBMP(File);
-
-            try
-            {
-
-                return new SDLTexture(Renderer, ptr);
-
-            }
-            finally
-            {
-
-                SDL.SDL_FreeSurface(ptr);
-
-            }
-
-        }
-
-        public static SDLTexture LoadBMP(SDLRenderer Renderer, string File)
-        {
-
-            IntPtr ptr = SDL.SDL_LoadBMP(File);
-
-            try
-            {
-
-                return new SDLTexture(Renderer, ptr);
+                return SDL.SDL_CreateTextureFromSurface(Renderer, ptr);

             }
             finally


Launching the client closes the launcher now.

--- SS14.Launcher/Program.cs
+++ SS14.Launcher/Program.cs
@@ -10,6 +10,7 @@
 using JetBrains.Annotations;
 using Newtonsoft.Json;
 using Robust.Client.Graphics.Drawing;
+using Robust.Client.Interfaces;
 using Robust.Client.Interfaces.ResourceManagement;
 using Robust.Client.Interfaces.UserInterface;
 using Robust.Client.UserInterface;
@@ -43,6 +44,7 @@
         [Dependency] private readonly ITaskManager _taskManager;
         [Dependency] private readonly IUriOpener _uriOpener;
         [Dependency] private readonly IUserInterfaceManager _userInterfaceManager;
+        [Dependency] private readonly IGameController _gameController;
 #pragma warning restore 649

         public static void Main(string[] args)
@@ -93,7 +95,11 @@

                 _interface.StatusLabel.Text = _loc.GetString("Ready!");
                 _interface.LaunchButton.Disabled = false;
-                _interface.LaunchButton.OnPressed += _ => LaunchClient();
+                _interface.LaunchButton.OnPressed += _ =>
+                {
+                    LaunchClient();
+                    _gameController.Shutdown();
+                };
             }
             catch (Exception e)
             {


Fixed typo in comment.

Fixed typo in comment.

--- Sandra.Chess/Position.cs
+++ Sandra.Chess/Position.cs
@@ -144,7 +144,7 @@

             if ((colorVectors[sideToMove] & targetDelta) != 0)
             {
-                // Do not allow capture of ones own pieces.
+                // Do not allow capture of one's own pieces.
                 return false;
             }


added a rectangular prism constructor

added a rectangular prism constructor

--- GeometryClassLibrary/Solids/OtherSolids/RectangularPrism.cs
+++ GeometryClassLibrary/Solids/OtherSolids/RectangularPrism.cs
@@ -15,6 +15,14 @@
         #region Properties

         #endregion
+
+        public RectangularPrism(Rectangle rectangle, Distance height) : base(_makePrismFromRectangle(rectangle, height)) { }
+
+        private static void _makePrismFromRectangle(Rectangle rectangle, Distance height)
+        {
+            var prism = rectangle.Extrude(rectangle.NormalVector * height.Inches);
+        }
+
         /// <summary>
         /// Constructs the rectangular prism between the origin and the given point as opposite corners.
         /// </summary>


Added nospam functions

Added nospam functions

--- SharpTox/ToxFunctions.cs
+++ SharpTox/ToxFunctions.cs
@@ -542,6 +542,20 @@
         }

         [DllImport("libtoxcore.dll", CallingConvention = CallingConvention.Cdecl)]
+        private static extern uint tox_get_nospam(IntPtr tox);
+        public static uint GetNospam(IntPtr tox)
+        {
+            return tox_get_nospam(tox);
+        }
+
+        [DllImport("libtoxcore.dll", CallingConvention = CallingConvention.Cdecl)]
+        private static extern void tox_get_nospam(IntPtr tox, uint nospam);
+        public static void SetNospam(IntPtr tox, uint nospam)
+        {
+            tox_get_nospam(tox, nospam);
+        }
+
+        [DllImport("libtoxcore.dll", CallingConvention = CallingConvention.Cdecl)]
         private static extern IntPtr tox_wait_data_size();
         public static IntPtr WaitDataSize()
         {


remove a unnecessary method

remove a unnecessary method

--- CommandInterface/Utility/ProjectConstructor.cs
+++ CommandInterface/Utility/ProjectConstructor.cs
@@ -21,16 +21,6 @@
         public FileInfo SolutionPath { get; set; }
         public FileInfo CommandInterfaceProject { get; set; }

-        public Guid GetProjectGuid(FileInfo projectFile)
-        {
-            using (var reader = projectFile.OpenText())
-            {
-                var xdoc = XDocument.Load(reader);
-                var guidString = xdoc.Descendants().Where(e => e.Name.LocalName == "ProjectGuid").First().Value;
-                return Guid.Parse(guidString);
-            }
-        }
-
         public void CreateProject(string baseName, DirectoryInfo projectRoot, List<FileInfo> fileList)
         {
             var solutionPath = MakeFileInfo(projectRoot, baseName + ".sln");
@@ -41,7 +31,7 @@
             var mainSourceCode = MakeFileInfo(projectRoot, "Program.cs");
             var projectGuid = Guid.NewGuid();
             var projectRelativePath = GetRelativePath(CommandInterfaceProject.FullName, projectRoot.FullName);
-            var commandInterfaceProjectGuid = GetProjectGuid(CommandInterfaceProject);
+            var commandInterfaceProjectGuid = ProjectInfo.ReadProjectGuid(CommandInterfaceProject);

             CreateFile(projectPath, LoadAndWriteXml(ProjectTemplates.BasicTemplate, xdoc => {
                 var rootNamespace = xdoc.Root.Name.Namespace;


Use NumberSyntax class for Org instruction assembly.

--- SimpSim.NET/Assembler.cs
+++ SimpSim.NET/Assembler.cs
@@ -114,10 +114,10 @@

         private void Org(string[] operands)
         {
-            AddressSyntax address;
-
-            if (AddressSyntax.TryParseAddress(operands[0], out address))
-                _instructionBytes.OriginAddress = address.Value;
+            byte number;
+
+            if (NumberSyntax.TryParseNumber(operands[0], out number))
+                _instructionBytes.OriginAddress = number;
         }

         private void Jmp(string[] operands)


fixed branch name

fixed branch name

--- CommandRunner/Controllers/WebHookController.cs
+++ CommandRunner/Controllers/WebHookController.cs
@@ -54,13 +54,14 @@
     {

       String eventType = parameter.GetValue("event_name").ToString();
-      Console.WriteLine(parameter.ToString());
+      Console.WriteLine("EventName:" + eventType);
       String branch = parameter.GetValue("ref").ToString();
+      branch = branch.Replace("refs/heads/", String.Empty);
+      Console.WriteLine("Push Branch:" + branch);

       String defaultBranch = parameter.GetValue("project").Value<String>("default_branch");
-

-      Console.WriteLine(defaultBranch);
+      Console.WriteLine("Default Branch:" + defaultBranch);

       if (String.IsNullOrEmpty(taskName))
       {
@@ -69,10 +70,11 @@

       if (eventType == "push" && branch == defaultBranch)
       {
+        JsonFileHelper jfh = new JsonFileHelper();
+        TaskModel task = await jfh.Read(taskName);
+        RunTask(task.Commands);
       }
-      JsonFileHelper jfh = new JsonFileHelper();
-      TaskModel task = await jfh.Read(taskName);
-      RunTask(task.Commands);
+
       return true;
     }


Unset ready status when opening character setup (#522)

* Close character setup when joining the game

* Unready when opening character setup instead

--- Content.Client/GameTicking/ClientGameTicker.cs
+++ Content.Client/GameTicking/ClientGameTicker.cs
@@ -220,6 +220,7 @@

             _lobby.CharacterPreview.CharacterSetupButton.OnPressed += args =>
             {
+                SetReady(false);
                 _userInterfaceManager.StateRoot.RemoveChild(_lobby);
                 _userInterfaceManager.StateRoot.AddChild(_characterSetup);
             };
@@ -237,17 +238,22 @@

             _lobby.ReadyButton.OnToggled += args =>
             {
-                if (_gameStarted)
-                {
-                    return;
-                }
-
-                _console.ProcessCommand($"toggleready {args.Pressed}");
+                SetReady(args.Pressed);
             };

             _lobby.LeaveButton.OnPressed += args => _console.ProcessCommand("disconnect");

             _updatePlayerList();
+        }
+
+        private void SetReady(bool newReady)
+        {
+            if (_gameStarted)
+            {
+                return;
+            }
+
+            _console.ProcessCommand($"toggleready {newReady}");
         }

         private void _joinGame(MsgTickerJoinGame message)


Fixes bugs where it was assumed there was only one leader per org unit, or only one child per org unit

--- Core.ApplicationServices/DriveReportService.cs
+++ Core.ApplicationServices/DriveReportService.cs
@@ -297,62 +297,48 @@
             var currentTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

             var leaderEmpl = _employmentRepository.AsQueryable().Where(e => e.Person.Id == leaderId && e.IsLeader).ToList();
-            if (leaderEmpl.Any())
-            {
-                // Iterate all employments belonging to the leader.
-                foreach (var employment in leaderEmpl)
-                {
-                    // Get the orgunit of the empl.
-                    var orgUnitId = employment.OrgUnit.Id;
-
-                    if (getReportsWhereSubExists)
-                    {
-                        // Get the leader of the childOrg if one exists.
-                        var childOrg = _orgUnitRepository.AsQueryable().SingleOrDefault(o => o.ParentId == orgUnitId);
-                        if (childOrg != null)
-                        {
-                            var childEmpl = _employmentRepository.AsQueryable().SingleOrDefault(e => e.IsLeader && e.OrgUnit.Id == childOrg.Id);
-                            if (childEmpl != null)
-                            {
-                                // Get and add all reports belonging to the leader of the child org.
-                                var childLeader = childEmpl.Person;
-                                var childLeaderReports = repo.AsQueryable().Where(dr => dr.Person.Id == childLeader.Id && dr.Employment.OrgUnit.Id == childOrg.Id);
-                                result.AddRange(childLeaderReports);
-                            }
-                        }
-                        result.AddRange(
-                            repo.AsQueryable()
-                                .Where(dr => dr.Employment.OrgUnit.Id == orgUnitId && dr.Person.Id != leaderId));
-                    }
-                    else
-                    {
-                        if (!(_substituteRepository.AsQueryable().Any(s => s.Person.Id == leaderId && s.StartDateTimestamp < currentTimestamp && s.EndDateTimestamp > currentTimestamp && s.OrgUnit.Id == orgUnitId)))
-                        {
-                            // Get the leader of the childOrg if one exists.
-                            var childOrg = _orgUnitRepository.AsQueryable().SingleOrDefault(o => o.ParentId == orgUnitId);
-                            if (childOrg != null)
-                            {
-                                var childEmpl = _employmentRepository.AsQueryable().SingleOrDefault(e => e.IsLeader && e.OrgUnit.Id == childOrg.Id);
-                                if (childEmpl != null)
-                                {
-                                    // Get and add all reports belonging to the leader of the child org.
-                                    var childLeader = childEmpl.Person;
-                                    var childLeaderReports = repo.AsQueryable().Where(dr => dr.Person.Id == childLeader.Id && dr.Employment.OrgUnit.Id == childOrg.Id);
-                                    result.AddRange(childLeaderReports);
-                                }
-                            }
-                            result.AddRange(
-                                repo.AsQueryable()
-                                    .Where(dr => dr.Employment.OrgUnit.Id == orgUnitId && dr.Person.Id != leaderId));
-                        }
-                    }
-
-
+
+            // Iterate all employments belonging to the leader.
+            foreach (var employment in leaderEmpl)
+            {
+                // Get the orgunit of the empl.
+                var orgUnitId = employment.OrgUnit.Id;
+
+                if (getReportsWhereSubExists)
+                {
+                    AddReportsOfOrgAndChildOrgLeaders(repo, orgUnitId, leaderId, result);
+                }
+                else
+                {
+                    if (!(_substituteRepository.AsQueryable().Any(s => s.Person.Id == leaderId && s.StartDateTimestamp < currentTimestamp && s.EndDateTimestamp > currentTimestamp && s.OrgUnit.Id == orgUnitId)))
+                    {
+                        AddReportsOfOrgAndChildOrgLeaders(repo, orgUnitId, leaderId, result);
+                    }
                 }
             }

             return result.AsQueryable();
         }

+        private void AddReportsOfOrgAndChildOrgLeaders(IQueryable<DriveReport> repo, int orgUnitId, int leaderId, List<DriveReport> driveReportList)
+        {
+            //The reports for the leaders of the child org units should also be approved
+            var childOrgs = _orgUnitRepository.AsQueryable().Where(o => o.ParentId == orgUnitId).ToList(); //to list to force a data reader to close
+            foreach (var childOrg in childOrgs)
+            {
+                var org = childOrg;
+                var childEmpls = _employmentRepository.AsQueryable().Where(e => e.IsLeader && e.OrgUnit.Id == org.Id).ToList();
+                foreach (var childEmpl in childEmpls)
+                {
+                    // Get and add all reports belonging to the leader of the child org.
+                    var childLeader = childEmpl.Person;
+                    var childLeaderReports = repo.AsQueryable().Where(dr => dr.Person.Id == childLeader.Id && dr.Employment.OrgUnit.Id == org.Id);
+                    driveReportList.AddRange(childLeaderReports);
+                }
+            }
+            driveReportList.AddRange(
+                repo.AsQueryable()
+                    .Where(dr => dr.Employment.OrgUnit.Id == orgUnitId && dr.Person.Id != leaderId));
+        }
     }
 }


Fix NullReference

Fix NullReference

--- Core/Simulation/Grid/Influence/LSInfluencer.cs
+++ Core/Simulation/Grid/Influence/LSInfluencer.cs
@@ -44,6 +44,9 @@
 			if (Body.PositionChangedBuffer) {
 				tempNode = GridManager.GetNode (Body._position.x, Body._position.y);

+				if (tempNode.IsNull())
+					return;
+
 				if (System.Object.ReferenceEquals (tempNode, LocatedNode) == false) {
                     LocatedNode.Remove (this);
 					 tempNode.Add (this);


await 最適化

await 最適化

--- Demo/2018/AsyncInternal/AwaitCodeGeneration.cs
+++ Demo/2018/AsyncInternal/AwaitCodeGeneration.cs
@@ -6,7 +6,7 @@
 {
     class AwaitCodeGeneration
     {
-        // Step7: 戻り値は TaskCompletionSouce 越しに返す
+        // 最適化: 未完了 Task だけを ContinueWith、終わったあと null 上書き
         public static Task<IEnumerable<string>> GetContents()
         {
             var state = 0;
@@ -29,17 +29,25 @@
                 }
                 state = 1;
                 tIndexes = GetIndex();
-                tIndexes.ContinueWith(_ => a());
-                return;
+                if (!tIndexes.IsCompleted)
+                {
+                    tIndexes.ContinueWith(_ => a());
+                    return;
+                }
                 Case1:
                 var indexes = tIndexes.Result;
+                tIndexes = null;

                 state = 2;
                 tSelectedIndexes = SelectIndex(indexes);
-                tSelectedIndexes.ContinueWith(_ => a());
-                return;
+                if (!tSelectedIndexes.IsCompleted)
+                {
+                    tSelectedIndexes.ContinueWith(_ => a());
+                    return;
+                }
                 Case2:
                 var selectedIndexes = tSelectedIndexes.Result;
+                tSelectedIndexes = null;

                 contents = new List<string>();
                 e = selectedIndexes.GetEnumerator();
@@ -48,10 +56,15 @@
                 BeginLoop:
                 state = 3;
                 tContent = GetContent(e.Current);
-                tContent.ContinueWith(_ => a());
-                return;
+                if (!tContent.IsCompleted)
+                {
+                    tContent.ContinueWith(_ => a());
+                    return;
+                }
                 Case3:
                 var content = tContent.Result;
+                tContent = null;
+
                 contents.Add(content);
                 EndLoop:
                 if (e.MoveNext()) goto BeginLoop;


Bring UseLogger back.

Bring UseLogger back.

--- ExRam.Gremlinq.Core/GremlinQueryEnvironment.cs
+++ ExRam.Gremlinq.Core/GremlinQueryEnvironment.cs
@@ -53,6 +53,11 @@
             return source.ConfigureExecutionPipeline(_ => pipeline);
         }

+        public static IGremlinQueryEnvironment UseLogger(this IGremlinQueryEnvironment source, ILogger logger)
+        {
+            return source.ConfigureLogger(_ => logger);
+        }
+
         public static readonly IGremlinQueryEnvironment Empty = new GremlinQueryEnvironmentImpl(
             GraphModel.Empty,
             GremlinQueryExecutionPipeline.Empty,


Synchronized dev device wizard with GSF

Synchronized dev device wizard with GSF

--- Source/Applications/openHistorian/openHistorian/wwwroot/AddSynchrophasorDeviceDev.cshtml
+++ Source/Applications/openHistorian/openHistorian/wwwroot/AddSynchrophasorDeviceDev.cshtml
@@ -530,21 +530,69 @@
             setTimeout(function () { $("#loadingDataLabel").css("visibility", "hidden"); }, 500);
         }

-        function phaseEndsWith(phaseLabel, phaseMatches) {
+        @{ /* Make sure any updates to phase guessing is synchronized with "InputWizardDevices.cs" in the "GSF.PhasorProtocol.UI.WPF" assembly */ }
+        function phaseMatchExact(phaseLabel, phaseMatches) {
             for (let i = 0; i < phaseMatches.length; i++) {
-                if (phaseLabel.endsWith(phaseMatches[i]))
+                if (phaseLabel === phaseMatches[i])
                     return true;
             }

             return false;
         }

-        function phaseMatchHighConfidence(phaseLabel, phaseMatches) {
+        function phaseEndsWith(phaseLabel, phaseMatches, ignoreCase) {
+            if (ignoreCase)
+                phaseLabel = phaseLabel.toUpperCase();
+
             for (let i = 0; i < phaseMatches.length; i++) {
-                const match = phaseMatches[i];
+                let phaseMatch = phaseMatches[i];
+
+                if (ignoreCase)
+                    phaseMatch = phaseMatch.toUpperCase();
+
+                if (phaseLabel.endsWith(phaseMatch))
+                    return true;
+            }
+
+            return false;
+        }
+
+        function phaseContains(phaseLabel, phaseMatches, ignoreCase) {
+            if (ignoreCase)
+                phaseLabel = phaseLabel.toUpperCase();
+
+            for (let i = 0; i < phaseMatches.length; i++) {
+                let phaseMatch = phaseMatches[i];
+
+                if (ignoreCase)
+                    phaseMatch = phaseMatch.toUpperCase();
+
+                if (phaseLabel.indexOf(phaseMatch) > -1)
+                    return true;
+            }
+
+            return false;
+        }
+
+        function phaseMatchHighConfidence(phaseLabel, containsMatches, endsWithMatches) {
+            if (phaseEndsWith(phaseLabel, containsMatches, true))
+                return true;
+
+            const matches = containsMatches.concat(endsWithMatches);
+
+            for (let i = 0; i < matches.length; i++) {
+                const match = matches[i];
                 const variations = [ " " + match, "_" + match, "-" + match, "." + match ];

-                if (phaseEndsWith(phaseLabel, variations))
+                if (phaseEndsWith(phaseLabel, variations, false))
+                    return true;
+            }
+
+            for (let i = 0; i < containsMatches.length; i++) {
+                const match = containsMatches[i];
+                const variations = [ " " + match + " ", "_" + match + "_", "-" + match + "-", "-" + match + "_", "_" + match + "-", "." + match + "." ];
+
+                if (phaseContains(phaseLabel, variations, false))
                     return true;
             }

@@ -554,42 +602,40 @@
         function phaseMatchLowConfidence(phaseLabel, phaseMatches) {
             for (let i = 0; i < phaseMatches.length; i++) {
                 const match = phaseMatches[i];
-                const variations = [ " " + match, match + " ", "_" + match, match + "_", "_" + match + "_", "." + match, match + ".", "." + match + "." ];
-
-                for (let j = 0; j < variations.length; j++) {
-                    if (phaseLabel.indexOf(variations[j]) > -1)
-                        return true;
-                }
+                const variations = [ " " + match, match + " ", "_" + match, match + "_", "_" + match + "_", "-" + match, match + "-", "-" + match + "-", "-" + match + "_", "_" + match + "-", "." + match, match + ".", "." + match + "." ];
+
+                if (phaseContains(phaseLabel, variations, true))
+                    return true;
             }

             return false;
         }

         function guessPhase(phase, phasorLabel) {
-            if (!isEmpty(phase) && phase !== "+")
+            if (!isEmpty(phase) && phase !== "+" && !phase.endsWith("?"))
                 return phase;

             // Handle high confidence phase matches when no phase is defined or when phase is "+" - since positive sequence is often default value, it's treated with suspicion
             if (isEmpty(phase) || phase === "+") {
-                if (phaseMatchHighConfidence(phasorLabel, [ "V1", "I1", "POS", "V1PM", "I1PM", "PS", "PSV", "PSI" ]) || phaseEndsWith(phasorLabel, [ "+SV", "+SI", "+V", "+I" ]))
+                if (phaseMatchExact(phasorLabel, [ "V1PM", "I1PM" ]) || phaseMatchHighConfidence(phasorLabel, [ "V1", "I1" ], [ "POS", "V1PM", "I1PM", "PS", "PSV", "PSI" ]) || phaseEndsWith(phasorLabel, [ "+SV", "+SI", "+V", "+I" ], true))
                     return "+";

-                if (phaseMatchHighConfidence(phasorLabel, [ "V0", "I0", "ZERO", "ZPV", "ZPI", "VSPM", "VZPM", "IZPM", "ZS", "ZSV", "ZSI" ]) || phaseEndsWith(phasorLabel, [ "0SV", "0SI" ]))
+                if (phaseMatchExact(phasorLabel, [ "V0PM", "I0PM", "VZPM", "IZPM" ]) || phaseMatchHighConfidence(phasorLabel, ["V0", "I0"], [ "ZERO", "ZPV", "ZPI", "VSPM", "V0PM", "I0PM", "VZPM", "IZPM", "ZS", "ZSV", "ZSI" ]) || phaseEndsWith(phasorLabel, [ "0SV", "0SI" ], true))
                     return "0";

-                if (phaseMatchHighConfidence(phasorLabel, [ "VA", "IA", "APV", "API", "VAPM", "IAPM", "AV", "AI" ]))
+                if (phaseMatchExact(phasorLabel, [ "VAPM", "IAPM" ]) || phaseMatchHighConfidence(phasorLabel, [ "VA", "IA" ], [ "APV", "API", "VAPM", "IAPM", "AV", "AI" ]))
                     return "A";

-                if (phaseMatchHighConfidence(phasorLabel, [ "VB", "IB", "BPV", "BPI", "VBPM", "IBPM", "BV", "BI" ]))
+                if (phaseMatchExact(phasorLabel, [ "VBPM", "IBPM" ]) || phaseMatchHighConfidence(phasorLabel, [ "VB", "IB" ], [ "BPV", "BPI", "VBPM", "IBPM", "BV", "BI" ]))
                     return "B";

-                if (phaseMatchHighConfidence(phasorLabel, [ "VC", "IC", "CPV", "CPI", "VCPM", "ICPM", "CV", "CI" ]))
+                if (phaseMatchExact(phasorLabel, [ "VCPM", "ICPM" ]) || phaseMatchHighConfidence(phasorLabel, [ "VC", "IC" ], [ "CPV", "CPI", "VCPM", "ICPM", "CV", "CI" ]))
                     return "C";

-                if (phaseMatchHighConfidence(phasorLabel, [ "VN", "IN", "NEUT", "NPV", "NPI", "VNPM", "INPM", "NV", "NI" ]))
+                if (phaseMatchExact(phasorLabel, [ "VNPM", "INPM" ]) || phaseMatchHighConfidence(phasorLabel, [ "VN", "IN" ], [ "NEUT", "NPV", "NPI", "VNPM", "INPM", "NV", "NI" ]))
                     return "N";

-                if (phaseMatchHighConfidence(phasorLabel, [ "V2", "I2", "NEG", "-SV", "-SI", "V2PM", "I2PM", "NS", "NSV", "NSI" ]) || phaseEndsWith(phasorLabel, [ "-V", "-I" ]))
+                if (phaseMatchExact(phasorLabel, [ "V2PM", "I2PM" ]) || phaseMatchHighConfidence(phasorLabel, [ "V2", "I2" ], [ "NEG", "-SV", "-SI", "V2PM", "I2PM", "NS", "NSV", "NSI" ]))
                     return "-";
             }

@@ -614,11 +660,36 @@
                 if (phaseMatchLowConfidence(phasorLabel, [ "VN", "IN", "NEUT", "NPV", "NPI", "VNPM", "INPM", "NV", "NI" ]))
                     return "N?";

+                if (phaseMatchLowConfidence(phasorLabel, [ "V2", "I2", "NEG", "-SV", "-SI", "V2PM", "I2PM", "NS", "NSV", "NSI" ]))
+                    return "-?";
+
+                // Test for contains after checks with separators
+                if (phaseContains(phasorLabel, ["V1", "I1", "POS", "V1PM", "I1PM", "PS", "PSV", "PSI", "+SV", "+SI", "+V", "+I"], true))
+                    return "+?";
+
+                if (phaseContains(phasorLabel, ["V0", "I0", "ZERO", "ZPV", "ZPI", "VSPM", "VZPM", "IZPM", "ZS", "ZSV", "ZSI", "0SV", "0SI"], true))
+                    return "0?";
+
+                if (phaseContains(phasorLabel, ["VA", "IA", "APV", "API", "VAPM", "IAPM", "AV", "AI"], true))
+                    return "A?";
+
+                if (phaseContains(phasorLabel, ["VB", "IB", "BPV", "BPI", "VBPM", "IBPM", "BV", "BI"], true))
+                    return "B?";
+
+                if (phaseContains(phasorLabel, [ "VC", "IC", "CPV", "CPI", "VCPM", "ICPM", "CV", "CI" ], true))
+                    return "C?";
+
+                if (phaseContains(phasorLabel, ["VN", "IN", "NEUT", "NPV", "NPI", "VNPM", "INPM", "NV", "NI"], true))
+                    return "N?";
+
+                if (phaseContains(phasorLabel, ["V2", "I2", "NEG", "-SV", "-SI", "V2PM", "I2PM", "NS", "NSV", "NSI"], true))
+                    return "-?";
+
                 // -V and -I may match too often, so check these last
-                if (phaseMatchLowConfidence(phasorLabel, [ "V2", "I2", "NEG", "-SV", "-SI", "V2PM", "I2PM", "NS", "NSV", "NSI", "-V", "-I" ]))
+                if (phaseMatchLowConfidence(phasorLabel, ["-V", "-I"]) || phaseContains(phasorLabel, ["-V", "-I"], true))
                     return "-?";

-                return "?";
+                return "+?";
             }

             return phase;
@@ -628,7 +699,7 @@
             if (!isEmpty(nominalVoltage) && nominalVoltage !== 0)
                 return nominalVoltage;

-            const commonVoltageLevels = ["69", "115", "138", "161", "230", "345", "500", "765"];
+            const commonVoltageLevels = [ "44", "69", "115", "138", "161", "169", "230", "345", "500", "765", "1100" ];

             // Check phasor label before device
             for (let i = 0; i < commonVoltageLevels.length; i++) {
@@ -1153,6 +1224,13 @@
                 for (let i = 0; i < deviceCount; i++) {
                     const cell = self.configFrame().Cells[i];

+                    // TODO: Update screen to accomodate lat/long at the device level
+                    if (!isEmpty(cell.Latitude))
+                        self.latitude(cell.Latitude);
+
+                    if (!isEmpty(cell.Longitude))
+                        self.longitude(cell.Longitude);
+
                     let cellAcronym = cell.IDLabel;

                     if (isEmpty(cellAcronym))
@@ -1221,6 +1299,9 @@
                         return {
                             ID: cell.ID,
                             ParentID: cell.ParentID,
+                            UniqueID: cell.UniqueID,
+                            Longitude: cell.Longitude,
+                            Latitude: cell.Latitude,
                             IDCode: cell.IDCode,
                             StationName: self.configFrame().Cells.length === 1 ? self.deviceName() : cell.IDLabel(),
                             IDLabel: cell.IDLabel(),
@@ -1437,8 +1518,8 @@
                 voltage.Phase.extend({
                     required: true,
                     pattern: {
-                        message: "Must be one of: A, B, C, 0, +, - or N",
-                        params: "^[A-C0+\\-N]$"
+                        message: "Must be one of: A, B, C, 0, +, -, N or L",
+                        params: "^[A-C0+\\-NL]$"
                     }
                 });

@@ -2289,11 +2370,8 @@
                                 powerCalculation.CurrentMagSignalID = iphmID;
                                 powerCalculation.Enabled = true;

-                                // For direct phase power calculations, do not apply voltage adjustment strategy
-                                if (phase === "A" || phase === "B" || phase === "C")
-                                    powerCalculation.CircuitDescription = circuitDescription + "; AdjustmentStrategy = None";
-                                else
-                                    powerCalculation.CircuitDescription = circuitDescription;
+                                // For all phase power calculations, do not apply any voltage adjustment strategy
+                                powerCalculation.CircuitDescription = circuitDescription + "; AdjustmentStrategy = None";

                                 if (powerCalculation.ID === 0) {
                                     return phasorHub.addNewPowerCalculation(powerCalculation).fail(function (error) {
@@ -2405,7 +2483,7 @@
                 attempt = 1;

             if (attempt > 4) {
-                showErrorMessage("Failed to find power output measurement after waiting 4 seconds - skipping 3-phase power calculations.");
+                showErrorMessage("Failed to find power output measurement after waiting 12 seconds - skipping 3-phase power calculations.");
                 return $.Deferred().resolve(null).promise();
             }

@@ -2422,17 +2500,17 @@
                     switch (type) {
                         case "MW":
                             if (powerCalculation.ActivePowerOutputSignalID == null || powerCalculation.ActivePowerOutputSignalID === 0)
-                                return delayedPromise(1000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });
+                                return delayedPromise(3000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });

                             return $.Deferred().resolve(powerCalculation.ActivePowerOutputSignalID).promise();
                         case "MVAR":
                             if (powerCalculation.ReactivePowerOutputSignalID == null || powerCalculation.ReactivePowerOutputSignalID === 0)
-                                return delayedPromise(1000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });
+                                return delayedPromise(3000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });

                             return $.Deferred().resolve(powerCalculation.ReactivePowerOutputSignalID).promise();
                         case "MVA":
                             if (powerCalculation.ApparentPowerOutputSignalID == null || powerCalculation.ApparentPowerOutputSignalID === 0)
-                                return delayedPromise(1000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });
+                                return delayedPromise(3000).then(function () { return queryPowerOutput(type, linePhase, ++attempt); });

                             return $.Deferred().resolve(powerCalculation.ApparentPowerOutputSignalID).promise();
                     }
@@ -2470,7 +2548,7 @@
                 let phaseBSignalID = null;
                 let phaseCSignalID = null;

-                // These queries will keep looping while power calculations are initializing until power output measurements exist or timeout after 4 seconds:
+                // These queries will keep looping while power calculations are initializing until power output measurements exist or timeout after 12 seconds:
                 queryPromises.push(queryPowerOutput(type, line.A, 1).then(function (signalID) {
                     phaseASignalID = signalID;
                 }));
@@ -2994,7 +3072,7 @@

             const templateType = viewModel.templateType();

-            if (templateType.toUpperCase() === "NONE")
+            if (templateType.toUpperCase().startsWith("NONE:"))
                 return $.Deferred().resolve().promise();

             const calcSignalType = getDeviceSignalType("CALC");
@@ -3130,6 +3208,9 @@

                                 // Check if this is a new device or an edit to an existing one
                                 if (device.ID === 0) {
+                                    if (!isEmpty(cell.UniqueID))
+                                        device.UniqueID = cell.UniqueID;
+
                                     // Add new device record
                                     return phasorHub.addNewDevice(device).then(function () {
                                         // Get newly added device with auto-incremented ID
@@ -4087,7 +4168,7 @@

-                            <input type="text" class="form-control" maxlength="1" style="width: 37px; margin-left: 3px" onclick="this.select()" data-bind="upperCase: Phase, textInput: Phase, style: { width: Phase.isValid() ? '37px' : '70px' }, selectOnError: Phase, enable: Enabled" placeholder="Ø" required>
+                            <input type="text" class="form-control" maxlength="1" style="width: 37px; margin-left: 3px" onclick="this.select()" data-bind="upperCase: Phase, textInput: Phase, style: { width: Phase.isValid() ? '37px' : '75px' }, selectOnError: Phase, enable: Enabled" placeholder="Ø" required>

@@ -4156,7 +4237,7 @@

-                            <input type="text" class="form-control" maxlength="1" style="width: 37px; margin-left: 3px" onclick="this.select()" data-bind="upperCase: Phase, textInput: Phase, style: { width: Phase.isValid() ? '37px' : '70px' }, selectOnError: Phase, enable: Enabled" placeholder="Ø" required>
+                            <input type="text" class="form-control" maxlength="1" style="width: 37px; margin-left: 3px" onclick="this.select()" data-bind="upperCase: Phase, textInput: Phase, style: { width: Phase.isValid() ? '37px' : '75px' }, selectOnError: Phase, enable: Enabled" placeholder="Ø" required>


Added log message if both server does not support the same hash algo

--- FluentFTP/Client/FtpClient_FileVerification.cs
+++ FluentFTP/Client/FtpClient_FileVerification.cs
@@ -120,6 +120,10 @@

 				return sourceHash.Value == destinationHash.Value;
 			}
+			else
+			{
+				LogLine(FtpTraceLevel.Info, "Source and Destination does not support the same hash algorythm");
+			}

 			//Not supported return true to ignore validation
 			return true;


Update ExchangeRatesContext.cs

Update ExchangeRatesContext.cs

--- TIKSN.Framework.Core/Finance/ForeignExchange/EntityFrameworkCore/ExchangeRatesContext.cs
+++ TIKSN.Framework.Core/Finance/ForeignExchange/EntityFrameworkCore/ExchangeRatesContext.cs
@@ -4,12 +4,12 @@
 {
     public class ExchangeRatesContext : DbContext
     {
-        public virtual DbSet<ExchangeRateEntity> ExchangeRates { get; set; }
-        public virtual DbSet<ForeignExchangeEntity> ForeignExchanges { get; set; }
-
         public ExchangeRatesContext(DbContextOptions<ExchangeRatesContext> dbContextOptions) : base(dbContextOptions)
         {
         }
+
+        public virtual DbSet<ExchangeRateEntity> ExchangeRates { get; set; }
+        public virtual DbSet<ForeignExchangeEntity> ForeignExchanges { get; set; }

         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
@@ -53,4 +53,4 @@
             });
         }
     }
-}+}


 //var performanceLastRequest = performance.getEntriesByName(location.origin + this.url);

                            //var timeInMilliseconds = performanceLastRequest[0].responseStart - performanceLastRequest[0].requestStart;
                            //$("#result").append(timeInMilliseconds + ' upload of ' + currentDownloadLength + '<br />');

--- AdvancedNetToolsSolution/AntWeb/Views/Speedtest/Index.cshtml
+++ AdvancedNetToolsSolution/AntWeb/Views/Speedtest/Index.cshtml
@@ -39,9 +39,10 @@
                         async: false,
                         url: "/speedtest/download?downloadLength=" + currentDownloadLength + "&marker=" + marker,
                         success: function f(id) {
-                            var performanceLastRequest = performance.getEntriesByName(location.origin + this.url);
-                            var timeInMilliseconds = performanceLastRequest[0].responseEnd - performanceLastRequest[0].responseStart;
-                            $("#result").append(timeInMilliseconds + ' download of ' + currentDownloadLength + '
');
+                            $("#result").append(' download of ' + currentDownloadLength + '
');
+                            //var performanceLastRequest = performance.getEntriesByName(location.origin + this.url);
+                            //var timeInMilliseconds = performanceLastRequest[0].responseEnd - performanceLastRequest[0].responseStart;
+                            //$("#result").append(timeInMilliseconds + ' download of ' + currentDownloadLength + '
');
                         }
                     })
                 }
@@ -72,9 +73,10 @@
                         url: "/speedtest/upload?marker=" + marker,
                         data: { uploadString: uploadString },
                         success: function f(id) {
-                            var performanceLastRequest = performance.getEntriesByName(location.origin + this.url);
-                            var timeInMilliseconds = performanceLastRequest[0].responseStart - performanceLastRequest[0].requestStart;
-                            $("#result").append(timeInMilliseconds + ' upload of ' + currentDownloadLength + '
');
+                            $("#result").append(' upload of ' + currentDownloadLength + '
');
+                            //var performanceLastRequest = performance.getEntriesByName(location.origin + this.url);
+                            //var timeInMilliseconds = performanceLastRequest[0].responseStart - performanceLastRequest[0].requestStart;
+                            //$("#result").append(timeInMilliseconds + ' upload of ' + currentDownloadLength + '
');
                         }
                     });
                 }


Only rebuild the printers list for name changes

--- ActionBar/PrinterSelector.cs
+++ ActionBar/PrinterSelector.cs
@@ -122,10 +122,9 @@
 				if (ProfileManager.Instance.ActiveProfile != null)
 				{
 					ProfileManager.Instance.ActiveProfile.Name = ActiveSliceSettings.Instance.GetValue(SettingsKey.printer_name);
+					Rebuild();
 				}
 			}
-
-			Rebuild();
 		}

 		public override void OnClosed(EventArgs e)


--HG--
extra : convert_revision : svn%3A755fb503-1302-0b44-8f45-eece28f159d8/trunk%40102

--- solution/NearForums.Web/State/SessionWrapper.cs
+++ solution/NearForums.Web/State/SessionWrapper.cs
@@ -15,6 +15,7 @@
 			set;
 		}

+		#region Get / Set to session
 		public T GetItem<T>(string key)
 		{
 			return (T)Session[key];
@@ -52,10 +53,12 @@
 			Session = session;
 		}

-		public SessionWrapper(HttpContextBase context) : this(context.Session)
+		public SessionWrapper(HttpContextBase context)
+			: this(context.Session)
 		{

-		}
+		}
+		#endregion

 		#region Props
 		/// <summary>


Bug fix

Bug fix

--- Agilent4156C/Agilent4156C.cs
+++ Agilent4156C/Agilent4156C.cs
@@ -154,7 +154,7 @@
             }
             else
             {
-                string[] units = new[] { "SMU1", "SMU2", "SMU3", "SMU4", "VSU1", "VSU2", "VMU1", "VMU2" };
+                string[] units = new[] { null, "SMU1", "SMU2", "SMU3", "SMU4", "VSU1", "VSU2", "VMU1", "VMU2" };
                 for (int i = 1; i <= 8; i++)
                 {
                     if (exceptUnits.Contains(i)) continue;


Fix commit 943e9a409575c26c258a5cdfc98ff205e866f22f

--- Algo/BasketMessageAdapter.cs
+++ Algo/BasketMessageAdapter.cs
@@ -1549,6 +1549,14 @@
 		private void ProcessOrderMessage(long transId, long originId, Message message)
 		{
 			if (!_orderAdapters.TryGetValue(originId, out var adapter))
+			{
+				if (message is OrderMessage ordMsg && !ordMsg.PortfolioName.IsEmpty())
+					adapter = GetAdapter(ordMsg.PortfolioName, message, out _);
+				else if (message is OrderPairReplaceMessage pairMsg)
+					adapter = GetAdapter(pairMsg.Message1.PortfolioName, message, out _);
+			}
+
+			if (adapter == null)
 			{
 				this.AddErrorLog(LocalizedStrings.UnknownTransactionId, originId);


BasketMessageAdapter. Fix online subscription processing.


added additional scope check for refresh token

--- source/Core/Validation/TokenRequestValidator.cs
+++ source/Core/Validation/TokenRequestValidator.cs
@@ -554,6 +554,25 @@
                 }
             }

+            /////////////////////////////////////////////
+            // check if client still has access to
+            // all scopes from the original token request
+            /////////////////////////////////////////////
+            if (!_validatedRequest.Client.AllowAccessToAllScopes)
+            {
+                foreach (var scope in _validatedRequest.RefreshToken.Scopes)
+                {
+                    if (!_validatedRequest.Client.AllowedScopes.Contains(scope))
+                    {
+                        var error = "Client does not have access to a requested scope anymore: " + scope;
+                        LogError(error);
+                        await RaiseRefreshTokenRefreshFailureEventAsync(refreshTokenHandle, error);
+
+                        return Invalid(Constants.TokenErrors.InvalidGrant);
+                    }
+                }
+            }
+
             _validatedRequest.RefreshToken = refreshToken;

             /////////////////////////////////////////////


refs #24 Add a documentation comment for MemberClickEventArgs

--- Application/MatchGenerator/ViewModel/MemberClickEventArgs.cs
+++ Application/MatchGenerator/ViewModel/MemberClickEventArgs.cs
@@ -6,6 +6,9 @@

 namespace MatchGenerator.ViewModel
 {
+	/// <summary>
+	/// リスト中のメンバーがクリックされた時のイベントデータを格納する.
+	/// </summary>
 	class MemberClickEventArgs : EventArgs
 	{
 	}


Throw Exception if GetValidTargets is not overriden

--- Assets/Scripts/HarryPotterUnity/Cards/Generic/GenericCard.cs
+++ Assets/Scripts/HarryPotterUnity/Cards/Generic/GenericCard.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using HarryPotterUnity.Cards.Generic.Interfaces;
 using HarryPotterUnity.Cards.Generic.PlayRequirements;
@@ -274,7 +275,13 @@

         public virtual List<GenericCard> GetValidTargets()
         {
-            return  new List<GenericCard>();
+            if (_inputRequired == 0)
+            {
+                return new List<GenericCard>();
+            }
+
+            throw new NotSupportedException("Card with input did not define valid targets");
+
         }

         protected virtual bool MeetsAdditionalPlayRequirements()


translation component update

translation component update

--- Assets/Scripts/System/Lib/Translation/TranslationProvider.cs
+++ Assets/Scripts/System/Lib/Translation/TranslationProvider.cs
@@ -24,13 +24,13 @@
 				ISelector selector = app.Make("translation.selector") as ISelector;

 				tran.SetFileLoader(loader);
-				tran.SetLocale("zh");
 				tran.SetSelector(selector);
-
-				tran.SetRoot(config.Get(typeof(Translator) , "root" , null));
+
+                tran.SetLocale(config.Get(typeof(Translator), "default", "zh"));
+                tran.SetRoot(config.Get(typeof(Translator) , "root" , null));
 				tran.SetFallback(config.Get(typeof(Translator) , "fallback" , null));

-				return obj;
+                return obj;

 			});
 		}


check for null against classification target

--- BrightWire.Source/TabularData/Analysis/FrequencyCollector.cs
+++ BrightWire.Source/TabularData/Analysis/FrequencyCollector.cs
@@ -24,12 +24,15 @@

 	    public bool Process(IRow row)
         {
-            var val = row.GetField<string>(ColumnIndex);
-            if (_valueCount.TryGetValue(val, out ulong count))
-                _valueCount[val] = count + 1;
-            else
-                _valueCount.Add(val, 1);
-            ++Total;
+            var val = row.GetField<string>(ColumnIndex)?.Trim();
+	        if (val != null) {
+		        if (_valueCount.TryGetValue(val, out ulong count))
+			        _valueCount[val] = count + 1;
+		        else
+			        _valueCount.Add(val, 1);
+	        }
+
+	        ++Total;
             return true;
         }


Fixes bug in IB disconnect delay task

Fixes bug in IB disconnect delay task

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -667,11 +667,11 @@
                 {
                     if (_disconnected1100Fired)
                     {
-                        OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Error, -1, "Connect with Interactive Brokers lost. " +
+                        OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Error, -1, "Connection with Interactive Brokers lost. " +
                             "This could be because of internet connectivity issues or a log in from another location."
                             ));
                     }
-                }).Start();
+                });
             }
             else if ((int) e.ErrorCode == 1102)
             {


Use AccountValues.CashBalance key instead of net liq

Closes #200

It appears when only open forex positions are open then these values are always the same,
throwing equities into the mix causes the values to be different. Just tested against
IB demo account, now returning proper cash values

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -773,7 +773,7 @@
                 _accountProperties[e.Currency + ":" + e.Key] = e.Value;

                 // we want to capture if the user's cash changes so we can reflect it in the algorithm
-                if (e.Key == AccountValueKeys.NetLiquidationByCurrency && e.Currency != "BASE")
+                if (e.Key == AccountValueKeys.CashBalance && e.Currency != "BASE")
                 {
                     var cashBalance = decimal.Parse(e.Value, CultureInfo.InvariantCulture);
                     _cashBalances.AddOrUpdate(e.Currency, cashBalance);


首页头像问题

首页头像问题

--- CC98.VNext.AspNetCore/src/CC98.Share/Views/Home/Index.cshtml
+++ CC98.VNext.AspNetCore/src/CC98.Share/Views/Home/Index.cshtml
@@ -43,7 +43,7 @@

                 @*需要后端调用一下用户头像*@
-
+


Update tooltip for  "Include custom message classes in Outlook filter" general option, since Windows Search Service is recommended but not necessary with the dasl filter fixes.

--- CalDavSynchronizer/Ui/Options/GeneralOptionsForm.Designer.cs
+++ CalDavSynchronizer/Ui/Options/GeneralOptionsForm.Designer.cs
@@ -201,7 +201,8 @@
       this._includeCustomMessageClassesCheckBox.TabIndex = 7;
       this._includeCustomMessageClassesCheckBox.Text = "Include custom message classes in Outlook filter";
       this._toolTip.SetToolTip(this._includeCustomMessageClassesCheckBox, "Use prefix filter to include also custom message_classes in filter for Outlook fo" +
-        "lders. \r\nThis option needs Windows Search Service enabled.\r\n");
+        "lders. \r\nFor better performance, Windows Search Service shouldn\'t be deactivated" +
+        " if this option is enabled.");
       this._includeCustomMessageClassesCheckBox.UseVisualStyleBackColor = true;
       //
       // groupBox2


Issue #25. Logging in now handles user not entering a username/password properly

--- CarTracker/CarTracker.Web/Controllers/View/UserController.cs
+++ CarTracker/CarTracker.Web/Controllers/View/UserController.cs
@@ -49,6 +49,10 @@
         [Route("login")]
         public async Task<IActionResult> Login(string username, string password)
         {
+            if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password))
+            {
+                return Login(SOURCE_ERROR);
+            }
             var principal = _authenticationManager.LoginPasswordForPrincipal(username, password);
             if (null != principal)
             {