Extracting methods and some refactoring

Extracting methods and some refactoring

--- WorkoutTimer/WorkoutTimerCSharp/WorkOutTimer.cs
+++ WorkoutTimer/WorkoutTimerCSharp/WorkOutTimer.cs
@@ -11,31 +11,43 @@
     {
         public static void Main()
         {
+            RunTimer();
+        }
+
+        private static void GetUserSettings(out int numOfReps, out int numOfExercises, out int numOfSeries, out int restTimeBetweenSeries, out int restTimeBetweenExercises, out int repTime)
+        {
             Console.Write("Enter num of reps: ");
-            int numOfReps = int.Parse(Console.ReadLine());
+            numOfReps = int.Parse(Console.ReadLine());

             Console.Write("Enter num of exercises: ");
-            int numOfExercises = int.Parse(Console.ReadLine());
+            numOfExercises = int.Parse(Console.ReadLine());

             Console.Write("Enter num of series: ");
-            int numOfSeries = int.Parse(Console.ReadLine());
+            numOfSeries = int.Parse(Console.ReadLine());

             // in seconds
             Console.Write("Rest time between series (in seconds): ");
-            int restTimeBetweenSeries = int.Parse(Console.ReadLine());
+            restTimeBetweenSeries = int.Parse(Console.ReadLine());

             Console.Write("Rest time between Exercises (in seconds): ");
-            int restTimeBetweenExercises = int.Parse(Console.ReadLine());
+            restTimeBetweenExercises = int.Parse(Console.ReadLine());

             Console.Write("Aproximate time of repetition (in seconds): ");
-            int repTime = int.Parse(Console.ReadLine());
+            repTime = int.Parse(Console.ReadLine());
             // int serieTime = repTime * numOfReps;
-
-            RunTimer(numOfReps, numOfExercises, numOfSeries, restTimeBetweenSeries, restTimeBetweenExercises, repTime);
         }

-        private static void RunTimer(int numOfReps, int numOfExercises, int numOfSeries, int restTimeBetweenSeries, int restTimeBetweenExercises, int repTime)
+        private static void RunTimer()
         {
+
+            int numOfReps;
+            int numOfExercises;
+            int numOfSeries;
+            int restTimeBetweenSeries;
+            int restTimeBetweenExercises;
+            int repTime;
+
+            GetUserSettings(out numOfReps, out numOfExercises, out numOfSeries, out restTimeBetweenSeries, out restTimeBetweenExercises, out repTime);

             Console.WriteLine("Starting the timer...");


Delete Resources.Designer.cs

Delete Resources.Designer.cs

--- ZulrahWavesApp/Properties/Resources.Designer.cs
+++ ZulrahWavesApp/Properties/Resources.Designer.cs
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace ZulrahWavesApp.Properties
-{
-
-
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
-        private static global::System.Resources.ResourceManager resourceMan;
-
-        private static global::System.Globalization.CultureInfo resourceCulture;
-
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
-        }
-
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZulrahWavesApp.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
-                return resourceCulture;
-            }
-            set
-            {
-                resourceCulture = value;
-            }
-        }
-    }
-}


[tmp][tests] Disable Exec_Tests.NoTempFileLeaks

- This is comparing a "local" tmp path with the default
  Path.GetTempPath, which shouldn't match. I'm not sure why this works
  on netcore or windows!

--- src/XMakeTasks/UnitTests/Exec_Tests.cs
+++ src/XMakeTasks/UnitTests/Exec_Tests.cs
@@ -41,6 +41,7 @@
         /// lying around.
         /// </summary>
         [Fact]
+        [Trait("Category", "mono-osx-failing")]
         public void NoTempFileLeaks()
         {
             using (var alternativeTemp = new Helpers.AlternativeTempPath())


Removed unused DoMultiValue method from Interpreter

--- Src/AjTalk/Language/Interpreter.cs
+++ Src/AjTalk/Language/Interpreter.cs
@@ -326,22 +326,6 @@
             context.Push(newblock);
         }

-        private static void DoMultiValue(ExecutionContext context)
-        {
-            context.InstructionPointer++;
-            byte arg = context.Block.ByteCodes[context.InstructionPointer];
-
-            object[] args = new object[arg];
-
-            for (int k = arg - 1; k >= 0; k--)
-                args[k] = context.Pop();
-
-            Block newblock = (Block)context.Pop();
-            context.LastReceiver = newblock;
-
-            context.Push(new ExecutionContext(context.Machine, context.Receiver, newblock, args).Execute());
-        }
-
         private static void DoGetArgument(ExecutionContext context)
         {
             context.InstructionPointer++;


BaseLineAssert to compare content even during rebaselining

--- Src/Qart.Testing/BaseLineAssert.cs
+++ Src/Qart.Testing/BaseLineAssert.cs
@@ -1,4 +1,5 @@
 using NUnit.Framework;
+using Qart.Core.Io;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -12,22 +13,25 @@
     {
         public static void AreEqual(string fileName, string content)
         {
-            AreEqual(fileName, content, false, (expected, actual) => Assert.Fail("Content in the expeced file is different to the provided one",fileName, content));
+            AreEqual(fileName, content, false, (expected, actual) => Assert.Fail("Content in the expeced file is different to the provided one", fileName, content));
         }

         public static void AreEqual(string fileName, string content, bool rebase, Action<string, string> failAction)
         {
-            if(rebase)
+            string expectedContent = null;
+            if (File.Exists(fileName))
             {
-                File.WriteAllText(fileName, content);
+                expectedContent = File.ReadAllText(fileName);
             }
-            else
+
+            if (rebase)
             {
-                var expected = File.ReadAllText(fileName);
-                if(!string.Equals(expected, content))
-                {
-                    failAction(expected, content);
-                }
+                FileUtils.WriteAllText(fileName, content);
+            }
+
+            if (!string.Equals(expectedContent, content))
+            {
+                failAction(expectedContent, content);
             }
         }
     }


Scene locking is no longer necessary.

Scene locking is no longer necessary.

Due to reorganisation of code to the main managed Cycles
thread we don't have to lock the scene anymore. Calls
to the scene update through session update now always
happen on the same thread.

--- RenderEngines/ViewportRenderEngine.cs
+++ RenderEngines/ViewportRenderEngine.cs
@@ -275,7 +275,6 @@
 			{
 				TriggerStartSynchronizing();
 				Session.SetPause(true);
-				Session.Scene.Lock();
 				if (UploadData())
 				{
 					State = State.Rendering;
@@ -286,12 +285,7 @@
 					// then reset scene
 					Session.Scene.Reset();

-					Session.Scene.Unlock();
-
 					m_flush = false;
-				} else
-				{
-					Session.Scene.Unlock();
 				}

 				if (CancelRender)


Use the same XML declaration as the internal editor.

git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS36]$/ResXResourceManager/Main;C34258

--- ResXManager.Model/ResourceLanguage.cs
+++ ResXManager.Model/ResourceLanguage.cs
@@ -263,7 +263,7 @@
                 }
             }

-            var declaration = new XDeclaration("1.0", "utf-8", "yes");
+            const string declaration = @"<?xml version=""1.0"" encoding=""utf-8""?>";

             _file.Content = declaration + Environment.NewLine + _document;


Removing a redundant entries from cycle error messages, I think.

--- Stiletto/Internal/GraphVerifier.cs
+++ Stiletto/Internal/GraphVerifier.cs
@@ -45,7 +45,7 @@
                     var pathInOrder = path.Reverse().ToList();
                     var index = pathInOrder.IndexOf(binding) + 1;

-                    for (var i = 0; i < pathInOrder.Count; ++i)
+                    for (var i = 0; i < pathInOrder.Count - 1; ++i)
                     {
                         var currentItem = (index + i) % pathInOrder.Count;


Music bug fixed. Now when the game is over music stops and starts again after restart.

--- Super-Pang/Super-Pang/SuperPang.cs
+++ Super-Pang/Super-Pang/SuperPang.cs
@@ -14,6 +14,10 @@
         public static ConsoleColor playerColor = ConsoleColor.Green;
         public static ConsoleColor sceneColor = ConsoleColor.Green;

+
+        public static Thread timing;
+        public static Thread music;
+
         public const int FirstBallonRadius = 2;
         public static List<Balloon> balloons = new List<Balloon>();

@@ -52,8 +56,8 @@
             //First bonus position
             bonusPositionY = 1;

-            Thread timing = new Thread(new ThreadStart(TimeCounter));
-            Thread music = new Thread(new ThreadStart(Music.PlaySound));
+            timing = new Thread(new ThreadStart(TimeCounter));
+            music = new Thread(new ThreadStart(Music.PlaySound));
             timing.Start();
             music.Start();

@@ -261,9 +265,22 @@
             {
                 timeLeft--;
                 Thread.Sleep(1000);
-            }
-
-            lives--;
+
+                if (timeLeft <= 0)
+                {
+                    if (lives <= 0)
+                    {
+                        timeLeft = 100;
+                        music.Abort();
+                        RestartGame();
+                    }
+                    else
+                    {
+                        lives--;
+                    }
+
+                }
+            }
         }

         static void RestartGame()
@@ -338,6 +355,8 @@
                         lives--;
                         if (lives <= 0)
                         {
+                            timeLeft = 100;
+                            music.Abort();
                             RestartGame();
                         }
                     }


Version Bump

Version Bump

--- Syndll2/Properties/AssemblyInfo.cs
+++ Syndll2/Properties/AssemblyInfo.cs
@@ -11,9 +11,9 @@
 [assembly: ComVisible(false)]
 [assembly: Guid("a7fe65a7-0b61-4ea1-81c0-adc5a037ea17")]

