bug fixes

bug fixes

--- WycademyV2/src/WycademyV2/Commands/Services/ToastTimerService.cs
+++ WycademyV2/src/WycademyV2/Commands/Services/ToastTimerService.cs
@@ -1,5 +1,6 @@
 using Discord;
 using Discord.Commands;
+using Discord.Net;
 using Discord.WebSocket;
 using System;
 using System.Collections.Generic;
@@ -56,6 +57,8 @@
             await m.AddReactionAsync(RESTART);
             await m.AddReactionAsync(CANCEL);

+            await Task.Delay(1000);
+
             _messages.Add(m.Id, new ToastTimerMessage(context.User, context.Channel, m, AutoDeleteCallback));

             return m;
@@ -106,9 +109,20 @@
             var toastMessage = state as ToastTimerMessage;
             if (toastMessage == null) return;

-            await toastMessage.Cancel();
-            toastMessage.Dispose();
-            _messages.Remove(toastMessage.Message.Id);
+            try
+            {
+                await toastMessage.Cancel();
+            }
+            catch (HttpException)
+            {
+                // If this exception is thrown, the message was already deleted beforehand by somebody with manage messages.
+                // There's nothing we can do, so we just move on.
+            }
+            finally
+            {
+                toastMessage.Dispose();
+                _messages.Remove(toastMessage.Message.Id);
+            }
         }

         private class ToastTimerMessage : IDisposable
@@ -137,8 +151,9 @@
                 Channel = c;
                 Message = m;
                 _autoDeleteCallback = autodelete;
-                _toastTimer = new Timer(ToastTimerCallback, null, 0, 90000);
-                _autoDeleteTimer = new Timer(_autoDeleteCallback, this, 0, 1200000);
+                // Initialize the nova timer but don't start it.
+                _toastTimer = new Timer(ToastTimerCallback, null, Timeout.Infinite, Timeout.Infinite);
+                _autoDeleteTimer = new Timer(_autoDeleteCallback, this, 10000, 0);
             }

             /// <summary>
@@ -167,7 +182,7 @@
             public async Task StartTimer()
             {
                 await Channel.SendMessageAsync("Timer started. You will be notified in 90 seconds.");
-                _toastTimer.Change(0, 90000);
+                _toastTimer.Change(90000, 0);
             }

             /// <summary>
@@ -176,7 +191,7 @@
             public async Task StopTimer()
             {
                 await Channel.SendMessageAsync("Timer stopped. Note: pressing start will reset it to 0.");
-                _toastTimer.Change(0, Timeout.Infinite);
+                _toastTimer.Change(Timeout.Infinite, Timeout.Infinite);
             }

             /// <summary>
@@ -185,8 +200,8 @@
             public async Task ResetTimer()
             {
                 await Channel.SendMessageAsync("Timer reset to 0. You will be notified in 90 seconds.");
-                _toastTimer.Change(0, Timeout.Infinite);
-                _toastTimer.Change(0, 90000);
+                _toastTimer.Change(Timeout.Infinite, Timeout.Infinite);
+                _toastTimer.Change(90000, 0);
             }

             /// <summary>
@@ -202,7 +217,7 @@
                 // Notify the user after 90 seconds.
                 await Channel.SendMessageAsync($"{User.Mention}, nova coming in ~10 seconds!");
                 // Disable the timer until it's started again.
-                _toastTimer.Change(0, Timeout.Infinite);
+                _toastTimer.Change(Timeout.Infinite, Timeout.Infinite);
             }
         }
     }


Added methods to get the current AppModelPolicy for a token.

--- NtApiDotNet/NtToken.cs
+++ NtApiDotNet/NtToken.cs
@@ -2826,5 +2826,175 @@
                 return AppContainer || Restricted || IntegrityLevel < TokenIntegrityLevel.Medium;
             }
         }
