[SharpDX] Add Resource.FromMemory overloads to load textures from unmanaged memory

By avoiding byte[], and using unmanaged memory, we will have more
control over the disposal of intermediate buffers.

--- Source/SharpDX.Direct3D11/Resource.cs
+++ Source/SharpDX.Direct3D11/Resource.cs
@@ -238,6 +238,47 @@
         ///   Loads a texture from an image in memory.
         /// </summary>
         /// <param name = "device">The device used to load the texture.</param>
+        /// <param name = "pointer">Pointer to unmanaged memory containing the image data to load.</param>
+        /// <param name = "loadInfo">Specifies information used to load the texture.</param>
+        /// <returns>The loaded texture object.</returns>
+        public static T FromMemory<T>(Device device, DataPointer pointer, ImageLoadInformation loadInfo) where T : Resource
+        {
+            System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) ||
+                         typeof(T) == typeof(Texture3D));
+
+            System.Diagnostics.Debug.Assert(pointer.Pointer != IntPtr.Zero);
+            System.Diagnostics.Debug.Assert(pointer.Size > 0);
+            IntPtr temp;
+            Result resultOut;
+            D3DX11.CreateTextureFromMemory(device, pointer.Pointer, pointer.Size, loadInfo, IntPtr.Zero,
+                                           out temp, out resultOut);
+            return FromPointer<T>(temp);
+        }
+
+        /// <summary>
+        ///   Loads a texture from an image in memory.
+        /// </summary>
+        /// <param name = "device">The device used to load the texture.</param>
+        /// <param name = "pointer">Pointer to unmanaged memory containing the image data to load.</param>
+        /// <returns>The loaded texture object.</returns>
+        public static T FromMemory<T>(Device device, DataPointer pointer) where T : Resource
+        {
+            System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) ||
+                         typeof(T) == typeof(Texture3D));
+
+            System.Diagnostics.Debug.Assert(pointer.Pointer != IntPtr.Zero);
+            System.Diagnostics.Debug.Assert(pointer.Size > 0);
+            IntPtr temp;
+            Result resultOut;
+            D3DX11.CreateTextureFromMemory(device, pointer.Pointer, pointer.Size, null, IntPtr.Zero,
+                                           out temp, out resultOut);
+            return FromPointer<T>(temp);
+        }
+
+        /// <summary>
+        ///   Loads a texture from an image in memory.
+        /// </summary>
+        /// <param name = "device">The device used to load the texture.</param>
         /// <param name = "memory">Array of memory containing the image data to load.</param>
         /// <returns>The loaded texture object.</returns>
         public static Resource FromMemory(Device device, byte[] memory)
@@ -317,6 +358,74 @@
         }

         /// <summary>
+        ///   Loads a texture from an image in memory.
+        /// </summary>
+        /// <param name = "device">The device used to load the texture.</param>
+        /// <param name = "pointer">Pointer to unmanaged memory containing the image data to load.</param>
+        /// <param name = "loadInfo">Specifies information used to load the texture.</param>
+        /// <returns>The loaded texture object.</returns>
+        public static Resource FromMemory(Device device, DataPointer pointer, ImageLoadInformation loadInfo)
+        {
+            System.Diagnostics.Debug.Assert(pointer.Pointer != IntPtr.Zero);
+            System.Diagnostics.Debug.Assert(pointer.Size > 0);
+
+            IntPtr temp;
+            Result resultOut;
+            D3DX11.CreateTextureFromMemory(device, pointer.Pointer, pointer.Size, loadInfo, IntPtr.Zero, out temp, out resultOut);
+
+            var resource = new Resource(temp);
+            try
+            {
+                switch (resource.Dimension)
+                {
+                    case ResourceDimension.Texture1D: return FromPointer<Texture1D>(temp);
+                    case ResourceDimension.Texture2D: return FromPointer<Texture2D>(temp);
+                    case ResourceDimension.Texture3D: return FromPointer<Texture3D>(temp);
+                }
+            }
+            finally
+            {
+                resource.NativePointer = IntPtr.Zero;
+            }
+
+            return null;
+        }
+
+        /// <summary>
+        ///   Loads a texture from an image in memory.
+        /// </summary>
+        /// <param name = "device">The device used to load the texture.</param>
+        /// <param name = "pointer">Pointer to unmanaged memory containing the image data to load.</param>
+        /// <returns>The loaded texture object.</returns>
+        public static Resource FromMemory(Device device, DataPointer pointer)
+        {
+            System.Diagnostics.Debug.Assert(pointer.Pointer != IntPtr.Zero);
+            System.Diagnostics.Debug.Assert(pointer.Size > 0);
+
+            IntPtr temp;
+            Result resultOut;
+            D3DX11.CreateTextureFromMemory(device, pointer.Pointer, pointer.Size, null, IntPtr.Zero, out temp, out resultOut);
+
+            var resource = new Resource(temp);
+            try
+            {
+                switch (resource.Dimension)
+                {
+                    case ResourceDimension.Texture1D: return FromPointer<Texture1D>(temp);
+                    case ResourceDimension.Texture2D: return FromPointer<Texture2D>(temp);
+                    case ResourceDimension.Texture3D: return FromPointer<Texture3D>(temp);
+                }
+            }
+            finally
+            {
+                resource.NativePointer = IntPtr.Zero;
+            }
+
+            return null;
+        }
+
+
+        /// <summary>
         ///   Loads a texture from a stream of data.
         /// </summary>
         /// <param name = "device">The device used to load the texture.</param>


Small refactor of GameDetailsViewModel commands

--- source/Playnite.DesktopApp/ViewModels/GameDetailsViewModel.cs
+++ source/Playnite.DesktopApp/ViewModels/GameDetailsViewModel.cs
@@ -275,182 +275,27 @@
             }
         }

-        public RelayCommand<Guid> SetLibraryFilterCommand
-        {
-            get => new RelayCommand<Guid>((filter) =>
-            {
-                SetLibraryFilter(filter);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetPlatformFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Platform);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetPublisherFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Publishers);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetDeveloperFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Developers);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetGenreFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Genres);
-            });
-        }
-
-        public RelayCommand<DateTime?> SetReleaseDateFilterCommand
-        {
-            get => new RelayCommand<DateTime?>((filter) =>
-            {
-                SetReleaseDateFilter(filter);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetCategoryFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Categories);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetTagFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Tags);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetFeatureFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Features);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetAgeRatingCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.AgeRating);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetSeriesFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Series);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetSourceFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Source);
-            });
-        }
-
-        public RelayCommand<DatabaseObject> SetRegionFilterCommand
-        {
-            get => new RelayCommand<DatabaseObject>((filter) =>
-            {
-                SetFilter(filter, GameField.Region);
-            });
-        }
-
-        public RelayCommand<string> SetVersionFilterCommand
-        {
-            get => new RelayCommand<string>((filter) =>
-            {
-                SetVersionFilter(filter);
-            });
-        }
-
+        public RelayCommand<Guid> SetLibraryFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetPlatformFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetPublisherFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetDeveloperFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetGenreFilterCommand { get; }
+        public RelayCommand<DateTime?> SetReleaseDateFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetCategoryFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetTagFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetFeatureFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetAgeRatingCommand { get; }
+        public RelayCommand<DatabaseObject> SetSeriesFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetSourceFilterCommand { get; }
+        public RelayCommand<DatabaseObject> SetRegionFilterCommand { get; }
+        public RelayCommand<string> SetVersionFilterCommand { get; }
         public RelayCommand<Link> OpenLinkCommand { get; }
-
-        public RelayCommand<DatabaseObject> PlayCommand
-        {
-            get => new RelayCommand<DatabaseObject>((a) =>
-            {
-                Play();
-            });
-        }
-
-        public RelayCommand<object> InstallCommand
-        {
-            get => new RelayCommand<object>((a) =>
-            {
-                Install();
-            });
-        }
-
-        public RelayCommand<object> CheckSetupCommand
-        {
-            get => new RelayCommand<object>((a) =>
-            {
-                CheckSetup();
-            });
-        }
-
-        public RelayCommand<object> CheckExecutionCommand
-        {
-            get => new RelayCommand<object>((a) =>
-            {
-                CheckExecution();
-            });
-        }
-
-        public RelayCommand<object> EditGameCommand
-        {
-            get => new RelayCommand<object>((a) =>
-            {
-                EditGame();
-            });
-        }
-
-        public RelayCommand<object> ContextActionCommand
-        {
-            get => new RelayCommand<object>((a) =>
-            {
-                if (Game?.IsInstalling == true || Game?.IsUnistalling == true)
-                {
-                    CheckSetup();
-                }
-                else if (Game?.IsRunning == true || Game?.IsLaunching == true)
-                {
-                    CheckExecution();
-                }
-                else if (Game?.IsInstalled == false)
-                {
-                    Install();
-                }
-                else if(Game?.IsInstalled == true)
-                {
-                    Play();
-                }
-            });
-        }
+        public RelayCommand<DatabaseObject> PlayCommand { get; }
+        public RelayCommand<object> InstallCommand { get; }
+        public RelayCommand<object> CheckSetupCommand { get; }
+        public RelayCommand<object> CheckExecutionCommand { get; }
+        public RelayCommand<object> EditGameCommand { get; }
+        public RelayCommand<object> ContextActionCommand { get; }

         public GameDetailsViewModel(GamesCollectionViewEntry game, PlayniteSettings settings)
         {
@@ -461,6 +306,44 @@
         public GameDetailsViewModel(GamesCollectionViewEntry game, PlayniteSettings settings, DesktopGamesEditor editor, IDialogsFactory dialogs, IResourceProvider resources)
         {
             OpenLinkCommand = new RelayCommand<Link>((a) => GlobalCommands.NavigateUrl(Game.Game.ExpandVariables(a.Url)));
+            SetLibraryFilterCommand = new RelayCommand<Guid>((a) => SetLibraryFilter(a));
+            SetPlatformFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Platform));
+            SetPublisherFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Publishers));
+            SetDeveloperFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Developers));
+            SetGenreFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Genres));
+            SetReleaseDateFilterCommand = new RelayCommand<DateTime?>((a) => SetReleaseDateFilter(a));
+            SetCategoryFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Categories));
+            SetTagFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Tags));
+            SetFeatureFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Features));
+            SetAgeRatingCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.AgeRating));
+            SetSeriesFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Series));
+            SetSourceFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Source));
+            SetRegionFilterCommand = new RelayCommand<DatabaseObject>((a) => SetFilter(a, GameField.Region));
+            SetVersionFilterCommand = new RelayCommand<string>((filter) => SetVersionFilter(filter));
+            PlayCommand = new RelayCommand<DatabaseObject>((a) => Play());
+            InstallCommand = new RelayCommand<object>((a) => Install());
+            CheckSetupCommand = new RelayCommand<object>((a) => CheckSetup());
+            CheckExecutionCommand = new RelayCommand<object>((a) => CheckExecution());
+            EditGameCommand = new RelayCommand<object>((a) => EditGame());
+            ContextActionCommand = new RelayCommand<object>((a) =>
+            {
+                if (Game?.IsInstalling == true || Game?.IsUnistalling == true)
+                {
+                    CheckSetup();
+                }
+                else if (Game?.IsRunning == true || Game?.IsLaunching == true)
+                {
+                    CheckExecution();
+                }
+                else if (Game?.IsInstalled == false)
+                {
+                    Install();
+                }
+                else if (Game?.IsInstalled == true)
+                {
+                    Play();
+                }
+            });

             this.resources = resources;
             this.dialogs = dialogs;


