Add a strongly typed TraceEvent for the Microsoft-Windows-Kernel-Memory/MemInfo event.

--- src/TraceEvent/Parsers/KernelTraceEventParser.cs
+++ src/TraceEvent/Parsers/KernelTraceEventParser.cs
@@ -2048,6 +2048,22 @@
             }
         }

+        /// <summary>
+        /// Rasied every 0.5s with memory metrics of the current machine.
+        /// </summary>
+        public event Action<MemInfoTraceData> MemoryMemInfo
+        {
+            add
+            {
+                // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
+                source.RegisterEventTemplate(new MemInfoTraceData(value, 1, 1, "MemInfo", Guid.Empty, 0, "", MemoryProviderGuid, "Microsoft-Windows-Kernel-Memory", State));
+            }
+            remove
+            {
+                source.UnregisterEventTemplate(value, 1, MemoryProviderGuid);
+            }
+        }
+
         // TODO Added by hand without proper body decode.
         public event Action<EmptyTraceData> MemoryPFMappedSectionCreate
         {
@@ -2844,7 +2860,7 @@
         {
             if (s_templates == null)
             {
-                var templates = new TraceEvent[191];
+                var templates = new TraceEvent[192];
                 templates[0] = new EventTraceHeaderTraceData(null, 0xFFFF, 0, "EventTrace", EventTraceTaskGuid, 0, "Header", ProviderGuid, ProviderName, null);
                 templates[1] = new HeaderExtensionTraceData(null, 0xFFFF, 0, "EventTrace", EventTraceTaskGuid, 5, "Extension", ProviderGuid, ProviderName, null);
                 templates[2] = new HeaderExtensionTraceData(null, 0xFFFF, 0, "EventTrace", EventTraceTaskGuid, 32, "EndExtension", ProviderGuid, ProviderName, null);
@@ -2976,71 +2992,72 @@
                 templates[124] = new MemoryPageAccessTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 130, "PageAccess", ProviderGuid, ProviderName, null);
                 templates[125] = new MemoryProcessMemInfoTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 125, "ProcessMemInfo", ProviderGuid, ProviderName, null);
                 templates[126] = new MemoryProcessMemInfoTraceData(null, 2, 2, "MemoryProcessMemInfo", Guid.Empty, 0, "", MemoryProviderGuid, "Microsoft-Windows-Kernel-Memory", null);
-                templates[127] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 73, "PFMappedSectionCreate", ProviderGuid, ProviderName);
-                templates[128] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 76, "SessionDCStop", ProviderGuid, ProviderName);
-                templates[129] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 79, "PFMappedSectionDelete", ProviderGuid, ProviderName);
-                templates[130] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 115, "InMemoryStoreFault", ProviderGuid, ProviderName);
-                templates[131] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 119, "PageRelease", ProviderGuid, ProviderName);
-                templates[132] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 120, "RangeAccess", ProviderGuid, ProviderName);
-                templates[133] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 121, "RangeRelease", ProviderGuid, ProviderName);
-                templates[134] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 122, "Combine", ProviderGuid, ProviderName);
-                templates[135] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 123, "KernelMemUsage", ProviderGuid, ProviderName);
-                templates[136] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 124, "MMStats", ProviderGuid, ProviderName);
-                templates[137] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 126, "MemInfoSessionWS", ProviderGuid, ProviderName);
-                templates[138] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 127, "VirtualRotate", ProviderGuid, ProviderName);
-                templates[139] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 128, "VirtualAllocDCStart", ProviderGuid, ProviderName);
-                templates[140] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 129, "VirtualAllocDCStop", ProviderGuid, ProviderName);
-                templates[141] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 131, "RemoveFromWS", ProviderGuid, ProviderName);
-                templates[142] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 132, "WSSharableRundown", ProviderGuid, ProviderName);
-                templates[143] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 133, "InMemoryActiveRundown", ProviderGuid, ProviderName);
-                templates[144] = new SampledProfileTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 46, "Sample", ProviderGuid, ProviderName, null);
-                templates[145] = new PMCCounterProfTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 47, "PMCSample", ProviderGuid, ProviderName, null);
-                templates[146] = new SystemPathsTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 33, "SystemPaths", ProviderGuid, ProviderName);
-                templates[147] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 72, "SetInterval", ProviderGuid, ProviderName, null);
-                templates[148] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 73, "CollectionStart", ProviderGuid, ProviderName, null);
-                templates[149] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 74, "CollectionEnd", ProviderGuid, ProviderName, null);
-                templates[150] = new SysCallEnterTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 51, "SysClEnter", ProviderGuid, ProviderName, null);
-                templates[151] = new SysCallExitTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 52, "SysClExit", ProviderGuid, ProviderName, null);
-                templates[152] = new ISRTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 67, "ISR", ProviderGuid, ProviderName, null);
-                templates[153] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 66, "ThreadedDPC", ProviderGuid, ProviderName, null);
-                templates[154] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 68, "DPC", ProviderGuid, ProviderName, null);
-                templates[155] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 69, "TimerDPC", ProviderGuid, ProviderName, null);
-                templates[156] = new EmptyTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 58, "DebuggerEnabled", ProviderGuid, ProviderName);
-                templates[157] = new StackWalkStackTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 32, "Stack", ProviderGuid, ProviderName, null);
-                templates[158] = new StackWalkRefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 37, "StackKeyKernel", ProviderGuid, ProviderName, null);
-                templates[159] = new StackWalkRefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 38, "StackKeyUser", ProviderGuid, ProviderName, null);
-                templates[160] = new StackWalkDefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 35, "KeyDelete", ProviderGuid, ProviderName, null);
-                templates[161] = new StackWalkDefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 36, "KeyRundown", ProviderGuid, ProviderName, null);
-                templates[162] = new ALPCSendMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 33, "SendMessage", ProviderGuid, ProviderName, null);
-                templates[163] = new ALPCReceiveMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 34, "ReceiveMessage", ProviderGuid, ProviderName, null);
-                templates[164] = new ALPCWaitForReplyTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 35, "WaitForReply", ProviderGuid, ProviderName, null);
-                templates[165] = new ALPCWaitForNewMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 36, "WaitForNewMessage", ProviderGuid, ProviderName, null);
-                templates[166] = new ALPCUnwaitTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 37, "Unwait", ProviderGuid, ProviderName, null);
-                templates[167] = new EmptyTraceData(null, 0xFFFF, 14, "LostEvent", LostEventTaskGuid, 32, "", ProviderGuid, ProviderName);
-                templates[168] = new SystemConfigCPUTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 10, "CPU", ProviderGuid, ProviderName, null);
-                templates[169] = new SystemConfigPhyDiskTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 11, "PhyDisk", ProviderGuid, ProviderName, null);
-                templates[170] = new SystemConfigLogDiskTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 12, "LogDisk", ProviderGuid, ProviderName, null);
-                templates[171] = new SystemConfigNICTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 13, "NIC", ProviderGuid, ProviderName, null);
-                templates[172] = new SystemConfigVideoTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 14, "Video", ProviderGuid, ProviderName, null);
-                templates[173] = new SystemConfigServicesTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 15, "Services", ProviderGuid, ProviderName, null);
-                templates[174] = new SystemConfigPowerTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 16, "Power", ProviderGuid, ProviderName, null);
-                templates[175] = new SystemConfigIRQTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 21, "IRQ", ProviderGuid, ProviderName, null);
-                templates[176] = new SystemConfigPnPTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 22, "PnP", ProviderGuid, ProviderName, null);
-                templates[177] = new SystemConfigNetworkTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 17, "Network", ProviderGuid, ProviderName, null);
-                templates[178] = new SystemConfigIDEChannelTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 23, "IDEChannel", ProviderGuid, ProviderName, null);
-                templates[179] = new VirtualAllocTraceData(null, 0xFFFF, 0, "VirtualMem", VirtualAllocTaskGuid, 98, "Alloc", ProviderGuid, ProviderName, null);
-                templates[180] = new VirtualAllocTraceData(null, 0xFFFF, 0, "VirtualMem", VirtualAllocTaskGuid, 99, "Free", ProviderGuid, ProviderName, null);
-                templates[181] = new DispatcherReadyThreadTraceData(null, 0xFFFF, 0, "Dispatcher", ReadyThreadTaskGuid, 50, "ReadyThread", ProviderGuid, ProviderName, null);
-                templates[182] = new StringTraceData(null, 0xFFFF, 0, "PerfInfo", PerfInfoTaskGuid, 34, "Mark", ProviderGuid, ProviderName, false);
-                templates[183] = new BuildInfoTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 32, "BuildInfo", ProviderGuid, ProviderName);
-                templates[184] = new VolumeMappingTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 35, "VolumeMapping", ProviderGuid, ProviderName);
-                templates[185] = new StringTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 34, "UnknownVolume", ProviderGuid, ProviderName, true);
+                templates[127] = new MemInfoTraceData(null, 1, 1, "MemInfo", Guid.Empty, 0, "", MemoryProviderGuid, "Microsoft-Windows-Kernel-Memory", State);
+                templates[128] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 73, "PFMappedSectionCreate", ProviderGuid, ProviderName);
+                templates[129] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 76, "SessionDCStop", ProviderGuid, ProviderName);
+                templates[130] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 79, "PFMappedSectionDelete", ProviderGuid, ProviderName);
+                templates[131] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 115, "InMemoryStoreFault", ProviderGuid, ProviderName);
+                templates[132] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 119, "PageRelease", ProviderGuid, ProviderName);
+                templates[133] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 120, "RangeAccess", ProviderGuid, ProviderName);
+                templates[134] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 121, "RangeRelease", ProviderGuid, ProviderName);
+                templates[135] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 122, "Combine", ProviderGuid, ProviderName);
+                templates[136] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 123, "KernelMemUsage", ProviderGuid, ProviderName);
+                templates[137] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 124, "MMStats", ProviderGuid, ProviderName);
+                templates[138] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 126, "MemInfoSessionWS", ProviderGuid, ProviderName);
+                templates[139] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 127, "VirtualRotate", ProviderGuid, ProviderName);
+                templates[140] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 128, "VirtualAllocDCStart", ProviderGuid, ProviderName);
+                templates[141] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 129, "VirtualAllocDCStop", ProviderGuid, ProviderName);
+                templates[142] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 131, "RemoveFromWS", ProviderGuid, ProviderName);
+                templates[143] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 132, "WSSharableRundown", ProviderGuid, ProviderName);
+                templates[144] = new EmptyTraceData(null, 0xFFFF, 10, "Memory", MemoryTaskGuid, 133, "InMemoryActiveRundown", ProviderGuid, ProviderName);
+                templates[145] = new SampledProfileTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 46, "Sample", ProviderGuid, ProviderName, null);
+                templates[146] = new PMCCounterProfTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 47, "PMCSample", ProviderGuid, ProviderName, null);
+                templates[147] = new SystemPathsTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 33, "SystemPaths", ProviderGuid, ProviderName);
+                templates[148] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 72, "SetInterval", ProviderGuid, ProviderName, null);
+                templates[149] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 73, "CollectionStart", ProviderGuid, ProviderName, null);
+                templates[150] = new SampledProfileIntervalTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 74, "CollectionEnd", ProviderGuid, ProviderName, null);
+                templates[151] = new SysCallEnterTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 51, "SysClEnter", ProviderGuid, ProviderName, null);
+                templates[152] = new SysCallExitTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 52, "SysClExit", ProviderGuid, ProviderName, null);
+                templates[153] = new ISRTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 67, "ISR", ProviderGuid, ProviderName, null);
+                templates[154] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 66, "ThreadedDPC", ProviderGuid, ProviderName, null);
+                templates[155] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 68, "DPC", ProviderGuid, ProviderName, null);
+                templates[156] = new DPCTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 69, "TimerDPC", ProviderGuid, ProviderName, null);
+                templates[157] = new EmptyTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 58, "DebuggerEnabled", ProviderGuid, ProviderName);
+                templates[158] = new StackWalkStackTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 32, "Stack", ProviderGuid, ProviderName, null);
+                templates[159] = new StackWalkRefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 37, "StackKeyKernel", ProviderGuid, ProviderName, null);
+                templates[160] = new StackWalkRefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 38, "StackKeyUser", ProviderGuid, ProviderName, null);
+                templates[161] = new StackWalkDefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 35, "KeyDelete", ProviderGuid, ProviderName, null);
+                templates[162] = new StackWalkDefTraceData(null, 0xFFFF, 12, "StackWalk", StackWalkTaskGuid, 36, "KeyRundown", ProviderGuid, ProviderName, null);
+                templates[163] = new ALPCSendMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 33, "SendMessage", ProviderGuid, ProviderName, null);
+                templates[164] = new ALPCReceiveMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 34, "ReceiveMessage", ProviderGuid, ProviderName, null);
+                templates[165] = new ALPCWaitForReplyTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 35, "WaitForReply", ProviderGuid, ProviderName, null);
+                templates[166] = new ALPCWaitForNewMessageTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 36, "WaitForNewMessage", ProviderGuid, ProviderName, null);
+                templates[167] = new ALPCUnwaitTraceData(null, 0xFFFF, 13, "ALPC", ALPCTaskGuid, 37, "Unwait", ProviderGuid, ProviderName, null);
+                templates[168] = new EmptyTraceData(null, 0xFFFF, 14, "LostEvent", LostEventTaskGuid, 32, "", ProviderGuid, ProviderName);
+                templates[169] = new SystemConfigCPUTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 10, "CPU", ProviderGuid, ProviderName, null);
+                templates[170] = new SystemConfigPhyDiskTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 11, "PhyDisk", ProviderGuid, ProviderName, null);
+                templates[171] = new SystemConfigLogDiskTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 12, "LogDisk", ProviderGuid, ProviderName, null);
+                templates[172] = new SystemConfigNICTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 13, "NIC", ProviderGuid, ProviderName, null);
+                templates[173] = new SystemConfigVideoTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 14, "Video", ProviderGuid, ProviderName, null);
+                templates[174] = new SystemConfigServicesTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 15, "Services", ProviderGuid, ProviderName, null);
+                templates[175] = new SystemConfigPowerTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 16, "Power", ProviderGuid, ProviderName, null);
+                templates[176] = new SystemConfigIRQTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 21, "IRQ", ProviderGuid, ProviderName, null);
+                templates[177] = new SystemConfigPnPTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 22, "PnP", ProviderGuid, ProviderName, null);
+                templates[178] = new SystemConfigNetworkTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 17, "Network", ProviderGuid, ProviderName, null);
+                templates[179] = new SystemConfigIDEChannelTraceData(null, 0xFFFF, 15, "SystemConfig", SystemConfigTaskGuid, 23, "IDEChannel", ProviderGuid, ProviderName, null);
+                templates[180] = new VirtualAllocTraceData(null, 0xFFFF, 0, "VirtualMem", VirtualAllocTaskGuid, 98, "Alloc", ProviderGuid, ProviderName, null);
+                templates[181] = new VirtualAllocTraceData(null, 0xFFFF, 0, "VirtualMem", VirtualAllocTaskGuid, 99, "Free", ProviderGuid, ProviderName, null);
+                templates[182] = new DispatcherReadyThreadTraceData(null, 0xFFFF, 0, "Dispatcher", ReadyThreadTaskGuid, 50, "ReadyThread", ProviderGuid, ProviderName, null);
+                templates[183] = new StringTraceData(null, 0xFFFF, 0, "PerfInfo", PerfInfoTaskGuid, 34, "Mark", ProviderGuid, ProviderName, false);
+                templates[184] = new BuildInfoTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 32, "BuildInfo", ProviderGuid, ProviderName);
+                templates[185] = new VolumeMappingTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 35, "VolumeMapping", ProviderGuid, ProviderName);
+                templates[186] = new StringTraceData(null, 0xFFFF, 0, "SysConfig", SysConfigTaskGuid, 34, "UnknownVolume", ProviderGuid, ProviderName, true);
                 // templates[146] = new BatchedSampledProfileTraceData(null, 0xFFFF, 11, "PerfInfo", PerfInfoTaskGuid, 55, "BatchedSample", ProviderGuid, ProviderName, null);