+
+        /// <summary>
+        /// Query the token's full package name.
+        /// </summary>
+        public string PackageFullName
+        {
+            get
+            {
+                byte[] package_name = new byte[1024];
+                OptionalLength package_length = new OptionalLength(package_name.Length);
+                if (NtRtl.RtlQueryPackageClaims(Handle, package_name, package_length, null, null, null, null, null).IsSuccess())
+                {
+                    return Encoding.Unicode.GetString(package_name, 0, package_length.Length.ToInt32());
+                }
+                return string.Empty;
+            }
+        }
+
+        /// <summary>
+        /// Query the token's appid.
+        /// </summary>
+        public string AppId
+        {
+            get
+            {
+                byte[] app_id = new byte[1024];
+                OptionalLength app_id_length = new OptionalLength(app_id.Length);
+                if(NtRtl.RtlQueryPackageClaims(Handle, null, null, app_id, app_id_length, null, null, null).IsSuccess())
+                {
+                    return Encoding.Unicode.GetString(app_id, 0, app_id_length.Length.ToInt32());
+                }
+                return string.Empty;
+            }
+        }
+
+        private static readonly AppModelPolicy_PolicyValue[] _policy_lookup_table = {
+            AppModelPolicy_PolicyValue.LifecycleManager_ManagedByPLM, AppModelPolicy_PolicyValue.LifecycleManager_Unmanaged, AppModelPolicy_PolicyValue.LifecycleManager_Unmanaged, AppModelPolicy_PolicyValue.LifecycleManager_ManagedByPLM, AppModelPolicy_PolicyValue.LifecycleManager_ManagedByEM, AppModelPolicy_PolicyValue.LifecycleManager_ManagedByEM, AppModelPolicy_PolicyValue.LifecycleManager_Unmanaged, AppModelPolicy_PolicyValue.LifecycleManager_Unmanaged,
+            AppModelPolicy_PolicyValue.AppDataAccess_Allowed, AppModelPolicy_PolicyValue.AppDataAccess_Allowed, AppModelPolicy_PolicyValue.AppDataAccess_Denied, AppModelPolicy_PolicyValue.AppDataAccess_Allowed, AppModelPolicy_PolicyValue.AppDataAccess_Denied, AppModelPolicy_PolicyValue.AppDataAccess_Denied, AppModelPolicy_PolicyValue.AppDataAccess_Denied, AppModelPolicy_PolicyValue.AppDataAccess_Denied,
+            AppModelPolicy_PolicyValue.WindowingModel_CoreWindow, AppModelPolicy_PolicyValue.WindowingModel_Hwnd, AppModelPolicy_PolicyValue.WindowingModel_Hwnd, AppModelPolicy_PolicyValue.WindowingModel_CoreWindow, AppModelPolicy_PolicyValue.WindowingModel_LegacyPhone, AppModelPolicy_PolicyValue.WindowingModel_LegacyPhone, AppModelPolicy_PolicyValue.WindowingModel_None, AppModelPolicy_PolicyValue.WindowingModel_Hwnd,
+            AppModelPolicy_PolicyValue.DllSearchOrder_PackageGraphBased, AppModelPolicy_PolicyValue.DllSearchOrder_PackageGraphBased, AppModelPolicy_PolicyValue.DllSearchOrder_Traditional, AppModelPolicy_PolicyValue.DllSearchOrder_PackageGraphBased, AppModelPolicy_PolicyValue.DllSearchOrder_Traditional, AppModelPolicy_PolicyValue.DllSearchOrder_Traditional, AppModelPolicy_PolicyValue.DllSearchOrder_Traditional, AppModelPolicy_PolicyValue.DllSearchOrder_Traditional,
+            AppModelPolicy_PolicyValue.Fusion_Limited, AppModelPolicy_PolicyValue.Fusion_Full, AppModelPolicy_PolicyValue.Fusion_Full, AppModelPolicy_PolicyValue.Fusion_Limited, AppModelPolicy_PolicyValue.Fusion_Full, AppModelPolicy_PolicyValue.Fusion_Full, AppModelPolicy_PolicyValue.Fusion_Full, AppModelPolicy_PolicyValue.Fusion_Full,
+            AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Denied, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Allowed, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Allowed, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Denied, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Denied, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Denied, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Allowed, AppModelPolicy_PolicyValue.NonWindowsCodeLoading_Allowed,
+            AppModelPolicy_PolicyValue.ProcessEnd_TerminateProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess, AppModelPolicy_PolicyValue.ProcessEnd_ExitProcess,
+            AppModelPolicy_PolicyValue.BeginThreadInit_RoInitialize, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None, AppModelPolicy_PolicyValue.BeginThreadInit_None,
+            AppModelPolicy_PolicyValue.DeveloperInformation_None, AppModelPolicy_PolicyValue.DeveloperInformation_UI, AppModelPolicy_PolicyValue.DeveloperInformation_UI, AppModelPolicy_PolicyValue.DeveloperInformation_None, AppModelPolicy_PolicyValue.DeveloperInformation_None, AppModelPolicy_PolicyValue.DeveloperInformation_None, AppModelPolicy_PolicyValue.DeveloperInformation_None, AppModelPolicy_PolicyValue.DeveloperInformation_UI,
+            AppModelPolicy_PolicyValue.CreateFileAccess_Limited, AppModelPolicy_PolicyValue.CreateFileAccess_Full, AppModelPolicy_PolicyValue.CreateFileAccess_Full, AppModelPolicy_PolicyValue.CreateFileAccess_Limited, AppModelPolicy_PolicyValue.CreateFileAccess_Limited, AppModelPolicy_PolicyValue.CreateFileAccess_Full, AppModelPolicy_PolicyValue.CreateFileAccess_Full, AppModelPolicy_PolicyValue.CreateFileAccess_Full,
+            AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Allowed, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied, AppModelPolicy_PolicyValue.ImplicitPackageBreakaway_Denied,
+            AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_PackagedCWALauncher, AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_None, AppModelPolicy_PolicyValue.ProcessActivationShim_None,
+            AppModelPolicy_PolicyValue.AppKnownToStateRepository_Known, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Known, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Unknown, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Known, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Known, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Known, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Unknown, AppModelPolicy_PolicyValue.AppKnownToStateRepository_Unknown,
+            AppModelPolicy_PolicyValue.AudioManagement_ManagedByPBM, AppModelPolicy_PolicyValue.AudioManagement_Unmanaged, AppModelPolicy_PolicyValue.AudioManagement_Unmanaged, AppModelPolicy_PolicyValue.AudioManagement_ManagedByPBM, AppModelPolicy_PolicyValue.AudioManagement_ManagedByPBM, AppModelPolicy_PolicyValue.AudioManagement_ManagedByPBM, AppModelPolicy_PolicyValue.AudioManagement_Unmanaged, AppModelPolicy_PolicyValue.AudioManagement_Unmanaged,
+            AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_Yes, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No, AppModelPolicy_PolicyValue.PackageMayContainPublicComRegistrations_No,
+            AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_PrivateHive, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateComRegistrations_None,
+            AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_RegisterWithPsm, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_RegisterWithDesktopAppX, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_None, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_RegisterWithPsm, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_RegisterWithPsm, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_RegisterWithPsm, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_None, AppModelPolicy_PolicyValue.LaunchCreateProcessExtensions_None,
+            AppModelPolicy_PolicyValue.ClrCompat_Universal, AppModelPolicy_PolicyValue.ClrCompat_PackagedDesktop, AppModelPolicy_PolicyValue.ClrCompat_ClassicDesktop, AppModelPolicy_PolicyValue.ClrCompat_Others, AppModelPolicy_PolicyValue.ClrCompat_Others, AppModelPolicy_PolicyValue.ClrCompat_Others, AppModelPolicy_PolicyValue.ClrCompat_Others, AppModelPolicy_PolicyValue.ClrCompat_ClassicDesktop,
+            AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_True, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False, AppModelPolicy_PolicyValue.LoaderIgnoreAlteredSearchForRelativePath_False,
+            AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_Yes, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_No, AppModelPolicy_PolicyValue.ImplicitlyActivateClassicAAAServersAsIU_Yes,
+            AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveOnly, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveAndUserHive, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveAndUserHive, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveOnly, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveOnly, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveAndUserHive, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveAndUserHive, AppModelPolicy_PolicyValue.ComClassicCatalog_MachineHiveAndUserHive,
+            AppModelPolicy_PolicyValue.ComUnmarshaling_ForceStrongUnmarshaling, AppModelPolicy_PolicyValue.ComUnmarshaling_ApplicationManaged, AppModelPolicy_PolicyValue.ComUnmarshaling_ApplicationManaged, AppModelPolicy_PolicyValue.ComUnmarshaling_ForceStrongUnmarshaling, AppModelPolicy_PolicyValue.ComUnmarshaling_ForceStrongUnmarshaling, AppModelPolicy_PolicyValue.ComUnmarshaling_ApplicationManaged, AppModelPolicy_PolicyValue.ComUnmarshaling_ApplicationManaged, AppModelPolicy_PolicyValue.ComUnmarshaling_ApplicationManaged,
+            AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Enabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Disabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Disabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Enabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Enabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Disabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Disabled, AppModelPolicy_PolicyValue.ComAppLaunchPerfEnhancements_Disabled,
+            AppModelPolicy_PolicyValue.ComSecurityInitialization_SystemManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_ApplicationManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_ApplicationManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_SystemManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_SystemManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_SystemManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_ApplicationManaged, AppModelPolicy_PolicyValue.ComSecurityInitialization_ApplicationManaged,
+            AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_ASTA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_STA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_STA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_ASTA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_ASTA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_STA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_STA, AppModelPolicy_PolicyValue.RoInitializeSingleThreadedBehavior_STA,
+            AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleNone, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleAll, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleAll, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleNone, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleNone, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleAll, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleAll, AppModelPolicy_PolicyValue.ComDefaultExceptionHandling_HandleAll,
+            AppModelPolicy_PolicyValue.ComOopProxyAgility_Agile, AppModelPolicy_PolicyValue.ComOopProxyAgility_NonAgile, AppModelPolicy_PolicyValue.ComOopProxyAgility_NonAgile, AppModelPolicy_PolicyValue.ComOopProxyAgility_Agile, AppModelPolicy_PolicyValue.ComOopProxyAgility_Agile, AppModelPolicy_PolicyValue.ComOopProxyAgility_NonAgile, AppModelPolicy_PolicyValue.ComOopProxyAgility_NonAgile, AppModelPolicy_PolicyValue.ComOopProxyAgility_NonAgile,
+            AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_ExtendedForSamePackage, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout, AppModelPolicy_PolicyValue.AppServiceLifetime_StandardTimeout,
+            AppModelPolicy_PolicyValue.WebPlatform_Edge, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy, AppModelPolicy_PolicyValue.WebPlatform_Legacy,
+            AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_SharedWithAppContainer, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated, AppModelPolicy_PolicyValue.WinInetStoragePartitioning_Isolated,
+            AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerApp, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser, AppModelPolicy_PolicyValue.IndexerProtocolHandlerHost_PerUser,
+            AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_True, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False, AppModelPolicy_PolicyValue.LoaderIncludeUserDirectories_False,
+            AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_True, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False, AppModelPolicy_PolicyValue.ConvertAppContainerToRestrictedAppContainer_False,
+            AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_PrivateHive, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None, AppModelPolicy_PolicyValue.PackageMayContainPrivateMapiProvider_None,
+            AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_Caller, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None, AppModelPolicy_PolicyValue.AdminProcessPackageClaims_None,
+            AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_CopyOnWrite, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None, AppModelPolicy_PolicyValue.RegistryRedirectionBehavior_None,
+            AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_False, AppModelPolicy_PolicyValue.BypassCreateProcessAppxExtension_True,
+            AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_RedirectToPackage, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated, AppModelPolicy_PolicyValue.KnownFolderRedirection_Isolated,
+            AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNonFullTrust, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowFullTrust, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone, AppModelPolicy_PolicyValue.PrivateActivateAsPackageWinrtClasses_AllowNone,
+            AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_AppPrivate, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_AppPrivate, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None, AppModelPolicy_PolicyValue.AppPrivateFolderRedirection_None,
+            AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Virtualized, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Virtualized, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal, AppModelPolicy_PolicyValue.GlobalSystemAppDataAccess_Normal,
+            AppModelPolicy_PolicyValue.ConsoleHandleInheritance_All, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly, AppModelPolicy_PolicyValue.ConsoleHandleInheritance_ConsoleOnly,
+            AppModelPolicy_PolicyValue.ConsoleBufferAccess_RestrictedUnidirectional, AppModelPolicy_PolicyValue.ConsoleBufferAccess_Unrestricted, AppModelPolicy_PolicyValue.ConsoleBufferAccess_Unrestricted, AppModelPolicy_PolicyValue.ConsoleBufferAccess_RestrictedUnidirectional, AppModelPolicy_PolicyValue.ConsoleBufferAccess_RestrictedUnidirectional, AppModelPolicy_PolicyValue.ConsoleBufferAccess_RestrictedUnidirectional, AppModelPolicy_PolicyValue.ConsoleBufferAccess_Unrestricted, AppModelPolicy_PolicyValue.ConsoleBufferAccess_Unrestricted,
+            AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_ConvertTokenToUserToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken, AppModelPolicy_PolicyValue.ConvertCallerTokenToUserTokenForDeployment_UserCallerToken,
+        };
+
+        private static int? GetPolicyOffset(AppModelPolicy_Type policy_type, long attributes_present, ulong pkg_claim_flags)
+        {
+            if ((attributes_present & 1) == 0)
+            {
+                return 2;
+            }
+
+            if ((attributes_present & 2) == 0)
+            {
+                return 5;
+            }
+
+            if ((attributes_present & 4) != 0)
+            {
+                return 4;
+            }
+
+            if ((pkg_claim_flags & 4) != 0)
+            {
+                return 1;
+            }
+
+            if ((pkg_claim_flags & 8) != 0)
+            {
+                return 6;
+            }
+
+            if ((pkg_claim_flags & 0x40) != 0)
+            {
+                if (policy_type == AppModelPolicy_Type.LifecycleManager)
+                {
+                    return null;
+                }
+                return 7;
+            }
+
+            return 0;
+        }
+
+        private static AppModelPolicy_PolicyValue GetAppPolicy(AppModelPolicy_Type policy_type, long attributes_present, ulong pkg_claim_flags)
+        {
+            var offset = GetPolicyOffset(policy_type, attributes_present, pkg_claim_flags);
+            if (!offset.HasValue)
+            {
+                return AppModelPolicy_PolicyValue.None;
+            }
+
+            return _policy_lookup_table[8 * ((int)policy_type - 1) + offset.Value];
+        }
+
+        /// <summary>
+        /// Get the App Policy for this token.
+        /// </summary>
+        /// <param name="policy_type">The type of app policy.</param>
+        /// <returns>The policy value.</returns>
+        public AppModelPolicy_PolicyValue GetAppModelPolicy(AppModelPolicy_Type policy_type)
+        {
+            OptionalInt64 attributes_present_obj = new OptionalInt64(0);
+            PsPkgClaim pkg_claim = new PsPkgClaim();
+
+            if (!NtRtl.RtlQueryPackageClaims(Handle, null, null, null, null, null,
+                pkg_claim, attributes_present_obj).IsSuccess())
+            {
+                return AppModelPolicy_PolicyValue.None;
+            }
+
+            return GetAppPolicy(policy_type, attributes_present_obj.Value, pkg_claim.Flags);
+        }
+
+        /// <summary>
+        /// Get the list of policies for this App.
+        /// </summary>
+        public IEnumerable<AppModelPolicy_PolicyValue> AppModelPolicies
+        {
+            get
+            {
+                OptionalInt64 attributes_present_obj = new OptionalInt64(0);
+                PsPkgClaim pkg_claim = new PsPkgClaim();
+
+                if (!NtRtl.RtlQueryPackageClaims(Handle, null, null, null, null, null,
+                    pkg_claim, attributes_present_obj).IsSuccess())
+                {
+                    return Enumerable.Empty<AppModelPolicy_PolicyValue>();
+                }
+
+                return Enum.GetValues(typeof(AppModelPolicy_Type)).Cast<AppModelPolicy_Type>().Select(p => GetAppPolicy(p, attributes_present_obj.Value, pkg_claim.Flags));
+            }
+        }
     }
 }


Correcting checking and caching of static-cached mappers