-[assembly: AssemblyVersion("0.1.0")]
-[assembly: AssemblyFileVersion("0.1.0.9")]
-[assembly: AssemblyInformationalVersion("0.1.0-beta")]
+[assembly: AssemblyVersion("0.2.0")]
+[assembly: AssemblyFileVersion("0.2.0.10")]
+[assembly: AssemblyInformationalVersion("0.2.0-beta")]

 [assembly: InternalsVisibleTo("Syndll2.Tests, PublicKey=" +
 "00240000048000009400000006020000002400005253413100040000010001000f0f0c410cd366" +


Delete Program.cs

Delete Program.cs

--- hllib245/HLExtract.Net/Program.cs
+++ hllib245/HLExtract.Net/Program.cs
@@ -1,1156 +0,0 @@
-/*
- * HLExtract.Net
- * Copyright (C) 2008-2010 Ryan Gregg
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace HLExtract.Net
-{
-    class Program
-    {
-        static bool bSilent = false;
-        static bool bPause = true;
-        static string sDestination = string.Empty;
-
-        static int Main(string[] args)
-        {
-	        // Arguments.
-	        string sPackage = string.Empty;
-            List<string> Commands = new List<string>();
-            string sNCFRootPath = string.Empty;
-
-	        bool bFileMapping = false;
-	        bool bQuickFileMapping = false;
-	        bool bVolatileAccess = false;
-            bool bWriteAccess = false;
-	        bool bOverwriteFiles = true;
-
-	        // Package stuff.
-	        HLLib.HLPackageType ePackageType = HLLib.HLPackageType.HL_PACKAGE_NONE;
-	        uint uiPackage = HLLib.HL_ID_INVALID;
-            uint uiMode = (uint)HLLib.HLFileMode.HL_MODE_INVALID;
-
-	        if(HLLib.hlGetUnsignedInteger(HLLib.HLOption.HL_VERSION) < HLLib.HL_VERSION_NUMBER)
-	        {
-		        Console.WriteLine("Wrong HLLib version: v{0}.", HLLib.hlGetString(HLLib.HLOption.HL_VERSION));
-		        return 1;
-	        }
-
-	        // Process switches.
-	        if(args.Length == 1)
-	        {
-		        sPackage = args[0];
-	        }
-	        else
-	        {
-		        for(int i = 0; i < args.Length; i++)
-		        {
-                    if(string.Equals(args[i], "-p", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--package", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        if(sPackage.Length == 0 && i + 1 < args.Length)
-				        {
-                            sPackage = args[++i];
-				        }
-				        else
-				        {
-					        PrintUsage();
-					        return 2;
-				        }
-			        }
-                    else if(string.Equals(args[i], "-d", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--dest", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        if(sDestination.Length == 0 && i + 1 < args.Length)
-				        {
-                            sDestination = args[++i];
-				        }
-				        else
-				        {
-					        PrintUsage();
-					        return 2;
-				        }
-			        }
-                    else if(string.Equals(args[i], "-x", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--execute", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        if(sDestination.Length == 0 && i + 1 < args.Length)
-				        {
-                            Commands.Add(args[++i]);
-				        }
-				        else
-				        {
-					        PrintUsage();
-					        return 2;
-				        }
-			        }
-                    else if(string.Equals(args[i], "-n", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--ncfroot", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        if(sNCFRootPath.Length == 0 && i + 1 < args.Length)
-				        {
-                            sNCFRootPath = args[++i];
-				        }
-				        else
-				        {
-					        PrintUsage();
-					        return 2;
-				        }
-			        }
-                    else if(string.Equals(args[i], "-s", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--silent", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bSilent = true;
-			        }
-                    else if(string.Equals(args[i], "-u", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--no-pause", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bPause = false;
-			        }
-                    else if(string.Equals(args[i], "-m", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--filemapping", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bFileMapping = true;
-			        }
-                    else if(string.Equals(args[i], "-q", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--quick-filemapping", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bFileMapping = true;
-				        bQuickFileMapping = true;
-			        }
-                    else if(string.Equals(args[i], "-v", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--volatile", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bVolatileAccess = true;
-			        }
-                    else if(string.Equals(args[i], "-w", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--write", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bWriteAccess = true;
-			        }
-                    else if(string.Equals(args[i], "-o", StringComparison.CurrentCultureIgnoreCase) || string.Equals(args[i], "--no-overwrite", StringComparison.CurrentCultureIgnoreCase))
-			        {
-				        bOverwriteFiles = false;
-			        }
-			        else
-			        {
-				        PrintUsage();
-				        return 2;
-			        }
-		        }
-	        }
-
-	        // Make sure we have something to do.
-	        if(sPackage.Length == 0)
-	        {
-		        PrintUsage();
-		        return 2;
-	        }
-
-	        // If the destination directory is not specified, make it the input directory.
-	        if(sDestination.Length == 0)
-	        {
-                int iIndex = sPackage.LastIndexOfAny(new char[]{'\\', '/'});
-		        if(iIndex != -1)
-		        {
-			        sDestination = sPackage.Substring(0, iIndex + 1);
-		        }
-	        }
-
-	        HLLib.hlInitialize();
-
-            // Keep the delegates alive so they don't get garbage collected.
-            HLLib.HLExtractItemStartProc HLExtractItemStartProc = new HLLib.HLExtractItemStartProc(ExtractItemStartCallback);
-            HLLib.HLExtractItemEndProc HLExtractItemEndProc = new HLLib.HLExtractItemEndProc(ExtractItemEndCallback);
-            HLLib.HLExtractFileProgressProc HLExtractFileProgressProc = new HLLib.HLExtractFileProgressProc(FileProgressCallback);
-            HLLib.HLValidateFileProgressProc HLValidateFileProgressProc = new HLLib.HLValidateFileProgressProc(FileProgressCallback);
-            HLLib.HLDefragmentFileProgressExProc HLDefragmentFileProgressProc = new HLLib.HLDefragmentFileProgressExProc(DefragmentProgressCallback);
-
-	        HLLib.hlSetBoolean(HLLib.HLOption.HL_OVERWRITE_FILES, bOverwriteFiles);
-	        HLLib.hlSetVoid(HLLib.HLOption.HL_PROC_EXTRACT_ITEM_START, Marshal.GetFunctionPointerForDelegate(HLExtractItemStartProc));
-	        HLLib.hlSetVoid(HLLib.HLOption.HL_PROC_EXTRACT_ITEM_END, Marshal.GetFunctionPointerForDelegate(HLExtractItemEndProc));
-            HLLib.hlSetVoid(HLLib.HLOption.HL_PROC_EXTRACT_FILE_PROGRESS, Marshal.GetFunctionPointerForDelegate(HLExtractFileProgressProc));
-	        HLLib.hlSetVoid(HLLib.HLOption.HL_PROC_VALIDATE_FILE_PROGRESS, Marshal.GetFunctionPointerForDelegate(HLValidateFileProgressProc));
-	        HLLib.hlSetVoid(HLLib.HLOption.HL_PROC_DEFRAGMENT_PROGRESS_EX, Marshal.GetFunctionPointerForDelegate(HLDefragmentFileProgressProc));
-
-	        // Get the package type from the filename extension.
-	        ePackageType = HLLib.hlGetPackageTypeFromName(sPackage);
-
-	        // If the above fails, try getting the package type from the data at the start of the file.
-	        if(ePackageType == HLLib.HLPackageType.HL_PACKAGE_NONE && File.Exists(sPackage))
-	        {
-                FileStream Reader = null;
-                try
-                {
-                    byte[] lpBuffer = new byte[HLLib.HL_DEFAULT_PACKAGE_TEST_BUFFER_SIZE];
-                    Reader = new FileStream(sPackage, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
-                    int iBytesRead = Reader.Read(lpBuffer, 0, lpBuffer.Length);
-                    if(iBytesRead > 0)
-                    {
-                        IntPtr lpBytesRead = Marshal.AllocHGlobal(iBytesRead);
-                        try
-                        {
-                            Marshal.Copy(lpBuffer, 0, lpBytesRead, iBytesRead);
-                            ePackageType = HLLib.hlGetPackageTypeFromMemory(lpBytesRead, (uint)iBytesRead);
-                        }
-                        finally
-                        {
-                            Marshal.FreeHGlobal(lpBytesRead);
-                        }
-                    }
-                }
-                finally
-                {
-                    if(Reader != null)
-                    {
-                        Reader.Close();
-                    }
-                }
-	        }
-
-	        if(ePackageType == HLLib.HLPackageType.HL_PACKAGE_NONE)
-	        {
-                Console.WriteLine("Error loading {0}:", sPackage);
-                Console.WriteLine("Unsupported package type.");
-
-		        HLLib.hlShutdown();
-                Pause();
-		        return 3;
-	        }
-
-	        // Create a package element, the element is allocated by the library and cleaned
-	        // up by the library.  An ID is generated which must be bound to apply operations
-	        // to the package.
-	        if(!HLLib.hlCreatePackage(ePackageType, out uiPackage))
-	        {
-                Console.WriteLine("Error loading {0}:", sPackage);
-                Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-
-                HLLib. hlShutdown();
-                Pause();
-		        return 3;
-	        }
-
-	        HLLib.hlBindPackage(uiPackage);
-
-	        uiMode = (uint)HLLib.HLFileMode.HL_MODE_READ;
-            uiMode |= !bFileMapping ? (uint)HLLib.HLFileMode.HL_MODE_NO_FILEMAPPING : 0;
-            uiMode |= bQuickFileMapping ? (uint)HLLib.HLFileMode.HL_MODE_QUICK_FILEMAPPING : 0;
-            uiMode |= bVolatileAccess ? (uint)HLLib.HLFileMode.HL_MODE_VOLATILE : 0;
-            uiMode |= bWriteAccess ? (uint)HLLib.HLFileMode.HL_MODE_WRITE : 0;
-
-	        // Open the package.
-	        // Of the above modes, only HL_MODE_READ is required.  HL_MODE_WRITE is present
-	        // only for future use.  File mapping is recommended as an efficient way to load
-	        // packages.  Quick file mapping maps the entire file (instead of bits as they are
-	        // needed) and thus should only be used in Windows 2000 and up (older versions of
-	        // Windows have poor virtual memory management which means large files won't be able
-	        // to find a continues block and will fail to load).  Volatile access allows HLLib
-	        // to share files with other applications that have those file open for writing.
-	        // This is useful for, say, loading .gcf files while Steam is running.
-	        if(!HLLib.hlPackageOpenFile(sPackage, uiMode))
-	        {
-                Console.WriteLine("Error loading {0}:", sPackage);
-                Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-
-                HLLib. hlShutdown();
-                Pause();
-		        return 3;
-	        }
-
-	        // If we have a .ncf file, the package file data is stored externally.  In order to
-	        // validate the file data etc., HLLib needs to know where to look.  Tell it where.
-	        if(ePackageType == HLLib.HLPackageType.HL_PACKAGE_NCF && sNCFRootPath.Length > 0)
-	        {
-		        HLLib.hlNCFFileSetRootPath(sNCFRootPath);
-	        }
-
-	        if(!bSilent)
-		        Console.WriteLine("{0} opened.", sPackage);
-
-	        // Interactive console mode.
-	        EnterConsole(uiPackage, Commands);
-
-	        // Close the package.
-	        HLLib.hlPackageClose();
-
-	        if(!bSilent)
-		        Console.WriteLine("{0} closed.", sPackage);
-
-	        // Free up the allocated memory.
-	        HLLib.hlDeletePackage(uiPackage);
-
-	        HLLib.hlShutdown();
-
-	        return 0;
-        }
-
-        static void Pause()
-        {
-            if(bPause)
-            {
-                Console.Write("Press any key to continue . . . ");
-                Console.ReadKey(true);
-            }
-        }
-
-        static void PrintUsage()
-        {
-            System.Reflection.AssemblyName Name = System.Reflection.Assembly.GetExecutingAssembly().GetName();
-
-	        Console.WriteLine("HLExtract.Net v{0}.{1}.{2} using HLLib v{3}", Name.Version.Major, Name.Version.Minor, Name.Version.Build, HLLib.hlGetString(HLLib.HLOption.HL_VERSION));
-	        Console.WriteLine();
-	        Console.WriteLine("Correct HLExtract.Net usage:");
-	        Console.WriteLine(" -p <filepath>       (Package to load.)");
-	        Console.WriteLine(" -d <path>           (Destination extraction directory.)");
-            Console.WriteLine(" -x <command>        (Execute console command.)");
-	        Console.WriteLine(" -s                  (Silent mode.)");
-            Console.WriteLine(" -u                  (Don't pause on error..)");
-	        Console.WriteLine(" -m                  (Use file mapping.)");
-	        Console.WriteLine(" -q                  (Use quick file mapping.)");
-	        Console.WriteLine(" -v                  (Allow volatile access.)");
-            Console.WriteLine(" -w                  (Allow write access.)");
-	        Console.WriteLine(" -o                  (Don't overwrite files.)");
-	        Console.WriteLine(" -n <path>           (NCF file's root path.)");
-	        Console.WriteLine();
-	        Console.WriteLine("Example HLExtract.Net usage:");
-	        Console.WriteLine("HLExtract.Net.exe -p \"C:\\half-life.gcf\" -d \"C:\\backup\"");
-	        Console.WriteLine("HLExtract.Net.exe -p \"C:\\half-life.gcf\" -m -v");
-            Console.WriteLine("HLExtract.Net.exe -p \"C:\\half-life.gcf\" -w -x defragment -x exit");
-	        Console.WriteLine();
-	        Console.WriteLine("Batching HLExtract.Net:");
-            Console.WriteLine("for %%F in (*.gcf) do HLExtract.Net.exe -p \"%%F\" -u -v -x \"info .\" -x exit");
-            Console.WriteLine("for %%F in (*.gcf) do HLExtract.Net.exe -p \"%%F\" -s -u -x \"validate .\" -x exit");
-            Console.WriteLine("for %%F in (*.gcf) do HLExtract.Net.exe -p \"%%F\" -s -u -w -x defragment -x exit");
-
-            Pause();
-        }
-
-        static readonly uint MAX_PATH_SIZE = 512;
-
-        static string GetPath(IntPtr pItem)
-        {
-            string sPath = string.Empty;
-            IntPtr lpPath = IntPtr.Zero;
-            try
-            {
-                lpPath = Marshal.AllocHGlobal((int)MAX_PATH_SIZE);
-                HLLib.hlItemGetPath(pItem, lpPath, MAX_PATH_SIZE);
-                sPath = Marshal.PtrToStringAnsi(lpPath);
-            }
-            finally
-            {
-                if(lpPath != IntPtr.Zero)
-                {
-                    Marshal.FreeHGlobal(lpPath);
-                }
-            }
-            return sPath;
-        }
-
-#region Progress Callbacks
-        static uint uiProgressLast;
-
-        static void ProgressStart()
-        {
-	        uiProgressLast = 0;
-	        Console.Write("0%");
-        }
-
-        static void ProgressUpdate(UInt64 uiBytesDone, UInt64 uiBytesTotal)
-        {
-	        if(!bSilent)
-	        {
-		        uint uiProgress = uiBytesTotal == 0 ? 100 : (uint)(uiBytesDone * 100 / uiBytesTotal);
-		        while(uiProgress >= uiProgressLast + 10)
-		        {
-			        uiProgressLast += 10;
-			        if(uiProgressLast == 100)
-			        {
-				        Console.Write("100% ");
-			        }
-			        else if(uiProgressLast == 50)
-			        {
-				        Console.Write("50%");
-			        }
-			        else
-			        {
-				        Console.Write(".");
-			        }
-		        }
-	        }
-        }
-
-        static void ExtractItemStartCallback(IntPtr pItem)
-        {
-	        if(!bSilent)
-	        {
-		        if(HLLib.hlItemGetType(pItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-		        {
-			        Console.Write("  Extracting {0}: ", HLLib.hlItemGetName(pItem));
-			        ProgressStart();
-		        }
-		        else
-		        {
-			        Console.WriteLine("  Extracting {0}:", HLLib.hlItemGetName(pItem));
-		        }
-	        }
-        }
-
-        static void FileProgressCallback(IntPtr pFile, uint uiBytesExtracted, uint uiBytesTotal, ref bool pCancel)
-        {
-	        ProgressUpdate((UInt64)uiBytesExtracted, (UInt64)uiBytesTotal);
-        }
-
-        static void ExtractItemEndCallback(IntPtr pItem, bool bSuccess)
-        {
-	        if(bSuccess)
-	        {
-		        if(!bSilent)
-		        {
-                    uint uiSize = 0;
-			        HLLib.hlItemGetSize(pItem, out uiSize);
-			        if(HLLib.hlItemGetType(pItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-			        {
-				        Console.WriteLine("OK ({0} B)", uiSize);
-			        }
-			        else
-			        {
-				        Console.WriteLine("  Done {0}: OK ({1} B)", HLLib.hlItemGetName(pItem), uiSize);
-			        }
-		        }
-	        }
-	        else
-	        {
-		        if(!bSilent)
-		        {
-			        if(HLLib.hlItemGetType(pItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-			        {
-				        Console.WriteLine("Errored");
-				        Console.WriteLine("    {0}", HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-			        }
-			        else
-			        {
-				        Console.WriteLine("  Done {0}: Errored", HLLib.hlItemGetName(pItem));
-			        }
-		        }
-		        else
-		        {
-			        if(HLLib.hlItemGetType(pItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-			        {
-				        Console.WriteLine("  Error extracting {0}:", GetPath(pItem));
-				        Console.WriteLine("    {0}", HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-			        }
-			        else
-			        {
-				        Console.WriteLine("  Error extracting {0}.", GetPath(pItem));
-			        }
-		        }
-	        }
-        }
-
-        static void DefragmentProgressCallback(IntPtr pFile, uint uiFilesDefragmented, uint uiFilesTotal, UInt64 uiBytesDefragmented, UInt64 uiBytesTotal, ref bool pCancel)
-        {
-	        ProgressUpdate(uiBytesDefragmented, uiBytesTotal);
-        }
-#endregion
-
-        static readonly string[] ValidationNames = new string[] { "OK", "Assumed OK", "Incomplete", "Corrupt", "Canceled", "Error" };
-
-        static string GetValidation(HLLib.HLValidation eValidation)
-        {
-            if(eValidation >= HLLib.HLValidation.HL_VALIDATES_OK && eValidation <= HLLib.HLValidation.HL_VALIDATES_ERROR)
-            {
-                return ValidationNames[(uint)eValidation];
-            }
-            return string.Empty;
-        }
-
-        static HLLib.HLValidation Validate(IntPtr pItem)
-        {
-	        HLLib.HLValidation eValidation = HLLib.HLValidation.HL_VALIDATES_OK, eTest;
-
-	        switch(HLLib.hlItemGetType(pItem))
-	        {
-	        case HLLib.HLDirectoryItemType.HL_ITEM_FOLDER:
-		        if(!bSilent)
-		        {
-			        Console.WriteLine("  Validating {0}:", HLLib.hlItemGetName(pItem));
-		        }
-
-		        uint uiItemCount = HLLib.hlFolderGetCount(pItem);
-		        for(uint i = 0; i < uiItemCount; i++)
-		        {
-			        eTest = Validate(HLLib.hlFolderGetItem(pItem, i));
-			        if(eTest > eValidation)
-			        {
-				        eValidation = eTest;
-			        }
-		        }
-
-		        if(!bSilent)
-		        {
-			        Console.WriteLine("  Done {0}: {1}", HLLib.hlItemGetName(pItem), GetValidation(eValidation));
-		        }
-		        break;
-	        case HLLib.HLDirectoryItemType.HL_ITEM_FILE:
-		        if(!bSilent)
-		        {
-			        Console.Write("  Validating {0}: ", HLLib.hlItemGetName(pItem));
-			        ProgressStart();
-		        }
-
-		        eValidation = HLLib.hlFileGetValidation(pItem);
-
-		        if(bSilent)
-		        {
-			        switch(eValidation)
-			        {
-			        case HLLib.HLValidation.HL_VALIDATES_INCOMPLETE:
-			        case HLLib.HLValidation.HL_VALIDATES_CORRUPT:
-				        Console.WriteLine("  Validating {0}: {1}", GetPath(pItem), GetValidation(eValidation));
-				        break;
-			        }
-		        }
-		        else
-		        {
-                    Console.WriteLine(GetValidation(eValidation));
-		        }
-		        break;
-	        }
-
-	        return eValidation;
-        }
-
-        static void EnterConsole(uint uiPackage, List<string> Commands)
-        {
-	        IntPtr pItem = HLLib.hlPackageGetRoot();
-
-	        while(true)
-	        {
-                string sLine;
-                if(Commands.Count > 0)
-                {
-                    sLine = Commands[0].Trim();
-
-                    Console.WriteLine("{0}>{1}", HLLib.hlItemGetName(pItem), sLine);
-                    Commands.RemoveAt(0);
-                }
-                else
-                {
-                    // Command prompt.
-                    Console.Write("{0}>", HLLib.hlItemGetName(pItem));
-
-                    // Get and parse line.
-                    sLine = Console.ReadLine().Trim();
-                }
-                if(sLine == null)
-                {
-                    break;
-                }
-
-                int iIndex;
-                for(iIndex = 0; iIndex < sLine.Length; iIndex++)
-                {
-                    if(!Char.IsLetter(sLine[iIndex]))
-                    {
-                        break;
-                    }
-                }
-
-                string sCommand, sArgument;
-                if(iIndex == sLine.Length)
-                {
-                    sCommand = sLine;
-                    sArgument = string.Empty;
-                }
-                else
-                {
-                    sCommand = sLine.Substring(0, iIndex).TrimEnd();
-                    sArgument = sLine.Substring(iIndex).TrimStart();
-                }
-
-		        // Cycle through commands.
-
-		        //
-		        // Directory listing.
-		        // Good example of CDirectoryItem::GetType().
-		        //
-		        if(String.Equals(sCommand, "dir", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        uint uiItemCount = HLLib.hlFolderGetCount(pItem);
-			        uint uiFolderCount = 0, uiFileCount = 0;
-
-			        Console.WriteLine("Directory of {0}:", GetPath(pItem));
-
-			        Console.WriteLine();
-
-			        if(sArgument.Length == 0)
-			        {
-				        // List all items in the current folder.
-				        for(uint i = 0; i < uiItemCount; i++)
-				        {
-					        IntPtr pSubItem = HLLib.hlFolderGetItem(pItem, i);
-					        if(HLLib.hlItemGetType(pSubItem) == HLLib.HLDirectoryItemType.HL_ITEM_FOLDER)
-					        {
-						        uiFolderCount++;
-						        Console.WriteLine("  <{0}>", HLLib.hlItemGetName(pSubItem));
-					        }
-					        else if(HLLib.hlItemGetType(pSubItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-					        {
-						        uiFileCount++;
-						        Console.WriteLine("  {0}", HLLib.hlItemGetName(pSubItem));
-					        }
-				        }
-			        }
-			        else
-			        {
-				        IntPtr pSubItem = HLLib.hlFolderFindFirst(pItem, sArgument, HLLib.HLFindType.HL_FIND_ALL | HLLib.HLFindType.HL_FIND_NO_RECURSE);
-				        while(pSubItem != IntPtr.Zero)
-				        {
-					        if(HLLib.hlItemGetType(pSubItem) == HLLib.HLDirectoryItemType.HL_ITEM_FOLDER)
-					        {
-						        uiFolderCount++;
-						        Console.WriteLine("  <{0}>", HLLib.hlItemGetName(pSubItem));
-					        }
-					        else if(HLLib.hlItemGetType(pSubItem) == HLLib.HLDirectoryItemType.HL_ITEM_FILE)
-					        {
-						        uiFileCount++;
-						        Console.WriteLine("  {0}", HLLib.hlItemGetName(pSubItem));
-					        }
-
-					        pSubItem = HLLib.hlFolderFindNext(pItem, pSubItem, sArgument, HLLib.HLFindType.HL_FIND_ALL | HLLib.HLFindType.HL_FIND_NO_RECURSE);
-				        }
-			        }
-
-			        Console.WriteLine();
-
-			        // Could also have used hlFolderGetFolderCount() and
-			        // hlFolderGetFileCount().
-
-			        Console.WriteLine("Summary:");
-			        Console.WriteLine();
-			        Console.WriteLine("  {0} Folder{1}.", uiFolderCount, uiFolderCount != 1 ? "s" : "");
-			        Console.WriteLine("  {0} File{1}.", uiFileCount, uiFileCount != 1 ? "s" : "");
-			        Console.WriteLine();
-		        }
-		        //
-		        // Change directory.
-		        // Good example of CDirectoryFolder::GetParent() and item casting.
-		        //
-		        else if(String.Equals(sCommand, "cd", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command cd supplied.");
-			        }
-			        else
-			        {
-				        if(String.Equals(sArgument, ".", StringComparison.CurrentCultureIgnoreCase))
-				        {
-
-				        }
-				        else if(String.Equals(sArgument, "..", StringComparison.CurrentCultureIgnoreCase))
-				        {
-					        if(HLLib.hlItemGetParent(pItem) != IntPtr.Zero)
-					        {
-						        pItem = HLLib.hlItemGetParent(pItem);
-					        }
-					        else
-					        {
-						        Console.WriteLine("Folder does not have a parent.");
-					        }
-				        }
-				        else
-				        {
-					        bool bFound = false;
-					        uint uiItemCount = HLLib.hlFolderGetCount(pItem);
-					        for(uint i = 0; i < uiItemCount; i++)
-					        {
-						        IntPtr pSubItem = HLLib.hlFolderGetItem(pItem, i);
-						        if(HLLib.hlItemGetType(pSubItem) == HLLib.HLDirectoryItemType.HL_ITEM_FOLDER && String.Equals(sArgument, HLLib.hlItemGetName(pSubItem), StringComparison.CurrentCultureIgnoreCase))
-						        {
-							        bFound = true;
-							        pItem = pSubItem;
-							        break;
-						        }
-					        }
-
-					        if(!bFound)
-					        {
-						        Console.WriteLine("{0} not found.", sArgument);
-					        }
-				        }
-			        }
-		        }
-		        //
-		        // Go to the root folder.
-		        //
-		        else if(String.Equals(sCommand, "root", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        pItem = HLLib.hlPackageGetRoot();
-		        }
-		        //
-		        // Item information.
-		        // Good example of CPackageUtility helper functions.
-		        //
-		        else if(String.Equals(sCommand, "info", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command info supplied.");
-			        }
-			        else
-			        {
-				        IntPtr pSubItem = HLLib.hlFolderGetItemByPath(pItem, sArgument, HLLib.HLFindType.HL_FIND_ALL);
-
-				        if(pSubItem != IntPtr.Zero)
-				        {
-					        Console.WriteLine("Information for {0}:", GetPath(pSubItem));
-					        Console.WriteLine();
-
-					        switch(HLLib.hlItemGetType(pSubItem))
-					        {
-					        case HLLib.HLDirectoryItemType.HL_ITEM_FOLDER:
-						        Console.WriteLine("  Type: Folder");
-						        Console.WriteLine("  Size: {0} B", HLLib.hlFolderGetSizeEx(pSubItem, true));
-						        Console.WriteLine("  Size On Disk: {0} B", HLLib.hlFolderGetSizeOnDiskEx(pSubItem, true));
-						        Console.WriteLine("  Folders: {0}", HLLib.hlFolderGetFolderCount(pSubItem, true));
-						        Console.WriteLine("  Files: {0}", HLLib.hlFolderGetFileCount(pSubItem, true));
-						        break;
-					        case HLLib.HLDirectoryItemType.HL_ITEM_FILE:
-						        Console.WriteLine("  Type: File");
-						        Console.WriteLine("  Extractable: {0}", HLLib.hlFileGetExtractable(pSubItem) != 0 ? "True" : "False");
-						        //Console.WriteLine("  Validates: {0}", HLLib.hlFileGetValidates(pSubItem) ? "True" : "False");
-						        Console.WriteLine("  Size: {0} B", HLLib.hlFileGetSize(pSubItem));
-						        Console.WriteLine("  Size On Disk: {0} B", HLLib.hlFileGetSizeOnDisk(pSubItem));
-						        break;
-					        }
-
-					        uint uiAttributeCount = HLLib.hlPackageGetItemAttributeCount();
-					        for(uint i = 0; i < uiAttributeCount; i++)
-					        {
-                                HLLib.HLAttribute Attribute;
-						        if(HLLib.hlPackageGetItemAttribute(pSubItem, (HLLib.HLPackageAttribute)i, out Attribute))
-						        {
-                                    if(Attribute.eAttributeType != HLLib.HLAttributeType.HL_ATTRIBUTE_INVALID)
-                                    {
-                                        Console.WriteLine("  {0}: {1}", Attribute.GetName(), Attribute.ToString());
-                                    }
-						        }
-					        }
-
-					        Console.WriteLine();
-				        }
-				        else
-				        {
-					        Console.WriteLine("{0} not found.", sArgument);
-				        }
-			        }
-		        }
-		        //
-		        // Extract item.
-		        // Good example of CPackageUtility extract functions.
-		        //
-		        else if(String.Equals(sCommand, "extract", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command extract supplied.");
-			        }
-			        else
-			        {
-                        IntPtr pSubItem;
-				        if(String.Equals(sArgument, ".", StringComparison.CurrentCultureIgnoreCase))
-				        {
-					        pSubItem = pItem;
-				        }
-				        else
-				        {
-					        pSubItem = HLLib.hlFolderGetItemByName(pItem, sArgument, HLLib.HLFindType.HL_FIND_ALL);
-				        }
-
-				        if(pSubItem != IntPtr.Zero)
-				        {
-					        // Extract the item.
-					        // Item is extracted to cDestination\Item->GetName().
-					        if(!bSilent)
-					        {
-						        Console.WriteLine("Extracting {0}...", HLLib.hlItemGetName(pSubItem));
-						        Console.WriteLine();
-					        }
-
-					        HLLib.hlItemExtract(pSubItem, sDestination);
-
-					        if(!bSilent)
-					        {
-						        Console.WriteLine("");
-						        Console.WriteLine("Done.");
-					        }
-				        }
-				        else
-				        {
-					        Console.WriteLine("{0} not found.", sArgument);
-				        }
-			        }
-		        }
-		        //
-		        // Validate item.
-		        // Validates the checksums of each item.
-		        //
-		        else if(String.Equals(sCommand, "validate", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command extract supplied.");
-			        }
-			        else
-			        {
-                        IntPtr pSubItem;
-				        if(String.Equals(sArgument, ".", StringComparison.CurrentCultureIgnoreCase))
-				        {
-					        pSubItem = pItem;
-				        }
-				        else
-				        {
-					        pSubItem = HLLib.hlFolderGetItemByName(pItem, sArgument, HLLib.HLFindType.HL_FIND_ALL);
-				        }
-
-				        if(pSubItem != IntPtr.Zero)
-				        {
-					        if(!bSilent)
-					        {
-						        Console.WriteLine("Validating {0}...", HLLib.hlItemGetName(pSubItem));
-						        Console.WriteLine();
-					        }
-
-					        Validate(pSubItem);
-
-					        if(!bSilent)
-					        {
-						        Console.WriteLine();
-						        Console.WriteLine("Done.");
-					        }
-				        }
-				        else
-				        {
-					        Console.WriteLine("{0} not found.", sArgument);
-				        }
-			        }
-		        }
-                //
-		        // Defragment package.
-		        // Validates the checksums of each item.
-		        //
-		        else if(String.Equals(sCommand, "defragment", StringComparison.CurrentCultureIgnoreCase))
-		        {
-                    bool bForceDefragment = false;
-			        if(sArgument.Length != 0)
-			        {
-                        try
-                        {
-                            bForceDefragment = Convert.ToBoolean(sArgument);
-                        }
-                        catch
-                        {
-                        }
-			        }
-
-			        if(!bSilent)
-			        {
-				        Console.WriteLine("Defragmenting...");
-				        Console.WriteLine();
-			        }
-
-                    HLLib.hlSetBoolean(HLLib.HLOption.HL_FORCE_DEFRAGMENT, bForceDefragment);
-
-                    Console.Write("  Progress: ");
-                    ProgressStart();
-                    if(!HLLib.hlPackageDefragment())
-                    {
-                        Console.Write(" {0}", HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-                    }
-
-			        if(!bSilent)
-			        {
-                        Console.WriteLine();
-
-				        Console.WriteLine();
-				        Console.WriteLine("Done.");
-			        }
-		        }
-		        //
-		        // Find items.
-		        // Good example of recursive directory navigation (Search() function).
-		        //
-		        else if(String.Equals(sCommand, "find", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command find supplied.");
-			        }
-			        else
-			        {
-				        // Search for the requested items.
-				        if(!bSilent)
-				        {
-					        Console.WriteLine("Searching for {0}...", sArgument);
-					        Console.WriteLine();
-				        }
-
-				        uint uiFolderCount = 0, uiFileCount = 0;
-				        IntPtr pSubItem = HLLib.hlFolderFindFirst(pItem, sArgument, HLLib.HLFindType.HL_FIND_ALL);
-				        while(pSubItem != IntPtr.Zero)
-				        {
-                            switch(HLLib.hlItemGetType(pSubItem))
-                            {
-                                case HLLib.HLDirectoryItemType.HL_ITEM_FOLDER:
-                                    uiFolderCount++;
-
-                                    Console.WriteLine("  Found folder: {0}", GetPath(pSubItem));
-                                    break;
-                                case HLLib.HLDirectoryItemType.HL_ITEM_FILE:
-                                    uiFileCount++;
-
-                                    Console.WriteLine("  Found file: {0}", GetPath(pSubItem));
-                                    break;
-                            }
-
-					        pSubItem = HLLib.hlFolderFindNext(pItem, pSubItem, sArgument, HLLib.HLFindType.HL_FIND_ALL);
-				        }
-
-				        if(!bSilent)
-				        {
-					        if(uiFolderCount != 0 || uiFileCount != 0)
-					        {
-						        Console.WriteLine();
-					        }
-
-					        Console.WriteLine("  {0} folder{1} and {2} file{3} found.", uiFolderCount, uiFolderCount != 1 ? "s" : "", uiFileCount, uiFileCount != 1 ? "s" : "");
-					        Console.WriteLine();
-				        }
-			        }
-		        }
-		        //
-		        // Type files.
-		        // Good example of reading files into memory.
-		        //
-		        else if(String.Equals(sCommand, "type", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command type supplied.");
-			        }
-			        else
-			        {
-				        IntPtr pSubItem = HLLib.hlFolderGetItemByName(pItem, sArgument, HLLib.HLFindType.HL_FIND_FILES);
-
-				        if(pSubItem != IntPtr.Zero)
-				        {
-					        if(!bSilent)
-					        {
-						        Console.WriteLine("Type for {0}:", GetPath(pSubItem));
-						        Console.WriteLine();
-					        }
-
-                            IntPtr pStream;
-					        if(HLLib.hlFileCreateStream(pSubItem, out pStream))
-					        {
-						        if(HLLib.hlStreamOpen(pStream, (uint)HLLib.HLFileMode.HL_MODE_READ))
-						        {
-                                    char iChar;
-							        while(HLLib.hlStreamReadChar(pStream, out iChar))
-							        {
-								        if((iChar >= ' ' && iChar <= '~') || iChar == '\n' || iChar == '\t')
-								        {
-									        Console.Write(iChar);
-								        }
-							        }
-
-							        HLLib.hlStreamClose(pStream);
-						        }
-						        else
-						        {
-                                    Console.WriteLine("Error typing {0}:", HLLib.hlItemGetName(pSubItem));
-							        Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-						        }
-
-						        HLLib.hlFileReleaseStream(pSubItem, pStream);
-					        }
-					        else
-					        {
-                                Console.WriteLine("Error typing {0}:", HLLib.hlItemGetName(pSubItem));
-						        Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-					        }
-
-					        if(!bSilent)
-					        {
-						        Console.WriteLine();
-						        Console.WriteLine("Done.");
-					        }
-				        }
-				        else
-				        {
-					        Console.WriteLine("{0} not found.", sArgument);
-				        }
-			        }
-		        }
-		        //
-		        // Open item.
-		        // Good example of opening packages inside packages.
-		        //
-		        else if(String.Equals(sCommand, "open", StringComparison.CurrentCultureIgnoreCase))
-		        {
-			        if(sArgument.Length == 0)
-			        {
-				        Console.WriteLine("No argument for command open supplied.");
-			        }
-			        else
-			        {
-				        IntPtr pSubItem = HLLib.hlFolderGetItemByName(pItem, sArgument, HLLib.HLFindType.HL_FIND_FILES);
-
-				        if(pSubItem != IntPtr.Zero)
-				        {
-                            IntPtr pStream;
-					        if(HLLib.hlFileCreateStream(pSubItem, out pStream))
-					        {
-						        if(HLLib.hlStreamOpen(pStream, (uint)HLLib.HLFileMode.HL_MODE_READ))
-						        {
-							        HLLib.HLPackageType ePackageType = HLLib.hlGetPackageTypeFromStream(pStream);
-
-                                    uint uiSubPackage;
-							        if(HLLib.hlCreatePackage(ePackageType, out uiSubPackage))
-							        {
-								        HLLib.hlBindPackage(uiSubPackage);
-								        if(HLLib.hlPackageOpenStream(pStream, (uint)HLLib.HLFileMode.HL_MODE_READ))
-								        {
-									        if(!bSilent)
-										        Console.WriteLine("{0} opened.", HLLib.hlItemGetName(pSubItem));
-
-									        EnterConsole(uiSubPackage, Commands);
-
-									        HLLib.hlPackageClose();
-
-									        if(!bSilent)
-										        Console.WriteLine("{0} closed.", HLLib.hlItemGetName(pSubItem));
-								        }
-								        else
-								        {
-                                            Console.WriteLine("Error opening {0}:", HLLib.hlItemGetName(pSubItem));
-						                    Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-								        }
-
-								        HLLib.hlDeletePackage(uiSubPackage);
-
-								        HLLib.hlBindPackage(uiPackage);
-							        }
-							        else
-							        {
-                                        Console.WriteLine("Error opening {0}:", HLLib.hlItemGetName(pSubItem));
-						                Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-							        }
-
-							        HLLib.hlStreamClose(pStream);
-						        }
-						        else
-						        {
-                                    Console.WriteLine("Error opening {0}:", HLLib.hlItemGetName(pSubItem));
-						            Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-						        }
-
-						        HLLib.hlFileReleaseStream(pSubItem, pStream);
-					        }
-					        else
-					        {
-                                Console.WriteLine("Error opening {0}:", HLLib.hlItemGetName(pSubItem));
-						        Console.WriteLine(HLLib.hlGetString(HLLib.HLOption.HL_ERROR_SHORT_FORMATED));
-					        }
-				        }
-				        else
-				        {
-					        Console.WriteLine("{0} not found.", sArgument);
-				        }
-			        }
-		        }
-		        //
-		        // Clear screen.
-		        //
-		        else if(String.Equals(sCommand, "status", StringComparison.CurrentCultureIgnoreCase))
-		        {
-                    Console.WriteLine("Total size: {0} B", HLLib.hlGetUnsignedLong(HLLib.HLOption.HL_PACKAGE_SIZE));
-			        Console.WriteLine("Total mapping allocations: {0}", HLLib.hlGetUnsignedInteger(HLLib.HLOption.HL_PACKAGE_TOTAL_ALLOCATIONS));
-                    Console.WriteLine("Total mapping memory allocated: {0} B", HLLib.hlGetUnsignedLong(HLLib.HLOption.HL_PACKAGE_TOTAL_MEMORY_ALLOCATED));
-                    Console.WriteLine("Total mapping memory used: {0} B", HLLib.hlGetUnsignedLong(HLLib.HLOption.HL_PACKAGE_TOTAL_MEMORY_USED));
-
-			        uint uiAttributeCount = HLLib.hlPackageGetAttributeCount();
-			        for(uint i = 0; i < uiAttributeCount; i++)
-			        {
-                        HLLib.HLAttribute Attribute;
-				        if(HLLib.hlPackageGetAttribute((HLLib.HLPackageAttribute)i, out Attribute))
-				        {
-                            if(Attribute.eAttributeType != HLLib.HLAttributeType.HL_ATTRIBUTE_INVALID)
-                            {
-                                Console.WriteLine("{0}: {1}", Attribute.GetName(), Attribute.ToString());
-                            }
-				        }
-			        }
-		        }
-                else if(String.Equals(sCommand, "exec", StringComparison.CurrentCultureIgnoreCase) || String.Equals(sCommand, "execute", StringComparison.CurrentCultureIgnoreCase))
-                {
-                    if(sArgument.Length == 0)
-                    {
-                        Console.WriteLine("No argument for command open supplied.");
-                    }
-                    else
-                    {
-                        string[] NewCommands = sArgument.Split(new char[] { '|' });
-                        Commands.AddRange(NewCommands);
-                    }
-                }
-                else if(String.Equals(sCommand, "cls", StringComparison.CurrentCultureIgnoreCase))
-                {
-                    try
-                    {
-                        Console.Clear();
-                    }
-                    catch
-                    {
-                    }
-                }
-                else if(String.Equals(sCommand, "help", StringComparison.CurrentCultureIgnoreCase))
-                {
-                    Console.WriteLine("Valid commands:");
-                    Console.WriteLine();
-                    Console.WriteLine("dir <filter>       (Directory list.)");
-                    Console.WriteLine("cd <folder>        (Change directroy.)");
-                    Console.WriteLine("info <item>        (Item information.)");
-                    Console.WriteLine("extract <item>     (Extract item.)");
-                    Console.WriteLine("validate <item>    (Validate item.)");
-                    Console.WriteLine("defragment [force] (Defragment package.)");
-                    Console.WriteLine("find <filter>      (Find item.)");
-                    Console.WriteLine("type <file>        (Type a file.)");
-                    Console.WriteLine("open <file>        (Open a nested package.)");
-                    Console.WriteLine("root               (Go to the root folder.)");
-                    Console.WriteLine("status             (Package information.)");
-                    Console.WriteLine("execute <cmd>|...  (Execute 1 or more pipe delimited commands.)");
-                    Console.WriteLine("cls                (Clear the screen.)");
-                    Console.WriteLine("help               (Program help.)");
-                    Console.WriteLine("exit               (Quit program.)");
-                    Console.WriteLine();
-                }
-                else if(String.Equals(sCommand, "exit", StringComparison.CurrentCultureIgnoreCase))
-                {
-                    break;
-                }
-                else
-                {
-                    Console.WriteLine("Unkown command: {0}", sCommand);
-                }
-	        }
-        }
-    }
-}


Fixing metric reporting

Fixing metric reporting

--- S203.NewRelic.RabbitMq/RabbitAgent.cs
+++ S203.NewRelic.RabbitMq/RabbitAgent.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Net;
 using System.Reflection;
 using NewRelic.Platform.Sdk;
@@ -81,37 +82,37 @@

             Logger.Debug("Sending Queue Summary Metrics to New Relic");

-            ReportMetric("Queues/Queued", "Messages", overview["queue_totals"]["messages"]?.Value<int>() ?? 0);
-            ReportMetric("Queues/Ready", "Messages", overview["queue_totals"]["messages_ready"]?.Value<int>() ?? 0);
-            ReportMetric("Queues/Unacknowledged", "Messages", overview["queue_totals"]["messages_unacknowledged"]?.Value<int>() ?? 0);
+            ReportMetric("Queues/Queued", "Messages", overview["queue_totals"]["messages"]?.Value<float>() ?? 0);
+            ReportMetric("Queues/Ready", "Messages", overview["queue_totals"]["messages_ready"]?.Value<float>() ?? 0);
+            ReportMetric("Queues/Unacknowledged", "Messages", overview["queue_totals"]["messages_unacknowledged"]?.Value<float>() ?? 0);

             Logger.Debug("Sending Object Summary Metrics to New Relic");

-            var objects = JsonConvert.DeserializeObject<Dictionary<string, int>>(overview["object_totals"].ToString());
+            var objects = JsonConvert.DeserializeObject<Dictionary<string, float>>(overview["object_totals"].ToString());
             foreach (var metric in objects)
             {
-                ReportMetric("Objects/" + metric.Key, metric.Key, metric.Value);
+                ReportMetric("Objects/" + UppercaseFirst(metric.Key), UppercaseFirst(metric.Key), metric.Value);
             }

             Logger.Debug("Sending Message Summary Metrics to New Relic");

             ReportMetric("Messages/Publish", "Messages/Second",
-                _messagesPublished.Process(overview["message_stats"]["publish"]?.Value<int>() ?? 0));
+                _messagesPublished.Process(overview["message_stats"]["publish"]?.Value<float>() ?? 0));

             ReportMetric("Messages/Ack", "Messages/Second",
-                _messagesAcked.Process(overview["message_stats"]["ack"]?.Value<int>() ?? 0));
+                _messagesAcked.Process(overview["message_stats"]["ack"]?.Value<float>() ?? 0));

             ReportMetric("Messages/Deliver", "Messages/Second",
-                _messagesDelivered.Process(overview["message_stats"]["deliver"]?.Value<int>() ?? 0));
+                _messagesDelivered.Process(overview["message_stats"]["deliver"]?.Value<float>() ?? 0));

             ReportMetric("Messages/Confirm", "Messages/Second",
-                _messagesConfirmed.Process(overview["message_stats"]["confirm"]?.Value<int>() ?? 0));
+                _messagesConfirmed.Process(overview["message_stats"]["confirm"]?.Value<float>() ?? 0));

             ReportMetric("Messages/Redeliver", "Messages/Second",
-                _messagesRedelivered.Process(overview["message_stats"]["redeliver"]?.Value<int>() ?? 0));
+                _messagesRedelivered.Process(overview["message_stats"]["redeliver"]?.Value<float>() ?? 0));

             ReportMetric("Messages/NoAck", "Messages/Second",
-                _messagesNoacked.Process(overview["message_stats"]["get_noack"]?.Value<int>() ?? 0));
+                _messagesNoacked.Process(overview["message_stats"]["get_noack"]?.Value<float>() ?? 0));

             // ------- Nodes ---------
@@ -128,12 +129,32 @@

             Logger.Debug("Sending Node Metrics to New Relic");

-            ReportMetric("Node/DiskUsage/" + node["name"], "Bytes", node["disk_free"]?.Value<long>() ?? 0);
-            ReportMetric("Node/MemoryUsage/" + node["name"], "Percentage", node["mem_used"]?.Value<int>() ?? 0 / node["mem_limit"]?.Value<int>() ?? 0);
-            ReportMetric("Node/ProcUsage/" + node["name"], "Percentage", node["proc_used"]?.Value<int>() ?? 0 / node["proc_total"]?.Value<int>() ?? 0);
-            ReportMetric("Node/FileDescUsage/" + node["name"], "Percentage", node["fd_used"]?.Value<int>() ?? 0 / node["fd_total"]?.Value<int>() ?? 0);
-            ReportMetric("Node/SocketUsage/" + node["name"], "Percentage", node["sockets_used"]?.Value<int>() ?? 0 / node["sockets_total"]?.Value<int>() ?? 0);
+            var diskFree = node["disk_free"]?.Value<float>() ?? 0;
+            var memUsed = (node["mem_used"]?.Value<float>() ?? 0) / node["mem_limit"].Value<float>();
+            var procUsed = (node["proc_used"]?.Value<float>() ?? 0) / node["proc_total"].Value<float>();
+            var fdUsed = (node["fd_used"]?.Value<float>() ?? 0) / node["fd_total"].Value<float>();
+            var socketsUsed = (node["sockets_used"]?.Value<float>() ?? 0) / node["sockets_total"].Value<float>();
+
+            Logger.Debug("Disk Free Bytes: " + diskFree);
+            Logger.Debug("Memory Used %: " + memUsed);
+            Logger.Debug("Processor Used %: " + procUsed);
+            Logger.Debug("File Descriptors Used %: " + fdUsed);
+            Logger.Debug("Sockets Used %: " + socketsUsed);
+
+            ReportMetric("Node/DiskUsage/" + node["name"], "Bytes", diskFree);
+            ReportMetric("Node/MemoryUsage/" + node["name"], "Percentage", memUsed);
+            ReportMetric("Node/ProcUsage/" + node["name"], "Percentage", procUsed);
+            ReportMetric("Node/FileDescUsage/" + node["name"], "Percentage", fdUsed);
+            ReportMetric("Node/SocketUsage/" + node["name"], "Percentage", socketsUsed);
             ReportMetric("Node/Running/" + node["name"], "Running", node["running"]?.Value<bool>() ?? false ? 1 : 0);
+        }
+
+        private static string UppercaseFirst(string s)
+        {
+            if (string.IsNullOrEmpty(s))
+                return string.Empty;
+
+            return char.ToUpper(s[0]) + s.Substring(1);
         }
     }
 }


v1.4 Support for oxygen bottles (new main item type "oxygen") Fixed "Key with same name" exceptions on connected ships with same LCD names. v1.33 Fix oxygen in tanks showing too long numbers.

--- SEAutoLCDs/SEAutoLCDs/SEMMAPIClass.cs
+++ SEAutoLCDs/SEAutoLCDs/SEMMAPIClass.cs
@@ -45,9 +45,11 @@
         public string Storage;

 // COPY FROM HERE
-/* v:1.32 [Oxygen, Ammo reports, LCD joining & Groups support!]
+/* v:1.4 [Oxygen bottles, Ammo reports!]
 In-game script by MMaster
-
+ *
+ * Last update: Added support for oxygen container items (new main item type: "oxygen")
+ *
 Customize these: (do not report problems with modified values!) */

@@ -359,6 +361,7 @@
 Add("NATO_5p56x45mm", "AmmoMagazine", 0.45f, 0.2f, 1000);
 Add("NATO_25x184mm", "AmmoMagazine", 35f, 16f, 2000);
 Add("Missile200mm", "AmmoMagazine", 45f, 60f, 1600);
+Add("OxygenBottle", "OxygenContainerObject", 150f, 160f);
 // MODDED ITEMS
 // (subType, mainType, mass, volume, quota, display name, short name, used)
 // * if used is true, item will be shown in inventory even for 0 items
@@ -446,7 +449,7 @@
         for (int i = 0; i < textPanels.Count(); i++)
         {
             IMyTextPanel panel = (textPanels.Blocks[i] as IMyTextPanel);
-            string text = panel.CustomName + panel.NumberInGrid.ToString();
+            string text = panel.CustomName + " " + panel.NumberInGrid + " " + panel.GetPosition().ToString("F0");
             MMPanel p = null;

             int joinpos = text.IndexOf("!LINK:");
@@ -887,8 +890,8 @@

         if (found)
             MMLCDTextManager.AddLine(panel, "");
-        MMLCDTextManager.Add(panel, "Oxygen Tanks average");
-        MMLCDTextManager.AddRightAlign(panel, percent.ToString() + "%", LCD_LINE_WORK_STATE_POS);
+        MMLCDTextManager.Add(panel, "Oxygen Tanks");
+        MMLCDTextManager.AddRightAlign(panel, percent.ToString("F2") + "%", LCD_LINE_WORK_STATE_POS);
         MMLCDTextManager.AddLine(panel, "");
         MMLCDTextManager.AddProgressBar(panel, percent, FULL_PROGRESS_CHARS);
         MMLCDTextManager.AddLine(panel, "");
@@ -1054,7 +1057,8 @@
         return (subarg == "ingot" || subarg == "ore" ||
             subarg == "component" || subarg == "ammo" ||
             subarg == "tool" || subarg == "physicalgunobject" ||
-            subarg == "ammomagazine");
+            subarg == "ammomagazine" || subarg == "oxygencontainerobject" ||
+            subarg == "oxygen");
     }

     private void ShowInventoryLine(MMPanel panel, string msg, double num, int quota)
@@ -1235,6 +1239,7 @@
         MM.Debug("Printed ingots");

         PrintItemsOfMain(panel, amounts, missing, simple, "Component", "Components");
+        PrintItemsOfMain(panel, amounts, missing, simple, "OxygenContainerObject", "Oxygen");
         PrintItemsOfMain(panel, amounts, missing, simple, "AmmoMagazine", "Ammo");
         PrintItemsOfMain(panel, amounts, missing, simple, "PhysicalGunObject", "Tools");
     }