-                templates[186] = new ObjectHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 32, "CreateHandle", ProviderGuid, ProviderName, null);
-                templates[187] = new ObjectHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 33, "CloseHandle", ProviderGuid, ProviderName, null);
-                templates[188] = new ObjectDuplicateHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 34, "DuplicateHandle", ProviderGuid, ProviderName, null);
-                templates[189] = new ObjectTypeNameTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 37, "TypeDCEnd", ProviderGuid, ProviderName, null);
-                templates[190] = new ObjectNameTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 39, "HandleDCEnd", ProviderGuid, ProviderName, null);
+                templates[187] = new ObjectHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 32, "CreateHandle", ProviderGuid, ProviderName, null);
+                templates[188] = new ObjectHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 33, "CloseHandle", ProviderGuid, ProviderName, null);
+                templates[189] = new ObjectDuplicateHandleTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 34, "DuplicateHandle", ProviderGuid, ProviderName, null);
+                templates[190] = new ObjectTypeNameTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 37, "TypeDCEnd", ProviderGuid, ProviderName, null);
+                templates[191] = new ObjectNameTraceData(null, 0xFFFF, 0, "Object", ObjectTaskGuid, 39, "HandleDCEnd", ProviderGuid, ProviderName, null);

                 s_templates = templates;
             }
@@ -8641,6 +8658,84 @@
         #endregion
     }

+    public sealed class MemInfoTraceData : TraceEvent
+    {
+        public byte PriorityLevels { get { return (byte)GetByteAt(0); } }
+        public long ZeroPageCount { get { return (long)GetAddressAt(1); } }
+        public long FreePageCount { get { return (long)GetAddressAt(HostOffset(5, 1)); } }
+        public long ModifiedPageCount { get { return (long)GetAddressAt(HostOffset(9, 2)); } }
+        public long ModifiedNoWritePageCount { get { return (long)GetAddressAt(HostOffset(13, 3)); } }
+        public long BadPageCount { get { return (long)GetAddressAt(HostOffset(17, 4)); } }
+
+        #region Private
+        internal MemInfoTraceData(Action<MemInfoTraceData> action, int eventID, int task, string taskName, Guid taskGuid, int opcode, string opcodeName, Guid providerGuid, string providerName, KernelTraceEventParserState state)
+            : base(eventID, task, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName)
+        {
+            this.Action = action;
+        }
+        protected internal override Delegate Target
+        {
+            get { return Action; }
+            set { Action = (Action<MemInfoTraceData>)value; }
+        }
+        protected internal override void Dispatch()
+        {
+            Action(this);
+        }
+        protected unsafe internal override void Validate()
+        {
+            Debug.Assert(EventDataLength >= HostOffset(17, 1) + 4);
+        }
+        public unsafe override StringBuilder ToXml(StringBuilder sb)
+        {
+            Prefix(sb);
+            XmlAttribHex(sb, "PriorityLevels", PriorityLevels);
+            XmlAttribHex(sb, "ZeroPageCount", ZeroPageCount);
+            XmlAttribHex(sb, "FreePageCount", FreePageCount);
+            XmlAttribHex(sb, "ModifiedPageCount", ModifiedPageCount);
+            XmlAttribHex(sb, "ModifiedNoWritePageCount", ModifiedNoWritePageCount);
+            XmlAttribHex(sb, "BadPageCount", BadPageCount);
+            sb.Append("/>");
+            return sb;
+        }
+
+        public override string[] PayloadNames
+        {
+            get
+            {
+                if (payloadNames == null)
+                    payloadNames = new string[] { "PriorityLevels", "ZeroPageCount", "FreePageCount", "ModifiedPageCount", "ModifiedNoWritePageCount", "BadPageCount" };
+                return payloadNames;
+            }
+        }
+        /// <summary>
+        /// The fields after 'Count' are the first value in the array of working sets.
+        /// </summary>
+        public override object PayloadValue(int index)
+        {
+            switch (index)
+            {
+                case 0:
+                    return PriorityLevels;
+                case 1:
+                    return ZeroPageCount;
+                case 2:
+                    return FreePageCount;
+                case 3:
+                    return ModifiedPageCount;
+                case 4:
+                    return ModifiedNoWritePageCount;
+                case 5:
+                    return BadPageCount;
+                default:
+                    Debug.Assert(false, "Bad field index");
+                    return null;
+            }
+        }
+        private event Action<MemInfoTraceData> Action;
+        #endregion
+    }
+
     public sealed class SampledProfileTraceData : TraceEvent
     {
         public Address InstructionPointer { get { return GetAddressAt(0); } }


redundant guards

redundant guards

--- FodyHelpers/Guard.cs
+++ FodyHelpers/Guard.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections;
 using System.IO;

 [Obsolete("Not for public use")]
@@ -21,64 +20,12 @@
         }
     }

-    public static void AgainstEmpty(string argumentName, string value)
-    {
-        if (value !=null && string.IsNullOrWhiteSpace(value))
-        {
-            throw new ArgumentNullException(argumentName);
-        }
-    }
-
     public static void FileExists(string argumentName, string path)
     {
-        Guard.AgainstNullAndEmpty(nameof(path),path);
+        AgainstNullAndEmpty(argumentName, path);
         if (!File.Exists(path))
         {
             throw new ArgumentException($"File not found. Path: {path}");
         }
     }