--- AgileMapper/ObjectPopulation/ObjectMapperFactory.cs
+++ AgileMapper/ObjectPopulation/ObjectMapperFactory.cs
@@ -71,30 +71,48 @@
                     {
                         var ruleSets = data.MapperData.MapperContext.RuleSets;

-                        if ((data.MappingContext.RuleSet == ruleSets.CreateNew) &&
-                            (StaticCreateNewMapperCache<TSource, TTarget>.Mapper == null))
-                        {
+                        if (data.MappingContext.RuleSet == ruleSets.CreateNew)
+                        {
+                            if (StaticCreateNewMapperCache<TSource, TTarget>.Mapper != null)
+                            {
+                                goto SkipStaticCaching;
+                            }
+
                             return StaticCreateNewMapperCache<TSource, TTarget>.SetMapper((ObjectMapper<TSource, TTarget>)mapperToCache);
                         }

-                        if ((data.MappingContext.RuleSet == ruleSets.Overwrite) &&
-                            (StaticOverwriteMapperCache<TSource, TTarget>.Mapper == null))
-                        {
+                        if (data.MappingContext.RuleSet == ruleSets.Overwrite)
+                        {
+                            if (StaticOverwriteMapperCache<TSource, TTarget>.Mapper != null)
+                            {
+                                goto SkipStaticCaching;
+                            }
+
                             return StaticOverwriteMapperCache<TSource, TTarget>.SetMapper((ObjectMapper<TSource, TTarget>)mapperToCache);
                         }

-                        if ((data.MappingContext.RuleSet == ruleSets.Project) &&
-                            (StaticProjectionMapperCache<TSource, TTarget>.Mapper == null))
-                        {
+                        if (data.MappingContext.RuleSet == ruleSets.Project)
+                        {
+                            if (StaticProjectionMapperCache<TSource, TTarget>.Mapper != null)
+                            {
+                                goto SkipStaticCaching;
+                            }
+
                             return StaticProjectionMapperCache<TSource, TTarget>.SetMapper((ObjectMapper<TSource, TTarget>)mapperToCache);
                         }

-                        if ((data.MappingContext.RuleSet == ruleSets.Merge) &&
-                            (StaticMergeMapperCache<TSource, TTarget>.Mapper == null))
-                        {
+                        if (data.MappingContext.RuleSet == ruleSets.Merge)
+                        {
+                            if (StaticMergeMapperCache<TSource, TTarget>.Mapper != null)
+                            {
+                                goto SkipStaticCaching;
+                            }
+
                             return StaticMergeMapperCache<TSource, TTarget>.SetMapper((ObjectMapper<TSource, TTarget>)mapperToCache);
                         }
                     }
+
+                    SkipStaticCaching:

                     return mapperToCache;
                 });
@@ -145,33 +163,51 @@
             var ruleSet = mappingData.MappingContext.RuleSet;
             var ruleSets = mappingData.MapperContext.RuleSets;

-            if ((ruleSet == ruleSets.CreateNew) &&
-                (StaticCreateNewMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext == mappingData.MapperContext))
-            {
+            if (ruleSet == ruleSets.CreateNew)
+            {
+                if (StaticCreateNewMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext != mappingData.MapperContext)
+                {
+                    goto NoCachedMapper;
+                }
+
                 mapper = StaticCreateNewMapperCache<TSource, TTarget>.Mapper;
                 return true;
             }

-            if ((ruleSet == ruleSets.Overwrite) &&
-                (StaticOverwriteMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext == mappingData.MapperContext))
-            {
+            if (ruleSet == ruleSets.Overwrite)
+            {
+                if (StaticOverwriteMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext != mappingData.MapperContext)
+                {
+                    goto NoCachedMapper;
+                }
+
                 mapper = StaticOverwriteMapperCache<TSource, TTarget>.Mapper;
                 return true;
             }

-            if ((ruleSet == ruleSets.Project) &&
-                (StaticProjectionMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext == mappingData.MapperContext))
-            {
+            if (ruleSet == ruleSets.Project)
+            {
+                if (StaticProjectionMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext != mappingData.MapperContext)
+                {
+                    goto NoCachedMapper;
+                }
+
                 mapper = StaticProjectionMapperCache<TSource, TTarget>.Mapper;
                 return true;
             }

-            if ((ruleSet == ruleSets.Merge) &&
-                (StaticMergeMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext == mappingData.MapperContext))
-            {
+            if (ruleSet == ruleSets.Merge)
+            {
+                if (StaticMergeMapperCache<TSource, TTarget>.Mapper?.MapperData.MapperContext != mappingData.MapperContext)
+                {
+                    goto NoCachedMapper;
+                }
+
                 mapper = StaticMergeMapperCache<TSource, TTarget>.Mapper;
                 return true;
             }
+
+            NoCachedMapper:

             mapper = null;
             return false;


cleanup skip list

cleanup skip list

--- Algorithm.Sandbox/DataStructures/List/AsSkipList.cs
+++ Algorithm.Sandbox/DataStructures/List/AsSkipList.cs
@@ -2,12 +2,12 @@

 namespace Algorithm.Sandbox.DataStructures
 {
-    public class AsSkipListNode<T> where T : IComparable
+    internal class AsSkipListNode<T> where T : IComparable
     {
-        public AsSkipListNode<T> Prev { get; set; }
-        public AsSkipListNode<T>[] Next { get; set; }
+        internal AsSkipListNode<T> Prev { get; set; }
+        internal AsSkipListNode<T>[] Next { get; set; }

-        public T value { get; set; }
+        internal T value { get; set; }
     }

     public class AsSkipList<T> where T : IComparable
@@ -16,7 +16,7 @@

         public int MaxHeight { get; private set; }

-        public AsSkipListNode<T> Head { get; set; }
+        internal AsSkipListNode<T> Head { get; set; }

         public AsSkipList(int maxHeight = 32)
         {


Don't enable interactable collider until in-bounds

--- Assets/Scripts/Menu/Fun/TitleFloatingInteractive.cs
+++ Assets/Scripts/Menu/Fun/TitleFloatingInteractive.cs
@@ -23,10 +23,12 @@
 #pragma warning restore 0649

     private bool ignoreWalls;
+    private float colliderExtent;

     void Start()
 	{
-        setIgnoreWalls(true);
+        colliderExtent = Mathf.Max(wallHitCollider.bounds.extents.x, wallHitCollider.bounds.extents.y);
+        wallHitCollider.enabled = false;

         Vector2 goal = new Vector2(Random.Range(-floatTowardsBounds.x, floatTowardsBounds.x),
             Random.Range(-floatTowardsBounds.y, floatTowardsBounds.y));
@@ -44,10 +46,10 @@
             transform.position += (Vector3)escapeVelocity * Time.deltaTime;
             return;
         }
-        else if (lifetime > 0f && ignoreWalls && !CameraHelper.isObjectOffscreen(transform,
-            -Mathf.Max(wallHitCollider.bounds.extents.x, wallHitCollider.bounds.extents.y)))
+        else if (!wallHitCollider.enabled && !CameraHelper.isObjectOffscreen(transform,
+            -colliderExtent))
         {
-            setIgnoreWalls(false);
+            wallHitCollider.enabled = true;
         }

         if (lifetime > 0f)


bug fixs

bug fixs

--- Aurora/Physics/AuroraOpenDynamicsEngine/AODEPrim.cs
+++ Aurora/Physics/AuroraOpenDynamicsEngine/AODEPrim.cs
@@ -187,7 +187,7 @@
             //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
             ode = dode;
             if (!pos.IsFinite())
-            {
+            {
                 pos = new Vector3((parent_scene.Region.RegionSizeX * 0.5f), (parent_scene.Region.RegionSizeY * 0.5f),
                     parent_scene.GetTerrainHeightAtXY((parent_scene.Region.RegionSizeX * 0.5f), (parent_scene.Region.RegionSizeY * 0.5f)));
                 m_log.Warn("[PHYSICS]: Got nonFinite Object create Position");
@@ -489,6 +489,16 @@
             m_interpenetrationcount = 0;
             m_collisionscore = 0;

+            if (m_targetSpace != _parent_scene.space)
+                {
+                _parent_scene.waitForSpaceUnlock(m_targetSpace);
+                if (d.SpaceQuery(m_targetSpace, prim_geom))
+                    d.SpaceRemove(m_targetSpace, prim_geom);
+
+                m_targetSpace = _parent_scene.space;
+                d.SpaceAdd(m_targetSpace, prim_geom);
+                }
+
             lock (childrenPrim)
                 {
                 foreach (AuroraODEPrim prm in childrenPrim)
@@ -511,6 +521,16 @@
                     prm.m_interpenetrationcount = 0;
                     prm.m_collisionscore = 0;
                     _parent_scene.addActivePrim(prm);
+
+                    if (prm.m_targetSpace != _parent_scene.space)
+                        {
+                        _parent_scene.waitForSpaceUnlock(m_targetSpace);
+                        if (d.SpaceQuery(prm.m_targetSpace, prm.prim_geom))
+                            d.SpaceRemove(prm.m_targetSpace, prm.prim_geom);
+
+                        prm.m_targetSpace = _parent_scene.space;
+                        d.SpaceAdd(m_targetSpace, prm.prim_geom);
+                        }
                     }
                 }
             // The body doesn't already have a finite rotation mode set here
@@ -946,7 +966,7 @@
             try
             {
                 if (prim_geom == IntPtr.Zero)
-                {
+                {
                     SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null));
                 }
             }
@@ -1584,7 +1604,7 @@
                                 m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight;
                                 break;
                             case PIDHoverType.GroundAndWater:
-                                m_groundHeight = _parent_scene.GetTerrainHeightAtXY((float)dcpos.X, (float)dcpos.Y);
+                                m_groundHeight = _parent_scene.GetTerrainHeightAtXY((float)dcpos.X, (float)dcpos.Y);
                                 m_waterHeight = (float)_parent_scene.GetWaterLevel((float)dcpos.X, (float)dcpos.Y);
                                 if (m_groundHeight > m_waterHeight)
                                     {
@@ -1783,6 +1803,7 @@

         public void changePhysicsStatus(bool newphys)
             {
+            m_isphysical = newphys;
             if (!childPrim)
                 {
                 if (newphys == true)
@@ -1812,14 +1833,10 @@
                             DestroyBody();
                         }
                     }
-
-                }
-
-
-
+                }
+
             changeSelectedStatus(m_isSelected);
             resetCollisionAccounting();
-            m_isphysical = newphys;
             }

@@ -1845,7 +1862,10 @@

         public void changeprimsizeshape()
             {
-            string oldname = _parent_scene.geom_name_map[prim_geom];
+
+            _parent_scene.geom_name_map.Remove(prim_geom);
+            _parent_scene.actor_name_map.Remove(prim_geom);
+
             bool chp = childPrim;
             // Cleanup of old prim geometry and Bodies
             if (IsPhysical && Body != IntPtr.Zero)
@@ -1890,7 +1910,7 @@
                 if (IsPhysical)
                     meshlod = _parent_scene.MeshSculptphysicalLOD;

-                IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
+                IMesh mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, meshlod, IsPhysical);
                 // createmesh returns null when it doesn't mesh.
                 CreateGeom(m_targetSpace, mesh);
                 }
@@ -1919,7 +1939,9 @@
                         myrot.W = _orientation.W;
                         d.GeomSetQuaternion(prim_geom, ref myrot);
                         }
-                    _parent_scene.geom_name_map[prim_geom] = oldname;
+
+                    _parent_scene.geom_name_map[prim_geom] = this.m_primName;
+                    _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this;
                     }
                 }


More tests

More tests

--- BeanIO.Test/Parser/Multiline/MultilineRecordTest.cs
+++ BeanIO.Test/Parser/Multiline/MultilineRecordTest.cs
@@ -99,7 +99,7 @@
         }

         [Fact]
-        public void TestNestedRecorGroup()
+        public void TestNestedRecordGroup()
         {
             var factory = NewStreamFactory("BeanIO.Parser.Multiline.multiline_mapping.xml");
             var reader = factory.CreateReader("ml2", LoadStream("ml2.txt"));
@@ -139,7 +139,7 @@
         }

         [Fact]
-        public void TestNestedRecorGroupCollections()
+        public void TestNestedRecordGroupCollections()
         {
             var factory = NewStreamFactory("BeanIO.Parser.Multiline.multiline_mapping.xml");
             var reader = factory.CreateReader("ml3", LoadStream("ml3.txt"));
@@ -147,12 +147,134 @@
             {
                 // read batch #1
                 var map = Assert.IsType<Dictionary<string, object>>(reader.Read());
-                throw new NotImplementedException();
-            }
-            finally
-            {
-                reader.Close();
-            }
+                Assert.True(map.ContainsKey("batch"));
+                var list = Assert.IsType<List<OrderBatch>>(map["batch"]);
+                Assert.Collection(
+                    list,
+                    orderList =>
+                        {
+                            Assert.Collection(
+                                orderList.Orders,
+                                order => Assert.Equal("100", order.Id),
+                                order => Assert.Equal("101", order.Id));
+                        },
+                    orderList =>
+                        {
+                            Assert.Collection(
+                                orderList.Orders,
+                                order => Assert.Equal("103", order.Id));
+                        });
+
+                var text = new StringWriter();
+                factory.CreateWriter("ml3", text).Write(map);
+                Assert.Equal(
+                    "header,2\n" +
+                    "order,100,2012-01-01\n" +
+                    "customer,George,Smith\n" +
+                    "order,101,2012-01-01\n" +
+                    "customer,John,Smith\n" +
+                    "header,1\n" +
+                    "order,103,2012-01-01\n" +
+                    "customer,Jen,Smith\n",
+                    text.ToString());
+            }
+            finally
+            {
+                reader.Close();
+            }
+        }
+
+        [Fact]
+        public void TestRecordMap()
+        {
+            var factory = NewStreamFactory("BeanIO.Parser.Multiline.multiline_mapping.xml");
+            var reader = factory.CreateReader("ml4", LoadStream("ml4.txt"));
+            try
+            {
+                // read order #1
+                var order = Assert.IsType<Order>(reader.Read());
+
+                var itemMap = order.ItemMap;
+                Assert.Collection(
+                    itemMap,
+                    item =>
+                        {
+                            Assert.Equal("soda", item.Key);
+                            Assert.Equal("soda", item.Value.Name);
+                            Assert.Equal(2, item.Value.Quantity);
+                        },
+                    item =>
+                        {
+                            Assert.Equal("carrots", item.Key);
+                            Assert.Equal("carrots", item.Value.Name);
+                            Assert.Equal(5, item.Value.Quantity);
+                        });
+
+                var text = new StringWriter();
+                var writer = factory.CreateWriter("ml4", text);
+
+                writer.Write(order);
+
+                order = Assert.IsType<Order>(reader.Read());
+                Assert.NotNull(order.ItemMap);
+                Assert.Equal(3, order.ItemMap.Count);
+
+                writer.Write(order);
+
+                writer.Flush();
+
+                Assert.Equal(
+                    "order,100,2012-01-01\n" +
+                    "item,soda,2\n" +
+                    "item,carrots,5\n" +
+                    "order,101,2012-01-01\n" +
+                    "item,banana,1\n" +
+                    "item,apple,2\n" +
+                    "item,cereal,3\n",
+                    text.ToString());
+            }
+            finally
+            {
+                reader.Close();
+            }
+        }
+
+        [Fact]
+        public void TestNestedRecordGroupNonCollection()
+        {
+            var factory = NewStreamFactory("BeanIO.Parser.Multiline.multiline_mapping.xml");
+            var reader = factory.CreateReader("ml5", LoadStream("ml5.txt"));
+            try
+            {
+                var batch = Assert.IsType<OrderBatch>(reader.Read());
+                Assert.Equal(2, batch.BatchCount);
+
+                var order = batch.Order;
+                Assert.NotNull(order);
+                Assert.Equal("100", order.Id);
+
+                var customer = order.Customer;
+                Assert.NotNull(customer);
+                Assert.Equal("George", customer.FirstName);
+
+                var text = new StringWriter();
+                factory.CreateWriter("ml5", text).Write(batch);
+                Assert.Equal(
+                    "header,2\n" +
+                    "order,100,2012-01-01\n" +
+                    "customer,George,Smith\n",
+                    text.ToString());
+            }
+            finally
+            {
+                reader.Close();
+            }
+        }
+
+        [Fact]
+        public void TestEmptyRecordList()
+        {
+            throw new NotImplementedException();
         }

         private static TextReader LoadStream(string fileName)