set synced rev. nr. in assembly info

set synced rev. nr. in assembly info

git-svn-id: 98f681d7a2907ee2a41df434552134740bcc8829@73290 81fbe566-5dc4-48c1-bdea-7421811ca204

--- Source/lib/Properties/AssemblyInfo.cs
+++ Source/lib/Properties/AssemblyInfo.cs
@@ -21,7 +21,7 @@
 #if WINDOWS_PHONE71
 [assembly: AssemblyTitle("zxing.net for windows phone 7.1")]
 #endif
-[assembly: AssemblyDescription("port of the java based barcode scanning library for .net (java zxing rev. 2181)")]
+[assembly: AssemblyDescription("port of the java based barcode scanning library for .net (java zxing rev. 2196)")]
 [assembly: AssemblyCompany("ZXing.Net Developement")]
 [assembly: AssemblyProduct("ZXing.Net")]
 [assembly: AssemblyCopyright("Copyright  2012")]


SyncUtils.cs: make FUSE module load dialog more readable

Closes #21 (and bgo595283).

Signed-off-by: Alex Tereschenko <10ab4a620366487513eb6142e6429449f497066c@gmail.com>

--- Tomboy/Synchronization/SyncUtils.cs
+++ Tomboy/Synchronization/SyncUtils.cs
@@ -134,11 +134,10 @@
 			                              Gtk.ButtonsType.YesNo,
 			                              Catalog.GetString ("Enable FUSE?"),
 			                              Catalog.GetString (
-			                                      // TODO: This message isn't entirely accurate.
-			                                      //       We should fix it.
-			                                      "The synchronization you've chosen requires the FUSE module to be loaded.\n\n" +
+			                                      "The synchronization option you have chosen requires the FUSE module to be loaded.\n\n" +
 			                                      "To avoid getting this prompt in the future, you should load FUSE at startup.  " +
-			                                      "Add \"modprobe fuse\" to /etc/init.d/boot.local or \"fuse\" to /etc/modules."));
+			                                      "Add \"modprobe fuse\" to /etc/init.d/boot.local or \"fuse\" to /etc/modules.\n\n" +
+			                                      "Do you want to load the FUSE module now?"));
 			int response = dialog.Run ();
 			dialog.Destroy ();
 			if (response == (int) Gtk.ResponseType.Yes) {


Refactored MetaGesture.

Refactored MetaGesture.

--- TouchScript/Gestures/MetaGesture.cs
+++ TouchScript/Gestures/MetaGesture.cs
@@ -1,121 +1,121 @@
-/**
- * @author Valentin Simonov / http://va.lent.in/
- */
-
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace TouchScript.Gestures
-{
-    /// <summary>
-    /// Converts touchpoint events for target object into separate events to be used somewhere else.
-    /// </summary>
-    [AddComponentMenu("TouchScript/Gestures/Meta Gesture")]
-    public class MetaGesture : Gesture
-    {
-        #region Events
-
-        /// <summary>
-        /// Occurs when a touch point is added.
-        /// </summary>
-        public event EventHandler<MetaGestureEventArgs> TouchPointAdded;
-
-        /// <summary>
-        /// Occurs when a touch point is updated.
-        /// </summary>
-        public event EventHandler<MetaGestureEventArgs> TouchPointUpdated;
-
-        /// <summary>
-        /// Occurs when a touch point is removed.
-        /// </summary>
-        public event EventHandler<MetaGestureEventArgs> TouchPointRemoved;
-
-        /// <summary>
-        /// Occurs when a touch point is cancelled.
-        /// </summary>
-        public event EventHandler<MetaGestureEventArgs> TouchPointCancelled;
-
-        #endregion
-
-        #region Gesture callbacks
-
-        protected override void touchesBegan(IList<TouchPoint> touches)
-        {
-            if (State == GestureState.Possible)
-            {
-                setState(GestureState.Began);
-            }
-
-            if (TouchPointAdded == null) return;
-            foreach (var touchPoint in touches)
-            {
-                TouchPointAdded(this, new MetaGestureEventArgs(touchPoint));
-            }
-        }
-
-        protected override void touchesMoved(IList<TouchPoint> touches)
-        {
-            if (State == GestureState.Began || State == GestureState.Changed)
-            {
-                setState(GestureState.Changed);
-            }
-
-            if (TouchPointUpdated == null) return;
-            foreach (var touchPoint in touches)
-            {
-                TouchPointUpdated(this, new MetaGestureEventArgs(touchPoint));
-            }
-        }
-
-        protected override void touchesEnded(IList<TouchPoint> touches)
-        {
-            if (TouchPointRemoved != null)
-            {
-                foreach (var touchPoint in touches)
-                {
-                    TouchPointRemoved(this, new MetaGestureEventArgs(touchPoint));
-                }
-            }
-
-            if (State == GestureState.Began || State == GestureState.Changed)
-            {
-                if (activeTouches.Count == 0)
-                {
-                    setState(GestureState.Ended);
-                }
-            }
-        }
-
-        protected override void touchesCancelled(IList<TouchPoint> touches)
-        {
-            if (TouchPointCancelled != null)
-            {
-                foreach (var touchPoint in touches)
-                {
-                    TouchPointCancelled(this, new MetaGestureEventArgs(touchPoint));
-                }
-            }
-
-            if (State == GestureState.Began || State == GestureState.Changed)
-            {
-                if (activeTouches.Count == 0)
-                {
-                    setState(GestureState.Ended);
-                }
-            }
-        }
-
-        #endregion
-    }
-
-    public class MetaGestureEventArgs : EventArgs
-    {
-        public TouchPoint TouchPoint;
-
-        public MetaGestureEventArgs(TouchPoint touchPoint)
-        {
-            TouchPoint = touchPoint;
-        }
-    }
+/**
+ * @author Valentin Simonov / http://va.lent.in/
+ */
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace TouchScript.Gestures
+{
+    /// <summary>
+    /// Converts touchpoint events for target object into separate events to be used somewhere else.
+    /// </summary>
+    [AddComponentMenu("TouchScript/Gestures/Meta Gesture")]
+    public class MetaGesture : Gesture
+    {
+        #region Events
+
+        /// <summary>
+        /// Occurs when a touch point is added.
+        /// </summary>
+        public event EventHandler<MetaGestureEventArgs> TouchPointBegan;
+
+        /// <summary>
+        /// Occurs when a touch point is updated.
+        /// </summary>
+        public event EventHandler<MetaGestureEventArgs> TouchPointMoved;
+
+        /// <summary>
+        /// Occurs when a touch point is removed.
+        /// </summary>
+        public event EventHandler<MetaGestureEventArgs> TouchPointEnded;
+
+        /// <summary>
+        /// Occurs when a touch point is cancelled.
+        /// </summary>
+        public event EventHandler<MetaGestureEventArgs> TouchPointCancelled;
+
+        #endregion
+
+        #region Gesture callbacks
+
+        protected override void touchesBegan(IList<TouchPoint> touches)
+        {
+            if (State == GestureState.Possible)
+            {
+                setState(GestureState.Began);
+            }
+
+            if (TouchPointBegan == null) return;
+            foreach (var touchPoint in touches)
+            {
+                TouchPointBegan(this, new MetaGestureEventArgs(touchPoint));
+            }
+        }
+
+        protected override void touchesMoved(IList<TouchPoint> touches)
+        {
+            if (State == GestureState.Began || State == GestureState.Changed)
+            {
+                setState(GestureState.Changed);
+            }
+
+            if (TouchPointMoved == null) return;
+            foreach (var touchPoint in touches)
+            {
+                TouchPointMoved(this, new MetaGestureEventArgs(touchPoint));
+            }
+        }
+
+        protected override void touchesEnded(IList<TouchPoint> touches)
+        {
+			if (State == GestureState.Began || State == GestureState.Changed)
+            {
+                if (activeTouches.Count == 0)
+                {
+                    setState(GestureState.Ended);
+                }
+            }
+
+            if (TouchPointEnded != null)
+            {
+                foreach (var touchPoint in touches)
+                {
+                    TouchPointEnded(this, new MetaGestureEventArgs(touchPoint));
+                }
+            }
+        }
+
+        protected override void touchesCancelled(IList<TouchPoint> touches)
+        {
+			if (State == GestureState.Began || State == GestureState.Changed)
+            {
+                if (activeTouches.Count == 0)
+                {
+                    setState(GestureState.Ended);
+                }
+            }
+
+            if (TouchPointCancelled != null)
+            {
+                foreach (var touchPoint in touches)
+                {
+                    TouchPointCancelled(this, new MetaGestureEventArgs(touchPoint));
+                }
+            }
+        }
+
+        #endregion
+    }
+
+    public class MetaGestureEventArgs : EventArgs
+    {
+        public TouchPoint TouchPoint;
+
+        public MetaGestureEventArgs(TouchPoint touchPoint)
+        {
+            TouchPoint = touchPoint;
+        }
+    }
 }


v1.2.0.1

v1.2.0.1

git-svn-id: c7824798988443d6e8397993074642516d192594@88 8d6e282c-8220-11de-b77e-d9b456c0130a

--- SuperPutty/Properties/AssemblyInfo.cs
+++ SuperPutty/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.0.0")]
-[assembly: AssemblyFileVersion("1.2.0.0")]
+[assembly: AssemblyVersion("1.2.0.1")]
+[assembly: AssemblyFileVersion("1.2.0.1")]


Androidでタブアイコンを表示するように修正

Androidでタブアイコンを表示するように修正

--- TwitterSample/Droid/MainActivity.cs
+++ TwitterSample/Droid/MainActivity.cs
@@ -23,9 +23,10 @@
             Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule());

             Corcav.Behaviors.Infrastructure.Init();
-            FormsPlugin.Iconize.Droid.IconControls.Init();

             global::Xamarin.Forms.Forms.Init(this, bundle);
+
+            FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.sliding_tabs);

             LoadApplication(new App());
         }


Added option to add target assembly's directory to cecil's assembly resolver

--- UniversalUnityHooks.Core/Program.cs
+++ UniversalUnityHooks.Core/Program.cs
@@ -29,6 +29,9 @@
         [CommandOption("dry", 'd', Description = "If this value is true, the program will not write any changes to the target dll. This however will replace the dll with the clear one (filename.dll.clean), if found.")]
         public bool DryRun { get; set; }