-
-    public static void AgainstNullAndEmpty(string argumentName, ICollection value)
-    {
-        if (value == null)
-        {
-            throw new ArgumentNullException(argumentName);
-        }
-        if (value.Count == 0)
-        {
-            throw new ArgumentOutOfRangeException(argumentName);
-        }
-    }
-
-    public static void AgainstNegativeAndZero(string argumentName, int value)
-    {
-        if (value <= 0)
-        {
-            throw new ArgumentOutOfRangeException(argumentName);
-        }
-    }
-
-    public static void AgainstNegative(string argumentName, int value)
-    {
-        if (value < 0)
-        {
-            throw new ArgumentOutOfRangeException(argumentName);
-        }
-    }
-
-    public static void AgainstNegativeAndZero(string argumentName, TimeSpan value)
-    {
-        if (value <= TimeSpan.Zero)
-        {
-            throw new ArgumentOutOfRangeException(argumentName);
-        }
-    }
-
-    public static void AgainstNegative(string argumentName, TimeSpan value)
-    {
-        if (value < TimeSpan.Zero)
-        {
-            throw new ArgumentOutOfRangeException(argumentName);
-        }
-    }
 }


Fix comment.

Fix comment.

--- src/Workspaces/Core/Portable/Utilities/BKTree.cs
+++ src/Workspaces/Core/Portable/Utilities/BKTree.cs
@@ -20,8 +20,8 @@
             SpecializedCollections.EmptyArray<Node>(),
             SpecializedCollections.EmptyArray<Edge>());

-        // We have two completely flat arrays of structs (except for the char[] values the nodes
-        // point to).  These arrays fully represent the BK tree.  The structure is as follows:
+        // We have three completely flat arrays of structs.  These arrays fully represent the
+        // BK tree.  The structure is as follows:
         //
         // The root node is in _nodes[0].
         //
@@ -32,6 +32,10 @@
         // * of course '0' is only for the root case.  All nodes state where in _edges
         // their child edges range starts.  So the children for any node are in _edges from
         // [node.FirstEdgeIndex, node.FirstEdgeIndex + node.EdgeCount)
+        //
+        // Each node also has an associated string.  These strings are concatenated and stored
+        // in _allLowerCaseCharacters.  Each node has a TextSpan that indicates which portion
+        // of the character array is their string.
         private readonly char[] _allLowerCaseCharacters;
         private readonly Node[] _nodes;
         private readonly Edge[] _edges;


implemented methods:

implemented methods:

- CreateVirtualMachine(VirtualAppliance virtualAppliance, VirtualMachineTemplate virtualMachineTemplate, VirtualMachine virtualMachine)
- UpdateVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion)
- ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state)
- ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state)
- ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state, bool waitForCompletion)

--- src/biz.dfch.CS.Abiquo.Client/v1/AbiquoClient.cs
+++ src/biz.dfch.CS.Abiquo.Client/v1/AbiquoClient.cs
@@ -351,6 +351,17 @@
             return CreateVirtualMachine(virtualDataCenterId, virtualApplianceId, virtualMachineTemplateHref, virtualMachine);
         }

+        public override VirtualMachine CreateVirtualMachine(VirtualAppliance virtualAppliance, VirtualMachineTemplate virtualMachineTemplate, VirtualMachine virtualMachine)
+        {
+            var virtualDataCenterLink = virtualAppliance.GetLinkByRel(AbiquoRelations.VIRTUALDATACENTER);
+            var virtualDataCenterId = UriHelper.ExtractIdAsInt(virtualDataCenterLink.Href);
+            var virtualApplianceId = virtualAppliance.Id;
+            var virtualMachineTemplateHref = virtualMachineTemplate.GetLinkByRel(AbiquoRelations.EDIT).Href;
+
+            return CreateVirtualMachine(virtualDataCenterId, virtualApplianceId, virtualMachineTemplateHref,
+                virtualMachine);
+        }
+
         public override VirtualMachine CreateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, string virtualMachineTemplateHref,
             VirtualMachineBase virtualMachine)
         {
@@ -443,6 +454,20 @@
             VirtualMachine virtualMachine, bool force)
         {
             return UpdateVirtualMachine(virtualDataCenterId, virtualApplianceId, virtualMachineId, virtualMachine, force, false);
+        }
+
+        public override Task UpdateVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion)
+        {
+            var virtualDataCenterLink = virtualMachine.GetLinkByRel(AbiquoRelations.VIRTUALDATACENTER);
+            var virtualDataCenterId = UriHelper.ExtractIdAsInt(virtualDataCenterLink.Href);
+
+            var virtualApplianceLink = virtualMachine.GetLinkByRel(AbiquoRelations.VIRTUALAPPLIANCE);
+            var virtualApplianceId = UriHelper.ExtractIdAsInt(virtualApplianceLink.Href);
+
+            var virtualMachineId = virtualMachine.Id.GetValueOrDefault();
+
+            return UpdateVirtualMachine(virtualDataCenterId, virtualApplianceId, virtualMachineId, virtualMachine, force,
+                waitForCompletion);
         }

         public override Task UpdateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId,
@@ -495,6 +520,34 @@
             }

             return task;
+        }
+
+        public override Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state)
+        {
+            var virtualMachineState = new VirtualMachineState
+            {
+                State = state
+            };
+
+            return ChangeStateOfVirtualMachine(virtualMachine, virtualMachineState);
+        }
+
+        public override Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state)
+        {
+            return ChangeStateOfVirtualMachine(virtualMachine, state, false);
+        }
+
+        public override Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state, bool waitForCompletion)
+        {
+            var virtualDataCenterLink = virtualMachine.GetLinkByRel(AbiquoRelations.VIRTUALDATACENTER);
+            var virtualDataCenterId = UriHelper.ExtractIdAsInt(virtualDataCenterLink.Href);
+
+            var virtualApplianceLink = virtualMachine.GetLinkByRel(AbiquoRelations.VIRTUALAPPLIANCE);
+            var virtualApplianceId = UriHelper.ExtractIdAsInt(virtualApplianceLink.Href);
+
+            var virtualMachineId = virtualMachine.Id.GetValueOrDefault();
+
+            return ChangeStateOfVirtualMachine(virtualDataCenterId, virtualApplianceId, virtualMachineId, state, waitForCompletion);
         }

         public override Task ChangeStateOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId,


Null check was with main object instead of casting object. Null check of casted object (name)