fix assembly information - set default assembly version to 0.0.0 marking developer builds

--- src/Properties/AssemblyInfo.cs
+++ src/Properties/AssemblyInfo.cs
@@ -1,9 +1,11 @@
-using System.Resources;
+using System.Resources;
 using System.Reflection;

-[assembly: AssemblyTitle( "PiWeb Api" )]
-[assembly: AssemblyVersion( "1.0.1" )]
-[assembly: AssemblyCompany( "Carl Zeiss IZfM Dresden" )]
-[assembly: AssemblyProduct( "PiWeb Api" )]
+[assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum fr Messtechnik GmbH" )]
+[assembly: AssemblyProduct( "ZEISS PiWeb Api" )]
+[assembly: AssemblyCopyright( "Copyright  2017 Carl Zeiss Innovationszentrum fr Messtechnik GmbH" )]
+[assembly: AssemblyTrademark( "PiWeb" )]
 [assembly: NeutralResourcesLanguage( "en" )]

+[assembly: AssemblyVersion( "0.0.0" )]
+


Fix NgNavigation.Refresh() to reload the injected NgModules

Relates to #37

--- src/Protractor/NgNavigation.cs
+++ src/Protractor/NgNavigation.cs
@@ -122,8 +122,14 @@
         /// </summary>
         public void Refresh()
         {
-            this.ngDriver.WaitForAngular();
-            this.navigation.Refresh();
+            if (this.ngDriver.IgnoreSynchronization)
+            {
+                this.navigation.Refresh();
+            }
+            else
+            {
+                this.ngDriver.Url = this.ngDriver.Url;
+            }
         }

         #endregion


Forgot this thing

Forgot this thing

--- CoCSharp.Server/Handlers/AllianceMessageHandlers.cs
+++ CoCSharp.Server/Handlers/AllianceMessageHandlers.cs
@@ -117,6 +117,7 @@
             var chat = new ChatStreamEntry()
             {
                 MessageID = 1,
+                Unknown1 = 3,
                 UserID = 1,
                 HomeID = 1,
                 Name = "Test 1",


Fix Android Notification null reference

Fix Android Notification null reference

* Android Notification crash fix
* Add null checks
* Removed iOS only Notification parameters in Android Notification

--- Com.OneSignal.Android/Utilities/NativeConversion.cs
+++ Com.OneSignal.Android/Utilities/NativeConversion.cs
@@ -10,13 +10,9 @@
       public static Notification NotificationToXam(Android.OSNotification notification) {
          Notification nativeNotification = new Notification {
             androidNotificationId = notification.AndroidNotificationId,
-            groupedNotifications = new List<Notification>(),
             notificationId = notification.NotificationId,
-            templateName = notification.TemplateName,
-            templateId = notification.TemplateId,
             title = notification.Title,
             body = notification.Body,
-            additionalData = Json.Deserialize(notification.AdditionalData.ToString()) as Dictionary<string, object>,
             smallIcon = notification.SmallIcon,
             largeIcon = notification.LargeIcon,
             bigPicture = notification.BigPicture,
@@ -32,16 +28,26 @@
             priority = notification.Priority,
             rawPayload = notification.RawPayload,
          };
-         foreach (var individualNotification in notification.GroupedNotifications)
-            nativeNotification.groupedNotifications.Add(NotificationToXam(individualNotification));

-         nativeNotification.actionButtons = new List<ActionButton>();
-         foreach (var actionButton in notification.ActionButtons)
-            nativeNotification.actionButtons.Add(new ActionButton(actionButton.Id, actionButton.Text, actionButton.Icon));
+         if (notification.AdditionalData != null)
+            nativeNotification.additionalData = Json.Deserialize(notification.AdditionalData.ToString()) as Dictionary<string, object>;

-         nativeNotification.backgroundImageLayout = new BackgroundImageLayout(notification.GetBackgroundImageLayout().Image,
-            notification.GetBackgroundImageLayout().TitleTextColor,
-            notification.GetBackgroundImageLayout().BodyTextColor);
+         if (notification.GroupedNotifications != null) {
+            foreach (var individualNotification in notification.GroupedNotifications)
+               nativeNotification.groupedNotifications.Add(NotificationToXam(individualNotification));
+         }
+
+         if (notification.ActionButtons != null) {
+            nativeNotification.actionButtons = new List<ActionButton>();
+            foreach (var actionButton in notification.ActionButtons)
+               nativeNotification.actionButtons.Add(new ActionButton(actionButton.Id, actionButton.Text, actionButton.Icon));
+         }
+
+         if (notification.GetBackgroundImageLayout() != null) {
+            nativeNotification.backgroundImageLayout = new BackgroundImageLayout(notification.GetBackgroundImageLayout().Image,
+               notification.GetBackgroundImageLayout().TitleTextColor,
+               notification.GetBackgroundImageLayout().BodyTextColor);
+         }

          return nativeNotification;
       }


Moved initialization logic to service creation

The initialization happened after the creation of the services, which meant services couldn't setup dependencies of services services depending on them.

--- src/ServiceHost/ServiceHost.cs
+++ src/ServiceHost/ServiceHost.cs
@@ -135,8 +135,6 @@

             var services = FindServices();

-            InitializeServices(services);
-
             var host = CreateHost();

             _log.Info("Using the {0} host", host.GetType());
@@ -257,20 +255,6 @@
         }

         /// <summary>
-        /// Initialize all services.
-        /// </summary>
-        /// <param name="services">
-        /// The services.
-        /// </param>
-        private static void InitializeServices(IEnumerable<IService> services)
-        {
-            foreach (var service in services.OfType<IRequireInitialization>())
-            {
-                service.Initialize();
-            }
-        }
-
-        /// <summary>
         /// Set the default values unless they are already set.
         /// </summary>
         private void SetDefaultValues()
@@ -304,6 +288,11 @@
                 serviceType =>
                 {
                     var service = _containerAdapter.GetServiceInstance(serviceType);
+
+                    if (service is IRequireInitialization)
+                    {
+                        ((IRequireInitialization)service).Initialize();
+                    }

                     _containerAdapter.RegisterServiceInstance(serviceType, service);

@@ -313,4 +302,4 @@
             return services;
         }
     }
