Keep dependency order in main module

Keep dependency order in main module

--- Core/AppBrix/Modules/MainModuleBase.cs
+++ Core/AppBrix/Modules/MainModuleBase.cs
@@ -26,8 +26,6 @@
             var installed = new HashSet<string>(config.Modules.Select(x => x.Type));
             var modules = this.GetAllDependencies()
                 .Where(x => !installed.Contains(x.GetAssemblyQualifiedName()))
-                .OrderBy(x => x.Namespace)
-                .ThenBy(x => x.Name)
                 .Select(ModuleConfigElement.Create);

             foreach (var module in modules)


Remove SecBuffer[1] allocation from SafeDeleteContext.InitializeSecurityContext

--- src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs
+++ src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs
@@ -562,66 +562,64 @@
                         }
                     }

-                    Interop.SspiCli.SecBuffer[] outUnmanagedBuffer = new Interop.SspiCli.SecBuffer[1];
-                    fixed (void* outUnmanagedBufferPtr = &outUnmanagedBuffer[0])
-                    {
-                        // Fix Descriptor pointer that points to unmanaged SecurityBuffers.
-                        outSecurityBufferDescriptor.pBuffers = outUnmanagedBufferPtr;
-                        outUnmanagedBuffer[0].cbBuffer = outSecBuffer.size;
-                        outUnmanagedBuffer[0].BufferType = outSecBuffer.type;
-                        if (outSecBuffer.token == null || outSecBuffer.token.Length == 0)
-                        {
-                            outUnmanagedBuffer[0].pvBuffer = IntPtr.Zero;
-                        }
-                        else
-                        {
-                            outUnmanagedBuffer[0].pvBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(outSecBuffer.token, outSecBuffer.offset);
-                        }
-
-                        if (isSspiAllocated)
-                        {
-                            outFreeContextBuffer = SafeFreeContextBuffer.CreateEmptyHandle();
-                        }
-
-                        if (refContext == null || refContext.IsInvalid)
-                        {
-                            refContext = new SafeDeleteContext_SECURITY();
-                        }
-
-                        if (targetName == null || targetName.Length == 0)
-                        {
-                            targetName = dummyStr;
-                        }
-
-                        fixed (char* namePtr = targetName)
-                        {
-                            errorCode = MustRunInitializeSecurityContext_SECURITY(
-                                            ref inCredentials,
-                                            contextHandle.IsZero ? null : &contextHandle,
-                                            (byte*)(((object)targetName == (object)dummyStr) ? null : namePtr),
-                                            inFlags,
-                                            endianness,
-                                            haveInSecurityBufferDescriptor ? &inSecurityBufferDescriptor : null,
-                                            refContext,
-                                            ref outSecurityBufferDescriptor,
-                                            ref outFlags,
-                                            outFreeContextBuffer);
-                        }
-
-                        if (NetEventSource.IsEnabled) NetEventSource.Info(null, "Marshalling OUT buffer");
-
-                        // Get unmanaged buffer with index 0 as the only one passed into PInvoke.
-                        outSecBuffer.size = outUnmanagedBuffer[0].cbBuffer;
-                        outSecBuffer.type = outUnmanagedBuffer[0].BufferType;
-                        if (outSecBuffer.size > 0)
-                        {
-                            outSecBuffer.token = new byte[outSecBuffer.size];
-                            Marshal.Copy(outUnmanagedBuffer[0].pvBuffer, outSecBuffer.token, 0, outSecBuffer.size);
-                        }
-                        else
-                        {
-                            outSecBuffer.token = null;
-                        }
+                    Interop.SspiCli.SecBuffer outUnmanagedBuffer = default;
+
+                    // Fix Descriptor pointer that points to unmanaged SecurityBuffers.
+                    outSecurityBufferDescriptor.pBuffers = &outUnmanagedBuffer;
+                    outUnmanagedBuffer.cbBuffer = outSecBuffer.size;
+                    outUnmanagedBuffer.BufferType = outSecBuffer.type;
+                    if (outSecBuffer.token == null || outSecBuffer.token.Length == 0)
+                    {
+                        outUnmanagedBuffer.pvBuffer = IntPtr.Zero;
+                    }
+                    else
+                    {
+                        outUnmanagedBuffer.pvBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(outSecBuffer.token, outSecBuffer.offset);
+                    }
+
+                    if (isSspiAllocated)
+                    {
+                        outFreeContextBuffer = SafeFreeContextBuffer.CreateEmptyHandle();
+                    }
+
+                    if (refContext == null || refContext.IsInvalid)
+                    {
+                        refContext = new SafeDeleteContext_SECURITY();
+                    }
+
+                    if (targetName == null || targetName.Length == 0)
+                    {
+                        targetName = dummyStr;
+                    }
+
+                    fixed (char* namePtr = targetName)
+                    {
+                        errorCode = MustRunInitializeSecurityContext_SECURITY(
+                                        ref inCredentials,
+                                        contextHandle.IsZero ? null : &contextHandle,
+                                        (byte*)(((object)targetName == (object)dummyStr) ? null : namePtr),
+                                        inFlags,
+                                        endianness,
+                                        haveInSecurityBufferDescriptor ? &inSecurityBufferDescriptor : null,
+                                        refContext,
+                                        ref outSecurityBufferDescriptor,
+                                        ref outFlags,
+                                        outFreeContextBuffer);
+                    }
+
+                    if (NetEventSource.IsEnabled) NetEventSource.Info(null, "Marshalling OUT buffer");
+
+                    // Get unmanaged buffer with index 0 as the only one passed into PInvoke.
+                    outSecBuffer.size = outUnmanagedBuffer.cbBuffer;
+                    outSecBuffer.type = outUnmanagedBuffer.BufferType;
+                    if (outSecBuffer.size > 0)
+                    {
+                        outSecBuffer.token = new byte[outSecBuffer.size];
+                        Marshal.Copy(outUnmanagedBuffer.pvBuffer, outSecBuffer.token, 0, outSecBuffer.size);
+                    }
+                    else
+                    {
+                        outSecBuffer.token = null;
                     }
                 }
             }


Update Android link speed to match windows

--- src/Connectivity.Plugin.Android/ConnectivityImplementation.cs
+++ src/Connectivity.Plugin.Android/ConnectivityImplementation.cs
@@ -275,7 +275,7 @@
                 try
                 {
                     if (ConnectionTypes.Contains(ConnectionType.WiFi))
-                        return new[] { (UInt64)WifiManager.ConnectionInfo.LinkSpeed };
+                        return new[] { (UInt64)WifiManager.ConnectionInfo.LinkSpeed * 1000000 };
                 }
                 catch (Exception e)
                 {


Fix reloading existing widget instance error

--- DesktopWidgets/Helpers/WidgetHelper.cs
+++ DesktopWidgets/Helpers/WidgetHelper.cs
@@ -44,11 +44,8 @@

         private static void LoadView(this WidgetId id, bool systemStartup = false)
         {
-            foreach (var view in App.WidgetViews.Where(view => view.Id == id))
-            {
+            foreach (var view in App.WidgetViews.Where(view => view.Id == id).ToList())
                 view.Close();
-                App.WidgetViews.Remove(view);
-            }

             var widgetView = new WidgetView(id, id.GetNewViewModel(), id.GetNewControlView(), systemStartup);
             App.WidgetViews.Add(widgetView);


Use Widget "On Top" option value when set as AppBar

--- DesktopWidgets/View/WidgetView.xaml.cs
+++ DesktopWidgets/View/WidgetView.xaml.cs
@@ -314,27 +314,29 @@
             UpdateLayout();
         }

+        private void SetAsAppBar(ABEdge edge) => AppBarFunctions.SetAppBar(this, edge, topMost: Settings.Topmost);
+
         private void SetAsAppBar()
         {
             switch (Settings.HorizontalAlignment)
             {
                 case HorizontalAlignment.Left:
-                    AppBarFunctions.SetAppBar(this, ABEdge.Left);
+                    SetAsAppBar(ABEdge.Left);
                     _isAppBar = true;
                     break;
                 case HorizontalAlignment.Right:
-                    AppBarFunctions.SetAppBar(this, ABEdge.Right);
+                    SetAsAppBar(ABEdge.Right);
                     _isAppBar = true;
                     break;
                 default:
                     switch (Settings.VerticalAlignment)
                     {
                         case VerticalAlignment.Top:
-                            AppBarFunctions.SetAppBar(this, ABEdge.Top);
+                            SetAsAppBar(ABEdge.Top);
                             _isAppBar = true;
                             break;
                         case VerticalAlignment.Bottom:
-                            AppBarFunctions.SetAppBar(this, ABEdge.Bottom);
+                            SetAsAppBar(ABEdge.Bottom);
                             _isAppBar = true;
                             break;
                     }


Enabled the console to output the exception call stack on an error.

--- DtronixModeler/Xaml/MainWindow.xaml.cs
+++ DtronixModeler/Xaml/MainWindow.xaml.cs
@@ -158,6 +158,7 @@
 				Console.WriteLine("Error in executing specified options. Error:");
 				foreach (var inner_ex in ex.InnerExceptions) {
 					Console.WriteLine(inner_ex.Message);
+					Console.WriteLine(inner_ex.ToString());
 				}
 			}


Fix dropdown arrow not returning when no item selected

--- EDDiscovery/Controls/ComboBoxCustom.cs
+++ EDDiscovery/Controls/ComboBoxCustom.cs
@@ -16,7 +16,6 @@
         private ListControlCustom _listcontrol;

         public event EventHandler DropDown;
-        public event EventHandler DropDownClosed;
         public event EventHandler SelectedIndexChanged;

         public int SelectedIndex { get { return _listcontrol.SelectedIndex; } set { _listcontrol.SelectedIndex = value; } }
@@ -61,12 +60,6 @@
         {
             base.OnDeactivate(e);
             this.Close();
-        }
-
-        protected override void OnFormClosed(FormClosedEventArgs e)
-        {
-            base.OnFormClosed(e);
-            DropDownClosed(this, e);
         }
     }

@@ -267,6 +260,8 @@
         {
             int selectedindex = _cbdropdown.SelectedIndex;
             _cbdropdown.Close();
+            isActivated = false;
+            this.Invalidate(true);
             _cbsystem.SelectedIndex = selectedindex;
         }

@@ -444,8 +439,8 @@
             _cbdropdown.ScrollBarButtonColor = this.ScrollBarButtonColor;

             _cbdropdown.DropDown += _cbdropdown_DropDown;
-            _cbdropdown.DropDownClosed += _cbdropdown_DropDownClosed;
             _cbdropdown.SelectedIndexChanged += _cbdropdown_SelectedIndexChanged;
+            _cbdropdown.Deactivate += _cbdropdown_Deactivate;

             Control parent = this.Parent;
             while (parent != null && !(parent is Form))
@@ -456,15 +451,10 @@
             _cbdropdown.Show(parent);
         }