@@ -1556,7 +1561,8 @@
         return (subarg == "ingot" || subarg == "ore" ||
             subarg == "component" || subarg == "ammo" ||
             subarg == "tool" || subarg == "physicalgunobject" ||
-            subarg == "ammomagazine");
+            subarg == "ammomagazine" || subarg == "oxygencontainerobject" ||
+            subarg == "oxygen");
     }

     public void AddSpec(string subfulltype, bool ignore = false, int min = 1, int max = -1)
@@ -1582,6 +1588,9 @@
             else
                 if (mainType == "ammo")
                     mainType = "ammomagazine";
+                else
+                    if (mainType == "oxygen")
+                        mainType = "oxygencontainerobject";
         }

         subType = parts[0].ToLower();
@@ -1593,6 +1602,9 @@
             else
                 if (subType == "ammo")
                     subType = "ammomagazine";
+                else
+                    if (subType == "oxygen")
+                        subType = "oxygencontainerobject";
             spec.mainType = subType;

             specByMainLower.AddItem(spec.mainType, spec);


Instead of throwing a JsonReaderException if the root object is not a PMap, add a TextErrorInfo to Errors.

--- Sandra.UI.WF/Storage/SettingReader.cs
+++ Sandra.UI.WF/Storage/SettingReader.cs
@@ -36,6 +36,7 @@
         private class ParseRun : JsonTerminalSymbolVisitor<PValue>
         {
             private const string UnrecognizedValueMessage = "Unrecognized value '{0}'";
+            private const string NoPMapMessage = "Expected json object at root";

             private readonly List<JsonTerminalSymbol> tokens;

@@ -192,12 +193,13 @@
                             throw new JsonReaderException("End of file expected");
                         }