-}+}


Rewrite DropboxManager to use C# 5 async and clean up files in event of failure/cancellation

--- src/Services/DropboxManager.cs
+++ src/Services/DropboxManager.cs
@@ -86,7 +86,7 @@

         #region Implementation

-        Task<Metadata> LoadThumbnail (string path, string size, string destPath, CancellationToken token)
+        async Task<Metadata> LoadThumbnail (string path, string size, string destPath, CancellationToken token)
         {
             var session = EnsureLoggedIn ();

@@ -94,99 +94,82 @@
             var request = session.Service.CreateRequest ("GET", uri, session.Account);
             request.Parameters ["size"] = size;

-            return request.GetResponseAsync (token).ContinueWith (t => {
-                Response res = t.Result;
-                var metadataText = res.Headers["x-dropbox-metadata"];
-                var metadata = ParseMetadata (JToken.Parse (metadataText));
-
-                var s = res.GetResponseStream ();
+            Response res = await request.GetResponseAsync (token).ConfigureAwait (false);
+            token.ThrowIfCancellationRequested ();
+
+            var metadataText = res.Headers["x-dropbox-metadata"];
+            var metadata = ParseMetadata (JToken.Parse (metadataText));
+
+            try {
+                using (var s = res.GetResponseStream ())
                 using (var fs = File.Create (destPath)) {
                     s.CopyTo (fs);
                 }
-
-                return metadata;
-            }, token);
-        }
-
-        Task<Metadata> LoadFile (string path, string destPath, Action<float> progress, CancellationToken token)
+            } catch {
+                TryDelete (destPath);
+                throw;
+            }
+
+            return metadata;
+        }
+
+        async Task<Metadata> LoadFile (string path, string destPath, Action<float> progress, CancellationToken token)
         {
             var session = EnsureLoggedIn ();

             var uri = FormatUri ((DropboxService) session.Service, BaseContentUri, "files/{root}{path}", path);
             var request = session.Service.CreateRequest ("GET", uri, session.Account);

-            return request.GetResponseAsync (token).ContinueWith (responseTask => {
-                Response res = responseTask.Result;
-                var metadataText = res.Headers ["x-dropbox-metadata"];
-                var metadata = ParseMetadata (JToken.Parse (metadataText));
-
-                const int BufferLength = 16 * 1024;
-
-                var state = new LoadFileAsyncState {
-                    OutputStream = File.Create (destPath),
-                    ResponseStream = res.GetResponseStream (),
-                    OnProgress = progress,
-                    Metadata = metadata,
-                    TotalBytes = Int64.Parse (res.Headers["Content-Length"]),
-                    Buffer = new byte [BufferLength],
-                    BufferLength = BufferLength
-                };
-
-                return ReadNextChunksAsync (state, token).ContinueWith (downloadTask => {
-                    state.Dispose ();
-
-                    if (downloadTask.IsCanceled || downloadTask.IsFaulted) {
-                        try {
-                            File.Delete (destPath);
-                        } catch { }
-                    }
-
-                    return downloadTask.Result;
-                });
-            }).Unwrap ();
-        }
-
-        struct LoadFileAsyncState : IDisposable
-        {
-            public byte [] Buffer;
-            public int BufferLength;
-            public long BytesLoaded { get; set; }
-            public long TotalBytes { get; set; }
-
-            public FileStream OutputStream { get; set; }
-            public Stream ResponseStream { get; set; }
-            public Action<float> OnProgress { get; set; }
-            public Metadata Metadata { get; set; }
-
-            public void Dispose ()
-            {
-                ResponseStream.Close ();
-                OutputStream.Close ();
-            }
-        }
-
-        Task<Metadata> ReadNextChunksAsync (LoadFileAsyncState state, CancellationToken token)
-        {
-            return Task.Factory.FromAsync<byte[], int, int, int> (
+            Response res = await request.GetResponseAsync (token).ConfigureAwait (false);
+            token.ThrowIfCancellationRequested ();
+
+            var metadataText = res.Headers ["x-dropbox-metadata"];
+            var metadata = ParseMetadata (JToken.Parse (metadataText));
+
+            const int BufferLength = 16 * 1024;
+
+            using (var state = new LoadFileAsyncState {
+                OutputStream = File.Create (destPath),
+                ResponseStream = res.GetResponseStream (),
+                OnProgress = progress,
+                Metadata = metadata,
+                TotalBytes = Int64.Parse (res.Headers["Content-Length"]),
+                Buffer = new byte [BufferLength],
+                BufferLength = BufferLength
+            }) {
+                try {
+                    int readBytes;
+                    do {
+                        readBytes = await ReadNextChunkAsync (state).ConfigureAwait (false);
+                        token.ThrowIfCancellationRequested ();
+                    } while (readBytes > 0);
+
+                    return metadata;
+                } catch {
+                    TryDelete (destPath);
+                    throw;
+                }
+            }
+        }
+
+        async Task<int> ReadNextChunkAsync (LoadFileAsyncState state)
+        {
+            int bytesRead = await Task.Factory.FromAsync<byte[], int, int, int> (
                 state.ResponseStream.BeginRead,
                 state.ResponseStream.EndRead,
                 state.Buffer, 0, state.BufferLength, null
-            ).ContinueWith (t => {
-                int bytesRead = t.Result;
-                if (bytesRead == 0)
-                    return Task.FromResult (state.Metadata);
-
+            ).ConfigureAwait (false);
+
+            if (bytesRead > 0) {
                 state.BytesLoaded += bytesRead;

                 if (state.OnProgress != null)
                     state.OnProgress (((float) state.BytesLoaded) / state.TotalBytes);

                 state.OutputStream.Write (state.Buffer, 0, bytesRead);
-
-                token.ThrowIfCancellationRequested ();
-                return ReadNextChunksAsync (state, token);
-
-            }, token, TaskContinuationOptions.OnlyOnRanToCompletion, TaskScheduler.Default).Unwrap ();
+            }
+
+            return bytesRead;
         }

         Task<Metadata> GetMetadata (string path, bool includeContent, string hash, CancellationToken token)
@@ -278,6 +261,32 @@
             return data;
         }

+        static void TryDelete (string file)
+        {
+            try {
+                File.Delete (file);
+            } catch { }
+        }
+
+        struct LoadFileAsyncState : IDisposable
+        {
+            public byte [] Buffer;
+            public int BufferLength;
+            public long BytesLoaded { get; set; }
+            public long TotalBytes { get; set; }
+
+            public FileStream OutputStream { get; set; }
+            public Stream ResponseStream { get; set; }
+            public Action<float> OnProgress { get; set; }
+            public Metadata Metadata { get; set; }
+
+            public void Dispose ()
+            {
+                ResponseStream.Close ();
+                OutputStream.Close ();
+            }
+        }
+
         public struct Metadata
         {
             private Metadata [] _contents;


:fire: :goberserk:  增加一个特性，使得服务的查找可以跨服务容器。 :bird:

应用该特性可以在默认服务容器中加入其它服务容器，即可达到服务的全局查找。

服务容器的分类主要主要体现在：
1) 服务的边界划分，即分类管理；
2) 服务查找是以容器为优先级界定的，这是因为处于同一容器的服务总是最先被查找，其次才是外部容器内的服务查找。

--- src/Services/ServiceStorage.cs
+++ src/Services/ServiceStorage.cs
@@ -2,7 +2,7 @@
  * Authors:
  *   钟峰(Popeye Zhong) <zongsoft@gmail.com>
  *
- * Copyright (C) 2010-2015 Zongsoft Corporation <http://www.zongsoft.com>
+ * Copyright (C) 2010-2016 Zongsoft Corporation <http://www.zongsoft.com>
  *
  * This file is part of Zongsoft.CoreLibrary.
  *