--- src/XMakeTasks/AssemblyRemapping.cs
+++ src/XMakeTasks/AssemblyRemapping.cs
@@ -61,7 +61,7 @@
         public override bool Equals(object obj)
         {
             AssemblyNameExtension name = obj as AssemblyNameExtension;
-            if (obj == null)
+            if (name == null)
             {
                 return false;
             }


missing using

missing using

--- Src/src/Qart.Core/Xsd/XsdUtils.cs
+++ Src/src/Qart.Core/Xsd/XsdUtils.cs
@@ -1,4 +1,5 @@
-using System.IO;
+using Qart.Core.Io;
+using System.IO;
 using System.Xml;
 using System.Xml.Schema;


v0.2.1

--- TCC.UI/Properties/AssemblyInfo.cs
+++ TCC.UI/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
 // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
 // usando l'asterisco '*' come illustrato di seguito:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.2.0.0")]
-[assembly: AssemblyFileVersion("0.2.0.0")]
+[assembly: AssemblyVersion("0.2.1.0")]
+[assembly: AssemblyFileVersion("0.2.1.0")]


Added documentation for ProjectileType.cs.

--- Terraria_Server/ProjectileType.cs
+++ Terraria_Server/ProjectileType.cs
@@ -5,6 +5,9 @@

 namespace Terraria_Server
 {
+    /// <summary>
+    /// All available projectile types
+    /// </summary>
     public enum ProjectileType
     {
         UNKNOWN,


[Modify] Remove it

[Modify] Remove it

--- websocket-sharp/Server/WebSocketServer.cs
+++ websocket-sharp/Server/WebSocketServer.cs
@@ -731,28 +731,6 @@
              || name == _hostname;
     }

-    private bool checkServicePath (string path, out string message)
-    {
-      message = null;
-
-      if (path.IsNullOrEmpty ()) {
-        message = "'path' is null or empty.";
-        return false;
-      }
-
-      if (path[0] != '/') {
-        message = "'path' is not an absolute path.";
-        return false;
-      }
-
-      if (path.IndexOfAny (new[] { '?', '#' }) > -1) {
-        message = "'path' includes either or both query and fragment components.";
-        return false;
-      }
-
-      return true;
-    }
-
     private bool checkSslConfiguration (
       ServerSslConfiguration configuration, out string message
     )


[Modify] Add a catch

[Modify] Add a catch

--- websocket-sharp/Server/WebSocketServer.cs
+++ websocket-sharp/Server/WebSocketServer.cs
@@ -838,6 +838,18 @@

           break;
         }
+        catch (InvalidOperationException ex) {
+          if (_state == ServerState.ShuttingDown) {
+            _log.Info ("The underlying listener is stopped.");
+
+            return;
+          }
+
+          _log.Fatal (ex.Message);
+          _log.Debug (ex.ToString ());
+
+          break;
+        }
         catch (Exception ex) {
           _log.Fatal (ex.Message);
           _log.Debug (ex.ToString ());


[Modify] Add it

[Modify] Add it

--- websocket-sharp/Server/WebSocketServer.cs
+++ websocket-sharp/Server/WebSocketServer.cs
@@ -558,6 +558,35 @@
       _state = ServerState.Stop;
     }

+    private bool checkIfAvailable (
+      bool ready, bool start, bool shutting, bool stop, out string message
+    )
+    {
+      message = null;
+
+      if (!ready && _state == ServerState.Ready) {
+        message = "This operation is not available in: ready";
+        return false;
+      }
+
+      if (!start && _state == ServerState.Start) {
+        message = "This operation is not available in: start";
+        return false;
+      }
+
+      if (!shutting && _state == ServerState.ShuttingDown) {
+        message = "This operation is not available in: shutting down";
+        return false;
+      }
+
+      if (!stop && _state == ServerState.Stop) {
+        message = "This operation is not available in: stop";
+        return false;
+      }
+
+      return true;
+    }
+
     private string checkIfCertificateExists ()
     {
       return _secure && (_sslConfig == null || _sslConfig.ServerCertificate == null)


Fix problem with setup and Log option handling

--- GitMind/Utils/Log.cs
+++ GitMind/Utils/Log.cs
@@ -32,12 +32,13 @@
 		private static readonly string LevelInfo = "INFO ";
 		private static readonly string LevelWarn = "WARN ";
 		private static readonly string LevelError = "ERROR";
-		private static readonly bool DisableErrorAndUsageReporting = false;
+		private static readonly Lazy<bool> DisableErrorAndUsageReporting;

 		static Log()
 		{
-			DisableErrorAndUsageReporting = Settings.Get<Options>().DisableErrorAndUsageReporting;
-
+			DisableErrorAndUsageReporting = new Lazy<bool>(() =>
+				Settings.Get<Options>().DisableErrorAndUsageReporting);
+
 			Task.Factory.StartNew(SendBufferedLogRows, TaskCreationOptions.LongRunning)
 				.RunInBackground();
 		}
@@ -145,7 +146,7 @@

 		private static void SendUsage(string text)
 		{
-			if (DisableErrorAndUsageReporting)
+			if (DisableErrorAndUsageReporting.Value)
 			{
 				return;
 			}


fix an bug about http request encoding.

fix an bug about http request encoding.

--- Helper/HttpHelper.cs
+++ Helper/HttpHelper.cs
@@ -16,7 +16,7 @@
 {
     public class HttpHelper
     {
-        public const string CharsetReg = @"(meta.*?charset=""?(?<Charset>[^\s""'>]+)""?)|(xml.*?encoding=""?(?<Charset>[^\s"">]+)""?)";
+        public const string CharsetReg = @"(meta.*?charset=""?(?<Charset>[^\s""'>;]+)""?)|(xml.*?encoding=""?(?<Charset>[^\s"">;]+)""?)";

         /// <summary>
         /// 使用Http Request获取网页信息


WriteString fix

WriteString fix

--- IO/ProtobufStream.cs
+++ IO/ProtobufStream.cs
@@ -62,7 +62,7 @@
         // -- String
         public void WriteString(string value, int length = 0)
         {
-            var lengthBytes = new VarInt(_buffer.Length).InByteArray();//GetVarIntBytes(value.Length);
+            var lengthBytes = new VarInt(value.Length).InByteArray();
             var final = new byte[value.Length + lengthBytes.Length];

             Buffer.BlockCopy(lengthBytes, 0, final, 0, lengthBytes.Length);


DB.cs board_create fixes to allow multiboard with Applications names per board.

--- yafsrc/YAF.Classes/YAF.Classes.Data/DB.cs
+++ yafsrc/YAF.Classes/YAF.Classes.Data/DB.cs
@@ -661,26 +661,25 @@
                 DBAccess.ExecuteNonQuery(cmd);
             }
         }
+
         /// <summary>
         /// Creates a new board
         /// </summary>
-        /// <param name="name">Name of new board</param>
-        /// <param name="allowThreaded">Bool, allow threaded?</param>
-        /// <param name="userName">User name of admin</param>
-        /// <param name="userEmail">Email of admin</param>
-        /// <param name="userPass">Admins password</param>
+        /// <param name="adminUsername">Membership Provider User Name</param>
+        /// <param name="adminUserKey">Membership Provider User Key</param>
+        /// <param name="boardName">Name of new board</param>
+        /// <param name="boardMembershipName">Membership Provider Application Name for new board</param>
+        /// <param name="boardRolesName">Roles Provider Application Name for new board</param>
         static public void board_create(object adminUsername, object adminUserKey, object boardName, object boardMembershipName, object boardRolesName)
         {
-			// TODO : Mek, please look at this as it's somewhat desynced
             using (SqlCommand cmd = DBAccess.GetCommand("board_create"))
             {
                 cmd.CommandType = CommandType.StoredProcedure;
-                cmd.Parameters.AddWithValue("BoardName", "" /*name*/);
+                cmd.Parameters.AddWithValue("BoardName", boardName);
                 cmd.Parameters.AddWithValue("MembershipAppName", boardMembershipName);
                 cmd.Parameters.AddWithValue("RolesAppName", boardRolesName);
                 cmd.Parameters.AddWithValue("UserName", adminUsername);
                 cmd.Parameters.AddWithValue("UserKey", adminUserKey);
-                cmd.Parameters.AddWithValue("UserPass", "" /*userPass*/);
                 cmd.Parameters.AddWithValue("IsHostAdmin", 0);
                 DBAccess.ExecuteNonQuery(cmd);
             }


fix(ipfs-mount): fatal error if IPFS is not running

--- IpfsMount/Program.cs
+++ IpfsMount/Program.cs
@@ -6,13 +6,22 @@
 using System.Text;
 using System.Threading.Tasks;
 using DokanNet;
+using Ipfs.Api;

 namespace IpfsMount
 {
     class Program
     {
-        static void Main(string[] args)
+        static int Main(string[] args)
         {
+            // Logging
+            bool debugging = args.Length > 1 && args[1] == "-d";
+            NameValueCollection properties = new NameValueCollection();
+            properties["level"] = debugging ? "Debug" : "Error";
+            properties["showDateTime"] = debugging.ToString();
+            LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(properties);
+            var log = LogManager.GetLogger("ipfs-mount");
+
             if (args.Length < 1)
                 throw new ArgumentException("Missing the drive letter.");

@@ -22,13 +31,17 @@
                 drive = drive.Substring(0, drive.Length - 1);
             drive = drive + @":\";

-            // Debugging
-            bool debugging = args.Length > 1 && args[1] == "-d";
-            NameValueCollection properties = new NameValueCollection();
-            properties["level"] = debugging ? "Debug" : "Off";
-            properties["showDateTime"] = "true";
-            LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(properties);
-
+            // Verify that local IPFS is up and running
+            try
+            {
+                new IpfsClient().Id();
+            }
+            catch (Exception e)
+            {
+                log.Fatal("IPFS is not running", e);
+                return 1;
+            }
+
             // Mount IPFS, doesn't return until the drive is dismounted
             var options = DokanOptions.WriteProtection;
             if (debugging)
@@ -37,6 +50,8 @@
                 drive,
                 options,
                 new DokanLogger());
+
+            return 0;
         }
     }


fixed spacing

fixed spacing

--- JsonConfig/Config.cs
+++ JsonConfig/Config.cs
@@ -79,9 +79,9 @@

 			// scan ALL linked assemblies and merge their default configs
 			var assemblies = AppDomain.CurrentDomain.GetAssemblies();
-            foreach (dynamic conf in assemblies.Select(assembly => GetDefaultConfig(assembly))) {
-                Default = Merger.Merge(conf, Default);
-            }
+			foreach (dynamic conf in assemblies.Select(assembly => GetDefaultConfig(assembly))) {
+				Default = Merger.Merge(conf, Default);
+			}

 			// User config (provided through a settings.conf file)
 			var execution_path = AppDomain.CurrentDomain.BaseDirectory;


Fix comments.

Fix comments.

--- backend/src/Squidex.Domain.Apps.Entities/Tags/TagService.cs
+++ backend/src/Squidex.Domain.Apps.Entities/Tags/TagService.cs
@@ -33,11 +33,13 @@

             public bool Rebuild(TagsExport export)
             {
+                // Tags should never be null, but it might happen due of bugs.
                 if (export.Tags != null)
                 {
                     Tags = export.Tags;
                 }

+                // Alias can be null, because it was not part of the initial release.
                 if (export.Alias != null)
                 {
                     Alias = export.Alias;
@@ -96,6 +98,7 @@
                     // Remove the mapping to the old name.
                     Alias.Remove(alias.Key);

+                    // If the tag has been named back to the original name, we do not need the mapping anymore.
                     if (alias.Key != newName)
                     {
                         // Create a new mapping to the new name.
@@ -177,7 +180,7 @@

             public TagsSet GetTags(long version)
             {
-                var tags = new Dictionary<string, int>();
+                var result = new Dictionary<string, int>();

                 foreach (var tag in Tags.Values)
                 {
@@ -185,10 +188,10 @@
                     var name = NormalizeName(tag.Name);

                     // An old bug could have produced duplicate names.
-                    tags[name] = tags.GetValueOrDefault(name) + tag.Count;
-                }
-
-                return new TagsSet(tags, version);
+                    result[name] = result.GetValueOrDefault(name) + tag.Count;
+                }
+
+                return new TagsSet(result, version);
             }

             private static string NormalizeName(string name)


Fix - Aggiunto UseSimpleInjector nel Configure della Startup

--- src/backend/SO115App.API/Startup.cs
+++ src/backend/SO115App.API/Startup.cs
@@ -57,7 +57,7 @@
         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
         {
-            HttpClient httpClient = new HttpClient();
+            HttpClient httpClient = new HttpClient();
             services.AddSingleton(httpClient);
             services.AddControllers();
             services.AddHttpContextAccessor();
@@ -126,6 +126,7 @@
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
         {
+            app.UseSimpleInjector(container);
             LogConfigurator.Configure();

             if (env.IsDevelopment())


Fixed CSS async parsing tests

Fixed CSS async parsing tests

--- UnitTests/Library/AsyncParsing.cs
+++ UnitTests/Library/AsyncParsing.cs
@@ -14,15 +14,16 @@
         [TestMethod]
         public void TestAsyncCssParsingFromStream()
         {
-            var source = "h1 { color: red; } h2 { color: blue; } p { font-family: Arial; } div { margin: 10 }";
-            var content = Encoding.UTF8.GetBytes(source);
-            var parser = new CssParser(new MemoryStream(content), Configuration.Default);
+            var text = "h1 { color: red; } h2 { color: blue; } p { font-family: Arial; } div { margin: 10 }";
+            var source = new DelayedStream(Encoding.UTF8.GetBytes(text));
+            var parser = new CssParser(source, Configuration.Default);
             var task = parser.ParseAsync();
             Assert.IsFalse(task.IsCompleted);
             Assert.IsNotNull(parser.Result);
             task.Wait();
             Assert.IsTrue(task.IsCompleted);
             Assert.IsNotNull(parser.Result);
+
             Assert.AreEqual(4, parser.Result.Rules.Length);
         }

@@ -50,9 +51,6 @@
             var source = "h1 { color: red; } h2 { color: blue; } p { font-family: Arial; } div { margin: 10 }";
             var parser = new CssParser(source, Configuration.Default);
             var task = parser.ParseAsync();
-            Assert.IsFalse(task.IsCompleted);
-            Assert.IsNotNull(parser.Result);
-            task.Wait();
             Assert.IsTrue(task.IsCompleted);
             Assert.IsNotNull(parser.Result);


Revert "UnitSystem: Hide ctor with string culture for non-WinRC (breaking change)"

This reverts commit 2c62d3aa33ad0aff58c543f67b2211e97c782c1e.

--- UnitsNet/CustomCode/UnitSystem.cs
+++ UnitsNet/CustomCode/UnitSystem.cs
@@ -83,18 +83,14 @@
         {
         }

-        // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
-#if WINDOWS_UWP
         /// <summary>
         ///     Create unit system for parsing and generating strings of the specified culture.
         ///     If null is specified, the default English US culture will be used.
         /// </summary>
         /// <param name="cultureInfo"></param>
-        public UnitSystem([CanBeNull] string cultureInfo)
-            : this(cultureInfo != null ? new CultureInfo(cultureInfo) : DefaultCulture)
-        {
-        }
-#endif
+        public UnitSystem([CanBeNull] string cultureInfo) : this(cultureInfo != null ? new CultureInfo(cultureInfo) : DefaultCulture)
+        {
+        }

         /// <summary>
         ///     Create unit system for parsing and generating strings of the specified culture.


batch update format map

batch update format map

--- VSColorOutput/OutputClassifier.cs
+++ VSColorOutput/OutputClassifier.cs
@@ -113,13 +113,21 @@
         {
             var colorMap = ColorMap.GetMap();
             var formatMap = _formatMapService.GetClassificationFormatMap("output");
-            foreach (var category in OutputClassificationDefinitions.Categories)
+            try
             {
-                var classificationType = _classificationTypeRegistry.GetClassificationType(category);
-                var textProperties = formatMap.GetTextProperties(classificationType);
-                var color = colorMap[category];
-                var wpfColor = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
-                formatMap.SetTextProperties(classificationType, textProperties.SetForeground(wpfColor));
+                formatMap.BeginBatchUpdate();
+                foreach (var category in OutputClassificationDefinitions.Categories)
+                {
+                    var classificationType = _classificationTypeRegistry.GetClassificationType(category);
+                    var textProperties = formatMap.GetTextProperties(classificationType);
+                    var color = colorMap[category];
+                    var wpfColor = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
+                    formatMap.SetTextProperties(classificationType, textProperties.SetForeground(wpfColor));
+                }
+            }
+            finally
+            {
+                formatMap.EndBatchUpdate();
             }
         }
     }


Remove unnecessary Flush

Remove unnecessary Flush

--- Kyru/Core/Session.cs
+++ Kyru/Core/Session.cs
@@ -147,7 +147,6 @@
 			var bytes = ms.ToArray();
 			bytes = Crypto.DecryptAes(bytes, DecryptFileKey(userFile), userFile.IV);
 			output.Write(bytes, 0, bytes.Length);
-			output.Flush();
 		}
 	}
 }


Добавлен аргумент skipAuthorization для LikesCategory

Для общедоступных методов добавлен аргумент skipAuthorization

--- VkNet/Categories/LikesCategory.cs
+++ VkNet/Categories/LikesCategory.cs
@@ -38,10 +38,10 @@
 		/// Страница документации ВКонтакте <see href="http://vk.com/dev/likes.getList"/>.
 		/// </remarks>
 		[ApiVersion("5.44")]
-		public ReadOnlyCollection<long> GetList(LikesGetListParams @params)
+		public ReadOnlyCollection<long> GetList(LikesGetListParams @params, bool skipAuthorization = true)
 		{
 		    @params.Extended = false;
-			VkResponseArray response = _vk.Call("likes.getList", @params, true);
+			VkResponseArray response = _vk.Call("likes.getList", @params, skipAuthorization);

             return response.ToReadOnlyCollectionOf<long>(x => x);
 		}


wrapped reader tests with using() statement

--- src/tests/DreamMisc/TrimmingStringReaderTests.cs
+++ src/tests/DreamMisc/TrimmingStringReaderTests.cs
@@ -29,30 +29,34 @@

         [Test]
         public void Nothing_to_trim() {
-            TextReader reader = new TrimmingStringReader("this is plain text");
-            string result = reader.ReadToEnd();
-            Assert.AreEqual("this is plain text", result);
+            using(TextReader reader = new TrimmingStringReader("this is plain text")) {
+                string result = reader.ReadToEnd();
+                Assert.AreEqual("this is plain text", result);
+            }
         }

         [Test]
         public void Trim_from_the_beginning() {
-            TextReader reader = new TrimmingStringReader("   this is plain text");
-            string result = reader.ReadToEnd();
-            Assert.AreEqual("this is plain text", result);
+            using(TextReader reader = new TrimmingStringReader("   this is plain text")) {
+                string result = reader.ReadToEnd();
+                Assert.AreEqual("this is plain text", result);
+            }
         }

         [Test]
         public void Trim_from_the_end() {
-            TextReader reader = new TrimmingStringReader("this is plain text   ");
-            string result = reader.ReadToEnd();
-            Assert.AreEqual("this is plain text", result);
+            using(TextReader reader = new TrimmingStringReader("this is plain text   ")) {
+                string result = reader.ReadToEnd();
+                Assert.AreEqual("this is plain text", result);
+            }
         }

         [Test]
         public void Trim_both_the_beginning_and_end() {
-            TextReader reader = new TrimmingStringReader("   this is plain text   ");
-            string result = reader.ReadToEnd();
-            Assert.AreEqual("this is plain text", result);
+            using(TextReader reader = new TrimmingStringReader("   this is plain text   ")) {
+                string result = reader.ReadToEnd();
+                Assert.AreEqual("this is plain text", result);
+            }
         }
     }
 }


Keep OS system alive when CoinJoining

Keep OS system alive when CoinJoining

--- WalletWasabi.Gui/Helpers/Utils.cs
+++ WalletWasabi.Gui/Helpers/Utils.cs
@@ -1,6 +1,7 @@
 using Avalonia.Threading;
 using System;
 using System.IO;
+using System.Runtime.InteropServices;
 using System.Threading.Tasks;

 namespace WalletWasabi.Gui.Helpers
@@ -25,5 +26,27 @@

 			return false;
 		}
+
+		[FlagsAttribute]
+		public enum EXECUTION_STATE : uint
+		{
+			ES_AWAYMODE_REQUIRED = 0x00000040,
+			ES_CONTINUOUS = 0x80000000,
+			ES_DISPLAY_REQUIRED = 0x00000002,
+			ES_SYSTEM_REQUIRED = 0x00000001
+			// Legacy flag, should not be used.
+			// ES_USER_PRESENT = 0x00000004
+		}
+
+		[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+		private static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+
+		public static void KeepSystemAwake()
+		{
+			if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+			{
+				SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED);
+			}
+		}
 	}
 }