-                        if (!PType.Map.TryGetValidValue(rootValue, out map))
+                        bool validMap = PType.Map.TryGetValidValue(rootValue, out map);
+                        if (!validMap)
                         {
-                            throw new JsonReaderException("Expected json object at root");
+                            Errors.Add(new TextErrorInfo(NoPMapMessage, symbol.Start, symbol.Length));
                         }

-                        return true;
+                        return validMap;
                     }

                     map = default(PMap);


Make sure event registration and deregistration happen for the same method.

--- Sandra.UI/AppTemplate/SettingsForm.cs
+++ Sandra.UI/AppTemplate/SettingsForm.cs
@@ -123,7 +123,7 @@
                 // Save points.
                 jsonTextBox.SavePointLeft += (_, __) => UpdateChangedMarker();
                 jsonTextBox.SavePointReached += (_, __) => UpdateChangedMarker();
-                jsonTextBox.WorkingCopyTextFile.OpenTextFile.FileUpdated += (_, __) => UpdateChangedMarker();
+                jsonTextBox.WorkingCopyTextFile.OpenTextFile.FileUpdated += OpenTextFile_FileUpdated;

                 // Interaction between settingsTextBox and errorsTextBox.
                 jsonTextBox.CurrentErrorsChanged += (_, __) => DisplayErrors();