@@ -36,8 +36,8 @@
 	{
 		#region 成员字段
 		private IMatcher _matcher;
-		private List<ServiceEntry> _list;
-		private ConcurrentDictionary<string, ServiceEntry> _namedDictionary;
+		private List<ServiceEntry> _entries;
+		private ConcurrentDictionary<string, ServiceEntry> _namedEntries;
 		#endregion

 		#region 构造函数
@@ -48,8 +48,8 @@
 		public ServiceStorage(IMatcher matcher)
 		{
 			_matcher = matcher;
-			_list = new List<ServiceEntry>();
-			_namedDictionary = new ConcurrentDictionary<string, ServiceEntry>(StringComparer.OrdinalIgnoreCase);
+			_entries = new List<ServiceEntry>();
+			_namedEntries = new ConcurrentDictionary<string, ServiceEntry>(StringComparer.OrdinalIgnoreCase);
 		}
 		#endregion

@@ -58,7 +58,7 @@
 		{
 			get
 			{
-				return _list.Count;
+				return _entries.Count;
 			}
 		}

@@ -130,15 +130,15 @@
 				return;

 			if(!string.IsNullOrWhiteSpace(entry.Name))
-				_namedDictionary[entry.Name] = entry;
-
-			_list.Add(entry);
+				_namedEntries[entry.Name] = entry;
+
+			_entries.Add(entry);
 		}

 		public virtual void Clear()
 		{
-			_namedDictionary.Clear();
-			_list.Clear();
+			_namedEntries.Clear();
+			_entries.Clear();
 		}

 		public virtual ServiceEntry Remove(string name)
@@ -148,8 +148,8 @@

 			ServiceEntry entry = null;

-			if(_namedDictionary.TryRemove(name, out entry))
-				_list.Remove(entry);
+			if(_namedEntries.TryRemove(name, out entry))
+				_entries.Remove(entry);

 			return entry;
 		}
@@ -162,10 +162,10 @@
 			name = name.Trim();
 			ServiceEntry entry;

-			if(_namedDictionary.TryGetValue(name, out entry))
+			if(_namedEntries.TryGetValue(name, out entry))
 				return entry;

-			return null;
+			return this.GetEntryFromOtherStorage(name);
 		}

 		public virtual ServiceEntry Get(Type type, object parameter = null)
@@ -175,7 +175,7 @@

 			var entries = new List<ServiceEntry>();

-			foreach(var entry in _list)
+			foreach(var entry in _entries)
 			{
 				if(entry.ContractTypes == null || entry.ContractTypes.Length < 1)
 					entries.Add(entry);
@@ -198,7 +198,7 @@
 				}
 			}

-			return null;
+			return this.GetEntryFromOtherStorage(type, parameter);
 		}

 		public virtual IEnumerable<ServiceEntry> GetAll(Type type, object parameter = null)
@@ -209,7 +209,7 @@
 			var list = new List<ServiceEntry>();
 			var result = new List<ServiceEntry>();

-			foreach(var entry in _list)
+			foreach(var entry in _entries)
 			{
 				if(entry.ContractTypes == null || entry.ContractTypes.Length < 1)
 					list.Add(entry);
@@ -261,7 +261,7 @@
 		{
 			for(int i = index; i < array.Length; index++)
 			{
-				array.SetValue(_list[i - index], i);
+				array.SetValue(_entries[i - index], i);
 			}
 		}

@@ -288,12 +288,12 @@

 		bool ICollection<ServiceEntry>.Contains(ServiceEntry item)
 		{
-			return _list.Contains(item);
+			return _entries.Contains(item);
 		}

 		void ICollection<ServiceEntry>.CopyTo(ServiceEntry[] array, int arrayIndex)
 		{
-			_list.CopyTo(array, arrayIndex);
+			_entries.CopyTo(array, arrayIndex);
 		}

@@ -312,14 +312,63 @@

 		IEnumerator IEnumerable.GetEnumerator()
 		{
-			foreach(var entry in _list)
+			foreach(var entry in _entries)
 				yield return entry;
 		}

 		IEnumerator<ServiceEntry> IEnumerable<ServiceEntry>.GetEnumerator()
 		{
-			foreach(var entry in _list)
+			foreach(var entry in _entries)
 				yield return entry;
+		}
+		#endregion
+
+		#region 私有方法
+		private ServiceEntry GetEntryFromOtherStorage(string name)
+		{
+			foreach(var entry in _entries.ToArray())
+			{
+				var result = this.GetEntryFromOtherStorage(entry, storage => storage.Get(name));
+
+				if(result != null)
+					return result;
+			}
+
+			return null;
+		}
+
+		private ServiceEntry GetEntryFromOtherStorage(Type type, object parameter)
+		{
+			foreach(var entry in _entries.ToArray())
+			{
+				var result = this.GetEntryFromOtherStorage(entry, storage => storage.Get(type, parameter));
+
+				if(result != null)
+					return result;
+			}
+
+			return null;
+		}
+
+		private ServiceEntry GetEntryFromOtherStorage(ServiceEntry entry, Func<IServiceStorage, ServiceEntry> getThunk)
+		{
+			if(entry == null || getThunk == null)
+				return null;
+
+			if(typeof(IServiceProvider).IsAssignableFrom(entry.ServiceType))
+			{
+				var provider = (IServiceProvider)entry.Service;
+
+				if(provider != null && provider.Storage != null)
+				{
+					var result = getThunk(provider.Storage);
+
+					if(result != null)
+						return result;
+				}
+			}
+
+			return null;
 		}
 		#endregion
 	}


TextureクラスのXMLドキュメントを記述

TextureクラスのXMLドキュメントを記述