+        [CommandOption("addtargetresolver", 'm', Description = "Automatically adds the target parent folder to the assembly resolver.")]
+        public bool AddTargetDirectoryResolve { get; set; } = true;
+
         public ValueTask ExecuteAsync(IConsole console)
         {
             console.Output.WriteLine($"input command {string.Join(",", Files)}");
@@ -45,6 +48,10 @@
             foreach (var resolveDirectory in ResolveDirectories)
             {
                 resolver.AddSearchDirectory(resolveDirectory.FullName);
+            }
+            if (AddTargetDirectoryResolve)
+            {
+                resolver.AddSearchDirectory(Target.DirectoryName);
             }
             var targetDefinition = AssemblyDefinition.ReadAssembly(Target.FullName);


Fixed test.

Fixed test.

--- Tests/Linq/UserTests/Issue445Tests.cs
+++ Tests/Linq/UserTests/Issue445Tests.cs
@@ -13,11 +13,11 @@

 	[TestFixture]
 	public class Issue445Tests : TestBase
-	{
+	{
 		class IssueContextSourceAttribute : IncludeDataContextSourceAttribute
 		{
 			public IssueContextSourceAttribute(bool includeLinqService = true)
-				: base(includeLinqService, ProviderName.SQLite, ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2012, TestProvName.SQLiteMs)
+				: base(includeLinqService, ProviderName.SQLite, ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014, TestProvName.SQLiteMs)
 			{ }
 		}


Timespan test.

Timespan test.

--- Tests/WhenLoggerInitializeIsCalled.cs
+++ Tests/WhenLoggerInitializeIsCalled.cs
@@ -23,7 +23,7 @@
   <root>
     <level error=""true""/>
   </root>
-  <appender name=""FileAppender"" type=""NLogger.Appenders.FileLoggerAppender, NLogger"" parameters=""C:\BS\log.txt"">
+  <appender name=""FileAppender"" type=""NLogger.Appenders.FileLoggerAppender, NLogger"" parameters=""C:\BS\log.txt"" timesincelastwrite=""00:00:59"">
     <level info=""true""/>
     <pattern value=""%date %level %message""/>
   </appender>
@@ -53,5 +53,13 @@
         {
             Assert.That(_logger.Appenders.First(x => x.GetType() == typeof(FileLoggerAppender)).LogPattern, Is.EqualTo("%date %level %message"));
         }
+
+        [Test]
+        public void LoggerFileAppenderTimeSinceLastWriteShouldBeCorrect()
+        {
+            Assert.That(
+                _logger.Appenders.First(x => x.GetType() == typeof (FileLoggerAppender)).TimeSinceLastWrite.Seconds,
+                Is.EqualTo(59));
+        }
     }
 }


Force all threads to declare exchanges and queues if there has been no previous declaration.

--- src/Brokers/RabbitMQ/RestBus.RabbitMQ/Client/RestBusClient.cs
+++ src/Brokers/RabbitMQ/RestBus.RabbitMQ/Client/RestBusClient.cs
@@ -189,13 +189,24 @@
                 //TODO: Consider placing model acquisition/return in a try-finally block: Implement once this method has been simplified.
                 model = pooler.GetModel(ChannelFlags.None);

+                //Redeclare exchanges and queues every 30 seconds or the first time client is sending a message
                 TimeSpan elapsedSinceLastDeclareExchange = TimeSpan.FromMilliseconds(Environment.TickCount - lastExchangeDeclareTickCount);
-                if (lastExchangeDeclareTickCount == 0 || elapsedSinceLastDeclareExchange.TotalMilliseconds < 0 || elapsedSinceLastDeclareExchange.TotalSeconds > 30)
-                {
-                    //Redeclare exchanges and queues every 30 seconds
-
-                    Interlocked.Exchange(ref lastExchangeDeclareTickCount, Environment.TickCount);
+                bool firstDeclare = lastExchangeDeclareTickCount == 0;
+                if (firstDeclare || elapsedSinceLastDeclareExchange.TotalMilliseconds < 0 || elapsedSinceLastDeclareExchange.TotalSeconds > 30)
+                {
+                    if (!firstDeclare)
+                    {
+                        //All threads must attempt to declare exchanges and queues if it hasn't been previously declared
+                        //(for instance, all threads were started at once)
+                        //So do not swap out this value on first declare
+                        Interlocked.Exchange(ref lastExchangeDeclareTickCount, Environment.TickCount);
+                    }
                     AmqpUtils.DeclareExchangeAndQueues(model.Channel, exchangeInfo, exchangeDeclareSync, null);
+                    if(firstDeclare)
+                    {
+                        //Swap out this value after declaring on firstdeclare
+                        Interlocked.Exchange(ref lastExchangeDeclareTickCount, Environment.TickCount);
+                    }
                 }

                 //TODO: if exchangeInfo wants a Session/Server/Sticky Queue


Don't create a new tuple each time

Don't create a new tuple each time

--- XSerializer/CustomJsonSerializer.cs
+++ XSerializer/CustomJsonSerializer.cs
@@ -200,8 +200,6 @@

         private Func<string, Tuple<IJsonSerializerInternal, int>> GetGetSerializerAndArgIndexFunc(ParameterInfo[] parameters)
         {
-            var tupleConstructor = typeof(Tuple<IJsonSerializerInternal, int>).GetConstructors()[0];
-
             var propertyNameParameter = Expression.Parameter(typeof(string), "propertyName");

             var switchCases = new SwitchCase[parameters.Length];
@@ -209,9 +207,10 @@
             for (int i = 0; i < parameters.Length; i++)
             {
                 var serializer = JsonSerializerFactory.GetSerializer(parameters[i].ParameterType, _encrypt);
+                var tuple = Tuple.Create(serializer, i);

                 switchCases[i] = Expression.SwitchCase(
-                    Expression.New(tupleConstructor, Expression.Constant(serializer), Expression.Constant(i)),
+                    Expression.Constant(tuple),
                     Expression.Constant(parameters[i].Name.ToLower()));
             }


Remove unused directives from CheckinEvent

--- TfsHipChat/Tfs/Events/CheckinEvent.cs
+++ TfsHipChat/Tfs/Events/CheckinEvent.cs
@@ -1,5 +1,4 @@
-using System.Collections;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Xml.Serialization;

 namespace TfsHipChat.Tfs.Events


Enable changing text color of Button on macOS

--- Xwt.XamMac/Xwt.Mac/ButtonBackend.cs
+++ Xwt.XamMac/Xwt.Mac/ButtonBackend.cs
@@ -57,6 +57,29 @@
 			Widget.SetButtonType (NSButtonType.MomentaryPushIn);
 		}

+		Drawing.Color textColor = Drawing.Colors.Black;
+		public override Xwt.Drawing.Color TextColor {
+			get {
+				//Foundation.NSRange range;
+				//var attributes = Widget.AttributedTitle.GetCoreTextAttributes(0, out range);
+				//CoreGraphics.CGColor color = attributes.ForegroundColor;
+				// HACK: return internally tracked color because retrieving the color from the attributed title using the above code causes a crash
+				return textColor;
+			}
+			set {
+				var paragraphStyle = new NSMutableParagraphStyle() {
+					Alignment = NSTextAlignment.Center
+				};
+				var title = new Foundation.NSAttributedString(
+					Widget.Title,
+					foregroundColor: value.ToNSColor(),
+					paragraphStyle: paragraphStyle
+				);
+				Widget.AttributedTitle = title;
+				textColor = value;
+			}
+		}
+
 		public void EnableEvent (Xwt.Backends.ButtonEvent ev)
 		{
 			((MacButton)Widget).EnableEvent (ev);
@@ -77,6 +100,7 @@
 			if (useMnemonic)
 				label = label.RemoveMnemonic ();
 			Widget.Title = label ?? "";
+			TextColor = textColor; // color must be reapplied when title is changed
 			if (string.IsNullOrEmpty (label))
 				imagePosition = ContentPosition.Center;
 			if (!image.IsNull) {


Simplify some code to remove suppressions.

--- src/Compilers/CSharp/Portable/Symbols/TypeSymbolExtensions.cs
+++ src/Compilers/CSharp/Portable/Symbols/TypeSymbolExtensions.cs
@@ -152,7 +152,7 @@

         public static TypeSymbol EnumUnderlyingTypeOrSelf(this TypeSymbol type)
         {
-            return type.IsEnumType() ? type.GetEnumUnderlyingType()! : type;
+            return type.GetEnumUnderlyingType() ?? type;
         }

         public static bool IsObjectType(this TypeSymbol type)
@@ -508,10 +508,7 @@

             if (type.IsValueType)
             {
-                if (type.IsEnumType())
-                {
-                    type = type.GetEnumUnderlyingType()!;
-                }
+                type = type.EnumUnderlyingTypeOrSelf();

                 switch (type.SpecialType)
                 {
@@ -1021,9 +1018,9 @@
             }

             // User-defined implicit conversion with target type as Enum type is not valid.
-            if (!isTargetTypeOfUserDefinedOp && type.IsEnumType())
-            {
-                type = type.GetEnumUnderlyingType()!;
+            if (!isTargetTypeOfUserDefinedOp)
+            {
+                type = type.EnumUnderlyingTypeOrSelf();
             }

             switch (type.SpecialType)
@@ -1473,7 +1470,7 @@

         internal static bool IsGenericTaskType(this TypeSymbol type, CSharpCompilation compilation)
         {
-            if (!(type is NamedTypeSymbol namedType) || namedType.Arity != 1)
+            if (!(type is NamedTypeSymbol { Arity: 1 } namedType))
             {
                 return false;
             }
@@ -1486,7 +1483,7 @@

         internal static bool IsIAsyncEnumerableType(this TypeSymbol type, CSharpCompilation compilation)
         {
-            if (!(type is NamedTypeSymbol namedType) || namedType.Arity != 1)
+            if (!(type is NamedTypeSymbol { Arity: 1 } namedType))
             {
                 return false;
             }
@@ -1496,7 +1493,7 @@

         internal static bool IsIAsyncEnumeratorType(this TypeSymbol type, CSharpCompilation compilation)
         {
-            if (!(type is NamedTypeSymbol namedType) || namedType.Arity != 1)
+            if (!(type is NamedTypeSymbol { Arity: 1 } namedType))
             {
                 return false;
             }


Mark WithCryptoKeyFile as supporting a null parameter

--- src/Compilers/Core/Portable/Compilation/CompilationOptions.cs
+++ src/Compilers/Core/Portable/Compilation/CompilationOptions.cs
@@ -497,7 +497,7 @@
             return CommonWithCryptoKeyContainer(cryptoKeyContainer);
         }

-        public CompilationOptions WithCryptoKeyFile(string cryptoKeyFile)
+        public CompilationOptions WithCryptoKeyFile(string? cryptoKeyFile)
         {
             return CommonWithCryptoKeyFile(cryptoKeyFile);
         }
@@ -538,7 +538,7 @@
         protected abstract CompilationOptions CommonWithMainTypeName(string? mainTypeName);
         protected abstract CompilationOptions CommonWithScriptClassName(string scriptClassName);
         protected abstract CompilationOptions CommonWithCryptoKeyContainer(string? cryptoKeyContainer);
-        protected abstract CompilationOptions CommonWithCryptoKeyFile(string cryptoKeyFile);
+        protected abstract CompilationOptions CommonWithCryptoKeyFile(string? cryptoKeyFile);
         protected abstract CompilationOptions CommonWithCryptoPublicKey(ImmutableArray<byte> cryptoPublicKey);
         protected abstract CompilationOptions CommonWithDelaySign(bool? delaySign);
         protected abstract CompilationOptions CommonWithCheckOverflow(bool checkOverflow);


whitespace

whitespace

--- Titanium.Web.Proxy/ResponseHandler.cs
+++ Titanium.Web.Proxy/ResponseHandler.cs
@@ -66,7 +66,7 @@

                     return;
                 }
-
+
                 //if user requested to send request again
                 //likely after making modifications from User Response Handler
                 if (args.ReRequest)


Filter out dummy subtypes

Filter out dummy subtypes

--- src/Connectivity.Plugin.Android/ConnectivityImplementation.cs
+++ src/Connectivity.Plugin.Android/ConnectivityImplementation.cs
@@ -70,7 +70,7 @@
                         {
                             var info = manager.GetNetworkInfo(network);

-                            if (info == null || !info.IsAvailable)
+                            if (info == null || !info.IsAvailable || info.Subtype.HasFlag(ConnectivityType.Dummy))
                                 continue;

                             if (info.IsConnected)
@@ -86,7 +86,7 @@
                 {
                     foreach (var info in manager.GetAllNetworkInfo())
                     {
-                        if (info == null || !info.IsAvailable)
+                        if (info == null || !info.IsAvailable || info.Subtype.HasFlag(ConnectivityType.Dummy))
                             continue;

                         if (info.IsConnected)


calculation on position size and price

calculation on position size and price

--- Tools/Indicator/CRV_Indicator_tool.cs
+++ Tools/Indicator/CRV_Indicator_tool.cs
@@ -12,13 +12,12 @@
 using AgenaTrader.Helper;

 /// <summary>
-/// Version: 1.3.5
+/// Version: 1.3.6
 /// -------------------------------------------------------------------------
 /// Simon Pucher 2016
 /// -------------------------------------------------------------------------
 /// todo
 /// + crv calculation not working on proposals
-/// + if there are positions left in the portfolio write + symbol
 /// -------------------------------------------------------------------------
 /// Shows the CRV of your current trade in the right upper corner of the chart.
 /// -------------------------------------------------------------------------
@@ -26,6 +25,27 @@
 /// </summary>
 namespace AgenaTrader.UserCode
 {
+
+
+    public class crv_resultobject {
+
+        public string text = "flat";
+        public double crv = 0.0;
+       public double crv_price = 0.0;
+        public double up = 0.0;
+        public double down = 0.0;
+        public double up_price = 0.0;
+        public double down_price = 0.0;
+
+        public double target_quant = 0.0;
+        public double stop_quant = 0.0;
+
+        public crv_resultobject() {
+
+        }
+    }
+
+
 	[Description("Shows the CRV of your current trade in the right upper corner of the chart.")]
     [Category("Tools")]
     public class CRV_Indicator_Tool : UserIndicator
@@ -77,9 +97,9 @@

             if (force || _lastupdate.AddSeconds(this._seconds) < DateTime.Now)
             {
-                string text = "flat";
-
-
+
+
+
                 //openedtrade = this.Root.Core.TradingManager.GetOpenedTrade(this.Instrument);
                 //IEnumerable<ITradingOrder> SubmittedOrders = this.Root.Core.TradingManager.SubmittedOrders;
                 //IEnumerable<ITradingOrder> RegisteredOrders = this.Root.Core.TradingManager.RegisteredOrders;
@@ -88,121 +108,127 @@
                 //IEnumerable<ITradingOrder> ActiveRegisteredOrders = this.Root.Core.TradingManager.ActiveRegisteredOrders;
                 //IEnumerable<ITradingOrder> ActiveSubmittedOrders = this.Root.Core.TradingManager.ActiveSubmittedOrders;

-
-                double crv = 0.0;
-                double crv_price = 0.0;
-                double up = 0.0;
-                double down = 0.0;
-                double up_price = 0.0;
-                double down_price = 0.0;
-
-
-                //IEnumerable<ITradingOrder> _regorders = this.Root.Core.TradingManager.ActiveRegisteredOrders.Where(x => x.Instrument.Symbol == this.Instrument.Symbol);
-                //if (_regorders != null && _regorders.Count() > 0)
-                //{
-                //    PositionType direction = PositionType.Flat;
-
-                //    foreach (ITradingOrder item in _regorders)
-                //    {
-
-                //    }
-
-                //}
+                crv_resultobject resultdata = new crv_resultobject();
+
+
+
+

                 IEnumerable<ITradingOrder> _openorders = this.Root.Core.TradingManager.OpenedOrders.Where(x => x.Instrument.Symbol == this.Instrument.Symbol);

-                //IEnumerable<ITradingOrder> combine = _openorders.Union(_regorders);
-
-                if (TradeInfo != null && _openorders != null && _openorders.Count() > 0)
-                {
-
-                    foreach (ITradingOrder item in _openorders)
+
+                if (this.TradeInfo != null)
+                {
+                    resultdata = this.calculate(_openorders, this.TradeInfo.Quantity, TradeInfo.AvgPrice, TradeInfo.MarketPosition);
+                }
+
+
+                DrawTextFixed("CRV_string", resultdata.text, this.TextPositionCRV, Color.Black, new Font("Arial", this.FontSizeCRV, FontStyle.Regular), Color.Transparent, Color.Transparent);
+                _lastupdate = DateTime.Now;
+            }
+
+        }
+
+
+        protected override void OnTermination()
+        {
+            // Remove event listener
+            if (ChartControl != null)
+                ChartControl.ChartPanelMouseMove -= ChartControl_ChartPanelMouseMove;
+        }
+
+
+        public crv_resultobject calculate(IEnumerable<ITradingOrder> _openorders, int entry_quantity, double entry_price, PositionType positiontype) {
+            crv_resultobject result = new crv_resultobject();
+
+            if ( _openorders != null && _openorders.Count() > 0)
+            {
+                result.target_quant = entry_quantity;
+                result.stop_quant = entry_quantity;
+
+                foreach (ITradingOrder item in _openorders)
+                {
+                    if ((positiontype == PositionType.Long && item.IsLong) || (positiontype == PositionType.Short && item.IsShort))
                     {
-                        if (TradeInfo.MarketPosition == PositionType.Long && item.IsLong)
+                        //
+                    }
+                    else
+                    {
+                        double price = item.StopPrice;
+                        if (price == 0.0)
                         {
-
+                            price = item.Price;
                         }
-                        else if (TradeInfo.MarketPosition == PositionType.Short && item.IsShort)
+                        //stop or target
+                        if (price < entry_price && positiontype == PositionType.Long
+                            || price > entry_price && positiontype == PositionType.Short)
                         {
-
+                            result.stop_quant = result.stop_quant - item.Quantity;
+                            result.down_price = result.down_price + (entry_price - item.StopPrice);
+                            result.down = result.down + ((entry_price * item.Quantity) - (item.StopPrice * item.Quantity));
                         }
                         else
                         {
-                            double price = item.StopPrice;
-                            if (price == 0.0)
-                            {
-                                price = item.Price;
-                            }
-                            //stop or target
-                            if (price < TradeInfo.AvgPrice && TradeInfo.MarketPosition == PositionType.Long
-                                || price > TradeInfo.AvgPrice && TradeInfo.MarketPosition == PositionType.Short)
-                            {
-                                down_price = down_price + (TradeInfo.AvgPrice - item.StopPrice);
-                                down = down + ((TradeInfo.AvgPrice * item.Quantity) - (item.StopPrice * item.Quantity));
-                            }
-                            else
-                            {
-                                up_price = up_price + (item.Price - TradeInfo.AvgPrice);
-                                up = up + ((item.Price * item.Quantity) - (TradeInfo.AvgPrice * item.Quantity));
-                            }
+                            result.target_quant = result.target_quant - item.Quantity;
+                            result.up_price = result.up_price + (item.Price - entry_price);
+                            result.up = result.up + ((item.Price * item.Quantity) - (entry_price * item.Quantity));
                         }
                     }
-
-                }
-
-
-
-
-
-                crv = up / down;
-                crv_price = up_price / down_price;
-
-                if (down == 0.0 && up != 0.0)
-                {
-                    //text = "in risk";
-                    text = "-";
-                }
-                else if (down != 0.0 && up == 0.0)
-                {
-                    //text = "in love";
-                    text = "-";
-                }
-                else if (down == 0.0 && up == 0.0)
-                {
-                    if (TradeInfo != null)
+                }
+
+            }
+
+
+            result.crv = result.up / result.down;
+            result.crv_price = result.up_price / result.down_price;
+
+            if (result.down == 0.0 && result.up != 0.0)
+            {
+                //text = "in risk";
+                result.text = "-";
+            }
+            else if (result.down != 0.0 && result.up == 0.0)
+            {
+                //text = "in love";
+                result.text = "-";
+            }
+            else if (result.down == 0.0 && result.up == 0.0)
+            {
+                if (TradeInfo != null)
+                {
+                    switch (positiontype)
                     {
-                        switch (TradeInfo.MarketPosition)
-                        {
-                            case PositionType.Long:
-                                text = "long";
-                                break;
-                            case PositionType.Short:
-                                text = "short";
-                                break;
-                        }
+                        case PositionType.Long:
+                            result.text = "long";
+                            break;
+                        case PositionType.Short:
+                            result.text = "short";
+                            break;
                     }
                 }
-                else
-                {
-                    text = Math.Round(crv, this.RoundDecimal).ToString() + " / " + Math.Round(crv_price, this.RoundDecimal).ToString();
-                }
-
-                DrawTextFixed("CRV_string", text, this.TextPositionCRV, Color.Black, new Font("Arial", this.FontSizeCRV, FontStyle.Regular), Color.Transparent, Color.Transparent);
-                _lastupdate = DateTime.Now;
-            }
-
-        }
-
-
-        protected override void OnTermination()
-        {
-            // Remove event listener
-            if (ChartControl != null)
-                ChartControl.ChartPanelMouseMove -= ChartControl_ChartPanelMouseMove;
-        }
-
+            }
+            else
+            {
+                string textquant = "";
+                if (result.target_quant > 0 && result.stop_quant > 0)
+                {
+                    textquant = "*";
+                }
+                else if (result.target_quant > 0)
+                {
+                    textquant = "+";
+                }
+                else if (result.stop_quant > 0)
+                {
+                    textquant = "-";
+                }
+                result.text = Math.Round(result.crv, this.RoundDecimal).ToString() + textquant + " / " + Math.Round(result.crv_price, this.RoundDecimal).ToString();
+            }
+
+            return result;
+        }

         public override string ToString()


Update ProjectContainerViewModel.cs

Update ProjectContainerViewModel.cs

--- src/Core2D/ViewModels/Containers/ProjectContainerViewModel.cs
+++ src/Core2D/ViewModels/Containers/ProjectContainerViewModel.cs
@@ -22,7 +22,7 @@
     public partial class ProjectContainerViewModel : BaseContainerViewModel, ISelection
     {
         [AutoNotify] private OptionsViewModel? _options;
-        [AutoNotify] private IHistory? _history;
+        [AutoNotify(IgnoreDataMember = true)] private IHistory? _history;
         [AutoNotify] private ImmutableArray<LibraryViewModel> _styleLibraries;
         [AutoNotify] private ImmutableArray<LibraryViewModel> _groupLibraries;
         [AutoNotify] private ImmutableArray<DatabaseViewModel> _databases;


サクり関係の通知でプロフィールのアイコンが表示されない事があるバグを修正

サクり関係の通知でプロフィールのアイコンが表示されない事があるバグを修正

ついでに参照ライブラリを最新のものへ更新。
SnkLib.Web.GooglePlusも更新。Activityのテキスト書式周りのバグが修正された。

--- Metrooz/ViewModel/Notification/NotificationWithProfileViewModel.cs
+++ Metrooz/ViewModel/Notification/NotificationWithProfileViewModel.cs
@@ -68,7 +68,7 @@
             _name = model.Actor.Name;
             _linkUrl = model.Actor.ProfileUrl;
             DataCacheDictionary.DownloadImage(new Uri(model.Actor.IconImageUrl.Replace("$SIZE_SEGMENT", "s80-c-k")))
-                .ContinueWith(tsk => _profileIconUrl = tsk.Result);
+                .ContinueWith(tsk => ProfileIconUrl = tsk.Result);
         }
         string _name;
         Uri _linkUrl;


Update ProjectEditorViewModel.Editor.cs

Update ProjectEditorViewModel.Editor.cs

--- src/Core2D/ViewModels/Editor/ProjectEditorViewModel.Editor.cs
+++ src/Core2D/ViewModels/Editor/ProjectEditorViewModel.Editor.cs
@@ -34,11 +34,11 @@

         public void SetShapeName(BaseShapeViewModel shape, IEnumerable<BaseShapeViewModel>? source = null)
         {
-            var input = source ?? _project?.GetAllShapes();
-            if (input is null)
-            {
-                return;
-            }
+            if (_project is null)
+            {
+                return;
+            }
+            var input = source ?? _project.GetAllShapes();
             var shapes = input.Where(s => s.GetType() == shape.GetType() && s != shape).ToList();
             var count = shapes.Count + 1;
             var update = string.IsNullOrEmpty(shape.Name) || input.Any(x => x != shape && x.Name == shape.Name);


経過フレームカウンターのバグ修正

経過フレームカウンターのバグ修正

--- WPFView/Timing/ElapsedFrameCounter.cs
+++ WPFView/Timing/ElapsedFrameCounter.cs
@@ -76,7 +76,7 @@
                 {
                     if (step)
                     {
-                        Reset();
+                        previousTicks += ticksPerFrame * elapsedFrames;
                     }
                     return elapsedFrames;
                 }


Improved Opening Times

Improved Opening Times

--- WWCP_Core/CommonTypes/OpeningTimes.cs
+++ WWCP_Core/CommonTypes/OpeningTimes.cs
@@ -57,6 +57,8 @@

         #region IsOpen24Hours

+        private readonly Boolean _IsOpen24Hours;
+
         /// <summary>
         /// 24/7 open...
         /// </summary>
@@ -64,30 +66,30 @@
         {
             get
             {
-                return !RegularOpenings.Any();
-            }
-        }
-
-        #endregion
-
-        #region Text
-
-        private String _Text;
+                return _IsOpen24Hours;
+            }
+        }
+
+        #endregion
+
+        #region FreeText
+
+        private String _FreeText;

         /// <summary>
         /// An additoonal free text.
         /// </summary>
-        public String Text
+        public String FreeText
         {

             get
             {
-                return _Text;
+                return _FreeText;
             }

             set
             {
-                _Text = value;
+                _FreeText = value;
             }

         }
@@ -98,15 +100,17 @@

         #region Constructor(s)

-        #region OpeningTime(Text = "")
-
-        private OpeningTimes(String Text = "")
+        #region OpeningTime(FreeText = "", IsOpen24Hours = true)
+
+        private OpeningTimes(String   FreeText       = "",
+                             Boolean  IsOpen24Hours  = true)
         {

             this._RegularOpenings      = new RegularHours[7];
             this._ExceptionalOpenings  = new List<ExceptionalPeriod>();
             this._ExceptionalClosings  = new List<ExceptionalPeriod>();
-            this._Text                 = Text;
+            this._FreeText             = FreeText;
+            this._IsOpen24Hours        = IsOpen24Hours;

         }

@@ -118,9 +122,9 @@
                             DayOfWeek  ToWeekday,
                             HourMin    Begin,
                             HourMin    End,
-                            String     Text = "")
-
-            : this(Text)
+                            String     FreeText = "")
+
+            : this(FreeText, IsOpen24Hours: false)

         {

@@ -182,10 +186,11 @@
         }

-        public static OpeningTimes FreeText(String Text)
-        {
-
-            return new OpeningTimes(Text);
+        public static OpeningTimes FromFreeText(String   Text,
+                                                Boolean  IsOpen24Hours = true)
+        {
+
+            return new OpeningTimes(Text, IsOpen24Hours);

         }

@@ -207,33 +212,151 @@

             OpeningTimes = null;

-            var match = Regex.Match(Text, "([a-zA-Z]+) - ([a-zA-Z]+) ([0-9]{2}:[0-9]{2})h - ([0-9]{2}:[0-9]{2})h");
+            var match = Regex.Match(Text, "([a-zA-Z]+) - ([a-zA-Z]+) (([0-9]{2}:[0-9]{2})h - ([0-9]{2}:[0-9]{2})h|closed)");
             if (!match.Success)
                 return false;

+            #region Parse weekdays
+
             DayOfWeek FromWeekday;

-            if (!Enum.TryParse<DayOfWeek>(match.Groups[1].Value, true, out FromWeekday))
-                return false;
+            switch (match.Groups[1].Value.ToLower())
+            {
+
+                case "mo":
+                case "mon":
+                case "monday":
+                    FromWeekday = DayOfWeek.Monday;
+                    break;
+
+                case "tu":
+                case "di":
+                case "tue":
+                case "tuesday":
+                    FromWeekday = DayOfWeek.Tuesday;
+                    break;
+
+                case "we":
+                case "mi":
+                case "wed":
+                case "wednesday":
+                    FromWeekday = DayOfWeek.Wednesday;
+                    break;
+
+                case "th":
+                case "do":
+                case "thu":
+                case "thursday":
+                    FromWeekday = DayOfWeek.Thursday;
+                    break;
+
+                case "fr":
+                case "fri":
+                case "friday":
+                    FromWeekday = DayOfWeek.Friday;
+                    break;
+
+                case "sa":
+                case "sat":
+                case "saturday":
+                    FromWeekday = DayOfWeek.Saturday;
+                    break;
+
+                case "su":
+                case "so":
+                case "sun":
+                case "sunday":
+                    FromWeekday = DayOfWeek.Sunday;
+                    break;
+
+                default:
+                    return false;
+
+            }

             DayOfWeek ToWeekday;

-            if (!Enum.TryParse<DayOfWeek>(match.Groups[2].Value, true, out ToWeekday))
-                return false;
+            switch (match.Groups[2].Value.ToLower())
+            {
+
+                case "mo":
+                case "mon":
+                case "monday":
+                    ToWeekday = DayOfWeek.Monday;
+                    break;
+
+                case "tu":
+                case "di":
+                case "tue":
+                case "tuesday":
+                    ToWeekday = DayOfWeek.Tuesday;
+                    break;
+
+                case "we":
+                case "mi":
+                case "wed":
+                case "wednesday":
+                    ToWeekday = DayOfWeek.Wednesday;
+                    break;
+
+                case "th":
+                case "do":
+                case "thu":
+                case "thursday":
+                    ToWeekday = DayOfWeek.Thursday;
+                    break;
+
+                case "fr":
+                case "fri":
+                case "friday":
+                    ToWeekday = DayOfWeek.Friday;
+                    break;
+
+                case "sa":
+                case "sat":
+                case "saturday":
+                    ToWeekday = DayOfWeek.Saturday;
+                    break;
+
+                case "su":
+                case "so":
+                case "sun":
+                case "sunday":
+                    ToWeekday = DayOfWeek.Sunday;
+                    break;
+
+                default:
+                    return false;
+
+            }
+
+            #endregion
+
+            #region Parse hours...

             HourMin Begin;
-
-            if (!HourMin.TryParse(match.Groups[3].Value, out Begin))
-                return false;
-
             HourMin End;

-            if (!HourMin.TryParse(match.Groups[4].Value, out End))
-                return false;
-
-
-            OpeningTimes = new OpeningTimes(FromWeekday, ToWeekday, Begin, End);
-            return true;
+            if (HourMin.TryParse(match.Groups[4].Value, out Begin) &&
+                HourMin.TryParse(match.Groups[5].Value, out End))
+            {
+                OpeningTimes = new OpeningTimes(FromWeekday, ToWeekday, Begin, End);
+                return true;
+            }
+
+            #endregion
+
+            #region ...or parse "closed"
+
+            else if (match.Groups[3].Value == "closed")
+            {
+                OpeningTimes = OpeningTimes.FromFreeText(Text, IsOpen24Hours: false);
+                return true;
+            }
+
+            #endregion
+
+            return false;

         }

@@ -247,7 +370,7 @@
         {
             get
             {
-                return new OpeningTimes();
+                return new OpeningTimes(IsOpen24Hours: true);
             }
         }

@@ -340,7 +463,7 @@
             if (IsOpen24Hours && OpeningTimes.IsOpen24Hours)
                 return true;

-            return Text.Equals(OpeningTimes.Text);
+            return FreeText.Equals(OpeningTimes.FreeText);

         }

@@ -355,7 +478,7 @@
         /// </summary>
         public override Int32 GetHashCode()
         {
-            return Text.GetHashCode();
+            return FreeText.GetHashCode();
         }

         #endregion
@@ -367,7 +490,7 @@
         /// </summary>
         public override String ToString()
         {
-            return IsOpen24Hours ? "24 hours" : Text;
+            return IsOpen24Hours ? "24 hours" : FreeText;
         }

         #endregion


Add ByteBufferWriter.Position.

Add ByteBufferWriter.Position.

Signed-off-by: Bradley Grainger <dae7ff431bf350b84a58dc5360c13b9e7c97b48a@gmail.com>

--- src/MySqlConnector/Protocol/Serialization/ByteBufferWriter.cs
+++ src/MySqlConnector/Protocol/Serialization/ByteBufferWriter.cs
@@ -15,7 +15,9 @@
 			m_output = m_buffer;
 		}

-		public ArraySegment<byte> ArraySegment => new ArraySegment<byte>(m_buffer, 0, m_buffer.Length - m_output.Length);
+		public int Position => m_buffer.Length - m_output.Length;
+
+		public ArraySegment<byte> ArraySegment => new ArraySegment<byte>(m_buffer, 0, Position);

 		public PayloadData ToPayloadData() => new PayloadData(ArraySegment, isPooled: true);

@@ -210,7 +212,7 @@

 		private void Reallocate(int additional = 0)
 		{
-			var usedLength = m_buffer.Length - m_output.Length;
+			var usedLength = Position;
 			var newBuffer = ArrayPool<byte>.Shared.Rent(Math.Max(usedLength + additional, m_buffer.Length * 2));
 			Buffer.BlockCopy(m_buffer, 0, newBuffer, 0, usedLength);
 			ArrayPool<byte>.Shared.Return(m_buffer);


Improved docs

Improved docs

--- src/Rainbow.Storage.Sc/Deserialization/DefaultDeserializer.cs
+++ src/Rainbow.Storage.Sc/Deserialization/DefaultDeserializer.cs
@@ -399,17 +399,28 @@
 		{
 			Language language = Language.Parse(serializedVersion.Language.Name);
 			var targetVersion = Version.Parse(serializedVersion.VersionNumber);
+
 			Item languageItem = item.Database.GetItem(item.ID, language);
+
 			Item languageVersionItem = languageItem.Versions[targetVersion];
+
 			IDictionary<Guid, IItemFieldValue> serializedVersionFieldsLookup = serializedVersion.Fields.ToDictionary(field => field.FieldId);

+			// Add a new version if we need to for the serialized version we're pasting
+			// NOTE: normally Sitecore will return an empty version when requested (e.g. you can ask for 'en#25' and get a blank version back)
+			// so this null check is only here for legacy support
 			if (languageVersionItem == null)
 			{
 				languageVersionItem = languageItem.Versions.AddVersion();
+
+				if(languageVersionItem == null) throw new InvalidOperationException("Failed to add a new version: AddVersion() returned null.");
+
 				if (!creatingNewItem)
 					_logger.AddedNewVersion(languageVersionItem);
 			}

+			// Based on the note above, in order to detect the modern form where item.Versions[] returns a blank version no matter what,
+			// we need to check again to see if the version we requested is actually currently present on the item or not, so we can correctly log version adds
 			// ReSharper disable once SimplifyLinqExpression
 			if (!languageVersionItem.Versions.GetVersionNumbers().Any(x => x.Number == languageVersionItem.Version.Number))
 			{
@@ -417,6 +428,7 @@
 					_logger.AddedNewVersion(languageVersionItem);
 			}

+			// begin writing the version data
 			bool commitEditContext = false;

 			try


added ChunkBy

added ChunkBy

--- PureLib/Common/Utility.cs
+++ PureLib/Common/Utility.cs
@@ -93,6 +93,12 @@
                 .Select(s => (T)Enum.Parse(typeof(T), s)).ToArray();
         }

+        public static IEnumerable<List<T>> ChunkBy<T>(List<T> list, int chunkSize) {
+            for (int i = 0; i < list.Count; i += chunkSize) {
+                yield return list.GetRange(i, Math.Min(chunkSize, list.Count - i));
+            }
+        }
+
         public static void Shuffle<T>(this IList<T> list) {
             Shuffle<T>(list, list.Count);
         }


Fixed title of sopnsors in now-view

Fixed title of sopnsors in now-view

--- src/Swetugg.Web/Areas/Swetugg2017/Views/Conference/Now.cshtml
+++ src/Swetugg.Web/Areas/Swetugg2017/Views/Conference/Now.cshtml
@@ -111,7 +111,7 @@

-
Sponsorer

+
Våra pponsorer


Update FormattingEngineTriviaTests for top-level statements

--- src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
+++ src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
@@ -1650,20 +1650,21 @@

         [WorkItem(542546, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542546")]
         [WorkItem(44423, "https://github.com/dotnet/roslyn/issues/44423")]
-        [Fact(Skip = "https://github.com/dotnet/roslyn/issues/44423"), Trait(Traits.Feature, Traits.Features.Formatting)]
+        [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
         public async Task FormatInvalidCode_1()
         {
+            var expected = @"> Roslyn.Utilities.dll!   Basic";
             var content = @">	Roslyn.Utilities.dll! 	Basic";
-            await AssertFormatAsync(content, content);
+            await AssertFormatAsync(expected, content);
         }

         [WorkItem(542546, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542546")]
         [WorkItem(44423, "https://github.com/dotnet/roslyn/issues/44423")]
-        [Fact(Skip = "https://github.com/dotnet/roslyn/issues/44423"), Trait(Traits.Feature, Traits.Features.Formatting)]
+        [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
         public async Task FormatInvalidCode_2()
         {
             var content = @">	Roslyn.Utilities.dll! Line 43 + 0x5 bytes	Basic";
-            var expectedContent = @">	Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic";
+            var expectedContent = @"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic";
             await AssertFormatAsync(expectedContent, content);
         }


* minor: fix lolbug in RestInventoryService spotted by jhurliman

--- OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
+++ OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
@@ -1391,8 +1391,8 @@

         private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf)
         {
-            return (newf.Name            != oldf.Name
-                    || newf.Folder      != oldf.Description
+            return (newf.Name           != oldf.Name
+                    || newf.Folder      != oldf.Folder
                     || newf.Description != oldf.Description
                     || newf.Owner       != oldf.Owner
                     || newf.Creator     != oldf.Creator


Remove the event trigger for the attach event from the attachment module. The script engine already triggers this internally.

--- OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -241,7 +241,7 @@
                     objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);

                     // Do this last so that event listeners have access to all the effects of the attachment
-                    m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
+                    //m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
                 }
                 else
                 {


Search only finds in top level.

Search only finds in top level.

--- OpenSonos.LocalMusicServer/MusicDatabase/FlatFileMusicCatalogue.cs
+++ OpenSonos.LocalMusicServer/MusicDatabase/FlatFileMusicCatalogue.cs
@@ -57,7 +57,7 @@
             }

             var directoryEntries = new List<IRepresentAResource>();
-            var @out = SearchDirectories(new DirectoryInfo(_root), query + "*");
+            var @out = Directory.GetDirectories(query + "*");
             directoryEntries.AddRange(@out.Select(ToContainer));

             return directoryEntries;
@@ -67,16 +67,5 @@
         {
             return "x-file-cifs:" + (_root + identifier.Path).Replace("\\", "/");
         }
-
-        private static List<DirectoryInfo> SearchDirectories(DirectoryInfo root, string searchPattern)
-        {
-            var folders = new List<DirectoryInfo>();
-            foreach (var d in root.GetDirectories(searchPattern))
-            {
-                folders.Add(d);
-                SearchDirectories(d, searchPattern);
-            }
-            return folders;
-        }
     }
 }


look up enum added

look up enum added

git-svn-id: e0e042b8ce53780fdf586f11e640f9a809ea7553@84 0f896bb5-3ab0-2d4e-82a7-85ef10020915

--- PS.Mothership.Core/PS.Mothership.Core.Common/Dto/UserProfileDto.cs
+++ PS.Mothership.Core/PS.Mothership.Core.Common/Dto/UserProfileDto.cs
@@ -2,6 +2,7 @@
 using System.Runtime.Serialization;
 using System.Web.Security;
 using Newtonsoft.Json;
+using PS.Mothership.Core.Common.Template.PsMsContext;

 namespace PS.Mothership.Core.Common.Dto
 {
@@ -45,5 +46,13 @@
             get { return _sessionId; }
             set { _sessionId = value; }
         }
+
+        /// <summary>
+        ///     This is just to manage the internal status
+        ///     of the user state and not to be transfered
+        ///     or serilized for transport
+        /// </summary>
+        [JsonIgnore]
+        public LoginUserResultStatusLutEnum StatusInternal { get; set; }
     }
 }


refactorign

refactorign

--- Parser/Src/Parser.Data/BusinessTransactions/BusinessTransaction.cs
+++ Parser/Src/Parser.Data/BusinessTransactions/BusinessTransaction.cs
@@ -4,6 +4,10 @@

 namespace Parser.Data.BusinessTransactions
 {
+    /// <summary>
+    /// Unit Of Work is a less catchy name!
+    /// https://martinfowler.com/eaaCatalog/unitOfWork.html
+    /// </summary>
     public class BusinessTransaction : IBusinessTransaction
     {
         private readonly IDbContext dbContext;


Completed development of OWLVocabularyDeclarationRule

--- RDFSharp.Semantics/Validator/Rules/OWLVocabularyDeclarationRule.cs
+++ RDFSharp.Semantics/Validator/Rules/OWLVocabularyDeclarationRule.cs
@@ -14,6 +14,7 @@
 using RDFSharp.Model;
 using RDFSharp.Query;
 using System.Collections.Generic;
+using System.Data;
 using System.Linq;

 namespace RDFSharp.Semantics
@@ -570,7 +571,77 @@
                 }
             }
             //owl:NegativeObjectAssertion [OWL2]
-
+            RDFSelectQuery negativeObjectAssertionQuery = new RDFSelectQuery()
+                .AddPatternGroup(new RDFPatternGroup()
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.RDF.TYPE, RDFVocabulary.OWL.NEGATIVE_PROPERTY_ASSERTION))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.SOURCE_INDIVIDUAL, new RDFVariable("?NASN_SOURCE")))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.ASSERTION_PROPERTY, new RDFVariable("?NASN_PROPERTY")))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.TARGET_INDIVIDUAL, new RDFVariable("?NASN_TARGET")))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?NASN_SOURCE")))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?NASN_PROPERTY")))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?NASN_TARGET"))))
+                .AddProjectionVariable(new RDFVariable("?NASN_SOURCE"))
+                .AddProjectionVariable(new RDFVariable("?NASN_PROPERTY"))
+                .AddProjectionVariable(new RDFVariable("?NASN_TARGET"));
+            RDFSelectQueryResult negativeObjectAssertionQueryResult = negativeObjectAssertionQuery.ApplyToGraph(ontology.Data.ABoxGraph);
+            foreach (DataRow negativeObjectAssertion in negativeObjectAssertionQueryResult.SelectResults.Rows)
+            {
+                string nasnSource = negativeObjectAssertion["?NASN_SOURCE"].ToString();
+                if (!ontology.Data.CheckHasIndividual(new RDFResource(nasnSource)))
+                    validatorRuleReport.AddEvidence(new OWLValidatorEvidence(
+                        OWLSemanticsEnums.OWLValidatorEvidenceCategory.Warning,
+                        nameof(OWLVocabularyDeclarationRule),
+                        $"Declaration of individual '{nasnSource}' is not found in the data: it is required as subject of an 'owl:NegativeObjectAssertion' relation",
+                        $"Declare '{nasnSource}' individual to the data"));
+
+                string nasnProperty = negativeObjectAssertion["?NASN_PROPERTY"].ToString();
+                if (!ontology.Model.PropertyModel.CheckHasProperty(new RDFResource(nasnProperty)))
+                    validatorRuleReport.AddEvidence(new OWLValidatorEvidence(
+                        OWLSemanticsEnums.OWLValidatorEvidenceCategory.Warning,
+                        nameof(OWLVocabularyDeclarationRule),
+                        $"Declaration of property '{nasnProperty}' is not found in the model: it is required as predicate of an 'owl:NegativeObjectAssertion' relation",
+                        $"Declare '{nasnProperty}' property to the property model"));
+
+                string nasnTarget = negativeObjectAssertion["?NASN_TARGET"].ToString();
+                if (!ontology.Data.CheckHasIndividual(new RDFResource(nasnTarget)))
+                    validatorRuleReport.AddEvidence(new OWLValidatorEvidence(
+                        OWLSemanticsEnums.OWLValidatorEvidenceCategory.Warning,
+                        nameof(OWLVocabularyDeclarationRule),
+                        $"Declaration of individual '{nasnTarget}' is not found in the data: it is required as object of an 'owl:NegativeObjectAssertion' relation",
+                        $"Declare '{nasnTarget}' individual to the data"));
+            }
+            //owl:NegativeDatatypeAssertion [OWL2]
+            RDFSelectQuery negativeDatatypeAssertionQuery = new RDFSelectQuery()
+                .AddPatternGroup(new RDFPatternGroup()
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.RDF.TYPE, RDFVocabulary.OWL.NEGATIVE_PROPERTY_ASSERTION))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.SOURCE_INDIVIDUAL, new RDFVariable("?NASN_SOURCE")))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.ASSERTION_PROPERTY, new RDFVariable("?NASN_PROPERTY")))
+                    .AddPattern(new RDFPattern(new RDFVariable("?NASN_REPRESENTATIVE"), RDFVocabulary.OWL.TARGET_VALUE, new RDFVariable("?NASN_TARGET")))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?NASN_SOURCE")))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?NASN_PROPERTY")))
+                    .AddFilter(new RDFIsLiteralFilter(new RDFVariable("?NASN_TARGET"))))
+                .AddProjectionVariable(new RDFVariable("?NASN_SOURCE"))
+                .AddProjectionVariable(new RDFVariable("?NASN_PROPERTY"))
+                .AddProjectionVariable(new RDFVariable("?NASN_TARGET"));
+            RDFSelectQueryResult negativeDatatypeAssertionQueryResult = negativeDatatypeAssertionQuery.ApplyToGraph(ontology.Data.ABoxGraph);
+            foreach (DataRow negativeDatatypeAssertion in negativeDatatypeAssertionQueryResult.SelectResults.Rows)
+            {
+                string nasnSource = negativeDatatypeAssertion["?NASN_SOURCE"].ToString();
+                if (!ontology.Data.CheckHasIndividual(new RDFResource(nasnSource)))
+                    validatorRuleReport.AddEvidence(new OWLValidatorEvidence(
+                        OWLSemanticsEnums.OWLValidatorEvidenceCategory.Warning,
+                        nameof(OWLVocabularyDeclarationRule),
+                        $"Declaration of individual '{nasnSource}' is not found in the data: it is required as subject of an 'owl:NegativeDatatypeAssertion' relation",
+                        $"Declare '{nasnSource}' individual to the data"));
+
+                string nasnProperty = negativeDatatypeAssertion["?NASN_PROPERTY"].ToString();
+                if (!ontology.Model.PropertyModel.CheckHasProperty(new RDFResource(nasnProperty)))
+                    validatorRuleReport.AddEvidence(new OWLValidatorEvidence(
+                        OWLSemanticsEnums.OWLValidatorEvidenceCategory.Warning,
+                        nameof(OWLVocabularyDeclarationRule),
+                        $"Declaration of property '{nasnProperty}' is not found in the model: it is required as predicate of an 'owl:NegativeDatatypeAssertion' relation",
+                        $"Declare '{nasnProperty}' property to the property model"));
+            }
             #endregion

             return validatorRuleReport;