[skip ci] dump client version

[skip ci] dump client version

--- WalletWasabi/Helpers/Constants.cs
+++ WalletWasabi/Helpers/Constants.cs
@@ -8,7 +8,7 @@
 {
 	public static class Constants
 	{
-		public static readonly Version ClientVersion = new Version(1, 0, 2);
+		public static readonly Version ClientVersion = new Version(1, 0, 3);
 		public const string BackendMajorVersion = "2";
 		public static readonly VersionsResponse VersionsResponse = new VersionsResponse { ClientVersion = ClientVersion.ToString(), BackenMajordVersion = BackendMajorVersion };


Avoid NPE during process WebException response

--- TwitterApi.cs
+++ TwitterApi.cs
@@ -165,7 +165,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream == null) return json.ToString();
                 using (StreamReader reader = new StreamReader(resStream))
                     Console.WriteLine(reader.ReadToEnd());
@@ -190,7 +190,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream == null) return json.ToString();
                 using (StreamReader reader = new StreamReader(resStream))
                 {
@@ -233,7 +233,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream == null) return json.ToString();
                 using (StreamReader reader = new StreamReader(resStream))
                 {
@@ -278,7 +278,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream == null) return json.ToString();
                 using (StreamReader reader = new StreamReader(resStream))
                     Console.WriteLine(reader.ReadToEnd());
@@ -306,7 +306,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream == null) return json.ToString();
                 using (StreamReader reader = new StreamReader(resStream))
                     Console.WriteLine(reader.ReadToEnd());
@@ -340,7 +340,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream != null)
                     using (StreamReader reader = new StreamReader(resStream))
                         Console.WriteLine(reader.ReadToEnd());
@@ -374,7 +374,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream != null)
                     using (StreamReader reader = new StreamReader(resStream))
                         Console.WriteLine(reader.ReadToEnd());
@@ -404,7 +404,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream != null)
                     using (StreamReader reader = new StreamReader(resStream))
                         Console.WriteLine(reader.ReadToEnd());
@@ -434,7 +434,7 @@
             }
             catch (WebException ex)
             {
-                Stream resStream = ex.Response.GetResponseStream();
+                Stream resStream = ex.Response?.GetResponseStream();
                 if (resStream != null)
                     using (StreamReader reader = new StreamReader(resStream))
                         Console.WriteLine(reader.ReadToEnd());


Fix fatal Obj-C callback issue due to delegate collection

VS for Mac is encountering a fatal error of: A callback was made on a garbage collected delegate of type 'Xwt.XamMac!Xwt.Mac.ViewBackend+DelegateIntPtrIntPtrBool::Invoke'.

The underlying root cause for this is that the delegates that are created and passed off to native code are not being kept alive.  The GC has no way of knowing that delegates passed to native code need to be kept alive so a root must be established in some way.

Since these are all static methods, we can create a static variable to hold these delegates for the lifetime of the application.

--- Xwt.XamMac/Xwt.Mac/ViewBackend.cs
+++ Xwt.XamMac/Xwt.Mac/ViewBackend.cs
@@ -535,6 +535,13 @@
 		static Selector becomeFirstResponderSel = new Selector ("becomeFirstResponder");
 		static Selector resignFirstResponderSel = new Selector ("resignFirstResponder");

+		static DelegateIntPtrIntPtrIntPtrNSDragOperation draggingEnteredDelegate = new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingEntered);
+		static DelegateIntPtrIntPtrIntPtrNSDragOperation draggingUpdatedDelegate = new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingUpdated);
+		static DelegateIntPtrIntPtrIntPtrVoid draggingExitedDelegate = new DelegateIntPtrIntPtrIntPtrVoid(DraggingExited);
+		static DelegateIntPtrIntPtrIntPtrBool prepareForDragOperationDelegate = new DelegateIntPtrIntPtrIntPtrBool(PrepareForDragOperation);
+		static DelegateIntPtrIntPtrIntPtrBool performDragOperationDelegate = new DelegateIntPtrIntPtrIntPtrBool(PerformDragOperation);
+		static DelegateIntPtrIntPtrIntPtrVoid delegateIntPtrIntPtrIntPtrVoid = new DelegateIntPtrIntPtrIntPtrVoid(ConcludeDragOperation);
+
 		static HashSet<Type> typesConfiguredForDragDrop = new HashSet<Type> ();
 		static HashSet<Type> typesConfiguredForFocusEvents = new HashSet<Type> ();