--- src/Sitrine/Texture/Texture.cs
+++ src/Sitrine/Texture/Texture.cs
@@ -31,7 +31,7 @@
 namespace Sitrine.Texture
 {
     /// <summary>
-    /// ビットマップを画面上に描画するためのテクスチャクラスです。
+    /// テクスチャマッピングを用いてビットマップを画面上に描画するためのテクスチャクラスです。
     /// </summary>
     public abstract class Texture : IDisposable
     {
@@ -108,8 +108,14 @@
         #endregion

         #region -- Protected Properties --
+        /// <summary>
+        /// 再コンパイルの必要性を表す真偽値を取得します。
+        /// </summary>
         protected bool RequiredRecompile { get; private set; }

+        /// <summary>
+        /// ディスプレイリストの ID を取得または設定します。
+        /// </summary>
         protected int ListID { get; set; }
         #endregion

@@ -143,16 +149,25 @@
         #endregion

         #region -- Protected Methods --
+        /// <summary>
+        /// テクスチャをロードし、画面上に表示できる状態にします。
+        /// </summary>
         protected virtual void Load()
         {
             DebugText.IncrementLoadCount();
         }

+        /// <summary>
+        /// テクスチャデータを更新します。
+        /// </summary>
         protected virtual void Update()
         {
             DebugText.IncrementUpdateCount();
         }

+        /// <summary>
+        /// 再コンパイルを要求します。
+        /// </summary>
         protected void RequestRecompile()
         {
             if (!this.RequiredRecompile)
@@ -186,6 +201,9 @@
             this.RequiredRecompile = false;
         }

+        /// <summary>
+        /// 描画処理を実行します。
+        /// </summary>
         protected abstract void Execute();

         /// <summary>


Change: Issues handling

Change: Issues handling

--- src/reni2/Parser/ExpressionSyntax.cs
+++ src/reni2/Parser/ExpressionSyntax.cs
@@ -1,18 +1,39 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
 using hw.DebugFormatter;
-using hw.Parser;
 using Reni.Basics;
 using Reni.Context;
 using Reni.Feature;
 using Reni.TokenClasses;
-using Reni.Validation;

 namespace Reni.Parser
 {
     sealed class ExpressionSyntax : Value
     {
+        internal sealed class EvaluationDepthExhaustedException : Exception
+        {
+            readonly ContextBase Context;
+            readonly int Depth;
+            readonly Syntax Syntax;
+
+            public EvaluationDepthExhaustedException(Syntax syntax, ContextBase context, int depth)
+            {
+                Syntax = syntax;
+                Context = context;
+                Depth = depth;
+            }
+
+            public override string Message
+                => "Depth of " +
+                   Depth +
+                   " exhausted when evaluation expression.\n" +
+                   "Expression: " +
+                   Syntax.SourcePart.GetDumpAroundCurrent(10) +
+                   "\n" +
+                   "Context: " +
+                   Context.NodeDump;
+        }
+
         internal static Result<Value> Create
             (Syntax parent, Value left, Definable definable, Value right)
             => new Result<Value>(new ExpressionSyntax(parent, left, definable, right));
@@ -27,6 +48,8 @@
                 .With(leftvalue?.Issues.plus(rightvalue?.Issues));
         }

+        int CurrentResultDepth;
+
         ExpressionSyntax(Syntax parent, Value left, Definable definable, Value right)
             : base(parent)
         {
@@ -37,13 +60,13 @@
         }

         [Node]
-        internal Value Left { get; }
+        internal Value Left {get;}
+
         [Node]
-        public Definable Definable { get; }
+        public Definable Definable {get;}
+
         [Node]
-        internal Value Right { get; }
-
-        int CurrentResultDepth;
+        internal Value Right {get;}

         internal override Result ResultForCache(ContextBase context, Category category)
         {
@@ -57,36 +80,21 @@
                     return context.PrefixResult(category, Definable, Syntax, Right);

                 var left = context.ResultAsReferenceCache(Left);
+
                 var leftType = left.Type;
-                if(leftType != null && !leftType.HasIssues)
-                    return leftType
-                        .Execute(category, left, Syntax, Definable, context, Right);
+                if(leftType == null)
+                    return left.Issues.Result(category);

-                return left.Issues.Result(category);
+                if(leftType.HasIssues)
+                    return leftType.Issues.Result(category);
+
+                return leftType
+                    .Execute(category, left, Syntax, Definable, context, Right);
             }
             finally
             {
                 CurrentResultDepth--;
             }
-        }
-
-        internal sealed class EvaluationDepthExhaustedException : Exception
-        {
-            readonly Syntax Syntax;
-            readonly ContextBase Context;
-            readonly int Depth;
-
-            public EvaluationDepthExhaustedException(Syntax syntax, ContextBase context, int depth)
-            {
-                Syntax = syntax;
-                Context = context;
-                Depth = depth;
-            }
-
-            public override string Message
-                => "Depth of " + Depth + " exhausted when evaluation expression.\n" +
-                    "Expression: " + Syntax.SourcePart.GetDumpAroundCurrent(10) + "\n" +
-                    "Context: " + Context.NodeDump;
         }

         internal override Value Visit(ISyntaxVisitor visitor)


chg fake_xunit to report the number of assertions and the elapsed time for each test

--- src/common/fake_xunit.cs
+++ src/common/fake_xunit.cs
@@ -27,74 +27,92 @@

     public static class Assert
     {
+        public static int count;
         static void fail() => throw new Exception();
         public static void True(bool b)
         {
+            count++;
             if (!b) fail();
         }
         public static void True(bool b, string msg)
         {
+            count++;
             if (!b) fail();
         }
         public static void False(bool b)
         {
+            count++;
             if (b) fail();
         }
         public static void Null(object b)
         {
+            count++;
             if (b != null) fail();
         }
         public static void NotNull(object b)
         {
+            count++;
             if (b == null) fail();
         }
         public static void Equal<T>(T expected, T actual)
             where T : class
         {
+            count++;
             if (!Object.ReferenceEquals(expected, actual)) fail();
         }
         public static void Equal(byte expected, byte actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(int expected, byte actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(char expected, char actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(int expected, int actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(int expected, int? actual)
         {
+            count++;
             if (expected != actual.Value) fail();
         }
         public static void Equal(long expected, long actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(long expected, long? actual)
         {
+            count++;
             if (expected != actual.Value) fail();
         }
         public static void Equal(double expected, double actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Equal(double expected, double? actual)
         {
+            count++;
             if (expected != actual.Value) fail();
         }
         public static void Equal(string expected, string actual)
         {
+            count++;
             if (expected != actual) fail();
         }
         public static void Single<T>(IEnumerable<T> e)
         {
+            count++;
             if (e.Count() != 1) throw new Exception();
         }
     }
@@ -124,11 +142,15 @@
                     object inst = Activator.CreateInstance(t);
                     foreach (var m in ma)
                     {
-                        w($"{m.Name} -- ");
+                        w($"{m.Name,-40} -- ");
                         try
                         {
+                            Assert.count = 0;
+                            var sw = System.Diagnostics.Stopwatch.StartNew();
                             m.Invoke(inst, null);
-                            wn("pass");
+                            sw.Stop();
+                            var elapsed = (long) (sw.ElapsedMilliseconds);
+                            wn($"pass ({Assert.count,4} asserts, {elapsed,5} ms)");
                             pass++;
                         }
                         catch (Exception e)


Default PB port should be 8087

Default PB port should be 8087

Former-commit-id: 1c186d16981882cebab2b1db4811302718de35c4

--- src/RiakClient/Config/RiakNodeConfiguration.cs
+++ src/RiakClient/Config/RiakNodeConfiguration.cs
@@ -41,7 +41,7 @@
             set { this["hostAddress"] = value; }
         }

-        [ConfigurationProperty("pbcPort", DefaultValue = 8088, IsRequired = false)]
+        [ConfigurationProperty("pbcPort", DefaultValue = 8087, IsRequired = false)]
         public int PbcPort
         {
             get { return (int)this["pbcPort"]; }


More tests

More tests

--- src/Squidex.Web/ApiExceptionFilterAttribute.cs
+++ src/Squidex.Web/ApiExceptionFilterAttribute.cs
@@ -7,6 +7,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Security;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
@@ -60,7 +61,7 @@

         private static IActionResult OnValidationException(ValidationException ex)
         {
-            return ErrorResult(400, new ErrorDto { Message = ex.Summary, Details = ex.Errors?.ToArray(e => e.Message) });
+            return ErrorResult(400, new ErrorDto { Message = ex.Summary, Details = ToDetails(ex) });
         }

         private static IActionResult ErrorResult(int statusCode, ErrorDto error)
@@ -89,5 +90,20 @@
                 context.Result = result;
             }
         }
+
+        private static string[] ToDetails(ValidationException ex)
+        {
+            return ex.Errors?.ToArray(e =>
+            {
+                if (e.PropertyNames?.Any() == true)
+                {
+                    return $"{string.Join(", ", e.PropertyNames)}: {e.Message}";
+                }
+                else
+                {
+                    return e.Message;
+                }
+            });
+        }
     }
 }


Opt8: Improve loop performance in DisplayModeProvider.

--- src/System.Web.WebPages/DisplayModeProvider.cs
+++ src/System.Web.WebPages/DisplayModeProvider.cs
@@ -46,18 +46,35 @@
             get { return _displayModes; }
         }

+        private int FindFirstAvailableDisplayMode(IDisplayMode currentDisplayMode, bool requireConsistentDisplayMode)
+        {
+            if (requireConsistentDisplayMode && currentDisplayMode != null)
+            {
+                int first = _displayModes.IndexOf(currentDisplayMode);
+                return (first >= 0) ? first : _displayModes.Count;
+            }
+            return 0;
+        }
+
         /// <summary>
         /// Returns any IDisplayMode that can handle the given request.
         /// </summary>
         public IEnumerable<IDisplayMode> GetAvailableDisplayModesForContext(HttpContextBase httpContext, IDisplayMode currentDisplayMode)
         {
-            return GetAvailableDisplayModesForContext(httpContext, currentDisplayMode, RequireConsistentDisplayMode).ToList();
+            return GetAvailableDisplayModesForContext(httpContext, currentDisplayMode, RequireConsistentDisplayMode);
         }

         internal IEnumerable<IDisplayMode> GetAvailableDisplayModesForContext(HttpContextBase httpContext, IDisplayMode currentDisplayMode, bool requireConsistentDisplayMode)
         {
-            IEnumerable<IDisplayMode> possibleDisplayModes = (requireConsistentDisplayMode && currentDisplayMode != null) ? Modes.SkipWhile(mode => mode != currentDisplayMode) : Modes;
-            return possibleDisplayModes.Where(mode => mode.CanHandleContext(httpContext));
+            int first = FindFirstAvailableDisplayMode(currentDisplayMode, requireConsistentDisplayMode);
+            for (int i = first; i < _displayModes.Count; i++)
+            {
+                IDisplayMode mode = _displayModes[i];
+                if (mode.CanHandleContext(httpContext))
+                {
+                    yield return mode;
+                }
+            }
         }

         /// <summary>
@@ -73,9 +90,21 @@
         internal DisplayInfo GetDisplayInfoForVirtualPath(string virtualPath, HttpContextBase httpContext, Func<string, bool> virtualPathExists, IDisplayMode currentDisplayMode,
                                                           bool requireConsistentDisplayMode)
         {
-            IEnumerable<IDisplayMode> possibleDisplayModes = GetAvailableDisplayModesForContext(httpContext, currentDisplayMode, requireConsistentDisplayMode);
-            return possibleDisplayModes.Select(mode => mode.GetDisplayInfo(httpContext, virtualPath, virtualPathExists))
-                .FirstOrDefault(info => info != null);
+            // Performance sensitive
+            int first = FindFirstAvailableDisplayMode(currentDisplayMode, requireConsistentDisplayMode);
+            for (int i = first; i < _displayModes.Count; i++)
+            {
+                IDisplayMode mode = _displayModes[i];
+                if (mode.CanHandleContext(httpContext))
+                {
+                    DisplayInfo info = mode.GetDisplayInfo(httpContext, virtualPath, virtualPathExists);
+                    if (info != null)
+                    {
+                        return info;
+                    }
+                }
+            }
+            return null;
         }

         internal static IDisplayMode GetDisplayMode(HttpContextBase context)


added Arabic character range with help of @AdelinGhanayem

--- inklecate/InkParser/InkParser_CharacterRanges.cs
+++ inklecate/InkParser/InkParser_CharacterRanges.cs
@@ -22,8 +22,10 @@
 			CharacterRange.Define('\u0530', '\u058F', excludes: new CharacterSet().AddCharacters("\u0530").AddRange('\u0557', '\u0560').AddRange('\u0588', '\u058E'));
 		internal static readonly CharacterRange Hebrew =
 			CharacterRange.Define('\u0590', '\u05FF', excludes: new CharacterSet());
+
+		// Many thanks to Adelin Ghanayem for currating these ranges.
 		internal static readonly CharacterRange Arabic =
-			CharacterRange.Define('\u0600', '\u06FF', excludes: new CharacterSet());
+			CharacterRange.Define('\u0620', '\u06FF', excludes: new CharacterSet().AddCharacters('\u0640', '\u06E9').AddRange('\u064B', '\u065F').AddRange('\u066A', '\u066D').AddRange('\u06DD', '\u06DE'));

 		protected CharacterRangeInlcude EnableCharacterRange()
 		{


Rearrange and clean up Task.microsoft.net35.cs

--- Core/System/Threading/Tasks/Task.microsoft.net35.cs
+++ Core/System/Threading/Tasks/Task.microsoft.net35.cs
@@ -12,18 +12,19 @@
 {
     public partial class Task
     {
+        private readonly static Predicate<Task> _isExceptionObservedByParentPredicate = (t => t.IsExceptionObservedByParent);
+        private readonly static Action<object> _taskCancelCallback = (TaskCancelCallback);
+
+        [SecurityCritical]
+        private static ContextCallback _executionContextCallback;
+
+        private int _cancellationAcknowledged;
         private StrongBox<CancellationTokenRegistration> _cancellationRegistration;
+        private int _cancellationRequested;
         private int _completionCountdown = 1;
         private List<Task> _exceptionalChildren;
+        private int _exceptionObservedByParent;
         private TaskExceptionHolder _exceptionsHolder;
-        private readonly static Predicate<Task> _isExceptionObservedByParentPredicate = (t => t.IsExceptionObservedByParent);
-        private readonly static Action<object> _taskCancelCallback = (TaskCancelCallback);
-        [SecurityCritical]
-        private static ContextCallback _executionContextCallback;
-
-        private int _cancellationAcknowledged;
-        private int _cancellationRequested;
-        private int _exceptionObservedByParent;
         private int _threadAbortedmanaged;

         /// <summary>
@@ -67,7 +68,7 @@
         }

         /// <summary>
-        /// This is to be called just before the task does its final state transition.
+        /// This is to be called just before the task does its final state transition.
         /// It traverses the list of exceptional children, and appends their aggregate exceptions into this one's exception list
         /// </summary>
         internal void AddExceptionsFromChildren()
@@ -80,8 +81,8 @@

             if (tmp != null)
             {
-                // This lock is necessary because even though AddExceptionsFromChildren is last to execute, it may still
-                // be racing with the code segment at the bottom of Finish() that prunes the exceptional child array.
+                // This lock is necessary because even though AddExceptionsFromChildren is last to execute, it may still
+                // be racing with the code segment at the bottom of Finish() that prunes the exceptional child array.
                 lock (tmp)
                 {
                     foreach (Task task in tmp)
@@ -113,7 +114,7 @@
         }

         /// <summary>
-        /// Checks if we registered a CT callback during construction, and deregisters it.
+        /// Checks if we registered a CT callback during construction, and deregisters it.
         /// This should be called when we know the registration isn't useful anymore. Specifically from Finish() if the task has completed
         /// successfully or with an exception.
         /// </summary>
@@ -149,12 +150,12 @@
         /// Signals completion of this particular task.
         ///
         /// The bUserDelegateExecuted parameter indicates whether this Finish() call comes following the
-        /// full execution of the user delegate.
-        ///
+        /// full execution of the user delegate.
+        ///
         /// If bUserDelegateExecuted is false, it mean user delegate wasn't invoked at all (either due to
         /// a cancellation request, or because this task is a promise style Task). In this case, the steps
         /// involving child tasks (i.e. WaitForChildren) will be skipped.
-        ///
+        ///
         /// </summary>
         internal void Finish(bool bUserDelegateExecuted)
         {
@@ -177,7 +178,7 @@
                     // Apparently some children still remain. It will be up to the last one to process the completion of this task on their own thread.
                     // We will now yield the thread back to ThreadPool. Mark our state appropriately before getting out.

-                    // We have to use an atomic update for this and make sure not to overwrite a final state,
+                    // We have to use an atomic update for this and make sure not to overwrite a final state,
                     // because at this very moment the last child's thread may be concurrently completing us.
                     // Otherwise we risk overwriting the TaskStatus which may have been set by that child task.

@@ -185,7 +186,7 @@
                 }

                 // Now is the time to prune exceptional children. We'll walk the list and removes the ones whose exceptions we might have observed after they threw.
-                // we use a local variable for exceptional children here because some other thread may be nulling out _exceptionalChildren
+                // we use a local variable for exceptional children here because some other thread may be nulling out _exceptionalChildren
                 var exceptionalChildren = ThreadingHelper.VolatileRead(ref _exceptionalChildren);

                 if (exceptionalChildren != null)
@@ -213,7 +214,7 @@
         }

         /// <summary>
-        /// FinishStageTwo is to be executed as soon as we known there are no more children to complete.
+        /// FinishStageTwo is to be executed as soon as we known there are no more children to complete.
         /// It can happen i) either on the thread that originally executed this task (if no children were spawned, or they all completed by the time this task's delegate quit)
         ///              ii) or on the thread that executed the last child.
         /// </summary>
@@ -222,7 +223,7 @@
             AddExceptionsFromChildren();

             // At this point, the task is done executing and waiting for its children,
-            // we can transition our task to a completion state.
+            // we can transition our task to a completion state.
             TaskStatus completionState;
             if (ExceptionRecorded)
             {
@@ -230,8 +231,8 @@
             }
             else if (IsCancellationRequested && IsCancellationAcknowledged)
             {
-                // We transition into the TASK_STATE_CANCELED final state if the task's CT was signalled for cancellation,
-                // and the user delegate acknowledged the cancellation request by throwing an OCE,
+                // We transition into the TASK_STATE_CANCELED final state if the task's CT was signalled for cancellation,
+                // and the user delegate acknowledged the cancellation request by throwing an OCE,
                 // and the task hasn't otherwise transitioned into faulted state. (TASK_STATE_FAULTED trumps TASK_STATE_CANCELED)
                 //
                 // If the task threw an OCE without cancellation being requestsed (while the CT not being in signaled state),
@@ -263,7 +264,7 @@
         /// such as inlined continuations
         /// </summary>
         /// <param name="bTAEAddedToExceptionHolder">
-        /// Indicates whether the ThreadAbortException was added to this task's exception holder.
+        /// Indicates whether the ThreadAbortException was added to this task's exception holder.
         /// This should always be true except for the case of non-root self replicating task copies.
         /// </param>
         /// <param name="delegateRan">Whether the delegate was executed.</param>
@@ -365,13 +366,13 @@
         /// <summary>
         /// Checks whether this is an attached task, and whether we are being called by the parent task.
         /// And sets the TASK_STATE_EXCEPTIONOBSERVEDBYPARENT status flag based on that.
-        ///
-        /// This is meant to be used internally when throwing an exception, and when WaitAll is gathering
-        /// exceptions for tasks it waited on. If this flag gets set, the implicit wait on children
+        ///
+        /// This is meant to be used internally when throwing an exception, and when WaitAll is gathering
+        /// exceptions for tasks it waited on. If this flag gets set, the implicit wait on children
         /// will skip exceptions to prevent duplication.
-        ///
+        ///
         /// This should only be called when this task has completed with an exception
-        ///
+        ///
         /// </summary>
         internal void UpdateExceptionObservedStatus()
         {
@@ -422,7 +423,7 @@
                 cancellationToken.ThrowIfSourceDisposed();

                 // If an unstarted task has a valid CancellationToken that gets signalled while the task is still not queued
-                // we need to proactively cancel it, because it may never execute to transition itself.
+                // we need to proactively cancel it, because it may never execute to transition itself.
                 // The only way to accomplish this is to register a callback on the CT.
                 // We exclude Promise tasks from this, because TaskCompletionSource needs to fully control the inner tasks's lifetime (i.e. not allow external cancellations)

@@ -475,8 +476,8 @@
                 // Record this exception in the task's exception list
                 HandleException(tae);

-                // This is a ThreadAbortException and it will be rethrown from this catch clause, causing us to
-                // skip the regular Finish codepath. In order not to leave the task unfinished, we now call
+                // This is a ThreadAbortException and it will be rethrown from this catch clause, causing us to
+                // skip the regular Finish codepath. In order not to leave the task unfinished, we now call
                 // FinishThreadAbortedTask here.
                 FinishThreadAbortedTask(true, true);
             }
@@ -524,7 +525,7 @@

         /// <summary>
         /// Performs whatever handling is necessary for an unhandled exception. Normally
-        /// this just entails adding the exception to the holder object.
+        /// this just entails adding the exception to the holder object.
         /// </summary>
         /// <param name="unhandledException">The exception that went unhandled.</param>
         private void HandleException(Exception unhandledException)
@@ -543,8 +544,8 @@
             }
             else
             {
-                // Other exceptions, including any OCE from the task that doesn't match the tasks' own CT,
-                // or that gets thrown without the CT being set will be treated as an ordinary exception
+                // Other exceptions, including any OCE from the task that doesn't match the tasks' own CT,
+                // or that gets thrown without the CT being set will be treated as an ordinary exception
                 // and added to the aggregate.

                 AddException(unhandledException);


Fix cache find by name throwing exception

Former-commit-id: 268448dc8a2f676bff9bafa60e46bd7b9aa697de

--- Winston/Cache/SqliteCache.cs
+++ Winston/Cache/SqliteCache.cs
@@ -100,11 +100,11 @@
                             new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
                         var result = DB.Execute(
                             @"insert or replace into Packages (Name, Description, PackageData) values (@Name, @Desc, @Data)",
-                            new {Name = pkg.Name, Desc = pkg.Description, Data = json},
+                            new { Name = pkg.Name, Desc = pkg.Description, Data = json },
                             transaction: t);
                         result = DB.Execute(
                             @"insert or replace into PackageSearch (Name, Desc) values (@Name, @Desc)",
-                            new {Name = pkg.Name, Desc = pkg.Description},
+                            new { Name = pkg.Name, Desc = pkg.Description },
                             transaction: t);
                     }
                     t.Commit();
@@ -129,27 +129,44 @@
         public async Task<Package> ByName(string pkgName)
         {
             var result = await DB.QueryAsync<string>("select PackageData from Packages where Name = @Name", new { Name = pkgName });
-            var json = result.Single();
+            var json = result.SingleOrDefault();
+            if (json == null) return null;
             var pkg = JsonConvert.DeserializeObject<Package>(json);
             return pkg;
         }

         public async Task<IList<Package>> ByNames(IEnumerable<string> names)
         {
-            return await Task.WhenAll(names.Select(ByName));
+            // SQLite is going to end up executing these all in serial anyway,
+            // little point in making this code parallel.
+            var result = new List<Package>();
+            foreach (var name in names)
+            {
+                var match = await ByName(name);
+                if (match != null)
+                {
+                    result.Add(match);
+                }
+            }
+            return result;
         }

         public async Task<IList<Package>> Search(string query)
         {
-            var nameMatches = await DB.QueryAsync<string>("select distinct Name from PackageSearch where Name match @query", new {query});
-            var descMatches = await DB.QueryAsync<string>("select distinct Name from PackageSearch where Desc match @query", new {query});
+            var nameMatches = await DB.QueryAsync<string>("select distinct Name from PackageSearch where Name match @query", new { query });
+            var descMatches = await DB.QueryAsync<string>("select distinct Name from PackageSearch where Desc match @query", new { query });
             var names = nameMatches.Union(descMatches).Distinct();
             var result = new List<Package>();
             foreach (var name in names)
             {
-                var json = await DB.QueryAsync<string>("select PackageData from Packages where Name = @name", new {name});
-                var pkg = JsonConvert.DeserializeObject<Package>(json.Single());
-                result.Add(pkg);
+                var json =
+                    await DB.QueryAsync<string>("select PackageData from Packages where Name = @name", new { name });
+                var single = json.SingleOrDefault();
+                if (single != null)
+                {
+                    var pkg = JsonConvert.DeserializeObject<Package>(single);
+                    result.Add(pkg);
+                }
             }

             return result;


kangwl

kangwl

--- XK.WeiXin/Main/Logic/Text.cs
+++ XK.WeiXin/Main/Logic/Text.cs
@@ -86,7 +86,7 @@

         private string SearchStock() {
             Ext.Stock stock = new Stock(XmlDoc);
-            ReturnText = stock.SearchStock("股票");
+            ReturnText = stock.SearchStock("查询股票");
             return CreateSendMsg();
         }
         //#############################################################
@@ -107,7 +107,7 @@

         private string GetCommandList() {
             ReturnText = new Event(XmlDoc).CreateSendMsg();
-            return CreateSendMsg();
+            return ReturnText;
         }


corrected github formatting

corrected github formatting

--- FadeOutPanel.cs
+++ FadeOutPanel.cs
@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using UnityEngine.UI;

 public class FadeOutPanel : MonoBehaviour {