Well here too lol

Well here too lol

--- SoraBot/SoraBot.Data/Repositories/Interfaces/IProfileRepository.cs
+++ SoraBot/SoraBot.Data/Repositories/Interfaces/IProfileRepository.cs
@@ -7,5 +7,6 @@
     public interface IProfileRepository
     {
         Task<Maybe<ProfileImageGenDto>> GetProfileStatistics(ulong userId, ulong guildId);
+        Task SetUserHasBgBoolean(ulong userId, bool hasCustomBg);
     }
 }


Update AssemblyInfo.cs

Update AssemblyInfo.cs

--- XUnitTests/Properties/AssemblyInfo.cs
+++ XUnitTests/Properties/AssemblyInfo.cs
@@ -8,9 +8,9 @@
 [assembly: AssemblyTitle("XUnitTests")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Hewlett-Packard Company")]
+[assembly: AssemblyCompany("Freddy Juhel")]
 [assembly: AssemblyProduct("XUnitTests")]
-[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
+[assembly: AssemblyCopyright("Copyright © Freddy Juhel MIT 2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


XmlRpcManager: fix npe

XmlRpcManager: fix npe

--- ROS_Comm/XmlRpcManager.cs
+++ ROS_Comm/XmlRpcManager.cs
@@ -488,7 +488,7 @@

         public bool IsConnected
         {
-            get { return client.IsConnected; }
+            get { return client != null && client.IsConnected; }
         }

         #endregion


Added test vehicle.

Added test vehicle.

--- SDK/UnitTests/ApiTests.cs
+++ SDK/UnitTests/ApiTests.cs
@@ -217,6 +217,35 @@
         public void T07ListingVehiclesTest()
         {
             var problem = (RoutingProblemData)testObjects["problem"];
+            var vehicle = new VehicleUpdateRequest
+            {
+                Name = "vehicle 2",
+                Capacities = new List<CapacityData>
+                {
+                    new CapacityData { Name = "Weight", Amount = 3500 }
+                },
+                StartLocation = new LocationData
+                {
+                    Coordinate = new CoordinateData
+                    {
+                        Latitude = 61.244958,
+                        Longitude = 20.747143,
+                        System = "Euclidian"
+                    }
+                },
+                EndLocation = new LocationData
+                {
+                    Coordinate = new CoordinateData
+                    {
+                        Latitude = 62.244958,
+                        Longitude = 25.747143,
+                        System = "Euclidian"
+                    }
+                },
+                TimeWindows = { new TimeWindowData { Start = new DateTime(2013, 5, 14, 8, 0, 0), End = new DateTime(2013, 5, 14, 12, 0, 0) } }
+
+            };
+            api.Navigate<ResponseData>( problem.GetLink( "create-vehicle" ), vehicle );
             //##BEGIN EXAMPLE listingvehicles##
             var vehicles = api.Navigate<VehicleDataSet>(problem.GetLink("list-vehicles"));
             //##END EXAMPLE##


Added image compression for cheaper uploads; fixed bug that sometimes the photo isnt shown on the Drop screen

--- ScanDrop/MainPage.xaml.cs
+++ ScanDrop/MainPage.xaml.cs
@@ -22,6 +22,7 @@
         private CloudStore cloudStore = new CloudStore();
         private string currentTab;
         private const string LatestPhotoFilename = "LatestPhoto.jpg";
+        private const string LatestPhotoFilenameCompressed = "LatestPhoto_Compressed.jpg";

         public MainPage()
         {
@@ -34,11 +35,11 @@
                 ? (ChooserBase<PhotoResult>)new CameraCaptureTask()
                 : (ChooserBase<PhotoResult>)new PhotoChooserTask();

-            task.Completed += (object photoSender, PhotoResult result) =>
+            task.Completed += async (object photoSender, PhotoResult result) =>
             {
                 if (result.TaskResult == TaskResult.OK)
                 {
-                    SavePhoto(result.ChosenPhoto);
+                    await SavePhoto(result.ChosenPhoto);
                     ShowDropTab();
                 }
                 else
@@ -134,7 +135,7 @@
                     ScanPanel.Visibility = Visibility.Collapsed;
                     WorkPanel.Visibility = Visibility.Visible;

-                    LoadPhoto().ContinueWith(SetupDropTab);
+                    LoadPhoto(LatestPhotoFilename).ContinueWith(SetupDropTab);

                     // for reasons completely past my understanding, we need to do this inside the UI thread for it to work. I thought
                     // OnNavigatedTo was already on the ui thread? Ahwell.
@@ -211,7 +212,7 @@
         private async void DropButton_Tap(object sender, System.Windows.Input.GestureEventArgs evt)
         {
             var filename = Prefix.Text + Filename.Text + Extension.Text;
-            var photo = await LoadPhoto();
+            var photo = await LoadPhoto(LatestPhotoFilenameCompressed);
             if (photo == null)
             {
                 MessageBox.Show("First picture take, you must!");
@@ -233,11 +234,11 @@
         }

-        private Task<Stream> LoadPhoto()
+        private Task<Stream> LoadPhoto(string filename)
         {
             return Task.Run(() =>
             {
-                return (Stream)LocalStorage.Load(LatestPhotoFilename, (stream) =>
+                return (Stream)LocalStorage.Load(filename, (stream) =>
                 {
                     var ms = new MemoryStream();
                     stream.CopyTo(ms);
@@ -249,11 +250,27 @@

         private Task SavePhoto(Stream chosenPhoto)
         {
-            return Task.Run(() =>
-            {
+            return Dispatcher.InvokeAsync(() =>
+            {
+                // save compressed file
+                chosenPhoto.Seek(0, SeekOrigin.Begin);
+
+                var bitmap = new BitmapImage
+                {
+                    CreateOptions = BitmapCreateOptions.None
+                };
+                bitmap.SetSource(chosenPhoto);
+                var wbitmap = new WriteableBitmap(bitmap);
+
+                LocalStorage.Save(LatestPhotoFilenameCompressed, stream =>
+                {
+                    wbitmap.SaveJpeg(stream, bitmap.PixelWidth / 2, bitmap.PixelHeight / 2, 0, 80);
+                });
+
+                // save original, for exif data.
+                chosenPhoto.Seek(0, SeekOrigin.Begin);
                 LocalStorage.Save(LatestPhotoFilename, stream =>
                 {
-                    chosenPhoto.Seek(0, SeekOrigin.Begin);
                     chosenPhoto.CopyTo(stream);
                 });
             });


Added GetStyleAt method.

Added GetStyleAt method.

--- ScintillaNET/Scintilla.cs
+++ ScintillaNET/Scintilla.cs
@@ -761,6 +761,19 @@
         }

         /// <summary>
+        /// Gets the style of the specified document position.
+        /// </summary>
+        /// <param name="position">The zero-based document position of the character to get the style for.</param>
+        /// <returns>The zero-based <see cref="Style" /> index used at the specified <paramref name="position" />.</returns>
+        public int GetStyleAt(int position)
+        {
+            position = Helpers.Clamp(position, 0, TextLength);
+            position = Lines.CharToBytePosition(position);
+
+            return DirectMessage(NativeMethods.SCI_GETSTYLEAT, new IntPtr(position)).ToInt32();
+        }
+
+        /// <summary>
         /// Gets a range of text from the document.
         /// </summary>
         /// <param name="position">The zero-based starting character position of the range to get.</param>


MListElements of an entity

MListElements of an entity

--- Signum.Engine/Database.cs
+++ Signum.Engine/Database.cs
@@ -568,10 +568,10 @@
         }

         [MethodExpander(typeof(MListQueryExpander))]
-        public static IQueryable<MListElement<E, V>> MListQuery<E, V>(Expression<Func<E, MList<V>>> mlistProperty)
+        public static IQueryable<MListElement<E, V>> MListQuery<E, V>(Expression<Func<E, MList<V>>> mListProperty)
             where E : IdentifiableEntity
         {
-            PropertyInfo pi = ReflectionTools.GetPropertyInfo(mlistProperty);
+            PropertyInfo pi = ReflectionTools.GetPropertyInfo(mListProperty);

             var list = (FieldMList)Schema.Current.Table<E>().GetField(pi);

@@ -585,6 +585,34 @@
                 var query = Expression.Lambda<Func<IQueryable>>(Expression.Call(mi, arguments)).Compile()();

                 return Expression.Constant(query, mi.ReturnType);
+            }
+        }
+
+        [MethodExpander(typeof(MListQueryExpander))]
+        public static IQueryable<MListElement<E, V>> MListElements<E, V>(this E entity, Expression<Func<E, MList<V>>> mListProperty)
+                where E : IdentifiableEntity
+        {
+            return MListQuery(mListProperty).Where(mle => mle.Parent == entity);
+        }
+
+        class MListElementsExpander : IMethodExpander
+        {
+            static readonly MethodInfo miMListQuery = ReflectionTools.GetMethodInfo(() => Database.MListQuery<IdentifiableEntity, int>(null)).MakeGenericMethod();
+            static readonly MethodInfo miWhere = ReflectionTools.GetMethodInfo(() => Queryable.Where<IdentifiableEntity>(null, a => false)).MakeGenericMethod();
+
+            public Expression Expand(Expression instance, Expression[] arguments, MethodInfo mi)
+            {
+                Type[] types = mi.GetGenericArguments();
+
+                Type mleType = typeof(MListElement<,>).MakeGenericType(types);
+
+                var query = Expression.Lambda<Func<IQueryable>>(Expression.Call(miMListQuery.MakeGenericMethod(mi.GetGenericArguments()), arguments[1])).Compile()();
+
+                var p = Expression.Parameter(mleType, "e");
+
+                var lambda = Expression.Lambda(Expression.Equal(Expression.Property(p, "Parent"), arguments[0]), p);
+
+                return Expression.Call(miWhere.MakeGenericMethod(mleType), Expression.Constant(query, mi.ReturnType), lambda);
             }
         }


Fixed a bug where HttpAntiForgeryExceptions were being thrown on the website. http://dotnet.dzone.com/articles/htmlantiforgerytoken-%E2%80%93 http://blogs.msdn.com/b/tmarq/archive/2009/06/25/correct-use-of-system-web-httpresponse-redirect.aspx

--- Source/App/Global.asax.cs
+++ Source/App/Global.asax.cs
@@ -240,8 +240,17 @@

         protected void Application_Error(Object sender, EventArgs e) {
             Exception error = Server.GetLastError();
-            if (error != null)
-                Log.Error().Exception(error).Message("Application error.").Write();
+            if (error == null)
+                return;
+
+            if (error is HttpAntiForgeryException) {
+                Server.ClearError();
+                Response.Redirect("~/account/logoff", false);
+                Context.ApplicationInstance.CompleteRequest();
+                return;
+            }
+
+            Log.Error().Exception(error).Message("Application error.").Write();
         }
     }
 }


Fix flickering

Fix flickering


2.0.7


Fix advanced mode settings enabling

Fix advanced mode settings enabling


Added SubscribeDownloadAsync for workshop item


Bumped the version.

Bumped the version.


Neater code

Neater code


Numkeys can now be used to alter sphere size

--- Sphaira.Client/Program.cs
+++ Sphaira.Client/Program.cs
@@ -14,7 +14,7 @@
 {
     public class Program : GameWindow
     {
-        const float StandEyeLevel = 32f;
+        const float StandEyeLevel = 1.7f;
         const float CrouchEyeLevel = 0.8f;

         public static int Main(String[] args)
@@ -48,7 +48,7 @@

         protected override void OnLoad(EventArgs e)
         {
-            _sphere = new Sphere(16f, 1024f);
+            _sphere = new Sphere(32f, 1024f);

             _camera = new SphereCamera(Width, Height, _sphere, StandEyeLevel);

@@ -103,6 +103,19 @@
                             WindowState = WindowState.Fullscreen;
                         }
                         break;
+                    case Key.Number0:
+                    case Key.Number1:
+                    case Key.Number2:
+                    case Key.Number3:
+                    case Key.Number4:
+                    case Key.Number5:
+                    case Key.Number6:
+                    case Key.Number7:
+                    case Key.Number8:
+                    case Key.Number9:
+                        var n = (int) ke.Key - (int) Key.Number0;
+                        _sphere.Radius = (float) Math.Pow(2, n + 1);
+                        break;
                 }
             };
         }
@@ -117,7 +130,7 @@
             if (Keyboard[Key.D]) move += Vector3.UnitX;

             if (Keyboard[Key.ControlLeft]) {
-                _camera.EyeHeight = CrouchEyeLevel;
+                _camera.EyeHeight = _sphere.Radius * 1.5f;
             } else {
                 _camera.EyeHeight += (StandEyeLevel - _camera.EyeHeight) * 0.25f;
             }
@@ -137,7 +150,7 @@
                 move = Vector3.Transform(move.Normalized(), rot);

                 if (Keyboard[Key.ControlLeft]) {
-                    move *= 12f;
+                    move *= 64f;
                 } else if (Keyboard[Key.ShiftLeft]) {
                     move *= 16f;
                 } else {


Fix WinForms Bitmap LoadFromResource not implemented

--- Splat/WinForms/Bitmaps.cs
+++ Splat/WinForms/Bitmaps.cs
@@ -26,7 +26,15 @@

         public Task<IBitmap> LoadFromResource(string source, float? desiredWidth, float? desiredHeight)
         {
-            throw new NotImplementedException();
+            return Task.Run(() => {
+                var ret = new Bitmap(source);
+
+                if (desiredWidth != null) {
+                    ret = new Bitmap(ret, (int)desiredWidth, (int)desiredHeight);
+                }
+
+                return (IBitmap)new BitmapBitmap(ret);
+            });
         }

         public IBitmap Create(float width, float height)


Hopefully fix hosting with a Slay Monster quest.

--- StardewValleyMP/Server.cs
+++ StardewValleyMP/Server.cs
@@ -1,4 +1,5 @@
 using StardewValley;
+using StardewValley.Quests;
 using StardewValleyMP.Connections;
 using StardewValleyMP.Interface;
 using StardewValleyMP.Packets;
@@ -119,6 +120,11 @@
 			        });
             String xml = File.ReadAllText(worldPath);*/
             MemoryStream tmp = new MemoryStream();
+            foreach ( var quest in SaveGame.loaded.player.questLog)
+            {
+                if (quest is SlayMonsterQuest)
+                    (quest as SlayMonsterQuest).loadQuestInfo();
+            }
             SaveGame.serializer.Serialize(tmp, SaveGame.loaded);
             WorldDataPacket world = new WorldDataPacket(Encoding.UTF8.GetString(tmp.ToArray()));


Added default switch case.

Added default switch case.

Codacy complained there should be a default case, added default case with error log to display the unknown type.

--- StorageFormats/DSF_0x5.cs
+++ StorageFormats/DSF_0x5.cs
@@ -263,6 +263,9 @@
                         writer.Write('b');
                         writer.Write(value);
                         break;
+                    default:
+                        Logging.WriteLine($"Found unserialisable value type of: {kvp.Value.GetType()}");
+                        break;
                 }
                 writer.Write(End);
             }


Fixed path rebasing and a type in the generator element extraction.


Added BindAsyncOrDefault

Added BindAsyncOrDefault


kosole 形式 Full Color (SGR 38/48;2;rr;bb;gg m) 対応

--- TerminalEmulator/VT100.cs
+++ TerminalEmulator/VT100.cs
@@ -148,32 +148,73 @@
         }

         protected void ProcessSGR(string param) {
-            int state = 0;
+            int state = 0, target = 0, r = 0, g =0, b = 0;
             string[] ps = param.Split(';');

             foreach (string cmd in ps) {

                 TextDecoration dec = _currentdecoration;
                 int code = ParseSGRCode(cmd);
-                if (state == 1 || state == 2) {
-                    if (code == 5) {
-                        state += 2;
-                    }
-                    else {
-                        state = 0;
-                    }
-                }
-                else if (state == 3) {
-                    if (code < 256) {
-                        dec = SelectForeColor(dec, code);
-                    }
-                    state = 0;
-                }
-                else if (state == 4) {
-                    if (code < 256) {
-                        dec = SelectBackgroundColor(dec, code);
-                    }
-                    state = 0;
+                if (state != 0) {
+                    switch (state) {
+                        case 1:
+                            if (code == 5) {
+                                state = 2;
+                            }
+                            else if (code == 2) {
+                                state = 3;
+                            }
+                            else {
+                                state = 0;
+                                target = 0;
+                            }
+                            break;
+                        case 2:
+                            if (code < 256) {
+                                if (target == 3) {
+                                    dec = SelectForeColor(dec, code);
+                                }
+                                else if (target == 4) {
+                                    dec = SelectBackgroundColor(dec, code);
+                                }
+                            }
+                            state = 0;
+                            target = 0;
+                            break;
+                        case 3:
+                            if (code < 256) {
+                                r = code;
+                                state = 4;
+                            }
+                            else {
+                                state = 0;
+                                target = 0;
+                            }
+                            break;
+                        case 4:
+                            if (code < 256) {
+                                g = code;
+                                state = 5;
+                            }
+                            else {
+                                state = 0;
+                                target = 0;
+                            }
+                            break;
+                        case 5:
+                            if (code < 256) {
+                                b = code;
+                                if (target == 3) {
+                                    dec = SetForeColorByRGB(dec, r, g, b);
+                                }
+                                else if (target == 4) {
+                                    dec = SetBackColorByRGB(dec, r, g, b);
+                                }
+                            }
+                            state = 0;
+                            target = 0;
+                            break;
+                    }
                 }
                 else if (code >= 30 && code <= 37) {
                     //これだと色を変更したとき既に画面にあるものは連動しなくなるが、そこをちゃんとするのは困難である
@@ -218,12 +259,14 @@
                             break;
                         case 38:
                             state = 1;
+                            target = 3;
                             break;
                         case 39:
                             dec = dec.GetCopyWithDefaultTextColor();
                             break;
                         case 48:
-                            state = 2;
+                            state = 1;
+                            target = 4;
                             break;
                         case 49:
                             dec = dec.GetCopyWithDefaultBackColor();
@@ -259,6 +302,14 @@
                 color = c.Color;

             return dec.GetCopyWithBackColor(color);
+        }
+
+        private TextDecoration SetForeColorByRGB(TextDecoration dec, int r, int g, int b) {
+            return dec.GetCopyWithTextColor(Color.FromArgb(r, g, b));
+        }
+
+        private TextDecoration SetBackColorByRGB(TextDecoration dec, int r, int g, int b) {
+            return dec.GetCopyWithBackColor(Color.FromArgb(r, g, b));
         }

         private static int ParseSGRCode(string param) {


IP Exception

IP Exception

--- Terraria_Server/Player.cs
+++ Terraria_Server/Player.cs
@@ -38,7 +38,7 @@
         {
             get
             {
-                return System.Net.IPAddress.Parse(ipAddress);
+                return System.Net.IPAddress.Parse(ipAddress.Split(':')[0]);
             }
         }


Added a Java date converter (Unix with millis).


Test updated with cases

Test updated with cases

--- TestController/Program.cs
+++ TestController/Program.cs
@@ -13,12 +13,11 @@
         static void Main(string[] args)
         {
             IInventoryController controller = new InventoryController();
+
+            Print(controller.GetAllStockGroups());
+            Print(controller.GetAllStockItems());
+            Print(controller.GetAllStockUnits());

-            //controller.AddStockUnit(new StockUnit { StockUnitName = "_Primary", StockUnitSymbol = "" , StockUnitDecimalPlaces = 0 });
-
-            Print(controller.GetAllStockUnits());
-            Print(controller.GetAllStockItems());
-            Print(controller.GetAllStockGroups());
             Console.Write("Press any key to exit...");
             Console.ReadLine();
         }