@@ -543,12 +550,13 @@
 			lock (typesConfiguredForDragDrop) {
 				if (typesConfiguredForDragDrop.Add (type)) {
 					Class c = new Class (type);
-					c.AddMethod (draggingEnteredSel.Handle, new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingEntered), "i@:@");
-					c.AddMethod (draggingUpdatedSel.Handle, new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingUpdated), "i@:@");
-					c.AddMethod (draggingExitedSel.Handle, new DelegateIntPtrIntPtrIntPtrVoid(DraggingExited), "v@:@");
-					c.AddMethod (prepareForDragOperationSel.Handle, new DelegateIntPtrIntPtrIntPtrBool(PrepareForDragOperation), "B@:@");
-					c.AddMethod (performDragOperationSel.Handle, new DelegateIntPtrIntPtrIntPtrBool(PerformDragOperation), "B@:@");
-					c.AddMethod (concludeDragOperationSel.Handle, new DelegateIntPtrIntPtrIntPtrVoid(ConcludeDragOperation), "v@:@");
+
+                    c.AddMethod (draggingEnteredSel.Handle, draggingEnteredDelegate, "i@:@");
+                    c.AddMethod (draggingUpdatedSel.Handle, draggingUpdatedDelegate, "i@:@");
+                    c.AddMethod (draggingExitedSel.Handle, draggingExitedDelegate, "v@:@");
+                    c.AddMethod (prepareForDragOperationSel.Handle, prepareForDragOperationDelegate, "B@:@");
+                    c.AddMethod (performDragOperationSel.Handle, performDragOperationDelegate, "B@:@");
+                    c.AddMethod (concludeDragOperationSel.Handle, delegateIntPtrIntPtrIntPtrVoid, "v@:@");
 				}
 			}
 		}
@@ -558,13 +566,16 @@
 		delegate void DelegateIntPtrIntPtrIntPtrVoid(IntPtr p1, IntPtr p2, IntPtr p3);
 		delegate bool DelegateIntPtrIntPtrIntPtrBool(IntPtr p1, IntPtr p2, IntPtr p3);

+		static DelegateIntPtrIntPtrBool onBecomeFirstResponderDelegate = new DelegateIntPtrIntPtrBool(OnBecomeFirstResponder);
+		static DelegateIntPtrIntPtrBool onResignFirstResponderDelegate = new DelegateIntPtrIntPtrBool(OnResignFirstResponder);
+
 		static void SetupFocusEvents (Type type)
 		{
 			lock (typesConfiguredForFocusEvents) {
 				if (typesConfiguredForFocusEvents.Add (type)) {
 					Class c = new Class (type);
-					c.AddMethod (becomeFirstResponderSel.Handle, new DelegateIntPtrIntPtrBool(OnBecomeFirstResponder), "B@:");
-					c.AddMethod (resignFirstResponderSel.Handle, new DelegateIntPtrIntPtrBool(OnResignFirstResponder), "B@:");
+					c.AddMethod (becomeFirstResponderSel.Handle, onBecomeFirstResponderDelegate, "B@:");
+                    c.AddMethod (resignFirstResponderSel.Handle, onResignFirstResponderDelegate, "B@:");
 				}
 			}
 		}


Fix lastModified (#112)

Fix lastModified (#112)

The method StatObject not returns the last modified parameter.  The lastModified variable was not being set.

--- Minio/MinioClient.cs
+++ Minio/MinioClient.cs
@@ -396,7 +396,7 @@
                     }
                     if (parameter.Name == "Last-Modified")
                     {
-                        DateTime.Parse(parameter.Value.ToString());
+                        lastModified = DateTime.Parse(parameter.Value.ToString());
                     }
                     if (parameter.Name == "ETag")
                     {


Modified help to not give redudent info.

--- Modules/Help/Help.cs
+++ Modules/Help/Help.cs
@@ -67,6 +67,8 @@
                             Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("{0}", foundCommand.Description));
                         }
                         Bot.IRC.Command.SendNotice(command.Nick.Nickname, "\u200B");
+                        Dictionary<string, string> argDescriptions = new Dictionary<string, string>();
+                        int index = 0;
                         for (int i = 0; i < foundCommand.AllowedMessageTypes.Count; i++)
                         {
                             MessageType messageType = foundCommand.AllowedMessageTypes[i];
@@ -127,12 +129,40 @@
                                     {
                                         commandDesc = string.Format(" - {0}", arg.Description);
                                     }
-                                    Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("\t\t\u0002{0}\u0002{1}", arg.Name, commandDesc));
+                                    if (!argDescriptions.ContainsKey(arg.Name))
+                                    {
+                                        argDescriptions.Add(arg.Name, string.Format("\t\t\u0002{0}\u0002{1}", arg.Name, commandDesc));
+                                    }
                                     if (arg.AllowedValues.Count > 0)
                                     {
-                                        Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("\t\t\t\tAllowed Values: \u0002{0}\u0002", string.Join(", ", arg.AllowedValues)));
+                                        string argAllowed = string.Format("\t\t\t\tAllowed Values: \u0002{0}\u0002", string.Join(", ", arg.AllowedValues));
+                                        bool containsAllowed = false;
+                                        for (int x = 0; x < index; x++)
+                                        {
+                                            if (argDescriptions.ContainsKey(arg.Name + " - Allowed Values " + x))
+                                            {
+                                                if (argDescriptions[arg.Name + " - Allowed Values " + x] == argAllowed)
+                                                {
+                                                    containsAllowed = true;
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                        if (!containsAllowed)
+                                        {
+                                            argDescriptions.Add(arg.Name + " - Allowed Values " + index, argAllowed);
+                                            index++;
+                                        }
                                     }
                                 });
+                            }
+                        }
+                        Bot.IRC.Command.SendNotice(command.Nick.Nickname, "\u200B");
+                        if (argDescriptions.Count > 0)
+                        {
+                            foreach (KeyValuePair<string, string> argDescription in argDescriptions)
+                            {
+                                Bot.IRC.Command.SendNotice(command.Nick.Nickname, argDescription.Value);
                             }
                         }
                     }


Use indicated quality/aspect ratio in filename when possible. Fail back to the old method.

--- MovieInfo/Program.cs
+++ MovieInfo/Program.cs
@@ -91,7 +91,29 @@
         {
             get
             {
-                if ((Width == 0) || (Height == 0))
+                // Try and grab it from the filename
+                // (I usually specify it, and aspect ratio detection is all
+                // sorts of borked on SD movies, because this plugin gets the
+                // NATIVE pixel resolution, not display resolution.)
+                if (hd1080.IsMatch(Path))
+                {
+                    return VideoQuality.HD_1080;
+                }
+                else if (hd720.IsMatch(Path))
+                {
+                    return VideoQuality.HD_720;
+                }
+                else if (sdWidescreen.IsMatch(Path))
+                {
+                    return VideoQuality.SD_Widescreen;
+                }
+                else if (sdFullscreen.IsMatch(Path))
+                {
+                    return VideoQuality.SD_Fullscreen;
+                }
+
+                // Well, we failed. Let's try and figure it out the hard way.
+                else if ((Width == 0) || (Height == 0))
                 {
                     return VideoQuality.Unknown;
                 }
@@ -106,7 +128,7 @@
                 else
                 {
                     double aspectRatio = (double)Width / (double)Height;
-                    if (aspectRatio > 1.6)                                      // 16:10 or wider
+                    if (aspectRatio >= 1.6)                                     // 16:10 or wider
                     {
                         return VideoQuality.SD_Widescreen;
                     }
@@ -117,6 +139,12 @@
                 }
             }
         }