-        private void _cbdropdown_DropDownClosed(object sender, EventArgs e)
-        {
-            if (_cbdropdown != null)
-            {
-                _cbdropdown.Dispose();
-                _cbdropdown = null;
-            }
-
+        private void _cbdropdown_Deactivate(object sender, EventArgs e)
+        {
             isActivated = false;
+            this.Invalidate(true);
         }

         private void _cbdropdown_DropDown(object sender, EventArgs e)


made the endpoint test fixture abstract

made the endpoint test fixture abstract

Former-commit-id: 34372c9b17cd2f02eccac1f8afa163ae5743bc70

--- src/MassTransit.TestFramework/Fixtures/EndpointTestFixture.cs
+++ src/MassTransit.TestFramework/Fixtures/EndpointTestFixture.cs
@@ -33,7 +33,7 @@
 	/// </summary>
 	/// <typeparam name="TTransportFactory">Type of transport factory to create the endpoint with</typeparam>
 	[TestFixture]
-	public class EndpointTestFixture<TTransportFactory> :
+	public abstract class EndpointTestFixture<TTransportFactory> :
 		AbstractTestFixture
 		where TTransportFactory : class, ITransportFactory, new()
 	{


Fixes #734

Fixes #734

--- src/Media.Plugin.Sample/Media.Plugin.Sample/MediaPage.xaml.cs
+++ src/Media.Plugin.Sample/Media.Plugin.Sample/MediaPage.xaml.cs
@@ -25,6 +25,7 @@

 			takePhoto.Clicked += async (sender, args) =>
 			{
+				await CrossMedia.Current.Initialize();
 				files.Clear();
 				if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
 				{
@@ -49,6 +50,7 @@

 			pickPhoto.Clicked += async (sender, args) =>
 			{
+				await CrossMedia.Current.Initialize();
 				files.Clear();
 				if (!CrossMedia.Current.IsPickPhotoSupported)
 				{
@@ -69,6 +71,7 @@

 			pickPhotos.Clicked += async (sender, args) =>
 			{
+				await CrossMedia.Current.Initialize();
 				files.Clear();
 				if (!CrossMedia.Current.IsPickPhotoSupported)
 				{
@@ -87,6 +90,7 @@

 			takeVideo.Clicked += async (sender, args) =>
 			{
+				await CrossMedia.Current.Initialize();
 				files.Clear();
 				if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakeVideoSupported)
 				{
@@ -110,6 +114,7 @@

 			pickVideo.Clicked += async (sender, args) =>
 			{
+				await CrossMedia.Current.Initialize();
 				files.Clear();
 				if (!CrossMedia.Current.IsPickVideoSupported)
 				{


Removing useless property

Removing useless property

svn path=/trunk/bitsharp/; revision=105102

--- src/MonoTorrent/MonoTorrent.Client/Settings/EngineSettings.cs
+++ src/MonoTorrent/MonoTorrent.Client/Settings/EngineSettings.cs
@@ -42,7 +42,6 @@
     {
         #region Private Fields

-        private bool allowLegacyConnections;            // True if you want to allowing non-encrypted incoming connections. Returns true if encrytion is off
         private bool haveSupressionEnabled;             // True if you want to enable have surpression
         private EncryptionTypes allowedEncryption;      // The minimum encryption level to use. "None" corresponds to no encryption.
         private int listenPort;                         // The port to listen to incoming connections on
@@ -60,17 +59,15 @@

         #region Properties

-        /// <summary>
-        /// This specifies whether non-encrypted incoming connections should be accepted or denied. This setting returns
-        /// true if MinEncryption level is set to "None"
-        /// </summary>
-        public bool AllowLegacyConnections
-        {
-            get { return (this.allowLegacyConnections) || (this.allowedEncryption == EncryptionTypes.PlainText); }
-            set { this.allowLegacyConnections = value; }
-        }
-
-
+		/// <summary>
+        /// Specifies the encryption levels allowed
+        /// </summary>
+        public EncryptionTypes AllowedEncryption
+        {
+            get { return this.allowedEncryption; }
+            set { this.allowedEncryption = value; }
+        }
+
         /// <summary>
         /// This specifies whether have supression should be enabled or disabled. It is highly recommend that this should
         /// not be enabled
@@ -161,17 +158,7 @@
             set { maxWriteRate = value; }
         }

-
-        /// <summary>
-        /// Specifies the minimum encryption level to use for outgoing connections.
-        /// </summary>
-        public EncryptionTypes AllowedEncryption
-        {
-            get { return this.allowedEncryption; }
-            set { this.allowedEncryption = value; }
-        }
-
-
+
         /// <summary>
         /// This is the default directory that torrents will be downloaded to
         /// </summary>
@@ -186,7 +173,6 @@

         #region Defaults

-        private const bool DefaultAllowLegacyConnections = true;
         private const bool DefaultEnableHaveSupression = false;
         private const string DefaultSavePath = "";
         private const int DefaultMaxConnections = 150;
@@ -203,7 +189,7 @@

         public EngineSettings()
             : this(DefaultSavePath, DefaultListenPort, DefaultMaxConnections, DefaultMaxHalfOpenConnections,
-                  DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption, DefaultAllowLegacyConnections)
+                  DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption)
         {

         }
@@ -215,7 +201,7 @@
         /// <param name="defaultSavePath">The default path to save downloaded material to</param>
         /// <param name="listenPort">The port to listen for incoming connections on</param>
         public EngineSettings(string defaultSavePath, int listenPort)
-            : this(defaultSavePath, listenPort, DefaultMaxConnections, DefaultMaxHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption, DefaultAllowLegacyConnections)
+            : this(defaultSavePath, listenPort, DefaultMaxConnections, DefaultMaxHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption)
         {

         }
@@ -228,7 +214,7 @@
         /// <param name="defaultSavePath">The default path to save downloaded material to</param>
         /// <param name="listenPort">The port to listen for incoming connections on</param>
         public EngineSettings(string defaultSavePath, int listenPort, int globalMaxConnections)
-            : this(defaultSavePath, listenPort, globalMaxConnections, DefaultMaxHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption, DefaultAllowLegacyConnections)
+            : this(defaultSavePath, listenPort, globalMaxConnections, DefaultMaxHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption)
         {

         }
@@ -242,7 +228,7 @@
         /// <param name="defaultSavePath">The default path to save downloaded material to</param>
         /// <param name="listenPort">The port to listen for incoming connections on</param>
         public EngineSettings(string defaultSavePath, int listenPort, int globalMaxConnections, int globalHalfOpenConnections)
-            : this(defaultSavePath, listenPort, globalMaxConnections, globalHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption, DefaultAllowLegacyConnections)
+            : this(defaultSavePath, listenPort, globalMaxConnections, globalHalfOpenConnections, DefaultMaxDownloadSpeed, DefaultMaxUploadSpeed, DefaultAllowedEncryption)
         {

         }
@@ -259,9 +245,8 @@
         /// <param name="listenPort">The port to listen for incoming connections on</param>
         /// <param name="allowLegacyConnections">True if incoming connections without encryption should be accepted when encryption is enabled</param>
         /// <param name="minEncryption">The minimum level of encryption to use for outgoing connections</param>
-        public EngineSettings(string defaultSavePath, int listenPort, int globalMaxConnections, int globalHalfOpenConnections, int globalMaxDownloadSpeed, int globalMaxUploadSpeed, EncryptionTypes allowedEncryption, bool allowLegacyConnections)
-        {
-            this.allowLegacyConnections = allowLegacyConnections;
+        public EngineSettings(string defaultSavePath, int listenPort, int globalMaxConnections, int globalHalfOpenConnections, int globalMaxDownloadSpeed, int globalMaxUploadSpeed, EncryptionTypes allowedEncryption)
+        {
             this.globalMaxConnections = globalMaxConnections;
             this.globalMaxDownloadSpeed = globalMaxDownloadSpeed;
             this.globalMaxUploadSpeed = globalMaxUploadSpeed;
@@ -289,8 +274,7 @@
         public override bool Equals(object obj)
         {
             EngineSettings settings = obj as EngineSettings;
-            return (settings == null) ? false : this.allowLegacyConnections == settings.allowLegacyConnections &&
-                                                this.globalMaxConnections == settings.globalMaxConnections &&
+            return (settings == null) ? false : this.globalMaxConnections == settings.globalMaxConnections &&
                                                 this.globalMaxDownloadSpeed == settings.globalMaxDownloadSpeed &&
                                                 this.globalMaxHalfOpenConnections == settings.globalMaxHalfOpenConnections &&
                                                 this.globalMaxUploadSpeed == settings.globalMaxUploadSpeed &&
@@ -301,8 +285,7 @@

         public override int GetHashCode()
         {
-            return this.allowLegacyConnections.GetHashCode() +
-                   this.globalMaxConnections +
+            return this.globalMaxConnections +
                    this.globalMaxDownloadSpeed +
                    this.globalMaxHalfOpenConnections +
                    this.globalMaxUploadSpeed +


#5067 Adding global alias for binding flags in generator (#5068)

Fixes #5067

--- src/Orleans.CodeGenerator/Utilities/SymbolSyntaxExtensions.cs
+++ src/Orleans.CodeGenerator/Utilities/SymbolSyntaxExtensions.cs
@@ -116,7 +116,7 @@
                     $"Can't create parenthesized binary expression with {bindingFlags.Length} arguments");
             }

-            var flags = IdentifierName("System").Member("Reflection").Member("BindingFlags");
+            var flags = AliasQualifiedName("global", IdentifierName("System")).Member("Reflection").Member("BindingFlags");
             var bindingFlagsBinaryExpression = BinaryExpression(
                 operationKind,
                 flags.Member(bindingFlags[0].ToString()),


Use Observable.FromAsync

Use Observable.FromAsync

--- Espera/Espera.Services/MobileClient.cs
+++ Espera/Espera.Services/MobileClient.cs
@@ -7,7 +7,6 @@
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Reactive.Subjects;
-using System.Reactive.Threading.Tasks;
 using System.Reflection;
 using System.Threading;
 using System.Threading.Tasks;
@@ -86,7 +85,7 @@

         public void ListenAsync()
         {
-            Observable.Defer(() => this.socket.GetStream().ReadNextMessageAsync().ToObservable())
+            Observable.FromAsync(() => this.socket.GetStream().ReadNextMessageAsync())
                 .Repeat()
                 .TakeWhile(x => x != null)
                 // If we don't do this, the application will throw up whenever we are manipulating a


Small renaming.

Small renaming.

--- ExRam.Gremlinq/Gremlin/GremlinQuery.cs
+++ ExRam.Gremlinq/Gremlin/GremlinQuery.cs
@@ -74,9 +74,9 @@
             }
         }

-        public static IGremlinQuery Create(string initialIdentifier)
+        public static IGremlinQuery Create(string graphName = null)
         {
-            return new GremlinQueryImpl(initialIdentifier, ImmutableList<GremlinStep>.Empty, ImmutableDictionary<MemberInfo, string>.Empty, IdentifierFactory.CreateDefault());
+            return new GremlinQueryImpl(graphName, ImmutableList<GremlinStep>.Empty, ImmutableDictionary<MemberInfo, string>.Empty, IdentifierFactory.CreateDefault());
         }

         public static IGremlinQuery<T> WithGraphName<T>(this IGremlinQuery<T> query, string graphName)


fix(BackgroundClick, WP, UWP): OnBackground click did not unsubsribed

--- src/Rg.Plugins.Popup.WinShared/Renderers/PopupPageRenderer.cs
+++ src/Rg.Plugins.Popup.WinShared/Renderers/PopupPageRenderer.cs
@@ -68,6 +68,8 @@
             InputPane inputPane = InputPane.GetForCurrentView();
             inputPane.Showing -= OnKeyboardShowing;
             inputPane.Hiding -= OnKeyboardHiding;
+
+            ContainerElement.PointerPressed -= OnBackgroundClick;
         }

         private void OnOrientationChanged(DisplayInformation sender, object args)


FLAPI-216: Add graduate flag as additional property

--- src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
+++ src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
@@ -2,6 +2,7 @@
 {
     public enum AdditionalPropertyType
     {
-        ResidentsOnly = 1
+        ResidentsOnly = 1,
+        Graduate
     }
-}
+}


Updated Cookies Link

Updated Cookies Link

--- src/SFA.DAS.EmployerFinance.Web/Controllers/HomeController.cs
+++ src/SFA.DAS.EmployerFinance.Web/Controllers/HomeController.cs
@@ -43,7 +43,7 @@
         [Route("cookieConsent", Order = 1)]
         public ActionResult CookieConsent()
         {
-            return Redirect(Url.AccountsAction("cookieConsent", "settings"));
+            return Redirect(Url.EmployerAccountsAction("cookieConsent"));
         }

         [Route("signOut")]


Add partition to log

Add partition to log

--- src/SceneSkope.ServiceFabric.EventHubs/BaseReadingReceiver.cs
+++ src/SceneSkope.ServiceFabric.EventHubs/BaseReadingReceiver.cs
@@ -5,8 +5,6 @@
 using System;
 using System.Collections.Generic;
 using System.Fabric;
-using System.Linq;
-using System.Text;
 using System.Threading;
 using System.Threading.Tasks;

@@ -29,7 +27,7 @@
         bool automaticallySave,
         CancellationTokenSource cts)
         {
-            Log = log;
+            Log = log.ForContext("partition", partition);
             AutomaticallySave = automaticallySave;
             StateManager = stateManager;
             _offsets = offsets;


Fixed typos

Fixed typos

--- src/SceneViewEdit/SceneEditingDemo/Helpers/SceneEditHelper.cs
+++ src/SceneViewEdit/SceneEditingDemo/Helpers/SceneEditHelper.cs
@@ -18,7 +18,7 @@
 {
     /// <summary>
     /// <see cref="SceneEditHelper"/> provides methods for creating and editing geometries on the SceneView.
-    /// When draw or edit is requested, draw experience is started in the assosiated SceneView that provides
+    /// When draw or edit is requested, draw experience is started in the associated SceneView that provides
     /// visual feedback for the user about the operation.
     /// </summary>
     /// <remarks><see cref="SceneEditHelper"/> provides basic draw and edit operations for working with geometries that
@@ -58,12 +58,12 @@
 			Style = SimpleLineStyle.Dot
 		};

-		#endregion // Default draw symbols
-
-        /// <summary>
-        /// Gets the value indicating wheter there is a draw or edit session ongoing.
-        /// </summary>
-		public static bool IsActive { get; private set; }
+        #endregion // Default draw symbols
+
+        /// <summary>
+        /// Gets the value indicating whether there is a draw or edit session ongoing.
+        /// </summary>
+        public static bool IsActive { get; private set; }

 		#region Create geometries

@@ -84,7 +84,7 @@
         }

         /// <summary>
-        /// Create a new <see cref="Polyline"/>. This will activate drawing experience on the map. Draw is completed on douple click.
+        /// Create a new <see cref="Polyline"/>. This will activate drawing experience on the map. Draw is completed on double click.
         /// </summary>
         /// <param name="sceneView">The <see cref="SceneView"/> that is used for drawing.</param>
         /// <exception cref="TaskCanceledException">If previous task wasn't completed, <see cref="TaskCanceledException"/>
@@ -100,7 +100,7 @@
 		}

         /// <summary>
-        /// Create a new <see cref="Polygon"/>. This will activate drawing experience on the map. Draw is completed on douple click.
+        /// Create a new <see cref="Polygon"/>. This will activate drawing experience on the map. Draw is completed on double click.
         /// </summary>
         /// <param name="sceneView">The <see cref="SceneView"/> that is used for drawing.</param>
         /// <exception cref="TaskCanceledException">If previous task wasn't completed, <see cref="TaskCanceledException"/>
@@ -120,7 +120,7 @@
         #region Edit geometries

         /// <summary>
-        /// Edit existing <see cref="Polygon"/>. This will activate editing experience on the map. Edit is completed on douple click.
+        /// Edit existing <see cref="Polygon"/>. This will activate editing experience on the map. Edit is completed on double click.
         /// </summary>
         /// <param name="sceneView">The <see cref="SceneView"/> that is used for editing.</param>
         /// <exception cref="TaskCanceledException">If previous task wasn't completed, <see cref="TaskCanceledException"/>
@@ -234,8 +234,8 @@
 						isEditingVertex = false;
 					}
 				},
-				(p) => // Douple tapped - completes task and returns new polygon
-				{
+				(p) => // Double tapped - completes task and returns new polygon
+                {
 					fillGraphic.IsVisible = false;
 					lineMoveGraphic.IsVisible = false;
 					tcs.SetResult(newPolygon);
@@ -263,7 +263,7 @@
 		}

         /// <summary>
-        /// Edit existing <see cref="Polyline"/>. This will activate editing experience on the map. Edit is completed on douple click.
+        /// Edit existing <see cref="Polyline"/>. This will activate editing experience on the map. Edit is completed on double click.
         /// </summary>
         /// <param name="sceneView">The <see cref="SceneView"/> that is used for editing.</param>
         /// <exception cref="TaskCanceledException">If previous task wasn't completed, <see cref="TaskCanceledException"/>
@@ -369,8 +369,8 @@
 						isEditingVertex = false;
 					}
 				},
-				(p) => // Douple tapped - completes task and returns new polyline
-				{
+				(p) => // Double tapped - completes task and returns new polyline
+                {
 					tcs.SetResult(newPolyline);
 				});
 			Action cleanup = () =>


Usings

Usings

--- ExploreTasks/ExploreTasks/TaskTests.cs
+++ ExploreTasks/ExploreTasks/TaskTests.cs
@@ -1,6 +1,5 @@
-using System;
+using System.Diagnostics;
 using System.Linq;
-using System.Diagnostics;
 using System.Threading;
 using System.Threading.Tasks;
 using Xunit;


Code styling

Code styling

--HG--
branch : dev

--- Extensions/Projections/SearchFilter.cs
+++ Extensions/Projections/SearchFilter.cs
@@ -1,21 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using Orchard;
+using Orchard.ContentManagement;
 using Orchard.DisplayManagement;
 using Orchard.Environment.Extensions;
 using Orchard.Forms.Services;
+using Orchard.Indexing;
 using Orchard.Localization;
 using Orchard.Projections.Descriptors.Filter;
+using Orchard.Search.Helpers;
+using Orchard.Search.Models;
 using Orchard.Search.Services;
+using Orchard.Settings;
 using Piedone.HelpfulLibraries.Utilities;
-using Orchard.ContentManagement;
-using Orchard.Search.Models;
-using Orchard.Search.Helpers;
-using Orchard.Indexing;
+using System;
+using System.Linq;
 using System.Web.Mvc;
-using Orchard.Settings;

 namespace Piedone.HelpfulExtensions.Extensions.Projections
 {
@@ -43,7 +40,7 @@
                 .Element("SearchFilter", T("Search filter"), T("Filters for items matching a search query in the site search index."),
                     ApplyFilter,
                     DisplayFilter,
-                    "SearchFilter"
+                    nameof(SearchFilter)
                 );
         }

@@ -59,28 +56,21 @@
             var hitCountLimit = 0;
             int.TryParse(context.State.HitCountLimit.ToString(), out hitCountLimit);

-            var hits = _searchService.Query(query, 0, hitCountLimit != 0 ? new Nullable<int>(hitCountLimit) : null,
+            var hits = _searchService.Query(query, 0, hitCountLimit != 0 ? new int?(hitCountLimit) : null,
                                             settings.FilterCulture, index, SearchSettingsHelper.GetSearchFields(settings, index),
                                             hit => hit);
-            if (hits.Any())
-            {
-                context.Query.WhereIdIn(hits.Select(hit => hit.ContentItemId));
-            }
-            else
-            {
-                context.Query.WhereIdIn(new[] { 0 });
-            }
+
+            if (hits.Any()) context.Query.WhereIdIn(hits.Select(hit => hit.ContentItemId));
+            else context.Query.WhereIdIn(new[] { 0 });
         }

-        public LocalizedString DisplayFilter(FilterContext context)
-        {
-            return T("Content items matched by the search query {0} in the search index \"{1}\".", context.State.SearchQuery, context.State.Index);
-        }
+        public LocalizedString DisplayFilter(FilterContext context) =>
+            T("Content items matched by the search query {0} in the search index \"{1}\".", context.State.SearchQuery, context.State.Index);
     }

     [OrchardFeature("Piedone.HelpfulExtensions.Projections.Search")]
-    public class ContentTypesFilterForms : IFormProvider
+    public class SearchFilterForm : IFormProvider
     {
         private readonly IIndexProvider _indexProvider;
         private readonly dynamic _shapeFactory;
@@ -88,7 +78,7 @@
         public Localizer T { get; set; }

-        public ContentTypesFilterForms(IShapeFactory shapeFactory, IIndexProvider indexProvider)
+        public SearchFilterForm(IShapeFactory shapeFactory, IIndexProvider indexProvider)
         {
             _shapeFactory = shapeFactory;
             _indexProvider = indexProvider;
@@ -97,40 +87,36 @@
         }

-        public void Describe(Orchard.Forms.Services.DescribeContext context)
+        public void Describe(DescribeContext context)
         {
-            Func<IShapeFactory, object> form =
-                shape =>
-                {
-                    var f = _shapeFactory.Form(
-                        Id: "SearchFilterForm",
-                        _Index: _shapeFactory.SelectList(
-                            Id: "Index", Name: "Index",
-                            Title: T("Index"),
-                            Description: T("The selected index will be queried."),
-                            Size: 5,
-                            Multiple: false),
-                        _SearchQuery: _shapeFactory.Textbox(
-                            Id: "SearchQuery", Name: "SearchQuery",
-                            Title: T("Search query"),
-                            Description: T("The search query to match against."),
-                            Classes: new[] { "tokenized" }),
-                        _HitCountLimit: _shapeFactory.Textbox(
-                            Id: "HitCountLimit", Name: "HitCountLimit",
-                            Title: T("Hit count limit"),
-                            Description: T("For performance reasons you can limit the maximal number of search hits used in the query. Having thousands of search hits will result in poor performance and increased load on the database server."))
-                        );
+            Func<IShapeFactory, object> form = shape =>
+            {
+                var f = _shapeFactory.Form(
+                    Id: nameof(SearchFilterForm),
+                    _Index: _shapeFactory.SelectList(
+                        Id: "Index", Name: "Index",
+                        Title: T("Index"),
+                        Description: T("The selected index will be queried."),
+                        Size: 5,
+                        Multiple: false),
+                    _SearchQuery: _shapeFactory.Textbox(
+                        Id: "SearchQuery", Name: "SearchQuery",
+                        Title: T("Search query"),
+                        Description: T("The search query to match against."),
+                        Classes: new[] { "tokenized" }),
+                    _HitCountLimit: _shapeFactory.Textbox(
+                        Id: "HitCountLimit", Name: "HitCountLimit",
+                        Title: T("Hit count limit"),
+                        Description: T("For performance reasons you can limit the maximal number of search hits used in the query. Having thousands of search hits will result in poor performance and increased load on the database server."))
+                    );

-                    foreach (var index in _indexProvider.List())
-                    {
-                        f._Index.Add(new SelectListItem { Value = index, Text = index });
-                    }
+                foreach (var index in _indexProvider.List())
+                    f._Index.Add(new SelectListItem { Value = index, Text = index });

+                return f;
+            };

-                    return f;
-                };
-
-            context.Form("SearchFilter", form);
+            context.Form(nameof(SearchFilter), form);
         }
     }
 }


Added stacking style adorner

Added stacking style adorner

--- GongSolutions.Wpf.DragDrop/DragDrop.cs
+++ GongSolutions.Wpf.DragDrop/DragDrop.cs
@@ -24,7 +24,7 @@
     /// </summary>
     public static readonly DependencyProperty DragDropCopyKeyStateProperty =
       DependencyProperty.RegisterAttached("DragDropCopyKeyState", typeof(DragDropKeyStates), typeof(DragDrop), new PropertyMetadata(default(DragDropKeyStates)));
-
+
     /// <summary>
     /// Gets the drag drop copy key state indicating the effect of the drag drop operation.
     /// </summary>
@@ -40,9 +40,48 @@
     {
       target.SetValue(DragDropCopyKeyStateProperty, value);
     }
+
+    public static readonly DependencyProperty ShowAdornerItemsInStackProperty =
+    DependencyProperty.RegisterAttached("ShowAdornerItemsInStack", typeof(bool), typeof(DragDrop), new PropertyMetadata(false));
+
+    public static bool GetShowAdornerItemsInStack(UIElement target)
+    {
+        return (bool)target.GetValue(ShowAdornerItemsInStackProperty);
+    }
+
+    public static void SetShowAdornerItemsInStack(UIElement target, bool value)
+    {
+        target.SetValue(ShowAdornerItemsInStackProperty, value);
+    }
+
+    public static readonly DependencyProperty StackBackgroundProperty =
+    DependencyProperty.RegisterAttached("StackBackground", typeof(SolidColorBrush), typeof(DragDrop), new PropertyMetadata(null));
+
+    public static SolidColorBrush GetStackBackground(UIElement target)
+    {
+        return (SolidColorBrush)target.GetValue(StackBackgroundProperty);
+    }
+
+    public static void SetStackBackground(UIElement target, SolidColorBrush value)
+    {
+        target.SetValue(StackBackgroundProperty, value);
+    }
+
+    public static readonly DependencyProperty StackBorderBrushProperty =
+    DependencyProperty.RegisterAttached("StackBorderBrush", typeof(SolidColorBrush), typeof(DragDrop), new PropertyMetadata(null));
+
+    public static SolidColorBrush GetStackBorderBrush(UIElement target)
+    {
+        return (SolidColorBrush)target.GetValue(StackBorderBrushProperty);
+    }
+
+    public static void SetStackBorderBrush(UIElement target, SolidColorBrush value)
+    {
+        target.SetValue(StackBorderBrushProperty, value);
+    }

     public static readonly DependencyProperty DragAdornerTemplateProperty =
-      DependencyProperty.RegisterAttached("DragAdornerTemplate", typeof(DataTemplate), typeof(DragDrop));
+    DependencyProperty.RegisterAttached("DragAdornerTemplate", typeof(DataTemplate), typeof(DragDrop));

     public static DataTemplate GetDragAdornerTemplate(UIElement target)
     {
@@ -436,6 +475,7 @@
     {
       var template = GetDragAdornerTemplate(m_DragInfo.VisualSource);
       var templateSelector = GetDragAdornerTemplateSelector(m_DragInfo.VisualSource);
+            var showInStack = GetShowAdornerItemsInStack(m_DragInfo.VisualSource);

       UIElement adornment = null;

@@ -458,39 +498,108 @@
       }

       if (template != null || templateSelector != null) {
-        if (m_DragInfo.Data is IEnumerable && !(m_DragInfo.Data is string)) {
-          if (!useDefaultDragAdorner && ((IEnumerable)m_DragInfo.Data).Cast<object>().Count() <= 10) {
-            var itemsControl = new ItemsControl();
-            itemsControl.ItemsSource = (IEnumerable)m_DragInfo.Data;
-            itemsControl.ItemTemplate = template;
-            itemsControl.ItemTemplateSelector = templateSelector;
-
-            if (useVisualSourceItemSizeForDragAdorner)
+        if (showInStack)
+        {
+            if (!useDefaultDragAdorner)
             {
-              var bounds = VisualTreeHelper.GetDescendantBounds(m_DragInfo.VisualSourceItem);
-              itemsControl.SetValue(FrameworkElement.MinWidthProperty, bounds.Width);
+                var item = new ContentPresenter();
+                item.Content = (m_DragInfo.Data is IEnumerable && !(m_DragInfo.Data is string)) ? ((IEnumerable)m_DragInfo.Data).Cast<object>().FirstOrDefault() : m_DragInfo.Data;
+                item.ContentTemplate = template;
+                item.ContentTemplateSelector = templateSelector;
+
+                Rect bounds = new Rect(0, 0, 100, 30);
+
+                if (useVisualSourceItemSizeForDragAdorner)
+                {
+                    bounds = VisualTreeHelper.GetDescendantBounds(m_DragInfo.VisualSourceItem);
+                    item.SetValue(FrameworkElement.MinWidthProperty, bounds.Width);
+                }
+
+                var count = (m_DragInfo.Data is IEnumerable && !(m_DragInfo.Data is string)) ? ((IEnumerable)m_DragInfo.Data).Cast<object>().Count() : 1;
+
+                var border = new Border();
+                border.Background = GetStackBackground(m_DragInfo.VisualSource);
+                border.BorderBrush = GetStackBorderBrush(m_DragInfo.VisualSource);
+                border.BorderThickness = new Thickness(1);
+                border.Child = item;
+                border.HorizontalAlignment = HorizontalAlignment.Left;
+                border.VerticalAlignment = VerticalAlignment.Top;
+
+                var grid = new Grid();
+                grid.Children.Add(border);
+
+                var displacement = 4;
+                if (count > 1)
+                {
+                    for (var i = 0; i < Math.Min(count - 1, 10); i++)
+                    {
+                        var stackBottom = new Border();
+                        stackBottom.Background = GetStackBackground(m_DragInfo.VisualSource);
+                        stackBottom.BorderBrush = GetStackBorderBrush(m_DragInfo.VisualSource);
+                        stackBottom.Height = displacement;
+                        stackBottom.Width = bounds.Width + 2;
+                        stackBottom.Margin = new Thickness(displacement * (i + 1), bounds.Height + displacement * i + 2, 0, 0);
+                        stackBottom.BorderThickness = new Thickness(1, 0, 1, 1);
+                        stackBottom.HorizontalAlignment = HorizontalAlignment.Left;
+                        stackBottom.VerticalAlignment = VerticalAlignment.Top;
+
+                        var stackRight = new Border();
+                        stackRight.Background = GetStackBackground(m_DragInfo.VisualSource);
+                        stackRight.BorderBrush = GetStackBorderBrush(m_DragInfo.VisualSource);
+                        stackRight.Height = bounds.Height - displacement + 2;
+                        stackRight.Width = displacement;
+                        stackRight.Margin = new Thickness(bounds.Width + (displacement) * i + 2, displacement * (i + 1), 0, 0);
+                        stackRight.BorderThickness = new Thickness(0, 1, 1, 0);
+                        stackRight.HorizontalAlignment = HorizontalAlignment.Left;
+                        stackRight.VerticalAlignment = VerticalAlignment.Top;
+
+                        grid.Children.Add(stackBottom);
+                        grid.Children.Add(stackRight);
+                    }
+                }
+
+                adornment = grid;
+
             }
-
-            // The ItemsControl doesn't display unless we create a grid to contain it.
-            // Not quite sure why we need this...
-            var grid = new Grid();
-            grid.Children.Add(itemsControl);
-            adornment = grid;
-          }
-        } else {
-          var contentPresenter = new ContentPresenter();
-          contentPresenter.Content = m_DragInfo.Data;
-          contentPresenter.ContentTemplate = template;
-          contentPresenter.ContentTemplateSelector = templateSelector;
-
-          if (useVisualSourceItemSizeForDragAdorner)
-          {
-            var bounds = VisualTreeHelper.GetDescendantBounds(m_DragInfo.VisualSourceItem);
-            contentPresenter.SetValue(FrameworkElement.MinWidthProperty, bounds.Width);
-            contentPresenter.SetValue(FrameworkElement.MinHeightProperty, bounds.Height);
-          }
-
-          adornment = contentPresenter;
+        }
+        else {
+            if (m_DragInfo.Data is IEnumerable && !(m_DragInfo.Data is string))
+            {
+                if (!useDefaultDragAdorner && ((IEnumerable)m_DragInfo.Data).Cast<object>().Count() <= 10)
+                {
+                    var itemsControl = new ItemsControl();
+                    itemsControl.ItemsSource = (IEnumerable)m_DragInfo.Data;
+                    itemsControl.ItemTemplate = template;
+                    itemsControl.ItemTemplateSelector = templateSelector;
+
+                    if (useVisualSourceItemSizeForDragAdorner)
+                    {
+                        var bounds = VisualTreeHelper.GetDescendantBounds(m_DragInfo.VisualSourceItem);
+                        itemsControl.SetValue(FrameworkElement.MinWidthProperty, bounds.Width);
+                    }
+
+                    // The ItemsControl doesn't display unless we create a grid to contain it.
+                    // Not quite sure why we need this...
+                    var grid = new Grid();
+                    grid.Children.Add(itemsControl);
+                    adornment = grid;
+                }
+            }
+            else {
+                var contentPresenter = new ContentPresenter();
+                contentPresenter.Content = m_DragInfo.Data;
+                contentPresenter.ContentTemplate = template;
+                contentPresenter.ContentTemplateSelector = templateSelector;
+
+                if (useVisualSourceItemSizeForDragAdorner)
+                {
+                    var bounds = VisualTreeHelper.GetDescendantBounds(m_DragInfo.VisualSourceItem);
+                    contentPresenter.SetValue(FrameworkElement.MinWidthProperty, bounds.Width);
+                    contentPresenter.SetValue(FrameworkElement.MinHeightProperty, bounds.Height);
+                }
+
+                adornment = contentPresenter;
+            }
         }
       }


Don't try to shutdown if e.Cancel already set.

This allows users to add their own `ShutdownRequested` handlers which can override the lifetime's handler.

--- src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs
+++ src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs
@@ -132,6 +132,9 @@

         private void ShutdownRequested(object sender, CancelEventArgs e)
         {
+            if (e.Cancel)
+                return;
+
             // When an OS shutdown request is received, try to close all non-owned windows. Windows can cancel
             // shutdown by setting e.Cancel = true in the Closing event. Owned windows will be shutdown by their
             // owners.


Cleanup namespaces

Cleanup namespaces

Remove and sort

--- src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs
+++ src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs
@@ -12,7 +12,6 @@
 //

 using System.Collections.Generic;
-using System.Collections;
 using System.Globalization;

 namespace System.Text.RegularExpressions
@@ -70,7 +69,7 @@
             {
                 int[] expanded = new int[_depth * 2];

-                System.Array.Copy(_intStack, 0, expanded, 0, _depth);
+                Array.Copy(_intStack, 0, expanded, 0, _depth);

                 _intStack = expanded;
             }


revert

revert

--- src/Workspaces/CSharp/Portable/Extensions/ParenthesizedExpressionSyntaxExtensions.cs
+++ src/Workspaces/CSharp/Portable/Extensions/ParenthesizedExpressionSyntaxExtensions.cs
@@ -269,8 +269,7 @@
             return parentExpression != null && !RemovalChangesAssociation(node, parentExpression, semanticModel);
         }

-        private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool
-            = SharedPools.Default<Stack<SyntaxNode>>();
+        private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();

         private static bool RemovalMayIntroduceInterpolationAmbiguity(ParenthesizedExpressionSyntax node)
         {


Update src/Workspaces/Core/MSBuild/MSBuild/MSBuildProjectLoader.Worker_ResolveReferences.cs

Co-Authored-By: Joey Robichaud <681506cb781ec8e7123da10968e977916bbcfe04@microsoft.com>

--- src/Workspaces/Core/MSBuild/MSBuild/MSBuildProjectLoader.Worker_ResolveReferences.cs
+++ src/Workspaces/Core/MSBuild/MSBuild/MSBuildProjectLoader.Worker_ResolveReferences.cs
@@ -307,7 +307,7 @@
                     // Compilation with it.

                     var outputRefFilePath = projectReferenceInfo.OutputRefFilePath;
-                    if (!File.Exists(projectReferenceInfo.OutputRefFilePath) && outputRefFilePath != null)
+                    if (outputRefFilePath != null && !File.Exists(outputRefFilePath))
                     {
                         builder.Remove(outputRefFilePath);
                     }


Implementation of IDeserializationCallback to recreate the look-up tables on deserialisation.

--- Brazil/Tables.cs
+++ Brazil/Tables.cs
@@ -1,9 +1,10 @@

 using System;
+using System.Runtime.Serialization;
 namespace BeeDevelopment.Brazil {
-	public partial class Z80A {
-
-		public void InitialiseTables() {
+	public partial class Z80A : IDeserializationCallback {
+
+		private void InitialiseTables() {
 			this.InitTableInc();
 			this.InitTableDec();
 			this.InitTableParity();
@@ -317,5 +318,8 @@

+		public void OnDeserialization(object sender) {
+			this.InitialiseTables();
+		}
 	}
 }


Update flood.cs

Update flood.cs

Fixed spelling error on line 6.


Changed to convert

Changed to convert

--- AngleSharp/DocumentBuilder.cs
+++ AngleSharp/DocumentBuilder.cs
@@ -113,7 +113,7 @@
                 configuration = AngleSharp.Configuration.Default;

             var browsingContext = new SimpleBrowsingContext(configuration, Sandboxes.None);
-            return browsingContext.OpenAsync(new Url(url), cancel);
+            return browsingContext.OpenAsync(Url.Convert(url), cancel);
         }

         /// <summary>


Added trailing space to default isindex prompt

--- AngleSharp/Html/HtmlParser.cs
+++ AngleSharp/Html/HtmlParser.cs
@@ -1188,7 +1188,7 @@
                             if (tag.GetAttribute("prompt") != String.Empty)
                                 InsertCharacters(tag.GetAttribute("prompt"));
                             else
-                                InsertCharacters("This is a searchable index. Enter search keywords:");
+                                InsertCharacters("This is a searchable index. Enter search keywords: ");

                             var input = HtmlToken.OpenTag(HTMLInputElement.Tag);
                             input.AddAttribute("name", HTMLIsIndexElement.Tag);


Implement auto play delay

Implement auto play delay

--- AnimatorComponent/Animator.cs
+++ AnimatorComponent/Animator.cs
@@ -662,12 +662,11 @@

         #region ANIMATION HANDLERS
         /// <summary>
-        /// Decides whether to start animation playback on enter play mode.
+        /// Decides if to start animation playback on enter play mode.
         /// </summary>
         private void HandleStartAnimation() {
             if (Application.isPlaying && SettingsAsset.AutoPlay) {
-                StartAnimation();
-                //IsRunning = true;
+                Invoke("StartAnimation", SettingsAsset.AutoPlayDelay);
             }
         }


Fix initialization of the tilting curve

Fix initialization of the tilting curve

--- AnimatorComponent/PathData.cs
+++ AnimatorComponent/PathData.cs
@@ -204,7 +204,7 @@
             }
             if (tiltingCurve == null) {
                 tiltingCurve = new AnimationCurve();
-                InitializeEaseCurve();
+                InitializeTiltingCurve();
             }
         }


Trying a different way. Will remove commented code in a bit

--- Anlab.Core/Domain/TestItem.cs
+++ Anlab.Core/Domain/TestItem.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
 using System.Text;
 using System.Text.Encodings.Web;

@@ -22,6 +23,13 @@
         [Required]
         [StringLength(64)]
         public string Category { get; set; }
+
+        [NotMapped]
+        //public string[] Categories => Category?.Split('|');
+        public string[] Categories {
+            get => Category != null ? Category.Split('|') : new string[0];
+            set => Category = string.Join("|", value);
+        }

         [Required]
         [StringLength(8)]


Don't actually need a block request queue, only need one (since denotes a region)

--- Assets/MapGen/DFConnection.cs
+++ Assets/MapGen/DFConnection.cs
@@ -8,19 +8,22 @@

 public class DFConnection : MonoBehaviour {

+    // Assignable values
+    public int BlocksToFetch = 4;
+
     // Singleton stuff
     private static DFConnection _instance = null;
     private static List<System.Action> connectionCallbacks = new List<System.Action>();

     // Remote bindings
-    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MaterialList> MaterialListCall;
-    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.TiletypeList> TiletypeListCall;
-    private RemoteFunction<RemoteFortressReader.BlockRequest, RemoteFortressReader.BlockList> BlockListCall;
-    private RemoteFunction<dfproto.EmptyMessage> HashCheckCall;
-    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.UnitList> UnitListCall;
-    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.ViewInfo> ViewInfoCall;
-    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MapInfo> MapInfoCall;
-    private RemoteFunction<dfproto.EmptyMessage> MapResetCall;
+    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MaterialList> materialListCall;
+    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.TiletypeList> tiletypeListCall;
+    private RemoteFunction<RemoteFortressReader.BlockRequest, RemoteFortressReader.BlockList> blockListCall;
+    private RemoteFunction<dfproto.EmptyMessage> hashCheckCall;
+    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.UnitList> unitListCall;
+    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.ViewInfo> viewInfoCall;
+    private RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MapInfo> mapInfoCall;
+    private RemoteFunction<dfproto.EmptyMessage> mapResetCall;
     private color_ostream dfNetworkOut;
     private RemoteClient networkClient;

@@ -31,15 +34,40 @@
     private RemoteFortressReader.ViewInfo _netViewInfo;
     private RemoteFortressReader.UnitList _netUnitList;

-    // Special stuff for map blocks
-    private Queue<RemoteFortressReader.BlockRequest> pendingBlockRequests;
+    // Special stuff for map blocks.
+    // Coordinates of the region we're pulling data from:
+    private DFCoord _requestRegionMin;
+    private DFCoord _requestRegionMax;
+    public DFCoord RequestRegionMin {
+        get {
+            return _requestRegionMin;
+        }
+        set {
+            blockRequest.min_x = value.x;
+            blockRequest.min_y = value.y;
+            blockRequest.min_z = value.z;
+            _requestRegionMin = value;
+        }
+    }
+    public DFCoord RequestRegionMax {
+        get {
+            return _requestRegionMax;
+        }
+        set {
+
+            blockRequest.max_x = value.x;
+            blockRequest.max_y = value.y;
+            blockRequest.max_z = value.z;
+            _requestRegionMax = value;
+        }
+    }
+    // Cached block request
+    private RemoteFortressReader.BlockRequest blockRequest;
     // We use this as a (sort of) queue-
-    // It pulls elements in random order, but makes sure that
+    // It pops elements in random order, but makes sure that
     // we don't bother storing two updates to the same block at once
     private Dictionary<DFCoord, RemoteFortressReader.MapBlock> pendingBlocks;

-    private const int MAX_BLOCK_REQUESTS_TO_RUN = 2;
-
     public static DFConnection Instance {
         get {
             return _instance;
@@ -77,10 +105,6 @@
         get {
             return _netViewInfo;
         }
-    }
-
-    public void RequestMapBlock (RemoteFortressReader.BlockRequest req) {
-        pendingBlockRequests.Enqueue(req);
     }

     public RemoteFortressReader.MapBlock PopMapBlock () {
@@ -93,8 +117,11 @@
         return pair.Value;
     }

-
-    void Connect () {
+    // Connect to DF, fetch initial data, start things running
+    void ConnectAndInit () {
+        blockRequest = new RemoteFortressReader.BlockRequest();
+        blockRequest.blocks_needed = BlocksToFetch;
+        pendingBlocks = new Dictionary<DFCoord, RemoteFortressReader.MapBlock>();
         networkClient = new DFHack.RemoteClient(dfNetworkOut);
         bool success = networkClient.connect();
         if (!success) {
@@ -105,7 +132,8 @@
         BindMethods();
         FetchUnchangingInfo();
         PollDF();
-        MapResetCall.execute();
+        mapResetCall.execute();
+        PopulateTokenLists();

         foreach (System.Action callback in connectionCallbacks) {
             callback.Invoke();
@@ -113,23 +141,52 @@
         connectionCallbacks.Clear();
     }

+    // Bind the RPC functions we'll be calling
     void BindMethods () {
-        MaterialListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MaterialList>();
-        MaterialListCall.bind(networkClient, "GetMaterialList", "RemoteFortressReader");
-        TiletypeListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.TiletypeList>();
-        TiletypeListCall.bind(networkClient, "GetTiletypeList", "RemoteFortressReader");
-        BlockListCall = new RemoteFunction<RemoteFortressReader.BlockRequest, RemoteFortressReader.BlockList>();
-        BlockListCall.bind(networkClient, "GetBlockList", "RemoteFortressReader");
-        HashCheckCall = new RemoteFunction<dfproto.EmptyMessage>();
-        HashCheckCall.bind(networkClient, "CheckHashes", "RemoteFortressReader");
-        UnitListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.UnitList>();
-        UnitListCall.bind(networkClient, "GetUnitList", "RemoteFortressReader");
-        ViewInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.ViewInfo>();
-        ViewInfoCall.bind(networkClient, "GetViewInfo", "RemoteFortressReader");
-        MapInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MapInfo>();
-        MapInfoCall.bind(networkClient, "GetMapInfo", "RemoteFortressReader");
-        MapResetCall = new RemoteFunction<dfproto.EmptyMessage>();
-        MapResetCall.bind(networkClient, "ResetMapHashes", "RemoteFortressReader");
+        materialListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MaterialList>();
+        materialListCall.bind(networkClient, "GetMaterialList", "RemoteFortressReader");
+        tiletypeListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.TiletypeList>();
+        tiletypeListCall.bind(networkClient, "GetTiletypeList", "RemoteFortressReader");
+        blockListCall = new RemoteFunction<RemoteFortressReader.BlockRequest, RemoteFortressReader.BlockList>();
+        blockListCall.bind(networkClient, "GetBlockList", "RemoteFortressReader");
+        hashCheckCall = new RemoteFunction<dfproto.EmptyMessage>();
+        hashCheckCall.bind(networkClient, "CheckHashes", "RemoteFortressReader");
+        unitListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.UnitList>();
+        unitListCall.bind(networkClient, "GetUnitList", "RemoteFortressReader");
+        viewInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.ViewInfo>();
+        viewInfoCall.bind(networkClient, "GetViewInfo", "RemoteFortressReader");
+        mapInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MapInfo>();
+        mapInfoCall.bind(networkClient, "GetMapInfo", "RemoteFortressReader");
+        mapResetCall = new RemoteFunction<dfproto.EmptyMessage>();
+        mapResetCall.bind(networkClient, "ResetMapHashes", "RemoteFortressReader");
+    }
+
+    // Get information that only needs to be read once
+    void FetchUnchangingInfo () {
+        materialListCall.execute(null, out _netMaterialList);
+        tiletypeListCall.execute(null, out _netTiletypeList);
+        mapInfoCall.execute(null, out _netMapInfo);
+    }
+
+    // Fetch information that changes & read some pending map blocks
+    void PollDF () {
+        networkClient.suspend_game();
+        viewInfoCall.execute(null, out _netViewInfo);
+        unitListCall.execute(null, out _netUnitList);
+        RemoteFortressReader.BlockList resultList;
+        blockListCall.execute(blockRequest, out resultList);
+        foreach (RemoteFortressReader.MapBlock block in resultList.map_blocks) {
+                pendingBlocks[new DFCoord(block.map_x, block.map_y, block.map_z)] =
+                    block;
+        }
+        networkClient.resume_game();
+    }
+
+    //
+    void PopulateTokenLists () {
+        MaterialTokenList.matTokenList = _netMaterialList.material_list;
+        TiletypeTokenList.tiletypeTokenList = _netTiletypeList.tiletype_list;
+        MapTile.tiletypeTokenList = _netTiletypeList.tiletype_list;
     }

 	void Start () {
@@ -137,9 +194,8 @@
             throw new UnityException("Can't have multiple dwarf fortress connections!");
         }
         _instance = this;
-        pendingBlockRequests = new Queue<RemoteFortressReader.BlockRequest>();
-        pendingBlocks = new Dictionary<DFCoord, RemoteFortressReader.MapBlock>();
-        Connect();
+
+        ConnectAndInit();
     }

 	void Update () {
@@ -154,26 +210,5 @@
         PollDF();
 	}

-    void FetchUnchangingInfo () {
-        MaterialListCall.execute(null, out _netMaterialList);
-        TiletypeListCall.execute(null, out _netTiletypeList);
-        MapInfoCall.execute(null, out _netMapInfo);
-    }
-
-    void PollDF () {
-        networkClient.suspend_game();
-        ViewInfoCall.execute(null, out _netViewInfo);
-        UnitListCall.execute(null, out _netUnitList);
-        for (int i = 0; i < MAX_BLOCK_REQUESTS_TO_RUN; i++) {
-            if (pendingBlockRequests.Count == 0) break;
-            RemoteFortressReader.BlockRequest req = pendingBlockRequests.Dequeue();
-            RemoteFortressReader.BlockList resultList;
-            BlockListCall.execute(req, out resultList);
-            foreach (RemoteFortressReader.MapBlock block in resultList.map_blocks) {
-                pendingBlocks[new DFCoord(block.map_x, block.map_y, block.map_z)] =
-                    block;
-            }
-        }
-        networkClient.resume_game();
-    }
+
 }


fix exception on empty file

fix exception on empty file

--- CSV/CsvReader.cs
+++ CSV/CsvReader.cs
@@ -34,11 +34,16 @@
             RowDelimeter = rowDelimeter;
             ColumnDelimeter = columnDelimeter;
             HeaderRowCount = headerRowCount;
-
+
             if (headerRowCount > 0)
             {
-                Header = Reader.ReadLine(rowDelimeter).Split(columnDelimeter);
-                HeaderRowCount--;
+                var headerLine = Reader.ReadLine(rowDelimeter);
+                if (headerLine == null)
+                    Header = new string[0] { };
+                else {
+                    Header = headerLine.Split(columnDelimeter);
+                    HeaderRowCount--;
+                }
             }
         }


Fix unit tests

Fix unit tests

--- test/Microsoft.ApplicationInsights.AspNetCore.Tests/RequestTrackingMiddlewareTest.cs
+++ test/Microsoft.ApplicationInsights.AspNetCore.Tests/RequestTrackingMiddlewareTest.cs
@@ -83,7 +83,7 @@

             HandleRequestEnd(context, 0);

-            Assert.Equal(1, sentTelemetry.Count);
+            Assert.Single(sentTelemetry);
             Assert.IsType<RequestTelemetry>(this.sentTelemetry.First());

             RequestTelemetry requestTelemetry = this.sentTelemetry.First() as RequestTelemetry;
@@ -108,7 +108,7 @@

             HandleRequestEnd(context, 0);

-            Assert.Equal(1, sentTelemetry.Count);
+            Assert.Single(sentTelemetry);
             Assert.IsType<RequestTelemetry>(this.sentTelemetry.First());
             RequestTelemetry requestTelemetry = sentTelemetry.First() as RequestTelemetry;
             Assert.NotNull(requestTelemetry.Url);
@@ -309,14 +309,13 @@

             HandleRequestEnd(context, 0);

-            Assert.Equal(1, sentTelemetry.Count);
+            Assert.Single(sentTelemetry);
             Assert.IsType<RequestTelemetry>(this.sentTelemetry.First());
             RequestTelemetry requestTelemetry = this.sentTelemetry.First() as RequestTelemetry;
             Assert.True(requestTelemetry.Duration.TotalMilliseconds >= 0);
             Assert.True(requestTelemetry.Success);
             Assert.Equal(CommonMocks.InstrumentationKey, requestTelemetry.Context.InstrumentationKey);
-            Assert.Equal("", requestTelemetry.Source);
-            Assert.Equal("POST", requestTelemetry.HttpMethod);
+            Assert.Equal("", requestTelemetry.Source);
             Assert.Equal(CreateUri(HttpRequestScheme, HttpRequestHost, "/Test"), requestTelemetry.Url);
             Assert.NotEmpty(requestTelemetry.Context.GetInternalContext().SdkVersion);
             Assert.Contains(SdkVersionTestUtils.VersionPrefix, requestTelemetry.Context.GetInternalContext().SdkVersion);
@@ -341,8 +340,7 @@
             Assert.True(requestTelemetry.Duration.TotalMilliseconds >= 0);
             Assert.True(requestTelemetry.Success);
             Assert.Equal(CommonMocks.InstrumentationKey, requestTelemetry.Context.InstrumentationKey);
-            Assert.Equal("", requestTelemetry.Source);
-            Assert.Equal("GET", requestTelemetry.HttpMethod);
+            Assert.Equal("", requestTelemetry.Source);
             Assert.Equal(CreateUri(HttpRequestScheme, HttpRequestHost, "/Test"), requestTelemetry.Url);
             Assert.NotEmpty(requestTelemetry.Context.GetInternalContext().SdkVersion);
             Assert.Contains(SdkVersionTestUtils.VersionPrefix, requestTelemetry.Context.GetInternalContext().SdkVersion);
@@ -369,8 +367,7 @@
             Assert.True(requestTelemetry.Duration.TotalMilliseconds >= 0);
             Assert.True(requestTelemetry.Success);
             Assert.Equal(CommonMocks.InstrumentationKey, requestTelemetry.Context.InstrumentationKey);
-            Assert.Equal("", requestTelemetry.Source);
-            Assert.Equal("GET", requestTelemetry.HttpMethod);
+            Assert.Equal("", requestTelemetry.Source);
             Assert.Equal(CreateUri(HttpRequestScheme, HttpRequestHost, "/Test"), requestTelemetry.Url);
             Assert.NotEmpty(requestTelemetry.Context.GetInternalContext().SdkVersion);
             Assert.Contains(SdkVersionTestUtils.VersionPrefix, requestTelemetry.Context.GetInternalContext().SdkVersion);
@@ -390,14 +387,13 @@

             HandleRequestEnd(context, 0);

-            Assert.Equal(1, sentTelemetry.Count);
+            Assert.Single(sentTelemetry);
             Assert.IsType<RequestTelemetry>(this.sentTelemetry.First());
             RequestTelemetry requestTelemetry = this.sentTelemetry.First() as RequestTelemetry;
             Assert.True(requestTelemetry.Duration.TotalMilliseconds >= 0);
             Assert.True(requestTelemetry.Success);
             Assert.Equal(CommonMocks.InstrumentationKey, requestTelemetry.Context.InstrumentationKey);
-            Assert.Equal("", requestTelemetry.Source);
-            Assert.Equal("GET", requestTelemetry.HttpMethod);
+            Assert.Equal("", requestTelemetry.Source);
             Assert.Equal(CreateUri(HttpRequestScheme, HttpRequestHost, "/Test"), requestTelemetry.Url);
             Assert.NotEmpty(requestTelemetry.Context.GetInternalContext().SdkVersion);
             Assert.Contains(SdkVersionTestUtils.VersionPrefix, requestTelemetry.Context.GetInternalContext().SdkVersion);


changed NavGraph array orientation so that array indices correspond to graph [1][3]  == (1,3) instead of [1][3] == (3,1)

--- FFTools_NavigatorGraph.cs
+++ FFTools_NavigatorGraph.cs
@@ -91,9 +91,9 @@
             //only need 4 corners of old graph to build encompassing new graph
             if(this.Size != 0) {
                 locations.Add(this.NavGraph[0][0].location);
-                locations.Add(this.NavGraph[0][NavGraph.Length-1].location);
-                locations.Add(this.NavGraph[NavGraph[0].Length-1][0].location);
-                locations.Add(this.NavGraph[NavGraph[0].Length-1][NavGraph.Length-1].location);
+                locations.Add(this.NavGraph[0][NavGraph[0].Length-1].location);
+                locations.Add(this.NavGraph[NavGraph.Length-1][0].location);
+                locations.Add(this.NavGraph[NavGraph.Length-1][NavGraph[0].Length-1].location);
             }

             //find dimensions in "in-game" units to hold all locations
@@ -144,36 +144,31 @@
             int graphHeight = (int) (totalY/DIST_PER_GRID);

             //create new graph
-            GraphNode[][] newGraph = new GraphNode[graphHeight][];
-            for (int y = 0; y < graphHeight; y++) {
-                newGraph[y] = new GraphNode[graphWidth];
+            GraphNode[][] newGraph = new GraphNode[graphWidth][];
+            for (int x = 0; x < graphWidth; x++) {
+                newGraph[x] = new GraphNode[graphHeight];
             }

             //populate new graph
             //initial "in-game" coordinates stored in [0][0] = most negative X, most negative Y + buffers applied
             float graphX = tmp_minX + DIST_PER_GRID/2;
             float graphY = tmp_minY + DIST_PER_GRID/2;
-            float tmp_graphY = graphY;
+            float tmp_graphX = graphX;
             //fill in all grids
-            for (int y = 0; y < graphHeight; y++) {
-                float tmp_graphX = graphX;
-                for (int x = 0; x < graphWidth; x++) {
+            for (int x = 0; x < graphWidth; x++) {
+                float tmp_graphY = graphY;
+                for (int y = 0; y < graphHeight; y++) {
                     int oldX, oldY;
                     Location new_location = new Location(tmp_graphX, tmp_graphY, 0);
                     if(this.findLocation(new_location, out oldX, out oldY)) {
-                    //if location was in old graph, copy old graph properties
-                        //System.Console.WriteLine("x: " + x +
-                        //                      " y: " + y +
-                        //                      " oldX: " + oldX +
-                        //                      " oldY: " + oldY);
-                        newGraph[y][x] = this.NavGraph[oldY][oldX];
+                        newGraph[x][y] = this.NavGraph[oldX][oldY];
                     }
                     else {
-                        newGraph[y][x] = new GraphNode(new_location, true, true, true, true);    //NavGraph Z coordinates aren't used
-                    }
-                    tmp_graphX = tmp_graphX + DIST_PER_GRID;
-                }
-                tmp_graphY = tmp_graphY + DIST_PER_GRID;
+                        newGraph[x][y] = new GraphNode(new_location, true, true, true, true);    //NavGraph Z coordinates aren't used
+                    }
+                    tmp_graphY = tmp_graphY + DIST_PER_GRID;
+                }
+                tmp_graphX = tmp_graphX + DIST_PER_GRID;
             }
             this.NavGraph = newGraph;
             this.minX = tmp_minX;
@@ -220,7 +215,7 @@
         public void markObstacle (Location location, Move direction) {
             int x, y;
             if (this.findLocation(location, out x, out y))
-                this.NavGraph[y][x].canTravelFrom[(int) direction] = false;
+                this.NavGraph[x][y].canTravelFrom[(int) direction] = false;
             else
                 System.Console.WriteLine("Obstacle unmarkable, does not exist in graph: " + location.ToString());
         }
@@ -229,26 +224,26 @@
             List <int[]> adjacent = new List <int[]> ();
             //4 possibilities
             //North
-            if( (y+1) < NavGraph.Length) { //check within graph bounds
-                if (NavGraph[y+1][x].canTravelFrom[(int)Move.StoN]) { //check if we can reach node going in this direction
+            if( (y+1) < NavGraph[0].Length) { //check within graph bounds
+                if (NavGraph[x][y+1].canTravelFrom[(int)Move.StoN]) { //check if we can reach node going in this direction
                     adjacent.Add(new int[] {x,y+1});
                 }
             }
             //East
-            if( (x+1) < NavGraph[0].Length) { //check within graph bounds
-                if (NavGraph[y][x+1].canTravelFrom[(int)Move.WtoE]) { //check if we can reach node going in this direction
+            if( (x+1) < NavGraph.Length) { //check within graph bounds
+                if (NavGraph[x+1][y].canTravelFrom[(int)Move.WtoE]) { //check if we can reach node going in this direction
                     adjacent.Add(new int[] {x+1,y});
                 }
             }
             //South
             if( (y-1) >= 0) { //check within graph bounds
-                if (NavGraph[y-1][x].canTravelFrom[(int)Move.NtoS]) { //check if we can reach node going in this direction
+                if (NavGraph[x][y-1].canTravelFrom[(int)Move.NtoS]) { //check if we can reach node going in this direction
                     adjacent.Add(new int[] {x,y-1});
                 }
             }
             //West
             if( (x-1) >= 0) { //check within graph bounds
-                if (NavGraph[y][x-1].canTravelFrom[(int)Move.EtoW]) { //check if we can reach node going in this direction
+                if (NavGraph[x-1][y].canTravelFrom[(int)Move.EtoW]) { //check if we can reach node going in this direction
                     adjacent.Add(new int[] {x-1,y});
                 }
             }
@@ -265,12 +260,12 @@
             List <Location> path = new List <Location> ();
             PriorityQueue <GraphNode> openNodes = new PriorityQueue <GraphNode> ();
             //reset all scores to MaxValue, fromX/formY to -1
-            for (int y = 0; y < NavGraph.Length; y++) {
-                for (int x = 0; x < NavGraph[0].Length; x++) {
-                    NavGraph[y][x].costToNode = int.MaxValue;
-                    NavGraph[y][x].costToTarget = int.MaxValue;
-                    NavGraph[y][x].fromX = -1;
-                    NavGraph[y][x].fromY = -1;
+            for (int x = 0; x < NavGraph.Length; x++) {
+                for (int y = 0; y < NavGraph[0].Length; y++) {
+                    NavGraph[x][y].costToNode = int.MaxValue;
+                    NavGraph[x][y].costToTarget = int.MaxValue;
+                    NavGraph[x][y].fromX = -1;
+                    NavGraph[x][y].fromY = -1;
                 }
             }
             System.Console.WriteLine("done clearing cost and fromX/Y values");
@@ -287,12 +282,12 @@
             //dont use direct distance since we can't currently travel diagonally in graph
             //NavGraph[startY][startX].costToTarget = (int)Math.Ceiling(Math.Sqrt(Math.Pow(startX-endX, 2) + Math.Pow(startY-endY, 2)));
             //use min # of grids needed to traverse to target assuming no obstacles
-            NavGraph[startY][startX].costToTarget = Math.Abs(startX-endX) + Math.Abs(startY-endY);
-            NavGraph[startY][startX].fromX = startX;
-            NavGraph[startY][startX].fromY = startY;
+            NavGraph[startX][startY].costToTarget = Math.Abs(startX-endX) + Math.Abs(startY-endY);
+            NavGraph[startX][startY].fromX = startX;
+            NavGraph[startX][startY].fromY = startY;
             int currentX = startX;
             int currentY = startY;
-            openNodes.addNew(NavGraph[startY][startX]);
+            openNodes.addNew(NavGraph[startX][startY]);
             while (openNodes.Count > 0) {
                 GraphNode currentNode = openNodes.removeTop();
                 System.Console.WriteLine("Finding currentNode");
@@ -312,14 +307,14 @@
                     //int costToTarget = (int)Math.Ceiling(Math.Sqrt(Math.Pow(dx, 2) + Math.Pow(dy, 2)));
                     int costToTarget = Math.Abs(dx) + Math.Abs(dy);
                     int score = costToNode + costToTarget;
-                    System.Console.WriteLine("Node " + adjacent[0] + "," + adjacent[1] + " | Calculated Score: " + score + " | Current Score: " + NavGraph[adjacentY][adjacentX].Score);
-                    if (score < NavGraph[adjacentY][adjacentX].Score) {
+                    System.Console.WriteLine("Node " + adjacent[0] + "," + adjacent[1] + " | Calculated Score: " + score + " | Current Score: " + NavGraph[adjacentX][adjacentY].Score);
+                    if (score < NavGraph[adjacentX][adjacentY].Score) {
                         System.Console.WriteLine("\tAdding " + adjacentX + "," + adjacentY);
-                        NavGraph[adjacentY][adjacentX].costToTarget = costToTarget;
-                        NavGraph[adjacentY][adjacentX].costToNode = costToNode;
-                        NavGraph[adjacentY][adjacentX].fromX = currentX;
-                        NavGraph[adjacentY][adjacentX].fromY = currentY;
-                        openNodes.addNew(NavGraph[adjacentY][adjacentX]);
+                        NavGraph[adjacentX][adjacentY].costToTarget = costToTarget;
+                        NavGraph[adjacentX][adjacentY].costToNode = costToNode;
+                        NavGraph[adjacentX][adjacentY].fromX = currentX;
+                        NavGraph[adjacentX][adjacentY].fromY = currentY;
+                        openNodes.addNew(NavGraph[adjacentX][adjacentY]);
                     }
                 }
                 this.Print();
@@ -331,10 +326,10 @@
             System.Console.WriteLine("Start x,y: " + startX + "," + startY);
             while (!((currentX == startX) && (currentY == startY))) {
               System.Console.WriteLine("Current x,y: " + currentX + "," + currentY);
-              path.Add(NavGraph[currentY][currentX].location);
-              System.Console.WriteLine("\t From x,y: " + NavGraph[currentY][currentX].fromX + "," + NavGraph[currentY][currentX].fromY);
-              int tmpX = NavGraph[currentY][currentX].fromX;
-              int tmpY = NavGraph[currentY][currentX].fromY;
+              path.Add(NavGraph[currentX][currentY].location);
+              System.Console.WriteLine("\t From x,y: " + NavGraph[currentX][currentY].fromX + "," + NavGraph[currentX][currentY].fromY);
+              int tmpX = NavGraph[currentX][currentY].fromX;
+              int tmpY = NavGraph[currentX][currentY].fromY;
               currentX = tmpX;
               currentY = tmpY;
             }
@@ -355,8 +350,8 @@
             String line4 = "";
             String line5 = "";
             String line6 = "";
-            for (int y = this.NavGraph.Length-1; y >= 0; y--) {
-                for (int x = 0; x < this.NavGraph[y].Length; x++) {
+            for (int y = this.NavGraph[0].Length-1; y >= 0; y--) {
+                for (int x = 0; x < this.NavGraph.Length; x++) {
                     line0 = line0 + "\t";
                     line1 = line1 + "\t";
                     line2 = line2 + "\t";
@@ -364,10 +359,10 @@
                     line4 = line4 + "\t";
                     line5 = line5 + "\t";
                     line6 = line6 + "\t";
-                    if (!NavGraph[y][x].canTravelFrom[(int)Move.NtoS]) {
+                    if (!NavGraph[x][y].canTravelFrom[(int)Move.NtoS]) {
                         line0 = line0 + "-------";
                     }
-                    if (!NavGraph[y][x].canTravelFrom[(int)Move.WtoE]) {
+                    if (!NavGraph[x][y].canTravelFrom[(int)Move.WtoE]) {
                         line1 = line1 + "|";
                         line2 = line2 + "|";
                         line3 = line3 + "|";
@@ -380,21 +375,21 @@
                         line4 = line4 + " ";
                         line5 = line5 + " ";
                     }
-                    if (!NavGraph[y][x].canTravelFrom[(int)Move.StoN]) {
+                    if (!NavGraph[x][y].canTravelFrom[(int)Move.StoN]) {
                         line6 = line6 + "-------";
                     }
-                    line1 = line1 + this.NavGraph[y][x].location.x.ToString("n1");
-                    line2 = line2 + this.NavGraph[y][x].location.y.ToString("n1");
-                    if(this.NavGraph[y][x].costToNode != int.MaxValue)
-                        line3 = line3 + this.NavGraph[y][x].costToNode;
+                    line1 = line1 + this.NavGraph[x][y].location.x.ToString("n1");
+                    line2 = line2 + this.NavGraph[x][y].location.y.ToString("n1");
+                    if(this.NavGraph[x][y].costToNode != int.MaxValue)
+                        line3 = line3 + this.NavGraph[x][y].costToNode;
                     else
                         line3 = line3 + "Max";
-                    if(this.NavGraph[y][x].costToTarget != int.MaxValue)
-                        line4 = line4 + this.NavGraph[y][x].costToTarget;
+                    if(this.NavGraph[x][y].costToTarget != int.MaxValue)
+                        line4 = line4 + this.NavGraph[x][y].costToTarget;
                     else
                         line4 = line4 + "Max";
-                    line5 = line5 + this.NavGraph[y][x].fromX+","+this.NavGraph[y][x].fromY;
-                    if (!NavGraph[y][x].canTravelFrom[(int)Move.EtoW])
+                    line5 = line5 + this.NavGraph[x][y].fromX+","+this.NavGraph[x][y].fromY;
+                    if (!NavGraph[x][y].canTravelFrom[(int)Move.EtoW])
                     {
                         line1 = line1 + "|";
                         line2 = line2 + "|";


need to adjust cost/score for pathfinding currently the unit of cost is graphnodes traversed this treats diagonal movement equal to horiz/vertical, when it should be sqrt(2) times more

--- FFTools_NavigatorGraph.cs
+++ FFTools_NavigatorGraph.cs
@@ -40,6 +40,9 @@
             public int fromX;
             public int fromY;

+            //the way cost/score is calculated needs to be adjusted
+            //currently it is based on the # of graphNodes traversed, but this treats diagonal = horiz/vertical movement
+            //when diagonal should be sqrt(2) times as much in cost
             public int Score {
                 get {
                     return (costToNode == int.MaxValue) || (costToTarget == int.MaxValue) ? int.MaxValue :  costToNode + costToTarget;
@@ -315,8 +318,8 @@
             dx = Math.Abs(startX-endX);
             dy = Math.Abs(startY-endY);
             //heuristic if diagonals allowed
-            NavGraph[startX][startY].costToTarget = (dx > dy)? dx : dy;
-            //heuristic if diaganols not allowed
+            NavGraph[startX][startY].costToTarget = (dx > dy) ? dx : dy;
+            //heuristic if diagonals not allowed
             //NavGraph[startX][startY].costToTarget = dx + dy;
             NavGraph[startX][startY].fromX = startX;
             NavGraph[startX][startY].fromY = startY;


SINGLE TO DOUBLE ON NUMBER CONVERSION. DANGER THIS COULD BREAK THINGS

--- FileParsing/JsonParser.cs
+++ FileParsing/JsonParser.cs
@@ -78,7 +78,7 @@
                                     if (key_off)
                                     {
                                         key_off = false;
-                                        ret[key] = float.Parse(sb.ToString());
+                                        ret[key] = Double.Parse(sb.ToString());
                                         sb.Length = 0;
                                     }
                                     else throw new Exception("Entering Dictionary Without Key");
@@ -133,7 +133,7 @@
                             default:
                                 if (sb.Length != 0)
                                 {
-                                    ret.Add(float.Parse(sb.ToString()));
+                                    ret.Add(Double.Parse(sb.ToString()));
                                     sb.Length = 0;
                                 }
                                 break;


保养记录的条目后台方法

保养记录的条目后台方法

--- trunk/src/DeviceManagementSystem/NYB.DeviceManagementSystem.BLL/MaintainRecordBLL.cs
+++ trunk/src/DeviceManagementSystem/NYB.DeviceManagementSystem.BLL/MaintainRecordBLL.cs
@@ -96,7 +96,7 @@
                 {
                     return new CResult<string>("", ErrorCode.DeviceNotExist);
                 }
-
+
                 var entity = new MaintainRecord();
                 entity.CreateDate = DateTime.Now;
                 entity.CreateUserID = model.CreateUserID;
@@ -110,6 +110,17 @@

                 context.MaintainRecord.Add(entity);

+                foreach (var item in model.MaintainItems)
+                {
+                    var relation = new MaintainRecordMaintainItemRel()
+                    {
+                        MaintainRecordID = entity.ID,
+                        MaintainItemID = item.ID
+                    };
+
+                    context.MaintainRecordMaintainItemRel.Add(relation);
+                }
+
                 if (context.SaveChanges() > 0)
                 {
                     return new CResult<string>(entity.ID);
@@ -192,6 +203,31 @@
                         FileHelper.DelFile(item.FilePath);
                     }
                 }
+
+                var oldRelations = context.MaintainRecordMaintainItemRel.Where(t => t.MaintainRecordID == entity.ID);
+
+                var oldRelationItemIDs = oldRelations.Select(t => t.MaintainItemID);
+                var newRelationItemIDs = model.MaintainItems.Select(t => t.ID).ToList();
+
+                var needDeletes = oldRelations.Where(t => newRelationItemIDs.Contains(t.MaintainItemID) == false).ToList();
+                var needAdd = model.MaintainItems.Where(t => oldRelationItemIDs.Contains(t.ID) == false).ToList();
+
+                foreach (var item in needDeletes)
+                {
+                    context.MaintainRecordMaintainItemRel.Remove(item);
+                }
+
+                foreach (var item in needAdd)
+                {
+                    var relation = new MaintainRecordMaintainItemRel()
+                    {
+                        MaintainRecordID = entity.ID,
+                        MaintainItemID = item.ID
+                    };
+
+                    context.MaintainRecordMaintainItemRel.Add(relation);
+                }
+
                 if (context.SaveChanges() > 0)
                 {
                     return new CResult<string>("");
@@ -247,6 +283,18 @@
                     });
                 }

+                var items = (from rel in context.MaintainRecordMaintainItemRel
+                             join item in context.MaintainItem on rel.MaintainItemID equals item.ID
+                             where rel.MaintainRecordID == entity.ID
+                             select new WebMaintainItem()
+                             {
+                                 ID = item.ID,
+                                 Name = item.Name
+                             }).ToList();
+
+                model.MaintainItems = items;
+
+
                 LogHelper.Info("result", model);

                 return new CResult<WebMaintainRecord>(model);


Refresh cinema data.

Refresh cinema data.

--- FluentCineworld/Cinema.cs
+++ FluentCineworld/Cinema.cs
@@ -51,9 +51,8 @@
         public static readonly Cinema Hull = new Cinema(8059, "Hull");
         public static readonly Cinema Huntingdon = new Cinema(8060, "Huntingdon");
         public static readonly Cinema Ipswich = new Cinema(8064, "Ipswich");
-        public static readonly Cinema IsleofWight = new Cinema(8063, "Isle of Wight");
         public static readonly Cinema Jersey = new Cinema(8065, "Jersey");
-        public static readonly Cinema Leeds = new Cinema(8120, "Leeds");
+        public static readonly Cinema LeedsWhiteRose = new Cinema(8120, "Leeds - White Rose");
         public static readonly Cinema Leigh = new Cinema(8066, "Leigh");
         public static readonly Cinema Llandudno = new Cinema(8068, "Llandudno");
         public static readonly Cinema LondonBexleyheath = new Cinema(8020, "London - Bexleyheath");
@@ -74,6 +73,7 @@
         public static readonly Cinema MiltonKeynes = new Cinema(8071, "Milton Keynes");
         public static readonly Cinema NewcastleUponTyne = new Cinema(8117, "Newcastle upon Tyne");
         public static readonly Cinema NewportFriarsWalk = new Cinema(8103, "Newport - Friars Walk");
+        public static readonly Cinema NewportIsleofWight = new Cinema(8063, "Newport - Isle of Wight");
         public static readonly Cinema NewportSpyttyPark = new Cinema(8072, "Newport - Spytty Park");
         public static readonly Cinema Northampton = new Cinema(8073, "Northampton");
         public static readonly Cinema Nottingham = new Cinema(8074, "Nottingham");
@@ -84,7 +84,7 @@
         public static readonly Cinema Sheffield = new Cinema(8079, "Sheffield");
         public static readonly Cinema Shrewsbury = new Cinema(8080, "Shrewsbury");
         public static readonly Cinema Solihull = new Cinema(8081, "Solihull");
-        public static readonly Cinema Southampton = new Cinema(8082, "Southampton");
+        public static readonly Cinema Speke = new Cinema(8123, "Speke");
         public static readonly Cinema Stevenage = new Cinema(8084, "Stevenage");
         public static readonly Cinema StHelens = new Cinema(8085, "St Helens");
         public static readonly Cinema StNeots = new Cinema(8098, "St Neots");


Removed unnecessary using

Removed unnecessary using

--- HiP-DataStore/Core/EventStoreClient.cs
+++ HiP-DataStore/Core/EventStoreClient.cs
@@ -8,7 +8,6 @@
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.Extensions.Logging;
-using System.Reflection;

 namespace PaderbornUniversity.SILab.Hip.DataStore.Core
 {