@@ -251,6 +251,11 @@
             }
         }

+        private void OpenTextFile_FileUpdated(LiveTextFile sender, EventArgs e)
+        {
+            UpdateChangedMarker();
+        }
+
         private void UpdateChangedMarker()
         {
             string openTextFilePath = jsonTextBox.WorkingCopyTextFile.OpenTextFilePath;
@@ -400,7 +405,7 @@
         {
             if (disposing)
             {
-                jsonTextBox.WorkingCopyTextFile.OpenTextFile.FileUpdated -= (_, __) => UpdateChangedMarker();
+                jsonTextBox.WorkingCopyTextFile.OpenTextFile.FileUpdated -= OpenTextFile_FileUpdated;
                 noErrorsString?.Dispose();
                 errorLocationString?.Dispose();
             }


Recognise quoted argument delimiters.

Recognise quoted argument delimiters.

--- Scripting/Parser/Construct/Command.cs
+++ Scripting/Parser/Construct/Command.cs
@@ -93,6 +93,8 @@
                 {
                     if (sym == StringBound)
                         str = !str;
+                    else if (sym == Multicast)
+                        goto delim;
                     continue;
                 }
                 else if (IsCommentAt(code, i))
@@ -127,6 +129,7 @@
                     }
                 }

+            delim:
                 if (sym == Multicast && (i == 0 || code[i - 1] != Escape) && !str && levels[0] == 0 && levels[1] == 0 && levels[2] == 0)
                 {
                     parts.Add(code.Substring(last, i - last));


add Element_Attribute sample

add Element_Attribute sample

--- SerializableDictionaryTest/Program.cs
+++ SerializableDictionaryTest/Program.cs
@@ -5,6 +5,9 @@

 using ieAE = SerializableDictionaryTest.ImExPorter<int, SerializableDictionaryTest.MyData>;
 using kvpAE = System.Collections.Generic.KeyValuePair<int, SerializableDictionaryTest.MyData>;
+
+using ieEA = SerializableDictionaryTest.ImExPorter<SerializableDictionaryTest.MyData, int>;
+using kvpEA = System.Collections.Generic.KeyValuePair<SerializableDictionaryTest.MyData, int>;

 using ieEE = SerializableDictionaryTest.ImExPorter<SerializableDictionaryTest.MyData, SerializableDictionaryTest.MyData>;
 using kvpEE = System.Collections.Generic.KeyValuePair<SerializableDictionaryTest.MyData, SerializableDictionaryTest.MyData>;
@@ -30,6 +33,15 @@
             ieAE.export(dicAE1, filePathAE);
             var dicAE2 = ieAE.import(filePathAE);

+            string filePathEA = @"../Data/SampleEA.log";
+            var dicEA1 = ieEA.create(new kvpEA[]{
+                new kvpEA(new MyData(){ ID=0, Name="Zero", RegisteredDate=DateTime.Now, Height=170.0, }, 0),
+                new kvpEA(new MyData(){ ID=1, Name="One", RegisteredDate=DateTime.Now, Height=160.0, }, 1),
+                new kvpEA(new MyData(){ ID=2, Name="Two", RegisteredDate=DateTime.Now, Height=165.0, }, 2),
+            });
+            ieEA.export(dicEA1, filePathEA);
+            var dicEA2 = ieEA.import(filePathEA);
+
             string filePathEE = @"../Data/SampleEE.log";
             var dicEE1 = ieEE.create(new kvpEE[]{
                 new kvpEE(


Remove unneeded methods

Remove unneeded methods

--- TMDbLib/Client/TMDbClientMovies.cs
+++ TMDbLib/Client/TMDbClientMovies.cs
@@ -168,18 +168,6 @@
         public TranslationsContainer GetMovieTranslations(int movieId)
         {
             return GetMovieMethod<TranslationsContainer>(movieId, MovieMethods.Translations);
-        }
-
-        [Obsolete]
-        public SearchContainer<MovieResult> GetMovieSimilarMovies(int movieId, int page = 0)
-        {
-            return GetMovieSimilar(movieId, DefaultLanguage, page);
-        }
-
-        [Obsolete]
-        public SearchContainer<MovieResult> GetMovieSimilarMovies(int movieId, string language, int page = 0)
-        {
-            return GetMovieSimilar(movieId, language, page);
         }

         public SearchContainer<MovieResult> GetMovieSimilar(int movieId, int page = 0)


Fallback tls-sni-01 to http by default

Fallback tls-sni-01 to http by default

--- src/Certify.Core/Management/Challenges/ChallengeDiagnostics.cs
+++ src/Certify.Core/Management/Challenges/ChallengeDiagnostics.cs
@@ -121,7 +121,14 @@
                 {
                     var challengeConfig = managedCertificate.GetChallengeConfig(domain);

-                    if (challengeConfig.ChallengeType == SupportedChallengeTypes.CHALLENGE_TYPE_HTTP)
+                    var challengeType = challengeConfig.ChallengeType;
+                    if (challengeType== SupportedChallengeTypes.CHALLENGE_TYPE_SNI)
+                    {
+                        log.Warning("tls-sni-01 challenge type is no longer supported by the Let's Encrypt service. Falling back to http-01");
+                        challengeType = SupportedChallengeTypes.CHALLENGE_TYPE_HTTP;
+                    }
+
+                    if (challengeType == SupportedChallengeTypes.CHALLENGE_TYPE_HTTP)
                     {
                         // if dns validation not selected but one or more domains is a wildcard, reject
                         if (domain.StartsWith("*."))
@@ -166,8 +173,16 @@
                             results.Add(new StatusMessage { IsOK = true, Message = httpChallengeResult.Message, Result = httpChallengeResult });
                         }
                     }
-                    else if (challengeConfig.ChallengeType == SupportedChallengeTypes.CHALLENGE_TYPE_SNI)
-                    {
+                    else if (challengeType == SupportedChallengeTypes.CHALLENGE_TYPE_SNI)
+                    {
+
+                            result.IsOK = false;
+                            result.FailedItemSummary.Add($"The {SupportedChallengeTypes.CHALLENGE_TYPE_SNI} challenge type is no longer available.");
+                            results.Add(result);
+
+                            return results;
+                        /*
+
                         var serverVersion = await serverManager.GetServerVersion();

                         if (serverVersion.Major < 8)
@@ -199,8 +214,9 @@
                             )();

                         results.Add(result);
-                    }
-                    else if (challengeConfig.ChallengeType == SupportedChallengeTypes.CHALLENGE_TYPE_DNS)
+                        */
+                    }
+                    else if (challengeType == SupportedChallengeTypes.CHALLENGE_TYPE_DNS)
                     {
                         var recordName = $"_acme-challenge-test.{domain}".Replace("*.", "");


Update PathGeometryConverter.cs

Update PathGeometryConverter.cs

--- src/Core2D/Modules/Renderer.SkiaSharp/PathGeometryConverter.cs
+++ src/Core2D/Modules/Renderer.SkiaSharp/PathGeometryConverter.cs
@@ -79,65 +79,63 @@

             var context = factory.CreateGeometryContext(geometry);

-            using (var iterator = path.CreateRawIterator())
-            {
-                var points = new SKPoint[4];
-                var pathVerb = SKPathVerb.Move;
-
-                while ((pathVerb = iterator.Next(points)) != SKPathVerb.Done)
-                {
-                    switch (pathVerb)
-                    {
-                        case SKPathVerb.Move:
-                            {
-                                context.BeginFigure(
-                                    factory.CreatePointShape(points[0].X, points[0].Y),
-                                    false);
-                            }
-                            break;
-
-                        case SKPathVerb.Line:
-                            {
-                                context.LineTo(
-                                    factory.CreatePointShape(points[1].X, points[1].Y));
-                            }
-                            break;
-
-                        case SKPathVerb.Cubic:
-                            {
-                                context.CubicBezierTo(
-                                    factory.CreatePointShape(points[1].X, points[1].Y),
-                                    factory.CreatePointShape(points[2].X, points[2].Y),
-                                    factory.CreatePointShape(points[3].X, points[3].Y));
-                            }
-                            break;
-
-                        case SKPathVerb.Quad:
-                            {
-                                context.QuadraticBezierTo(
-                                    factory.CreatePointShape(points[1].X, points[1].Y),
-                                    factory.CreatePointShape(points[2].X, points[2].Y));
-                            }
-                            break;
-
-                        case SKPathVerb.Conic:
-                            {
-                                var quads = SKPath.ConvertConicToQuads(points[0], points[1], points[2], iterator.ConicWeight(), 1);
-                                context.QuadraticBezierTo(
-                                    factory.CreatePointShape(quads[1].X, quads[1].Y),
-                                    factory.CreatePointShape(quads[2].X, quads[2].Y));
-                                context.QuadraticBezierTo(
-                                    factory.CreatePointShape(quads[3].X, quads[3].Y),
-                                    factory.CreatePointShape(quads[4].X, quads[4].Y));
-                            }
-                            break;
-
-                        case SKPathVerb.Close:
-                            {
-                                context.SetClosedState(true);
-                            }
-                            break;
-                    }
+            using var iterator = path.CreateRawIterator();
+            var points = new SKPoint[4];
+            var pathVerb = SKPathVerb.Move;
+
+            while ((pathVerb = iterator.Next(points)) != SKPathVerb.Done)
+            {
+                switch (pathVerb)
+                {
+                    case SKPathVerb.Move:
+                    {
+                        context.BeginFigure(
+                            factory.CreatePointShape(points[0].X, points[0].Y),
+                            false);
+                    }
+                        break;
+
+                    case SKPathVerb.Line:
+                    {
+                        context.LineTo(
+                            factory.CreatePointShape(points[1].X, points[1].Y));
+                    }
+                        break;
+
+                    case SKPathVerb.Cubic:
+                    {
+                        context.CubicBezierTo(
+                            factory.CreatePointShape(points[1].X, points[1].Y),
+                            factory.CreatePointShape(points[2].X, points[2].Y),
+                            factory.CreatePointShape(points[3].X, points[3].Y));
+                    }
+                        break;
+
+                    case SKPathVerb.Quad:
+                    {
+                        context.QuadraticBezierTo(
+                            factory.CreatePointShape(points[1].X, points[1].Y),
+                            factory.CreatePointShape(points[2].X, points[2].Y));
+                    }
+                        break;
+
+                    case SKPathVerb.Conic:
+                    {
+                        var quads = SKPath.ConvertConicToQuads(points[0], points[1], points[2], iterator.ConicWeight(), 1);
+                        context.QuadraticBezierTo(
+                            factory.CreatePointShape(quads[1].X, quads[1].Y),
+                            factory.CreatePointShape(quads[2].X, quads[2].Y));
+                        context.QuadraticBezierTo(
+                            factory.CreatePointShape(quads[3].X, quads[3].Y),
+                            factory.CreatePointShape(quads[4].X, quads[4].Y));
+                    }
+                        break;
+
+                    case SKPathVerb.Close:
+                    {
+                        context.SetClosedState(true);
+                    }
+                        break;
                 }
             }


Fixed small bug

Fixed small bug

--- src/DocToMarkdown/MarkdownNodeParser/ListMarkdownNodeParser.cs
+++ src/DocToMarkdown/MarkdownNodeParser/ListMarkdownNodeParser.cs
@@ -116,7 +116,7 @@

             if (this._listLevel == 0)
             {
-                resultStringBuilder.AppendLine("**List:**");
+                resultStringBuilder.Append("**List:**");
             }

             var itemElements = element.Elements("item");


チェック最終時刻の丸めを忘れてた

チェック最終時刻の丸めを忘れてた

--- TimecardFunctions/MessageSender.cs
+++ TimecardFunctions/MessageSender.cs
@@ -46,13 +46,15 @@
                 var tzUser = TimeZoneInfo.FindSystemTimeZoneById(user.TimeZoneId);
                 var nowUserTz = TimeZoneInfo.ConvertTimeFromUtc(nowUtc, tzUser); // ユーザーのタイムゾーンでの現在時刻
                 var nowUserTzText = $"{nowUserTz.Year:0000}/{nowUserTz.Month:00}/{nowUserTz.Day:00}";  // ユーザーTZ現在時刻を文字列化
+                var nowHour = nowUserTz.Hour;
+                var nowStepedMinute = nowUserTz.Minute / 30 * 30;

                 Util.ParseHHMM(user.AskEndOfWorkStartTime, out startHour, out startMinute);
                 Util.ParseHHMM(user.AskEndOfWorkEndTime, out endHour, out endMinute);

                 var startTotalMinute = startHour * 60 + startMinute;
                 var endTotalMinute = endHour * 60 + endMinute;
-                var nowTotalMinute = nowUserTz.Hour * 60 + nowUserTz.Minute;
+                var nowTotalMinute = nowHour * 60 + nowStepedMinute;

                 var stateEntity = await conversationStateRepo.GetStatusByUserId(user.UserId);

@@ -93,10 +95,8 @@
                     var message = conversationRef.GetPostToUserMessage();
                     message = message.CreateReply();

-                    var hour = nowUserTz.Hour;
-                    var minute = nowUserTz.Minute / 30 * 30;
-                    message.Text = $"{user.NickName} さん、お疲れさまです。{hour}時{minute:00}分 です、今日のお仕事は終わりましたか？" +
-                        $"（y:終わった／n:終わってない／d:今日は徹夜）";
+                    message.Text = $"{user.NickName} さん、お疲れさまです。{nowHour}時{nowStepedMinute:00}分 です、今日のお仕事は終わりましたか？\n\n" +
+                        $"--\n\ny:終わった\n\nn:終わってない\n\nd:今日は徹夜";
                     message.Locale = "ja-Jp";

                     //message.Attachments.Add(new Attachment()
@@ -108,7 +108,7 @@
                     await connector.Conversations.ReplyToActivityAsync(message);

                     await conversationStateRepo.UpsertState(
-                        user.PartitionKey, conversationRef.User.Id, AskingState.AskingEoW, $"{hour:00}{minute:00}",
+                        user.PartitionKey, conversationRef.User.Id, AskingState.AskingEoW, $"{nowHour:00}{nowStepedMinute:00}",
                         nowUserTzText);
                 }
                 else


Use dapper params (else dapper will cache every result set)

--- src/MR.AspNetCore.Jobs.SqlServer/SqlServerStorageConnection.cs
+++ src/MR.AspNetCore.Jobs.SqlServer/SqlServerStorageConnection.cs
@@ -75,14 +75,17 @@

 		public Task<Job> GetNextJobToBeEnqueuedAsync()
 		{
-			var sql = $@"
+			var sql = @"
 				SELECT TOP (1) *
 				FROM [Jobs].Jobs WITH (readpast)
-				WHERE (Due IS NULL OR Due < GETUTCDATE()) AND StateName = '{ScheduledState.StateName}'";
+				WHERE (Due IS NULL OR Due < GETUTCDATE()) AND StateName = @StateName";

 			return _storage.UseConnectionAsync(async connection =>
 			{
-				return (await connection.QueryAsync<Job>(sql)).FirstOrDefault();
+				return (await connection.QueryAsync<Job>(sql, new
+				{
+					ScheduledState.StateName
+				})).FirstOrDefault();
 			});
 		}


Fix CanSendMessage test

Fix CanSendMessage test

--- src/NUnitFramework/tests/Internal/TestExecutionContextTests.cs
+++ src/NUnitFramework/tests/Internal/TestExecutionContextTests.cs
@@ -476,20 +476,18 @@
 #endregion

 #region SendMessage
-        [Test]
+        [Test, NonParallelizable]
         public void CanSendMessage()
         {
-            TestExecutionContext.CurrentContext.SendMessage("destination", "message");
-
 #if !NETCOREAPP1_1
             var listener = TestExecutionContext.CurrentContext.Listener as QueuingEventListener;
-            Assert.That(listener.Events.Count, Is.EqualTo(1));
-
-            var testMessageEvent = listener.Events.Dequeue(false) as TestMessageEvent;
-            Assert.That(testMessageEvent, Is.Not.Null);
-            Assert.That(testMessageEvent.TestMessage, Is.Not.Null);
-            Assert.That(testMessageEvent.TestMessage.Destination, Is.EqualTo("destination"));
-            Assert.That(testMessageEvent.TestMessage.Message, Is.EqualTo("message"));
+
+            var previousEventsCount = listener.Events.Count;
+#endif
+            TestExecutionContext.CurrentContext.SendMessage("destination", "message");
+
+#if !NETCOREAPP1_1
+            Assert.That(listener.Events.Count, Is.EqualTo(previousEventsCount + 1));
 #endif
         }
 #endregion


Updated to SM in sample

Updated to SM in sample

--- src/Nancy.Bootstrapper.Prototype.Console/CustomBootstrapper.cs
+++ src/Nancy.Bootstrapper.Prototype.Console/CustomBootstrapper.cs
@@ -1,16 +1,18 @@
-using Autofac;
-using Nancy.Bootstrapper.Prototype.Bootstrappers.Autofac;
+using Nancy.Bootstrapper.Prototype.Bootstrappers.StructureMap;
 using Nancy.Bootstrapper.Prototype.Configuration;
+using StructureMap.Pipeline;
+using StructureMap;

 namespace Nancy.Bootstrapper.Prototype.Console
 {
-    public class CustomBootstrapper : AutofacBootstrapper
+    public class CustomBootstrapper : StructureMapBootstrapper
     {
-        protected override void ConfigureApplication(IApplicationConfiguration<ContainerBuilder> app)
+        protected override void ConfigureApplication(IApplicationConfiguration<IContainer> app)
         {
-            app.Container.RegisterType<RequestService>()
-                .As<IRequestService>()
-                .InstancePerRequest();
+            app.Container.Configure(c =>
+                c.For<IRequestService>()
+                    .Use<RequestService>()
+                    .LifecycleIs<ContainerLifecycle>());

             app.Framework.Engine.Use<CustomEngine>();


Fixes #491 - configuration method for KeyValuePairs() on .NET 4.0.

--- src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs
+++ src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs
@@ -14,6 +14,7 @@

 using System;
 using System.Collections.Generic;
+using Serilog.Settings.KeyValuePairs;

 namespace Serilog.Configuration
 {
@@ -42,5 +43,16 @@

             return _loggerConfiguration;
         }
+
+        /// <summary>
+        /// Apply settings specified in the Serilog key-value setting format to the logger configuration.
+        /// </summary>
+        /// <param name="settings">A list of key-value pairs describing logger settings.</param>
+        /// <returns>Configuration object allowing method chaining.</returns>
+        public LoggerConfiguration KeyValuePairs(IEnumerable<KeyValuePair<string, string>> settings)
+        {
+            if (settings == null) throw new ArgumentNullException("settings");
+            return Settings(new KeyValuePairSettings(settings));
+        }
     }
 }


Added contracts field to it system usage dto

--- UI.MVC4/Models/ItSystemUsageDTO.cs
+++ UI.MVC4/Models/ItSystemUsageDTO.cs
@@ -40,5 +40,8 @@
         public IEnumerable<InterfaceExposureDTO> InterfaceExposures { get; set; }

         public IEnumerable<ItProjectDTO> ItProjects { get; set; }
+
+        public int? MainContractId { get; set; }
+        public IEnumerable<ItContractSystemDTO> Contracts { get; set; }
     }
 }


Added more ChainedStream unit tests

Added more ChainedStream unit tests

--- UnitTests/IO/ChainedStreamTests.cs
+++ UnitTests/IO/ChainedStreamTests.cs
@@ -146,6 +146,8 @@
 		{
 			Assert.IsTrue (chained.CanRead, "Expected to be able to read from the chained stream.");

+			Assert.AreEqual (0, chained.Read (cbuf, 0, 0), "Zero-length read");
+
 			do {
 				int n = (int) Math.Min (master.Length - master.Position, mbuf.Length);
 				int nread = chained.Read (cbuf, 0, n);
@@ -164,6 +166,8 @@
 		{
 			Assert.IsTrue (chained.CanRead, "Expected to be able to read from the chained stream.");

+			Assert.AreEqual (0, await chained.ReadAsync (cbuf, 0, 0), "Zero-length read");
+
 			do {
 				int n = (int) Math.Min (master.Length - master.Position, mbuf.Length);
 				int nread = await chained.ReadAsync (cbuf, 0, n);
@@ -179,7 +183,7 @@

 		void AssertSeekResults (string operation)
 		{
-			int n = (int) Math.Min (master.Length - master.Position, mbuf.Length);
+			int n = (int) Math.Min (master.Length - master.Position, 256);
 			int nread = chained.Read (cbuf, 0, n);
 			int mread = master.Read (mbuf, 0, n);

@@ -226,6 +230,40 @@
 		}

 		[Test]
+		public void TestSeekingToCurrentPosition ()
+		{
+			long expected, actual;
+
+			expected = master.Seek (99, SeekOrigin.Begin);
+			actual = chained.Seek (99, SeekOrigin.Begin);
+
+			Assert.AreEqual (expected, actual, "Seeking the chained stream did not return the expected position");
+
+			AssertSeekResults ("seeking to offset 99");
+
+			expected = master.Seek (master.Position, SeekOrigin.Begin);
+			actual = chained.Seek (chained.Position, SeekOrigin.Begin);
+
+			Assert.AreEqual (expected, actual, "Seeking the chained stream did not return the expected position");
+
+			AssertSeekResults ("seeking to current position via SeekOrigin.Begin");
+
+			expected = master.Seek (0, SeekOrigin.Current);
+			actual = chained.Seek (0, SeekOrigin.Current);
+
+			Assert.AreEqual (expected, actual, "Seeking the chained stream did not return the expected position");
+
+			AssertSeekResults ("seeking to current position via SeekOrigin.Current");
+
+			expected = master.Seek (master.Position - master.Length, SeekOrigin.End);
+			actual = chained.Seek (chained.Position - chained.Length, SeekOrigin.End);
+
+			Assert.AreEqual (expected, actual, "Seeking the chained stream did not return the expected position");
+
+			AssertSeekResults ("seeking to current position via SeekOrigin.End");
+		}
+
+		[Test]
 		public void TestSeekingToStreamBoundaries ()
 		{
 			long expected, actual;
@@ -257,7 +295,7 @@

 		async Task AssertSeekResultsAsync (string operation)
 		{
-			int n = (int) Math.Min (master.Length - master.Position, mbuf.Length);
+			int n = (int) Math.Min (master.Length - master.Position, 256);
 			int nread = await chained.ReadAsync (cbuf, 0, n);
 			int mread = await master.ReadAsync (mbuf, 0, n);

@@ -368,6 +406,38 @@
 		}

 		[Test]
+		public void TestWriteOverflow ()
+		{
+			var buffer = new byte[(int) chained.Length + 1];
+
+			for (int i = 0; i < buffer.Length; i++)
+				buffer[i] = (byte) (i & 0xff);
+
+			chained.Position = 0;
+			Assert.Throws<IOException> (() => chained.Write (buffer, 0, buffer.Length));
+
+			chained.Position = 0;
+			chained.Write (buffer, 0, buffer.Length - 1);
+			Assert.Throws<IOException> (() => chained.Write (buffer, buffer.Length - 1, 1));
+		}
+
+		[Test]
+		public async Task TestWriteOverflowAsync ()
+		{
+			var buffer = new byte[(int) chained.Length + 1];
+
+			for (int i = 0; i < buffer.Length; i++)
+				buffer[i] = (byte) (i & 0xff);
+
+			chained.Position = 0;
+			Assert.ThrowsAsync<IOException> (async () => await chained.WriteAsync (buffer, 0, buffer.Length));
+
+			chained.Position = 0;
+			await chained.WriteAsync (buffer, 0, buffer.Length - 1);
+			Assert.ThrowsAsync<IOException> (async () => await chained.WriteAsync (buffer, buffer.Length - 1, 1));
+		}
+
+		[Test]
 		public void TestChainedHeadersAndContent ()
 		{
 			var buf = Encoding.ASCII.GetBytes ("Content-Type: text/plain\r\n\r\n");


Remove unneeded catch/throw from 'mkdir' and 'oss' functions (#8425)

--- src/System.Management.Automation/engine/InitialSessionState.cs
+++ src/System.Management.Automation/engine/InitialSessionState.cs
@@ -4186,36 +4186,18 @@
 )

 begin {
-
-    try {
-        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('New-Item', [System.Management.Automation.CommandTypes]::Cmdlet)
-        $scriptCmd = {& $wrappedCmd -Type Directory @PSBoundParameters }
-        $steppablePipeline = $scriptCmd.GetSteppablePipeline()
-        $steppablePipeline.Begin($PSCmdlet)
-    } catch {
-        throw
-    }
-
+    $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('New-Item', [System.Management.Automation.CommandTypes]::Cmdlet)
+    $scriptCmd = {& $wrappedCmd -Type Directory @PSBoundParameters }
+    $steppablePipeline = $scriptCmd.GetSteppablePipeline()
+    $steppablePipeline.Begin($PSCmdlet)
 }

 process {
-
-    try {
-        $steppablePipeline.Process($_)
-    } catch {
-        throw
-    }
-
+    $steppablePipeline.Process($_)
 }

 end {
-
-    try {
-        $steppablePipeline.End()
-    } catch {
-        throw
-    }
-
+    $steppablePipeline.End()
 }

 ";
@@ -4234,35 +4216,20 @@
     [psobject]
     ${InputObject})

-begin
-{
-    try {
-        $PSBoundParameters['Stream'] = $true
-        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Out-String',[System.Management.Automation.CommandTypes]::Cmdlet)
-        $scriptCmd = {& $wrappedCmd @PSBoundParameters }
-        $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
-        $steppablePipeline.Begin($PSCmdlet)
-    } catch {
-        throw
-    }
+begin {
+    $PSBoundParameters['Stream'] = $true
+    $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Out-String',[System.Management.Automation.CommandTypes]::Cmdlet)
+    $scriptCmd = {& $wrappedCmd @PSBoundParameters }
+    $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
+    $steppablePipeline.Begin($PSCmdlet)
 }

-process
-{
-    try {
-        $steppablePipeline.Process($_)
-    } catch {
-        throw
-    }
+process {
+    $steppablePipeline.Process($_)
 }

-end
-{
-    try {
-        $steppablePipeline.End()
-    } catch {
-        throw
-    }
+end {
+    $steppablePipeline.End()
 }
 <#
 .ForwardHelpTargetName Out-String


Dispose test env in RequiredTransformations

Fixes a possible test-time crash introduced in f8330fdc: there's no
specified ordering for running the finalizer of _env, so sometimes it
might run after another Dispose cleaned up the test environment, and
then attempt to throw an assertion exception at a poorly-specified time,
leading to a crash in the test process instead of a test failure.

--- src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs
+++ src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs
@@ -20,7 +20,7 @@
 {
     [Trait("Category", "mono-osx-failing")]
     [Trait("Category", "mono-windows-failing")]
-    public sealed class RequiredTransformations
+    public sealed class RequiredTransformations : IDisposable
     {
         private readonly TestEnvironment _env;
         private readonly ITestOutputHelper _output;
@@ -29,6 +29,11 @@
         {
             _env = TestEnvironment.Create(output);
             _output = output;
+        }
+
+        public void Dispose()
+        {
+            _env.Dispose();
         }

         /// <summary>


Added default constructor.

Added default constructor.

--- NtApiDotNet/Win32/Security/Authentication/Kerberos/KerberosTransitedEncoding.cs
+++ NtApiDotNet/Win32/Security/Authentication/Kerberos/KerberosTransitedEncoding.cs
@@ -14,6 +14,7 @@

 using NtApiDotNet.Utilities.ASN1;
 using NtApiDotNet.Utilities.ASN1.Builder;
+using System;
 using System.IO;

 namespace NtApiDotNet.Win32.Security.Authentication.Kerberos
@@ -47,6 +48,14 @@
         /// Transited encoding data.
         /// </summary>
         public byte[] Data { get; }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        public KerberosTransitedEncoding()
+            : this(KerberosTransitedEncodingType.X500Compress, Array.Empty<byte>())
+        {
+        }

         /// <summary>
         /// Constructor.


Remove the override from DeletToInventory in HGInventoryAccessModule. This may be causing the infinite loop, not sure.

--- OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -136,7 +136,8 @@
             return ret;
         }

-        public override UUID DeleteToInventory(DeRezAction action, UUID folderID,
+        // DO NOT OVERRIDE THIS METHOD
+        public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
                 SceneObjectGroup objectGroup, IClientAPI remoteClient)
         {
             UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);


ReturnTheProperValueInTheContentField - Red

--- PrehensilePonyTail/PPTail.Data.FileSystem.Test/Repository_GetAllPages_Should.cs
+++ PrehensilePonyTail/PPTail.Data.FileSystem.Test/Repository_GetAllPages_Should.cs
@@ -164,6 +164,14 @@
             ExecutePropertyTest(fieldName, fieldValueDelegate);
         }

+        [Fact]
+        public void ReturnTheProperValueInTheContentField()
+        {
+            string fieldName = "content";
+            Func<ContentItem, string> fieldValueDelegate = (ContentItem c) => c.Content;
+            ExecutePropertyTest(fieldName, fieldValueDelegate);
+        }
+
         private static void ExecutePropertyTest(string fieldName, Func<ContentItem, string> fieldValueDelegate)
         {
             string expected = string.Empty.GetRandom();