+
+        // Match things like "The Shawshank Redemption (1994) [R] HD 1080p.mkv"
+        private static Regex hd1080 = new Regex(@".*\s+HD\s+1080[pi]\..*", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static Regex hd720 = new Regex(@".*\s+HD\s+720[pi]\..*", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static Regex sdWidescreen = new Regex(@".*\s+Widescreen\..*", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static Regex sdFullscreen = new Regex(@".*\s+Fullscreen\..*", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         /// <summary>
         /// The quality of a video
@@ -157,14 +185,43 @@

     class Program
     {
+        /// <summary>
+        /// Valid file extensions for movie files
+        /// </summary>
+        public static string[] validExtensions =
+        {
+            ".avi",
+            ".mkv",
+            ".mp4",
+        };
+
+        /// <summary>
+        /// Determines if a filename has a valid extension
+        /// (and is therefore likely to be a movie file)
+        /// </summary>
+        /// <param name="filename">The filename or path of the movie</param>
+        /// <returns>If the file is valid</returns>
+        public static bool hasValidExtension(string filename)
+        {
+            bool isValid = false;
+            foreach (string extension in validExtensions)
+            {
+                if (filename.EndsWith(extension, StringComparison.InvariantCultureIgnoreCase))
+                {
+                    isValid = true;
+                    break;
+                }
+            }
+            return isValid;
+        }
+
         static void Main(string[] args)
         {
             // Allowable time drift (hours)
             int allowedTimeError = 4;
             bool fixFileTimesWithinError = true;

-            // Match things like "I'm A Moive! (2006) [PG-13] HD 1080p.mkv"
-            Regex parser = new Regex(@"(^.+\((TV\s*)?\d{4}\)).*\.(mkv|avi)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+            // Match the movie folders (things like "I'm A Moive! (2006) [tmdbid=3283]"
             Regex parserBetter = new Regex(@"(^.+\((TV\s*)?\d{4}\)).*", RegexOptions.Compiled | RegexOptions.IgnoreCase);

             // Prepare to search
@@ -292,9 +349,7 @@
                 // Get the actual file
                 foreach (FileInfo movie in dir.GetFiles())
                 {
-                    if (movie.Name.EndsWith(".mkv", System.StringComparison.InvariantCultureIgnoreCase) ||
-                        movie.Name.EndsWith(".mp4", System.StringComparison.InvariantCultureIgnoreCase) ||
-                        movie.Name.EndsWith(".avi", System.StringComparison.InvariantCultureIgnoreCase))
+                    if (hasValidExtension(movie.Name))
                     {
                         // We have a movie
                         Movie match = new Movie();
@@ -310,9 +365,7 @@
                                 // Find movie files
                                 foreach (FileInfo trailer in trailers.GetFiles())
                                 {
-                                    if (trailer.Name.EndsWith(".mkv", System.StringComparison.InvariantCultureIgnoreCase) ||
-                                        trailer.Name.EndsWith(".mp4", System.StringComparison.InvariantCultureIgnoreCase) ||
-                                        trailer.Name.EndsWith(".avi", System.StringComparison.InvariantCultureIgnoreCase))
+                                    if (hasValidExtension(trailer.Name))
                                     {
                                         // We got a trailer!
                                         match.Trailers++;


Fix duplicate property in TextSegment class

--- Ndapi/TextSegment.cs
+++ Ndapi/TextSegment.cs
@@ -85,7 +85,7 @@
         /// <summary>
         /// Gets or sets the text segment content.
         /// </summary>
-        [Property(NdapiConstants.D2FP_FORE_COLOR)]
+        [Property(NdapiConstants.D2FP_TEXT)]
         public string Text
         {
             get { return GetStringProperty(NdapiConstants.D2FP_TEXT); }


コメントつけました

コメントつけました

あとRegisterProviderのシグネチャに破壊的変更

--- Net/LyricsFetcher.cs
+++ Net/LyricsFetcher.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Xml.Linq;
@@ -13,30 +14,62 @@
         #endregion

         #region public properties
+        /// <summary>
+        /// LyricsFetcher に登録済の歌詞提供事業者名リスト
+        /// </summary>
         public static string[] RegisteredProviders => registeredProviders.Keys.ToArray();

+        /// <summary>
+        /// 一意に識別可能な歌詞提供事業者名
+        /// </summary>
         public abstract string Provider { get; }
         #endregion

         static LyricsFetcher()
         {
-            // RegisterProvider(new InheritLyricsFetcher());
+            // RegisterProvider<JLyricLyricsFetcher>();
         }

         #region public methods
-        public static bool RegisterProvider(string provider, LyricsFetcher fetcher)
+        /// <summary>
+        /// 歌詞取得クラスを登録します。
+        /// </summary>
+        /// <typeparam name="TLyricsFetcher"></typeparam>
+        /// <returns></returns>
+        public static bool RegisterProvider<TLyricsFetcher>()
+            where TLyricsFetcher : LyricsFetcher, new()
         {
+            var fetcher = new TLyricsFetcher();
+            string provider = fetcher.Provider;
+
             if (registeredProviders.ContainsKey(provider)) return false;
             registeredProviders[provider] = fetcher;
             return true;
         }

+        /// <summary>
+        /// 登録済みの歌詞取得クラスを取得します。
+        /// </summary>
+        /// <param name="providerName"></param>
+        /// <returns></returns>
         public static LyricsFetcher GetFetcher(string providerName) => registeredProviders[providerName];

+        /// <summary>
+        /// タグを元に歌詞を取得します。
+        /// </summary>
+        /// <param name="title">タイトル</param>
+        /// <param name="artist">アーティスト</param>
+        /// <param name="album">アルバム</param>
+        /// <returns></returns>
         public abstract string Fetch(string title, string artist, string album = null);
         #endregion

         #region private methods
+        /// <summary>
+        /// リクエスト先のHTMLをXMLドキュメントとして非同期に取得します。
+        /// </summary>
+        /// <param name="url">リクエストURL</param>
+        /// <returns></returns>
         protected Task<XDocument> DownloadPageAsXmlAsync(string url) =>
             Task.Factory.StartNew(() => new SgmlReader { Href = url, IgnoreDtd = true })
             .ContinueWith(t => XDocument.Load(t.Result));


Add locking to MessageBus.

Add locking to MessageBus.

MessageBus methods are now thread-safe to call.

--- Phoebe/MessageBus.cs
+++ Phoebe/MessageBus.cs
@@ -1,13 +1,45 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Threading;

 namespace Toggl.Phoebe
 {
     public sealed class MessageBus
     {
+        private readonly ReaderWriterLock rwlock = new ReaderWriterLock ();
         private readonly Dictionary<Type, List<WeakReference>> registry =
             new Dictionary<Type, List<WeakReference>> ();
+
+        private bool TryWrite (Action act)
+        {
+            try {
+                rwlock.AcquireWriterLock (TimeSpan.FromMinutes (250));
+                try {
+                    act ();
+                } finally {
+                    rwlock.ReleaseWriterLock ();
+                }
+            } catch (ApplicationException) {
+                return false;
+            }
+            return true;
+        }
+
+        private bool TryRead (Action act)
+        {
+            try {
+                rwlock.AcquireReaderLock (TimeSpan.FromMinutes (250));
+                try {
+                    act ();
+                } finally {
+                    rwlock.ReleaseReaderLock ();
+                }
+            } catch (ApplicationException) {
+                return false;
+            }
+            return true;
+        }

         /// <summary>
         /// Subscribe listener to receive messages for TMessage. This method returns a subscription object, which you
@@ -17,7 +49,7 @@
         /// <param name="listener">Listener.</param>
         /// <param name="threadSafe">Indicates if the listener is thread-safe or not.</param>
         /// <typeparam name="TMessage">Type of the message to subscribe to.</typeparam>
-        /// <returns>A subscription object.</returns>
+        /// <returns>A subscription object, null if subscribing failed.</returns>
         public Subscription<TMessage> Subscribe<TMessage> (Action<TMessage> listener, bool threadSafe = false)
             where TMessage : Message
         {
@@ -26,13 +58,18 @@

             var subscription = new Subscription<TMessage> (listener, threadSafe);

-            List<WeakReference> subscriptions;
-            if (!registry.TryGetValue (typeof(TMessage), out subscriptions)) {
-                subscriptions = new List<WeakReference> ();
-                registry [typeof(TMessage)] = subscriptions;
+            var ok = TryWrite (delegate {
+                List<WeakReference> subscriptions;
+                if (!registry.TryGetValue (typeof(TMessage), out subscriptions)) {
+                    subscriptions = new List<WeakReference> ();
+                    registry [typeof(TMessage)] = subscriptions;
+                }
+                subscriptions.Add (new WeakReference (subscription));
+            });
+
+            if (!ok) {
+                return null;
             }
-            subscriptions.Add (new WeakReference (subscription));
-
             return subscription;
         }

@@ -43,12 +80,11 @@
         public void Unsubscribe<TMessage> (Subscription<TMessage> subscription)
             where TMessage : Message
         {
-            if (subscription == null)
-                throw new ArgumentNullException ("subscription");
-
-            foreach (var listeners in registry.Values) {
-                listeners.RemoveAll ((weak) => !weak.IsAlive || weak.Target == subscription);
-            }
+            TryWrite (delegate {
+                foreach (var listeners in registry.Values) {
+                    listeners.RemoveAll ((weak) => !weak.IsAlive || weak.Target == subscription);
+                }
+            });
         }

         /// <summary>
@@ -62,16 +98,30 @@
             if (msg == null)
                 throw new ArgumentNullException ("msg");

-            List<WeakReference> subscriptions;
-            if (registry.TryGetValue (typeof(TMessage), out subscriptions)) {
-                foreach (var weak in subscriptions.ToList()) {
-                    var subscription = weak.Target as Subscription<TMessage>;
-                    if (subscription != null) {
-                        subscription.Listener (msg);
-                    } else {
-                        subscriptions.Remove (weak);
+            var needsPurge = false;
+
+            // Dispatch message
+            TryRead (delegate {
+                List<WeakReference> subscriptions;
+                if (registry.TryGetValue (typeof(TMessage), out subscriptions)) {
+                    foreach (var weak in subscriptions) {
+                        var subscription = weak.Target as Subscription<TMessage>;
+                        if (subscription != null) {
+                            subscription.Listener (msg);
+                        } else {
+                            needsPurge = true;
+                        }
                     }
                 }
+            });
+
+            // Purge dead subscriptions
+            if (needsPurge) {
+                TryWrite (delegate {
+                    foreach (var listeners in registry.Values) {
+                        listeners.RemoveAll ((weak) => !weak.IsAlive);
+                    }
+                });
             }
         }
     }


implemented resolving for Nokia models

implemented resolving for Nokia models

--- PhoneNameResolver.cs
+++ PhoneNameResolver.cs
@@ -52,7 +52,6 @@
                 var modelMetadata = nokiaLookupTable[lookupValue];
                 if (nokiaCanonicalModels.ContainsKey(modelMetadata.ModelId))
                 {
-                    result.CanonicalManufacturer = nokiaCanonicalModels[modelMetadata.ModelId].CanonicalManufacturer;
                     result.CanonicalModel = nokiaCanonicalModels[modelMetadata.ModelId].CanonicalModel;
                     result.Comments = modelMetadata.Description;
                     result.IsResolved = true;
@@ -64,16 +63,58 @@

         private static Dictionary<string, CanonicalPhoneName> nokiaCanonicalModels = new Dictionary<string, CanonicalPhoneName>()
         {
-            { "Lumia920", new CanonicalPhoneName() { CanonicalManufacturer = "NOKIA", CanonicalModel = "Lumia 920" } }
+            { "Lumia505", new CanonicalPhoneName() { CanonicalModel = "Lumia 505" } },
+            { "Lumia510", new CanonicalPhoneName() { CanonicalModel = "Lumia 510" } },
+            { "Lumia610", new CanonicalPhoneName() { CanonicalModel = "Lumia 610" } },
+            { "Lumia620", new CanonicalPhoneName() { CanonicalModel = "Lumia 620" } },
+            { "Lumia710", new CanonicalPhoneName() { CanonicalModel = "Lumia 710" } },
+            { "Lumia800", new CanonicalPhoneName() { CanonicalModel = "Lumia 800" } },
+            { "Lumia810", new CanonicalPhoneName() { CanonicalModel = "Lumia 810" } },
+            { "Lumia820", new CanonicalPhoneName() { CanonicalModel = "Lumia 820" } },
+            { "Lumia822", new CanonicalPhoneName() { CanonicalModel = "Lumia 822" } },
+            { "Lumia900", new CanonicalPhoneName() { CanonicalModel = "Lumia 900" } },
+            { "Lumia920", new CanonicalPhoneName() { CanonicalModel = "Lumia 920" } }
         };

         private static Dictionary<string, ReportedNameMetadata> nokiaLookupTable = new Dictionary<string, ReportedNameMetadata>()
         {
+            // Lumia 505
+            { "LUMIA 505", new ReportedNameMetadata("Lumia505", null) },
+            // Lumia 510
+            { "LUMIA 510", new ReportedNameMetadata("Lumia510", null) },
+            { "NOKIA 510", new ReportedNameMetadata("Lumia510", null) },
+            // Lumia 610
+            { "LUMIA 610", new ReportedNameMetadata("Lumia610", null) },
+            { "LUMIA 610 NFC", new ReportedNameMetadata("Lumia610", "NFC") },
+            { "NOKIA 610", new ReportedNameMetadata("Lumia610", null) },
+            { "NOKIA 610C", new ReportedNameMetadata("Lumia610", null) },
+            // Lumia 620
+            { "LUMIA 620", new ReportedNameMetadata("Lumia620", null) },
+            { "RM-846", new ReportedNameMetadata("Lumia620", null) },
+            // Lumia 710
+            { "LUMIA 710", new ReportedNameMetadata("Lumia710", null) },
+            { "NOKIA 710", new ReportedNameMetadata("Lumia710", null) },
+            // Lumia 800
+            { "LUMIA 800", new ReportedNameMetadata("Lumia800", null) },
+            { "NOKIA 800", new ReportedNameMetadata("Lumia800", null) },
+            { "NOKIA 800C", new ReportedNameMetadata("Lumia800", "China") },
+            // Lumia 810
+            { "RM-878", new ReportedNameMetadata("Lumia810", "T-Mobile USA") },
+            // Lumia 820
+            { "RM-824", new ReportedNameMetadata("Lumia820", null) },
+            { "RM-825", new ReportedNameMetadata("Lumia820", null) },
+            { "RM-826", new ReportedNameMetadata("Lumia820", null) },
+            // Lumia 822
+            { "RM-845", new ReportedNameMetadata("Lumia822", "Verizon") },
+            // Lumia 900
+            { "LUMIA 900", new ReportedNameMetadata("Lumia900", null) },
+            { "NOKIA 900", new ReportedNameMetadata("Lumia900", null) },
             // Lumia 920
             { "RM-820", new ReportedNameMetadata("Lumia920", null) },
             { "RM-821", new ReportedNameMetadata("Lumia920", null) },
             { "RM-822", new ReportedNameMetadata("Lumia920", "China") },
             { "RM-867", new ReportedNameMetadata("Lumia920", "920T") },
+            { "NOKIA 920", new ReportedNameMetadata("Lumia920", null) },
         };
     }


Trajectory: add altitude to telemetry

Trajectory: add altitude to telemetry

--- Plugin/Trajectory.cs
+++ Plugin/Trajectory.cs
@@ -171,6 +171,7 @@
         {
             // Add telemetry channels for real and predicted variable values
             Telemetry.AddChannel<double>("ut");
+            Telemetry.AddChannel<double>("altitude");
             Telemetry.AddChannel<double>("airspeed");
             Telemetry.AddChannel<double>("aoa");
             Telemetry.AddChannel<float>("drag");
@@ -814,6 +815,7 @@
                     Vector3d localPredictedForceWithCache = new Vector3d(Vector3d.Dot(predictedForceWithCache, vesselRight), Vector3d.Dot(predictedForceWithCache, vesselUp), Vector3d.Dot(predictedForceWithCache, vesselBackward));

                     Telemetry.Send("ut", now);
+                    Telemetry.Send("altitude", vessel_.altitude);

                     Telemetry.Send("airspeed", Math.Floor(airVelocity.magnitude));
                     Telemetry.Send("aoa", (AoA * 180.0 / Math.PI));
@@ -824,7 +826,7 @@
                     //Telemetry.Send("force_actual.z", localActualForce.z);

-                    Telemetry.Send("force_total", localTotalForce.magnitude);
+                    //Telemetry.Send("force_total", localTotalForce.magnitude);
                     //Telemetry.Send("force_total.x", localTotalForce.x);
                     //Telemetry.Send("force_total.y", localTotalForce.y);
                     //Telemetry.Send("force_total.z", localTotalForce.z);


Trajectory: move integration step into function

--- Plugin/Trajectory.cs
+++ Plugin/Trajectory.cs
@@ -442,6 +442,22 @@
         }

         private VesselState AddPatch_outState;
+
+        struct SimulationState
+        {
+            public Vector3d position;
+            public Vector3d velocity;
+        }
+
+        static SimulationState VerletStep(SimulationState state, Vector3d prevPos, Vector3d acceleration, double dt)
+        {
+            SimulationState nextState;
+
+            nextState.position = 2.0 * state.position - prevPos + acceleration * (dt * dt);
+            nextState.velocity = (nextState.position - state.position) / dt;
+
+            return nextState;
+        }

         private IEnumerable<bool> AddPatch(VesselState startingState, DescentProfile profile)
         {
@@ -636,12 +652,15 @@
                     buffer.Add(new Point[chunkSize]);
                     int nextPosIdx = 0;

-                    Vector3d pos = Util.SwapYZ(patch.spaceOrbit.getRelativePositionAtUT(entryTime));
-                    Vector3d vel = Util.SwapYZ(patch.spaceOrbit.getOrbitalVelocityAtUT(entryTime));
+                    SimulationState lastState, state;
+                    state.position = Util.SwapYZ(patch.spaceOrbit.getRelativePositionAtUT(entryTime));
+                    state.velocity = Util.SwapYZ(patch.spaceOrbit.getOrbitalVelocityAtUT(entryTime));

                     //Util.PostSingleScreenMessage("atmo start cond", "Atmospheric start: vel=" + vel.ToString("0.00") + " (mag=" + vel.magnitude.ToString("0.00") + ")");

-                    Vector3d prevPos = pos - vel * dt;
+                    lastState.position = state.position - state.velocity * dt;
+
+
                     double currentTime = entryTime;
                     double lastPositionStoredUT = 0;
                     Vector3d lastPositionStored = new Vector3d();
@@ -661,7 +680,7 @@
                             incrementIterations = 0;
                         }

-                        double R = pos.magnitude;
+                        double R = state.position.magnitude;
                         double altitude = R - body.Radius;
                         double atmosphereCoeff = altitude / maxAtmosphereAltitude;
                         if (hitGround
@@ -672,9 +691,9 @@

                             if (hitGround || atmosphereCoeff <= 0.0)
                             {
-                                patch.rawImpactPosition = pos;
+                                patch.rawImpactPosition = state.position;
                                 patch.impactPosition = calculateRotatedPosition(body, patch.rawImpactPosition.Value, currentTime);
-                                patch.impactVelocity = vel;
+                                patch.impactVelocity = state.velocity;
                             }

                             patch.endTime = Math.Min(currentTime, patch.endTime);
@@ -710,8 +729,8 @@
                                 patchesBackBuffer_.Add(patch);
                                 AddPatch_outState = new VesselState
                                 {
-                                    position = pos,
-                                    velocity = vel,
+                                    position = state.position,
+                                    velocity = state.velocity,
                                     referenceBody = body,
                                     time = patch.endTime
                                 };
@@ -719,12 +738,12 @@
                             }
                         }

-                        Vector3d gravityAccel = pos * (-body.gravParameter / (R * R * R));
+                        Vector3d gravityAccel = state.position * (-body.gravParameter / (R * R * R));

                         //Util.PostSingleScreenMessage("prediction vel", "prediction vel = " + vel);
-                        Vector3d airVelocity = vel - body.getRFrmVel(body.position + pos);
-                        double angleOfAttack = profile.GetAngleOfAttack(body, pos, airVelocity);
-                        Vector3d aerodynamicForce = aerodynamicModel_.GetForces(body, pos, airVelocity, angleOfAttack);
+                        Vector3d airVelocity = state.velocity - body.getRFrmVel(body.position + state.position);
+                        double angleOfAttack = profile.GetAngleOfAttack(body, state.position, airVelocity);
+                        Vector3d aerodynamicForce = aerodynamicModel_.GetForces(body, state.position, airVelocity, angleOfAttack);
                         accumulatedForces += aerodynamicForce.magnitude * dt;
                         Vector3d acceleration = gravityAccel + aerodynamicForce / aerodynamicModel_.mass;

@@ -733,34 +752,33 @@
                             (float) (aerodynamicForce.magnitude / aerodynamicModel_.mass),
                             maxAccelBackBuffer_);

-
+                        // // Euler integration
                         //vel += acceleration * dt;
                         //pos += vel * dt;

                         // Verlet integration (more precise than using the velocity)
-                        Vector3d ppos = prevPos;
-                        prevPos = pos;
-                        pos = pos + pos - ppos + acceleration * (dt * dt);
-                        vel = (pos - prevPos) / dt;
+                        Vector3d ppos = lastState.position;
+                        lastState = state;
+                        state = VerletStep(state, ppos, acceleration, dt);

                         currentTime += dt;

                         double interval = altitude < 10000.0 ? trajectoryInterval * 0.1 : trajectoryInterval;
                         if (currentTime >= lastPositionStoredUT + interval)
                         {
-                            double groundAltitude = GetGroundAltitude(body, calculateRotatedPosition(body, pos, currentTime));
+                            double groundAltitude = GetGroundAltitude(body, calculateRotatedPosition(body, state.position, currentTime));
                             if (lastPositionStoredUT > 0)
                             {
                                 // check terrain collision, to detect impact on mountains etc.
                                 Vector3 rayOrigin = lastPositionStored;
-                                Vector3 rayEnd = pos;
+                                Vector3 rayEnd = state.position;
                                 double absGroundAltitude = groundAltitude + body.Radius;
                                 if (absGroundAltitude > rayEnd.magnitude)
                                 {
                                     hitGround = true;
                                     float coeff = Math.Max(0.01f, (float)((absGroundAltitude - rayOrigin.magnitude)
                                         / (rayEnd.magnitude - rayOrigin.magnitude)));
-                                    pos = rayEnd * coeff + rayOrigin * (1.0f - coeff);
+                                    state.position = rayEnd * coeff + rayOrigin * (1.0f - coeff);
                                     currentTime = currentTime * coeff + lastPositionStoredUT * (1.0f - coeff);
                                 }
                             }
@@ -771,17 +789,17 @@
                                 buffer.Add(new Point[chunkSize]);
                                 nextPosIdx = 0;
                             }
-                            Vector3d nextPos = pos;
+                            Vector3d nextPos = state.position;
                             if (Settings.fetch.BodyFixedMode)
                             {
                                 nextPos = calculateRotatedPosition(body, nextPos, currentTime);
                             }
                             buffer.Last()[nextPosIdx].aerodynamicForce = aerodynamicForce;
-                            buffer.Last()[nextPosIdx].orbitalVelocity = vel;
+                            buffer.Last()[nextPosIdx].orbitalVelocity = state.velocity;
                             buffer.Last()[nextPosIdx].groundAltitude = (float)groundAltitude;
                             buffer.Last()[nextPosIdx].time = currentTime;
                             buffer.Last()[nextPosIdx++].pos = nextPos;
-                            lastPositionStored = pos;
+                            lastPositionStored = state.position;
                         }
                     }
                 }


Integrates support for all XCCDF Rule Results per #66

--- Model/XccdfReader.cs
+++ Model/XccdfReader.cs
@@ -831,10 +831,29 @@
         {
             try
             {
-                if (xccdfResult.Equals("pass"))
-                { return "Completed"; }
-                else
-                { return "Ongoing"; }
+                switch (xccdfResult)
+                {
+                    case "pass":
+                        return "Completed";
+                    case "fail":
+                        return "Ongoing";
+                    case "error":
+                        return "Not Reviewed";
+                    case "unknown":
+                        return "Not Reviewed";
+                    case "notapplicable":
+                        return "Not Applicable";
+                    case "notchecked":
+                        return "Not Reviewed";
+                    case "notselected":
+                        return "Not Reviewed";
+                    case "informational":
+                        return "Not Applicable";
+                    case "fixed":
+                        return "Completed";
+                    default:
+                        return "Not Reviewed";
+                }
             }
             catch (Exception exception)
             {


Instantiating the Biography field to avoid null checks

--- Models/PersonPart.cs
+++ Models/PersonPart.cs
@@ -30,8 +30,9 @@
         // more complex functionality and also can contain a set of fields.
         // TextField is one of Orchard's many built-in fields. To utilize it you don't need to add a property for it to
         // the part (you just need to attach it to the content type, what we're doing from migrations) but having such
-        // a property is a nice shortcut to it.
-        public TextField Biography { get; set; }
+        // a property is a nice shortcut to it. You don't need to instantiate it either, why we do it here is to avoid
+        // null checks when working with the content item even without initializing it with IContentManager.LoadAsync().
+        public TextField Biography { get; set; } = new();
     }

     public enum Handedness