Added GetDuckMethodList

Added GetDuckMethodList

--- DewDuck/DewDuck.cs
+++ DewDuck/DewDuck.cs
@@ -10,6 +10,20 @@
     /// </summary>
     public class DewDuck
     {
+        /// <summary>
+        /// Return the list of methods of a duck
+        /// </summary>
+        /// <param name="duck"></param>
+        /// <returns></returns>
+        public static List<string> GetDuckMethodsList(object duck)
+        {
+            var result = new List<string>();
+            foreach (var item in duck.GetType().GetRuntimeMethods())
+            {
+                result.Add(item.ToString());
+            }
+            return result;
+        }
         /// <summary>
         /// Return true if the passed actions are methods in the passed duck
         /// </summary>


Bump up download file timeout (#39005)

Bump up download file timeout (#39005)

--- eng/tools/RepoTasks/DownloadFile.cs
+++ eng/tools/RepoTasks/DownloadFile.cs
@@ -100,7 +100,7 @@

         Log.LogMessage(MessageImportance.High, $"Attempting download '{source}' to '{target}'");

-        using (var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(5) })
+        using (var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(7.5) })
         {
             for (int retryNumber = 0; retryNumber < MaxRetries; retryNumber++)
             {


Improve Dropdown list of Tab

Improve Dropdown list of Tab

--- TemplateInit.ascx.cs
+++ TemplateInit.ascx.cs
@@ -245,7 +245,7 @@
                 rblDataSource.SelectedIndex = (Settings.TabId > 0 && Settings.ModuleId > 0 ? 1 : 0);
                 BindOtherModules(Settings.TabId, Settings.ModuleId);
                 BindTemplates(Settings.Template, (Renderinfo.IsOtherModule ? Renderinfo.Template.Uri() : null));
-                BindDetailPage(Settings.DetailTabId);
+                BindDetailPage(Settings.DetailTabId, Settings.TabId);
             }
             if (rblDataSource.SelectedIndex == 1) // other module
             {
@@ -332,13 +332,20 @@
                 ddlDataSource.Items.Add(li);
             }
         }
-        private void BindDetailPage(int tabId)
+        private void BindDetailPage(int currentDetailTabId, int otherModuleTabId)
         {

             ActivateDetailPage();

             ddlDetailPage.Items.Clear();
-            ddlDetailPage.Items.Add(new ListItem("Main Module Page", "-1"));
+            ddlDetailPage.Items.Add(new ListItem(string.Format("Main Module Page [{0}]", otherModuleTabId), "-1"));
+            if (otherModuleTabId>0)
+            {
+                //todo: add li with "CurrentPage"
+            }
+
+            //todo: wegfilteren van redirected tabs
+
             var listItems = new List<ListItem>();
             Dictionary<string, int> tabs = TabController.GetTabPathDictionary(ModuleContext.PortalId, DnnUtils.GetCurrentCultureCode());


Update CI with the new naming.

Update CI with the new naming.

--- CodeCakeBuilder/Build.cs
+++ CodeCakeBuilder/Build.cs
@@ -33,7 +33,7 @@
                         .Append( $@"/p:Version=""{info.NuGetVersion}""" )
                         .Append( $@"/p:AssemblyVersion=""{info.MajorMinor}.0""" )
                         .Append( $@"/p:FileVersion=""{info.FileVersion}""" )
-                        .Append( $@"/p:InformationalVersion=""{info.SemVer} ({info.NuGetVersion}) - SHA1: {info.CommitSha} - CommitDate: {info.CommitDateUtc.ToString( "u" )}""" );
+                        .Append( $@"/p:InformationalVersion=""{info.SemVer} ({info.NuGetVersion}) - SHA1: {info.CommitSha} - CommitDate: {info.CommitDateUtc:u}""" );
             }
             conf?.Invoke( @this );
             return @this;
@@ -132,15 +132,17 @@
                 {
                     Cake.DotNetCoreRestore();

-                    var testNetFrameworkDlls = projects
-                        .Where( p => p.Name.EndsWith( ".NetFramework.Tests" ) )
+                    var testProjects = projects.Where( p => p.Path.Segments.Contains( "Tests" ) );
+
+                    var testNetFrameworkDlls = testProjects
+                        .Where( p => p.Name.EndsWith( ".NetFramework" ) )
                         .Select( p => p.Path.GetDirectory().CombineWithFilePath( "bin/" + configuration + "/net461/" + p.Name + ".dll" ) );
                     Cake.Information( "Testing: {0}", string.Join( ", ", testNetFrameworkDlls.Select( p => p.GetFilename().ToString() ) ) );
                     Cake.NUnit( testNetFrameworkDlls, new NUnitSettings { Framework = "v4.6" } );

-                    var testNetCoreDirectories = projects
-                        .Where( p => p.Name.EndsWith( ".NetCore.Tests" ) )
+                    var testNetCoreDirectories = testProjects
+                        .Where( p => p.Name.EndsWith( ".NetCore" ) )
                         .Select( p => p.Path.GetDirectory() );
                     Cake.Information( "Testing: {0}", string.Join( ", ", testNetCoreDirectories.Select( p => p.GetDirectoryName().ToString() ) ) );
                     foreach( var testNetCoreDirectory in testNetCoreDirectories )


Remove photos when clearing all data

Remove photos when clearing all data

--- JsonNetDal/JsonDocumentDb.cs
+++ JsonNetDal/JsonDocumentDb.cs
@@ -38,10 +38,18 @@
         public async Task ClearAllData()
         {
             var dbFile = await GetDbFile();
-            // TODO remove photos
+            await dbFile.DeleteAsync(StorageDeleteOption.PermanentDelete);
+            await ClearFolder(ApplicationData.Current.LocalFolder);
+            changed.OnNext(Unit.Default);
+        }

-            await dbFile.DeleteAsync(StorageDeleteOption.PermanentDelete);
-            changed.OnNext(Unit.Default);
+        private async Task ClearFolder(StorageFolder folder)
+        {
+            var storageItems = await folder.GetItemsAsync();
+            var deleteTasks = storageItems
+                .Select(f => f.DeleteAsync(StorageDeleteOption.PermanentDelete))
+                .Select(x => x.AsTask());
+            await Task.WhenAll(deleteTasks);
         }

         public async Task<IEnumerable<Logic.Document>> GetAllDocumentsAsync()


Remove  environment newline

Remove  environment newline

--- CreateXMLFile/Program.cs
+++ CreateXMLFile/Program.cs
@@ -48,7 +48,6 @@
       result.Append("</QuoteValue>");
       result.Append(Environment.NewLine);
       result.Append("</Quote>");
-      result.Append(Environment.NewLine);
       /*
         <Quote>
           <Author></Author>


Added a comment

Added a comment

--- TextPoint/FRMMain.cs
+++ TextPoint/FRMMain.cs
@@ -20,6 +20,7 @@
         public FRMMain()
         {
             InitializeComponent();
+            //Media player
             var player = new WindowsMediaPlayer();
             player.URL = "X:/[musik]/Blink_182_-_Neighborhoods-2011-MOD/01_blink_182_-_ghost_on_the_dance_floor.mp3";
             player.settings.rate = 0.5;


Fix a threading bug. Changing a dictionary while exhausting enumerator (yield return) that's enumerating over that dictionary, is a BAD idea.

--- TimeLeft/TimeLeft.cs
+++ TimeLeft/TimeLeft.cs
@@ -224,7 +224,8 @@
         {
             bool modified = false;

-            foreach ( TimeLeftUnit unit in storage.GetAll() )
+            var all = storage.GetAll().ToArray();
+            foreach ( TimeLeftUnit unit in all )
             {
                 if (DateTime.UtcNow > unit.Date)
                 {


Add SetSpeed method

Add SetSpeed method

--- TinySato/TinySato.cs
+++ TinySato/TinySato.cs
@@ -91,6 +91,13 @@
             Add(string.Format("#E{0:D1}", density, spec.ToString("F")));
         }

+        public void SetSpeed(int speed)
+        {
+            if (!(1 <= speed && speed <= 5))
+                throw new TinySatoException("Specify 1-5 speed");
+            Add(string.Format("CS{0:D2}", speed));
+        }
+
         {
             if (!(1 <= x && x <= 9999))
                 throw new TinySatoException("Specify 1-9999 dots for x position.");


pretty pretty code

pretty pretty code

--- TrueCraft/Program.cs
+++ TrueCraft/Program.cs
@@ -122,15 +122,17 @@
             var message = e.Message;

             if (!message.StartsWith("/") || message.StartsWith("//"))
-            {
-                if (message.StartsWith("//"))
-                    message = message.Substring(1);
-
-                Server.SendMessage("<{0}> {1}", e.Client.Username, message);
-                return;
-            }
+                SendChatMessage(e.Client.Username, message);
+            else
+                e.PreventDefault = ProcessChatCommand(e);
+        }

-            e.PreventDefault = ProcessChatCommand(e);
+        private static void SendChatMessage(string username, string message)
+        {
+            if (message.StartsWith("//"))
+                message = message.Substring(1);
+
+            Server.SendMessage("<{0}> {1}", username, message);
         }

         /// <summary>


Fixed a bug where people saying numbers only in their last message were muted.

--- Dbot.Processor/Banner.cs
+++ Dbot.Processor/Banner.cs
@@ -211,7 +211,7 @@
     public Mute NumberSpam() {
       var numberRegex = new Regex(@"^.{0,2}\d+.{0,5}$");
       if (!numberRegex.Match(_message.Text).Success) return null;
-      var numberMessages = _context.TakeLast(Settings.NumberSpamContextLength).Count(x => numberRegex.Match(_message.Text).Success && _message.Nick == x.Nick) + 1; // To include the latest message that isn't in context yet.
+      var numberMessages = _context.TakeLast(Settings.NumberSpamContextLength).Count(m => numberRegex.Match(m.Text).Success && _message.Nick == m.Nick) + 1; // To include the latest message that isn't in context yet.
       return numberMessages >= Settings.NumberSpamTriggerLength ? new Mute(_message.Nick, TimeSpan.FromMinutes(10), "Counting down to your ban?") : null;
     }


useless CI...

useless CI...

--- VILab.API/Startup.cs
+++ VILab.API/Startup.cs
@@ -31,7 +31,7 @@
             }
             else
             {
-                app.UseExceptionHandler();fgh
+                app.UseExceptionHandler();
             }

             app.UseStatusCodePages();


Refactored GetDecadeDateRegExpression utility method

--- Utilities/Utility.cs
+++ Utilities/Utility.cs
@@ -586,52 +586,64 @@
         /// <summary>
         /// Gets the decade date regular expression in yyyymmdd format based on current date.
         /// </summary>
-        /// <returns></returns>
-        public static string GetDecadeDateRegExpression()
-        {
-            var startYear = DateTime.Now.AddYears(-100).Year;
-            var endYear = DateTime.Now.AddYears(100).Year;
-
-            var subStartYear = ToInt(startYear.ToString().Substring(0, 2));
-            var subEndYear = ToInt(endYear.ToString().Substring(0, 2));
-
-            var decadeStartYear = ToInt(startYear.ToString().Substring(0, 2) + "00");
-            var decadeEndYear = ToInt((endYear + 100).ToString().Substring(0, 2) + "00");
+        /// <param name="delimeter">The delimeter.</param>
+        /// <returns></returns>
+        public static string GetDecadeDateRegExpression(string delimeter = "")
+        {
+            int startYear = DateTime.Now.AddYears(-100).Year;
+            int endYear = DateTime.Now.AddYears(100).Year;
+
+            int subStartYear = Convert.ToInt16(startYear.ToString().Substring(0, 2));
+            int subEndYear = Convert.ToInt16(endYear.ToString().Substring(0, 2));
+
+            int decadeStartYear = Convert.ToInt16(startYear.ToString().Substring(0, 2) + "00");
+            int decadeEndYear = Convert.ToInt16((endYear + 100).ToString().Substring(0, 2) + "00");

             var regxStartYear = string.Join("|",
                 Enumerable.Range(subStartYear, ((subEndYear - subStartYear) + 1)));

             //Hp --> Logic: Validation for date format in yyyymmdd
-            var regxDateBuilder = new StringBuilder();
+            StringBuilder regxDateBuilder = new StringBuilder();

             //Validation for 31 days a year (Jan,Mar,May,Jul,Oct,Dec)
-            regxDateBuilder.Append(
-                "((((" + regxStartYear + ")[0-9]{2})(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))");
+            regxDateBuilder.Append(string.Join(delimeter,
+                $"(((({regxStartYear})[0-9]{{2}})",
+                "(0[13578]|1[02])",
+                $"(0[1-9]|[12][0-9]|3[01]))"));
+
             regxDateBuilder.Append("|");

             //Validation for 30 days a year (Apr,Jun,Sep,Nov)
-            regxDateBuilder.Append(
-                "(((" + regxStartYear + ")[0-9]{2})(0[469]|11)(0[1-9]|[12][0-9]|30))");
+            regxDateBuilder.Append(string.Join(delimeter,
+                $"((({regxStartYear})[0-9]{{2}})",
+                "(0[469]|11)",
+                "(0[1-9]|[12][0-9]|30))"));
+
             regxDateBuilder.Append("|");

             //Validation for 28 days a year (Feb)
-            regxDateBuilder.Append(
-                "(((" + regxStartYear + ")[0-9]{2})(02)(0[1-9]|1[0-9]|2[0-8]))");
+            regxDateBuilder.Append(string.Join(delimeter,
+                $"((({regxStartYear})[0-9]{{2}})",
+                "(02)",
+                "(0[1-9]|1[0-9]|2[0-8]))"));
+
             regxDateBuilder.Append("|");

             //Rules for validation of Leap year
             //1. Any year that can be evenly divided by 4 (such as 2012, 2016, etc)
             //2. If it can be evenly divided by 400, then it is (such as 2000, 2400)
             //3. If it can can be evenly divided by 100, then it isn't (such as 2100, 2200, 2300, 2500, 2600, etc)
-            var leapYears = string.Join("|",
+            var misLeapYears = string.Join("|",
                 Enumerable.Range(decadeStartYear, ((decadeEndYear - decadeStartYear) + 1))
-                .Where(y => ((DateTime.IsLeapYear(y)) && (0 == (y % 400)))));
-
-            var regxLeapYears = string.IsNullOrEmpty(leapYears) ?
-                string.Empty : string.Concat("|", leapYears);
-
-            regxDateBuilder.Append("((((" + regxStartYear + ")(04|08|[2468][048]|[13579][26]))" +
-                regxLeapYears + ")(02)(29)))");
+                .Where(Y => ((DateTime.IsLeapYear(Y)) && (0 == (Y % 400)))));
+
+            var regxMisLeapYears = string.IsNullOrEmpty(misLeapYears) ?
+                string.Empty : string.Concat("|", misLeapYears);
+
+            regxDateBuilder.Append(string.Join(delimeter,
+                $"(((({regxStartYear})(04|08|[2468][048]|[13579][26])){regxMisLeapYears})",
+                "(02)",
+                "(29)))"));

             return (regxDateBuilder.ToString());
         }


Fixed compile issue

Fixed compile issue

--- VersionrCore/Area.cs
+++ VersionrCore/Area.cs
@@ -3556,7 +3556,7 @@
 			}
 		}

-        enum RecordUpdateType
+        public enum RecordUpdateType
         {
             Created,
             Updated,


Fixed issue with read only files

Fixed issue with read only files

--- VersionrCore/Area.cs
+++ VersionrCore/Area.cs
@@ -2912,11 +2912,23 @@
                                     Printer.PrintDiagnostics(" > #c#MR:## Two way merge success.");
 #endif
                                     if (result != ml)
+                                    {
+                                        if (ml.IsReadOnly)
+                                            ml.IsReadOnly = false;
                                         ml.Delete();
+                                    }
                                     if (result != mr)
+                                    {
+                                        if (mr.IsReadOnly)
+                                            mr.IsReadOnly = false;
                                         mr.Delete();
+                                    }
                                     if (result != mf)
+                                    {
+                                        if (mf.IsReadOnly)
+                                            mf.IsReadOnly = false;
                                         mf.Delete();
+                                    }
                                     result.MoveTo(ml.FullName);
 								    if (!updateMode)
 								    {
@@ -2933,6 +2945,8 @@
 #if MERGE_DIAGNOSTICS
                                     Printer.PrintDiagnostics(" > #c#MR:## Two way merge failed, conflict.");
 #endif
+                                    if (mr.IsReadOnly)
+                                        mr.IsReadOnly = false;
                                     mr.Delete();
                                     LocalData.AddStageOperation(new StageOperation() { Type = StageOperationType.Conflict, Operand1 = x.CanonicalName });
 								    if (!updateMode)
@@ -2977,13 +2991,29 @@
                                     Printer.PrintDiagnostics(" > #c#MR:## Three way merge success.");
 #endif
                                     if (result != ml)
+                                    {
+                                        if (ml.IsReadOnly)
+                                            ml.IsReadOnly = false;
                                         ml.Delete();
+                                    }
                                     if (result != mr)
+                                    {
+                                        if (mr.IsReadOnly)
+                                            mr.IsReadOnly = false;
                                         mr.Delete();
+                                    }
                                     if (result != mf)
+                                    {
+                                        if (mf.IsReadOnly)
+                                            mf.IsReadOnly = false;
                                         mf.Delete();
+                                    }
                                     if (result != mb)
+                                    {
+                                        if (mb.IsReadOnly)
+                                            mb.IsReadOnly = false;
                                         mb.Delete();
+                                    }
                                     result.MoveTo(ml.FullName);
 								    if (!updateMode)
                                     {
@@ -3115,8 +3145,12 @@
                 if (x.IsFile)
 				{
 					try
-					{
-						System.IO.File.Delete(path);
+                    {
+                        System.IO.FileInfo fi = new FileInfo(path);
+                        if (fi.IsReadOnly)
+                            fi.IsReadOnly = false;
+
+                        System.IO.File.Delete(path);
 					}
 					catch
 					{
@@ -3153,7 +3187,11 @@
             foreach (var x in parentData)
             {
                 if (x.TemporaryFile != null)
+                {
+                    if (x.TemporaryFile.IsReadOnly)
+                        x.TemporaryFile.IsReadOnly = false;
                     x.TemporaryFile.Delete();
+                }
             }
             LocalData.BeginTransaction();
             foreach (var x in filetimesToRemove)
@@ -3368,9 +3406,15 @@
                             FileInfo info = Merge2Way(x, foreign, localRecord, local, transientResult.TemporaryFile, false, ref resolveAll);
                             if (info != transientResult.TemporaryFile)
                             {
+                                if (transientResult.TemporaryFile.IsReadOnly)
+                                    transientResult.TemporaryFile.IsReadOnly = false;
                                 transientResult.TemporaryFile.Delete();
                                 System.IO.File.Move(info.FullName, transientResult.TemporaryFile.FullName);
                             }
+                            if (foreign.IsReadOnly)
+                                foreign.IsReadOnly = false;
+                            if (local.IsReadOnly)
+                                local.IsReadOnly = false;
                             foreign.Delete();
                             local.Delete();
                             transientResult.TemporaryFile = new FileInfo(transientResult.TemporaryFile.FullName);
@@ -3402,13 +3446,23 @@
                             FileInfo info = Merge3Way(x, foreign, localRecord, local, parentObject.Record, parentFile, transientResult.TemporaryFile, false, ref resolveAll);
                             if (info != transientResult.TemporaryFile)
                             {
+                                if (transientResult.TemporaryFile.IsReadOnly)
+                                    transientResult.TemporaryFile.IsReadOnly = false;
                                 transientResult.TemporaryFile.Delete();
                                 System.IO.File.Move(info.FullName, transientResult.TemporaryFile.FullName);
                             }
+                            if (foreign.IsReadOnly)
+                                foreign.IsReadOnly = false;
+                            if (local.IsReadOnly)
+                                local.IsReadOnly = false;
                             foreign.Delete();
                             local.Delete();
                             if (parentObject.TemporaryFile == null)
+                            {
+                                if (parentFile.IsReadOnly)
+                                    parentFile.IsReadOnly = false;
                                 parentFile.Delete();
+                            }
                             transientResult.TemporaryFile = new FileInfo(transientResult.TemporaryFile.FullName);
                             results.Add(transientResult);
                         }
@@ -3463,7 +3517,11 @@
             foreach (var x in parentData)
             {
                 if (x.TemporaryFile != null)
+                {
+                    if (x.TemporaryFile.IsReadOnly)
+                        x.TemporaryFile.IsReadOnly = false;
                     x.TemporaryFile.Delete();
+                }
             }
             return results;
         }
@@ -3483,7 +3541,10 @@
             System.IO.File.Copy(ml, ml + ".mine", true);
             if (!isBinary && Utilities.DiffTool.Merge3Way(mb, ml, mf, mr, Directives.ExternalMerge))
             {
-                System.IO.File.Delete(ml + ".mine");
+                FileInfo fi = new FileInfo(ml + ".mine");
+                if (fi.IsReadOnly)
+                    fi.IsReadOnly = false;
+                fi.Delete();
                 Printer.PrintMessage("#s# - Resolved.##");
                 return temporaryFile;
             }
@@ -3493,13 +3554,19 @@
                 if (resolution == ResolveType.Mine)
                 {
                     Printer.PrintMessage("#s# - Resolved (mine).##");
-                    System.IO.File.Delete(ml + ".mine");
+                    FileInfo fi = new FileInfo(ml + ".mine");
+                    if (fi.IsReadOnly)
+                        fi.IsReadOnly = false;
+                    fi.Delete();
                     return local;
                 }
                 if (resolution == ResolveType.Theirs)
                 {
                     Printer.PrintMessage("#s# - Resolved (theirs).##");
-                    System.IO.File.Delete(ml + ".mine");
+                    FileInfo fi = new FileInfo(ml + ".mine");
+                    if (fi.IsReadOnly)
+                        fi.IsReadOnly = false;
+                    fi.Delete();
                     return foreign;
                 }
                 else
@@ -3534,7 +3601,10 @@
             System.IO.File.Copy(ml, ml + ".mine", true);
             if (!isBinary && Utilities.DiffTool.Merge(ml, mf, mr, Directives.ExternalMerge2Way))
             {
-                System.IO.File.Delete(ml + ".mine");
+                FileInfo fi = new FileInfo(ml + ".mine");
+                if (fi.IsReadOnly)
+                    fi.IsReadOnly = false;
+                fi.Delete();
                 Printer.PrintMessage("#s# - Resolved.##");
                 return temporaryFile;
             }
@@ -3544,13 +3614,19 @@
                 if (resolution == ResolveType.Mine)
                 {
                     Printer.PrintMessage("#s# - Resolved (mine).##");
-                    System.IO.File.Delete(ml + ".mine");
+                    FileInfo fi = new FileInfo(ml + ".mine");
+                    if (fi.IsReadOnly)
+                        fi.IsReadOnly = false;
+                    fi.Delete();
                     return local;
                 }
                 if (resolution == ResolveType.Theirs)
                 {
                     Printer.PrintMessage("#s# - Resolved (theirs).##");
-                    System.IO.File.Delete(ml + ".mine");
+                    FileInfo fi = new FileInfo(ml + ".mine");
+                    if (fi.IsReadOnly)
+                        fi.IsReadOnly = false;
+                    fi.Delete();
                     return foreign;
                 }
                 else
@@ -3895,6 +3971,8 @@
                             deletionList.Add(x.FilesystemEntry);
                         else
                         {
+                            if (x.FilesystemEntry.Info.IsReadOnly)
+                                x.FilesystemEntry.Info.IsReadOnly = false;
                             x.FilesystemEntry.Info.Delete();
                             RemoveFileTimeCache(x.CanonicalName);
                             Printer.PrintMessage("Purging unversioned file {0}", x.CanonicalName);
@@ -3909,6 +3987,9 @@
                 {
                     try
                     {
+                        if (x.FilesystemEntry.Info.IsReadOnly)
+                            x.FilesystemEntry.Info.IsReadOnly = false;
+
                         x.FilesystemEntry.Info.Delete();
                         RemoveFileTimeCache(x.CanonicalName);
                         Printer.PrintMessage("Purging copied file {0}", x.CanonicalName);
@@ -4198,7 +4279,10 @@
                         try
                         {
                             RemoveFileTimeCache(x.CanonicalName, false);
-                            System.IO.File.Delete(path);
+                            System.IO.FileInfo fi = new FileInfo(path);
+                            if (fi.IsReadOnly)
+                                fi.IsReadOnly = false;
+                            fi.Delete();
                             if (verbose)
                                 Printer.PrintMessage("#b#Deleted## {0}", x.CanonicalName);
                             deletions++;
@@ -4668,6 +4752,8 @@
             foreach (var x in deletionList)
             {
                 Printer.PrintMessage("#e#Deleted:## #b#{0}##", x.CanonicalName);
+                if (x.FilesystemEntry.Info.IsReadOnly)
+                    x.FilesystemEntry.Info.IsReadOnly = false;
                 x.FilesystemEntry.Info.Delete();
             }
             foreach (var x in directoryDeletionList.OrderByDescending(x => x.CanonicalName.Length))
@@ -4707,6 +4793,8 @@
                                 Printer.PrintMessage("#w#Deleting:## {0}", GetLocalCanonicalName(mineFile.FullName));
                                 try
                                 {
+                                    if (mineFile.IsReadOnly)
+                                        mineFile.IsReadOnly = false;
                                     mineFile.Delete();
                                 }
                                 catch (Exception e)
@@ -4719,6 +4807,8 @@
                                 Printer.PrintMessage("#w#Deleting:## {0}", GetLocalCanonicalName(theirsFile.FullName));
                                 try
                                 {
+                                    if (theirsFile.IsReadOnly)
+                                        theirsFile.IsReadOnly = false;
                                     theirsFile.Delete();
                                 }
                                 catch (Exception e)
@@ -4731,6 +4821,8 @@
                                 Printer.PrintMessage("#w#Deleting:## {0}", GetLocalCanonicalName(baseFile.FullName));
                                 try
                                 {
+                                    if (baseFile.IsReadOnly)
+                                        baseFile.IsReadOnly = false;
                                     baseFile.Delete();
                                 }
                                 catch (Exception e)
@@ -4751,6 +4843,8 @@
             foreach (var x in deletionList)
             {
                 Printer.PrintMessage("#e#Deleted:## #b#{0}##", x.CanonicalName);
+                if (x.FilesystemEntry.Info.IsReadOnly)
+                    x.FilesystemEntry.Info.IsReadOnly = false;
                 x.FilesystemEntry.Info.Delete();
             }
             foreach (var x in directoryDeletionList.OrderByDescending(x => x.CanonicalName.Length))


Wait for server started messge.

Wait for server started messge.

--- test/Vault.Tests/VaultTestServer.cs
+++ test/Vault.Tests/VaultTestServer.cs
@@ -4,7 +4,6 @@
 using System.IO;
 using System.Net;
 using System.Net.Sockets;
-using System.Threading;

 namespace Vault.Tests
 {
@@ -39,7 +38,11 @@
                 throw new Exception($"Process did not start successfully: {_process.StandardError}");
             }

-            Thread.Sleep(1000);
+            var line = _process.StandardOutput.ReadLine();
+            while (line?.StartsWith("==> Vault server started!") == false)
+            {
+                line = _process.StandardOutput.ReadLine();
+            }

             if (_process.HasExited)
             {
@@ -71,6 +74,7 @@
             {
                 try
                 {
+                    _process.CloseMainWindow();
                     _process.Kill();
                 }
                 catch { }


Made branch names not case-sensitive

Made branch names not case-sensitive

--- VersionrCore/Area.cs
+++ VersionrCore/Area.cs
@@ -1024,7 +1024,7 @@

         public List<Objects.Branch> GetBranchByName(string name)
         {
-            return Database.Table<Objects.Branch>().Where(x => x.Name == name && x.Terminus == null).ToList();
+            return Database.Table<Objects.Branch>().Where(x.Terminus == null).Where(x => x.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)).ToList();
         }

         public Objects.Branch CurrentBranch
@@ -3218,7 +3218,8 @@
             if (!System.Text.RegularExpressions.Regex.IsMatch(v, "^\\w+$"))
                 throw new Exception("Invalid branch name.");
             Printer.PrintDiagnostics("Checking for existing branch \"{0}\".", v);
-            var branch = Database.Find<Branch>(x => x.Name == v && x.Terminus == null);
+            var branches = Database.Table<Branch>().Where(x => x.Terminus == null);
+            var branch = branches.Where(x => x.Name.Equals(v, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
             if (branch != null)
                 throw new Exception(string.Format("Branch \"{0}\" already exists!", v));


enhanced comments

enhanced comments

--- YAGL/IModelAGraph.cs
+++ YAGL/IModelAGraph.cs
@@ -38,7 +38,7 @@
         /// </summary>
         /// <param name="edge">The <see cref="Edge{TVertex}"/> object for which the adjacent edges will be searched.</param>
         /// <returns>The edges adjacent to <paramref name="edge"/>.</returns>
-        /// <remarks>The parameter <paramref name="edge"/> is expected to be contained in this instance.</remarks>
+        /// <remarks>The parameter <paramref name="edge"/> is expected to be contained in the set of edges of this instance.</remarks>
         IEnumerable<Edge<TVertex>> AdjacentEdgesOfEdge(Edge<TVertex> edge);

         /// <summary>
@@ -47,7 +47,7 @@
         /// </summary>
         /// <param name="vertex">The vertex for which the adjacent vertices will be searched.</param>
         /// <returns>The vertices adjacent to the parameter <paramref name="vertex"/>.</returns>
-        /// <remarks>The parameter <paramref name="vertex"/> is expected to be contained in this instance.</remarks>
+        /// <remarks>The parameter <paramref name="vertex"/> is expected to be contained in the set of vertices of this instance.</remarks>
         IEnumerable<TVertex> AdjacentVerticesOfVertex(TVertex vertex);

         /// <summary>
@@ -56,7 +56,7 @@
         /// </summary>
         /// <param name="edges">The set of edges to determine if they are adjacent.</param>
         /// <returns><see cref="true"/> if the set of edges <paramref name="edges"/> are adjacent in this instance, <see cref="false"/> otherwise.</returns>
-        /// <remarks>Each <see cref="Edge{TVertex}"/> object contained in <paramref name="edges"/> is expected to be contained in this instance.</remarks>
+        /// <remarks>Each <see cref="Edge{TVertex}"/> object contained in <paramref name="edges"/> is expected to be contained in the set of edges of this instance.</remarks>
         bool AreEdgesAdjacent(params Edge<TVertex>[] edges);

         /// <summary>
@@ -65,21 +65,21 @@
         /// </summary>
         /// <param name="vertices">The vertices to determine if they are adjacent in this instance.</param>
         /// <returns><see cref="true"/> if the vertices are adjacent in this instance, <see cref="false"/> otherwise.</returns>
-        /// <remarks>Each vertex contained in <paramref name="vertices"/> is expected to be contained in this instance.</remarks>
+        /// <remarks>Each vertex contained in <paramref name="vertices"/> is expected to be contained in the set of vertices of this instance.</remarks>
         bool AreVerticesAdjacent(params TVertex[] vertices);

         /// <summary>
         /// Determine whether this instance contains the edge <paramref name="edge"/>.
         /// </summary>
         /// <param name="edge">The edge to determine if it is contained in this instance.</param>
-        /// <returns><see cref="true"/> if the parameter <paramref name="edge"/> is contained in this instance, <see cref="false"/> otherwise.</returns>
+        /// <returns><see cref="true"/> if the parameter <paramref name="edge"/> is contained in the set of edges of this instance, <see cref="false"/> otherwise.</returns>
         bool ContainsEdge(Edge<TVertex> edge);

         /// <summary>
         /// Determine whether this instance contains the given set of edges.
         /// </summary>
         /// <param name="edges">The edges to determine if they are contained in this instance.</param>
-        /// <returns><see cref="true"/> if each <see cref="Edge{TVertex}"/> object of the parameter <paramref name="edges"/> is contained in this instance, <see cref="false"/> otherwise.</returns>
+        /// <returns><see cref="true"/> if each <see cref="Edge{TVertex}"/> object of the parameter <paramref name="edges"/> is contained in the set of edges of this instance, <see cref="false"/> otherwise.</returns>
         bool ContainsEdges(params Edge<TVertex>[] edges);

         /// <summary>


Missed from previous commit.

Missed from previous commit.

--- LightBlue.WebHost/Program.cs
+++ LightBlue.WebHost/Program.cs
@@ -104,7 +104,7 @@
                 typeof(HostStub).Assembly.FullName,
                 typeof(HostStub).FullName);

-            stub.ConfigureTracing(new TraceShipper());
+            stub.ConfigureTracing(new ConsoleTraceShipper());

             AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionBehaviour.UnhandledExceptionHandler(webHostArgs.Title);


Delete Class1.cs

Delete Class1.cs

--- VoronoiLib/Class1.cs
+++ VoronoiLib/Class1.cs
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace VoronoiLib
-{
-    public class Class1
-    {
-    }
-}


DNN-10607: Setting the valid after UpdateElement Method

--- Web/EditorControl.cs
+++ Web/EditorControl.cs
@@ -1357,7 +1357,7 @@
             //{
                 var postBackScript =
                     string.Format(
-                        @"if (typeof Page_IsValid !== 'undefined' && !Page_IsValid) return; if (CKEDITOR && CKEDITOR.instances && CKEDITOR.instances.{0}) {{ CKEDITOR.instances.{0}.updateElement(); CKEDITOR.instances.{0}.destroy(); }}",
+                         @" if (CKEDITOR && CKEDITOR.instances && CKEDITOR.instances.{0}) {{ CKEDITOR.instances.{0}.updateElement();  if (typeof Page_IsValid !== 'undefined' && !Page_IsValid) return; CKEDITOR.instances.{0}.destroy(); }}",
                         editorFixedId);

                 RegisterOnSubmitStatement(


update

update

--- Demos/Skybox/FormMain.cs
+++ Demos/Skybox/FormMain.cs
@@ -91,7 +91,7 @@
             var center = new vec3(0, 0, 0);
             var up = new vec3(0, 1, 0);
             var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height);
-            this.teapot = TeapotNode.Create();
+            this.teapot = TeapotNode.Create(); this.teapot.Scale *= 3;
             teapot.Children.Add(new LegacyBoundingBoxNode(teapot.ModelSize));
             var totalBmp = new Bitmap(@"cubemaps_skybox.png");
             this.skybox = SkyboxNode.Create(totalBmp); this.skybox.Scale *= 60;


wpf MapControl checking for null on DataChangedEventArgs

--- Mapsui.Windows/MapControl.cs
+++ Mapsui.Windows/MapControl.cs
@@ -410,7 +410,12 @@
             }
             else
             {
-                if (e.Cancelled)
+                if (e == null)
+                {
+                    _errorMessage = "Unexpected error: DataChangedEventArgs can not be null";
+                    OnErrorMessageChanged(EventArgs.Empty);
+                }
+                else if (e.Cancelled)
                 {
                     _errorMessage = "Cancelled";
                     OnErrorMessageChanged(EventArgs.Empty);
@@ -429,7 +434,6 @@
                 {
                     RefreshGraphics();
                 }
-
             }
         }


Add debug controls to move model

Add debug controls to move model

--- Game/Game/Game1.cs
+++ Game/Game/Game1.cs
@@ -87,14 +87,26 @@
                 Exit();
             }

+            // Debug controls. Input will be moved into the ECS in the future.
+            var transform = player.GetComponent<TransformComponent>();
+            if (Keyboard.GetState().IsKeyDown(Keys.Up))
+            {
+                transform.Position += new Vector3(0, 0, -1);
+            }
+            else if (Keyboard.GetState().IsKeyDown(Keys.Down))
+            {
+                transform.Position += new Vector3(0, 0, 1);
+            }
+
             if (Keyboard.GetState().IsKeyDown(Keys.Left))
             {
-                player.GetComponent<TransformComponent>().Position += new Vector3(0, 0, -1);
+                var rot = Quaternion.CreateFromYawPitchRoll(0, 0, 0.25f);
+                transform.Rotation *= rot;
             }
-
-            if (Keyboard.GetState().IsKeyDown(Keys.Right))
+            else if (Keyboard.GetState().IsKeyDown(Keys.Right))
             {
-                player.GetComponent<TransformComponent>().Position += new Vector3(0, 0, 1);
+                var rot = Quaternion.CreateFromYawPitchRoll(0, 0, -0.25f);
+                transform.Rotation *= rot;
             }

             entityWorld.Update(gameTime.ElapsedGameTime);


Fix path separator for unix file systems

--- MetadataViewer/HtmlHelper.cs
+++ MetadataViewer/HtmlHelper.cs
@@ -26,7 +26,7 @@
         {
             var sb = new StringBuilder();

-            var editorPath = Path.Combine(appPaths.ProgramSystemPath, "dashboard-ui\\components\\metadataeditor\\metadataeditor.js");
+            var editorPath = Path.Combine(appPaths.ProgramSystemPath, "dashboard-ui", "components", "metadataeditor", "metadataeditor.js");

             var lines = File.ReadLines(editorPath);


- Adding comments for Validator class

- Adding comments for Validator class

--- Mixer.Base/Util/Validator.cs
+++ Mixer.Base/Util/Validator.cs
@@ -4,8 +4,16 @@

 namespace Mixer.Base.Util
 {
+    /// <summary>
+    /// Variable validation helper class
+    /// </summary>
     public static class Validator
     {
+        /// <summary>
+        /// Validates whether the specified string has a non-null and non-empty value. Throws an ArgumentException if it does not.
+        /// </summary>
+        /// <param name="value">The string to check</param>
+        /// <param name="name">The name of the string</param>
         public static void ValidateString(string value, string name)
         {
             if (string.IsNullOrEmpty(value))
@@ -14,6 +22,11 @@
             }
         }

+        /// <summary>
+        /// Validates whether the specified variable is not null. Throws an ArgumentException if it is.
+        /// </summary>
+        /// <param name="value">The variable to check</param>
+        /// <param name="name">The name of the variable</param>
         public static void ValidateVariable(object value, string name)
         {
             if (value == null)
@@ -22,6 +35,11 @@
             }
         }

+        /// <summary>
+        /// Validates whether the specified list has is not null and empty. Throws an ArgumentException if it is.
+        /// </summary>
+        /// <param name="value">The list to check</param>
+        /// <param name="name">The name of the list</param>
         public static void ValidateList<T>(IEnumerable<T> value, string name)
         {
             Validator.ValidateVariable(value, name);


revert no-op on TrySlimUTXO

revert no-op on TrySlimUTXO

--- NBitcoin/BIP174/PSBTInput.cs
+++ NBitcoin/BIP174/PSBTInput.cs
@@ -462,9 +462,6 @@
 					errors.Add(new PSBTError(Index, "Input finalized, but witness script is not null"));
 			}

-			// if (witness_utxo != null && non_witness_utxo != null)
-			// 	errors.Add(new PSBTError(Index, "witness utxo and non witness utxo simultaneously present"));
-
 			if (witness_script != null && witness_utxo == null)
 				errors.Add(new PSBTError(Index, "witness script present but no witness utxo"));

@@ -889,23 +886,23 @@
 		/// </summary>
 		public bool TrySlimUTXO()
 		{
-			// if (NonWitnessUtxo == null)
-			// 	return false;
-			// var coin = GetSignableCoin();
-			// if (coin == null)
-			// 	return false;
-
-			// if (Parent.Network.Consensus.NeverNeedPreviousTxForSigning ||
-			// 	coin.GetHashVersion() == HashVersion.Witness)
-			// {
-			// 	if (WitnessUtxo == null)
-			// 	{
-			// 		if (TxIn.PrevOut.N < NonWitnessUtxo.Outputs.Count)
-			// 			WitnessUtxo = NonWitnessUtxo.Outputs[TxIn.PrevOut.N];
-			// 	}
-			// 	NonWitnessUtxo = null;
-			// 	return true;
-			// }
+			if (NonWitnessUtxo == null)
+				return false;
+			var coin = GetSignableCoin();
+			if (coin == null)
+				return false;
+
+			if (Parent.Network.Consensus.NeverNeedPreviousTxForSigning ||
+				coin.GetHashVersion() == HashVersion.Witness)
+			{
+				if (WitnessUtxo == null)
+				{
+					if (TxIn.PrevOut.N < NonWitnessUtxo.Outputs.Count)
+						WitnessUtxo = NonWitnessUtxo.Outputs[TxIn.PrevOut.N];
+				}
+				NonWitnessUtxo = null;
+				return true;
+			}
 			return false;
 		}


Asserting on UrlPath being set correctly

--- tests/SendGrid.Tests/Integration.cs
+++ tests/SendGrid.Tests/Integration.cs
@@ -5998,17 +5998,21 @@
         [Fact]
         public void TestTakesProxyAsConstructorArgumentAndInitiailsesHttpClient()
         {
-            var sg = new SendGridClient(new FakeWebProxy(), fixture.apiKey);
-
-            Assert.NotNull(sg);
+            var urlPath = "urlPath";
+
+            var sg = new SendGridClient(new FakeWebProxy(), fixture.apiKey, urlPath: "urlPath");
+
+            Assert.Equal(sg.UrlPath, urlPath);
         }

         [Fact]
         public void TestTakesNullProxyAsConstructorArgumentAndInitiailsesHttpClient()
         {
-            var sg = new SendGridClient(null as IWebProxy, fixture.apiKey);
-
-            Assert.NotNull(sg);
+            var urlPath = "urlPath";
+
+            var sg = new SendGridClient(null as IWebProxy, fixture.apiKey, urlPath: "urlPath");
+
+            Assert.Equal(sg.UrlPath, urlPath);
         }

         /// <summary>


sample: fix CustomScrollable sample to prevent too high Upper values

Upper values having higher values than PageSize or PageIncrement cause
rendering issues. This commit is a small adaptation of a fix from one
of the edge cases pointed out in this commit in hyena:
https://git.gnome.org/browse/hyena/commit/?h=gtk3&id=0745bfb75809886925dfa49a57c79e5f71565d08

--- sample/CustomScrollableWidget.cs
+++ sample/CustomScrollableWidget.cs
@@ -184,6 +184,9 @@
 			if (hadjustment.Value + hadjustment.PageSize > hadjustment.Upper) {
 				hadjustment.Value = hadjustment.Upper - hadjustment.PageSize;
 			}
+			if (hadjustment.Upper > 0 && hadjustment.Upper < hadjustment.PageSize) {
+				hadjustment.Upper = hadjustment.PageSize;
+			}
 			hadjustment.Change ();
 		}

@@ -193,6 +196,9 @@
 			if (vadjustment.Value + vadjustment.PageSize > vadjustment.Upper) {
 				vadjustment.Value = vadjustment.Upper - vadjustment.PageSize;
 			}
+			if (vadjustment.Upper > 0 && vadjustment.Upper < vadjustment.PageSize) {
+				vadjustment.Upper = vadjustment.PageSize;
+			}
 			vadjustment.Change ();
 		}
 	}


And of course missed something.

And of course missed something.

--- fileserve/Program.cs
+++ fileserve/Program.cs
@@ -1,4 +1,4 @@
-namespace fileserve
+namespace unlimitedinf.fileserve
 {
     using System;
     using System.Collections.Generic;


[Core] Fix potential NullReferenceExceptions when using lang

--- Oxide.Core/Libraries/Lang.cs
+++ Oxide.Core/Libraries/Lang.cs
@@ -232,7 +232,7 @@
                 }

                 var defaultLangFile = GetMessageFile(plugin.Name);
-                if (MergeMessages(langFile, defaultLangFile) && File.Exists(Path.Combine(Interface.Oxide.LangDirectory, file)))
+                if (defaultLangFile != null && MergeMessages(langFile, defaultLangFile) && File.Exists(Path.Combine(Interface.Oxide.LangDirectory, file)))
                     File.WriteAllText(Path.Combine(Interface.Oxide.LangDirectory, file), JsonConvert.SerializeObject(langFile, Formatting.Indented));

                 AddLangFile(file, langFile, plugin);
@@ -251,18 +251,24 @@
         private bool MergeMessages(Dictionary<string, string> existingMessages, Dictionary<string, string> messages)
         {
             var changed = false;
+
             foreach (var message in messages)
             {
                 if (existingMessages.ContainsKey(message.Key)) continue;
                 existingMessages.Add(message.Key, message.Value);
                 changed = true;
             }
-            foreach (var message in existingMessages.Keys.ToArray())
-            {
-                if (messages.ContainsKey(message)) continue;
-                existingMessages.Remove(message);
-                changed = true;
-            }
+
+            if (existingMessages.Count > 0)
+            {
+                foreach (var message in existingMessages.Keys.ToArray())
+                {
+                    if (messages.ContainsKey(message)) continue;
+                    existingMessages.Remove(message);
+                    changed = true;
+                }
+            }
+
             return changed;
         }


Update Oxide.Core for Covalence changes

Update Oxide.Core for Covalence changes

--- Oxide.Core/Plugins/Plugin.cs
+++ Oxide.Core/Plugins/Plugin.cs
@@ -16,15 +16,9 @@
     /// </summary>
     public abstract class Plugin
     {
-        public static implicit operator bool(Plugin plugin)
-        {
-            return plugin != null;
-        }
-
-        public static bool operator !(Plugin plugin)
-        {
-            return !(bool)plugin;
-        }
+        public static implicit operator bool(Plugin plugin) => plugin != null;
+
+        public static bool operator !(Plugin plugin) => !(bool)plugin;

         /// <summary>
         /// Gets the source file name, if any
@@ -150,10 +144,7 @@
         /// Subscribes this plugin to the specified hook
         /// </summary>
         /// <param name="hookname"></param>
-        protected void Subscribe(string hookname)
-        {
-            Manager.SubscribeToHook(hookname, this);
-        }
+        protected void Subscribe(string hookname) => Manager.SubscribeToHook(hookname, this);

         /// <summary>
         /// Called when this plugin has been added to the specified manager
@@ -163,7 +154,7 @@
         {
             Manager = manager;
             if (HasConfig) LoadConfig();
-            if (OnAddedToManager != null) OnAddedToManager(this, manager);
+            OnAddedToManager?.Invoke(this, manager);
             RegisterWithCovalence();
         }

@@ -175,7 +166,7 @@
         {
             UnregisterWithCovalence();
             if (Manager == manager) Manager = null;
-            if (OnRemovedFromManager != null) OnRemovedFromManager(this, manager);
+            OnRemovedFromManager?.Invoke(this, manager);
         }

         /// <summary>
@@ -183,7 +174,6 @@
         /// </summary>
         public virtual void Load()
         {
-
         }

         /// <summary>
@@ -218,14 +208,12 @@
                 {
                     stoppedAt = Interface.Oxide.Now;
                     var runTime = stoppedAt - startedAt;
-                    if (runTime > 0.5)
-                        Interface.Oxide.LogWarning($"CallHook '{hookname}' on plugin '{Name} v{Version}' took: {(runTime)*1000:0}ms");
+                    if (runTime > 0.5) Interface.Oxide.LogWarning($"CallHook '{hookname}' on plugin '{Name} v{Version}' took: {(runTime)*1000:0}ms");
                     sum += runTime;
                     if (stoppedAt - averageAt > 10)
                     {
                         sum /= stoppedAt - averageAt;
-                        if (sum > 0.25)
-                            Interface.Oxide.LogWarning($"CallHook '{hookname}' on plugin '{Name} v{Version}' took average: {sum*1000:0}ms");
+                        if (sum > 0.25) Interface.Oxide.LogWarning($"CallHook '{hookname}' on plugin '{Name} v{Version}' took average: {sum*1000:0}ms");
                         sum = 0;
                         averageAt = 0;
                     }
@@ -239,10 +227,7 @@
         /// <param name="hookname"></param>
         /// <param name="args"></param>
         /// <returns></returns>
-        public object Call(string hookname, params object[] args)
-        {
-            return CallHook(hookname, args);
-        }
+        public object Call(string hookname, params object[] args) => CallHook(hookname, args);

         /// <summary>
         /// Calls a hook on this plugin and converts the return value to the specified type
@@ -251,9 +236,7 @@
         /// <param name="hookname"></param>
         /// <param name="args"></param>
         /// <returns></returns>
-        public T Call<T>(string hookname, params object[] args) {
-            return (T)Convert.ChangeType(CallHook(hookname, args), typeof(T));
-        }
+        public T Call<T>(string hookname, params object[] args) => (T)Convert.ChangeType(CallHook(hookname, args), typeof(T));

         /// <summary>
         /// Called when it's time to run a hook on this plugin
@@ -267,11 +250,7 @@
         /// Raises an error on this plugin
         /// </summary>
         /// <param name="message"></param>
-        public void RaiseError(string message)
-        {
-            if (OnError != null)
-                OnError(this, message);
-        }
+        public void RaiseError(string message) => OnError?.Invoke(this, message);

         public void TrackStart()
         {
@@ -303,7 +282,7 @@
         /// </summary>
         protected virtual void LoadConfig()
         {
-            Config = new DynamicConfigFile(Path.Combine(Manager.ConfigPath, string.Format("{0}.json", Name)));
+            Config = new DynamicConfigFile(Path.Combine(Manager.ConfigPath, $"{Name}.json"));
             if (Config.Exists())
             {
                 try
@@ -312,7 +291,7 @@
                 }
                 catch (Exception ex)
                 {
-                    RaiseError(string.Format("Failed to load config file (is the config file corrupt?) ({0})", ex.Message));
+                    RaiseError($"Failed to load config file (is the config file corrupt?) ({ex.Message})");
                 }
             }
             else
@@ -325,11 +304,7 @@
         /// <summary>
         /// Populates the config with default settings
         /// </summary>
-        protected virtual void LoadDefaultConfig()
-        {
-            // Call LoadDefaultConfig if it was defined as a private hook
-            CallHook("LoadDefaultConfig", null);
-        }
+        protected virtual void LoadDefaultConfig() => CallHook("LoadDefaultConfig", null);

         /// <summary>
         /// Saves the config file for this plugin
@@ -343,7 +318,7 @@
             }
             catch (Exception ex)
             {
-                RaiseError(string.Format("Failed to save config file (does the config have illegal objects in it?) ({0})", ex.Message));
+                RaiseError($"Failed to save config file (does the config have illegal objects in it?) ({ex.Message})");
             }
         }

@@ -367,10 +342,7 @@
         private void RegisterWithCovalence()
         {
             var covalence = Interface.Oxide.GetLibrary<Covalence>();
-            foreach (var pair in commandInfos)
-            {
-                covalence.RegisterCommand(pair.Key, CovalenceCommandCallback);
-            }
+            foreach (var pair in commandInfos) covalence.RegisterCommand(pair.Key, CovalenceCommandCallback);
         }

         private bool CovalenceCommandCallback(string cmd, CommandType type, IPlayer caller, string[] args)
@@ -387,11 +359,9 @@
             }
             foreach (var perm in cmdInfo.PermissionsRequired)
             {
-                if (!caller.HasPermission(perm))
-                {
-                    caller.ConnectedPlayer?.SendChatMessage(string.Format("Missing permission '{0}' to run command '{1}'!", perm, cmd));
-                    return true;
-                }
+                if (caller.HasPermission(perm)) continue;
+                caller.ConnectedPlayer?.Message($"Missing permission '{perm}' to run command '{cmd}'!");
+                return true;
             }

             // Call it
@@ -404,10 +374,7 @@
         private void UnregisterWithCovalence()
         {
             var covalence = Interface.Oxide.GetLibrary<Covalence>();
-            foreach (var pair in commandInfos)
-            {
-                covalence.UnregisterCommand(pair.Key);
-            }
+            foreach (var pair in commandInfos) covalence.UnregisterCommand(pair.Key);
         }

         #endregion


Ability to select Debugger from debugger window + bug fixes

--- Editor/DebuggerWindow.cs
+++ Editor/DebuggerWindow.cs
@@ -8,7 +8,8 @@
     {
         private const int nestedPadding = 10;

-        private Transform selectedObject;
+        public static Transform selectedObject;
+        public static Debugger selectedDebugger;

         private Vector2 scrollPosition = Vector2.zero;

@@ -63,6 +64,8 @@
         public void OnSelectionChange()
         {
             selectedObject = Selection.activeTransform;
+            if (selectedObject!=null) selectedDebugger = selectedObject.GetComponentInChildren<Debugger>();
+
             Repaint();
         }

@@ -79,37 +82,41 @@
                 EditorGUILayout.HelpBox("Cannot use this utility in Editor Mode", MessageType.Info);
                 return;
             }
-            else if (selectedObject == null)
+
+            var newDebugger = (Debugger)EditorGUILayout.ObjectField("Selected Debugger:", selectedDebugger, typeof(Debugger), true);
+
+            if (newDebugger != selectedDebugger)
+            {
+                selectedDebugger = newDebugger;
+                if (newDebugger!=null) selectedObject = selectedDebugger.transform;
+            }
+
+            if (selectedObject == null)
             {
                 EditorGUILayout.HelpBox("Please select an object", MessageType.Info);
                 return;
             }

-            Debugger debugger = selectedObject.GetComponentInChildren<Debugger>();
-
-
-            if (debugger == null)
+            if (selectedDebugger == null)
             {
                 EditorGUILayout.HelpBox("This object does not contain a debugger component", MessageType.Info);
                 return;
             }
-            else if (debugger.BehaviorTree == null)
+            else if (selectedDebugger.BehaviorTree == null)
             {
                 EditorGUILayout.HelpBox("BehavorTree is null", MessageType.Info);
                 return;
             }
-
-            GUIStyle boxStyle = EditorStyles.helpBox;
-
+
             EditorGUILayout.BeginScrollView(scrollPosition);

             GUILayout.BeginHorizontal();
-            DrawBlackboardKeyAndValues(debugger);
-            DrawStats(debugger);
+            DrawBlackboardKeyAndValues(selectedDebugger);
+            DrawStats(selectedDebugger);
             GUILayout.EndHorizontal();
             GUILayout.Space(10);

-            DrawBehaviourTree(debugger);
+            DrawBehaviourTree(selectedDebugger);
             GUILayout.Space(10);

             EditorGUILayout.EndScrollView();
@@ -240,13 +247,13 @@
                 {
                     BlackboardCondition nodeBlackboardCond = node as BlackboardCondition;
                     tagName = nodeBlackboardCond.Key + " " + operatorToString[nodeBlackboardCond.Operator] + " " + nodeBlackboardCond.Value;
-                    GUI.backgroundColor = new Color(1f,0.8f, 0.4f);
+                    GUI.backgroundColor = new Color(0.9f,0.9f, 0.6f);
                 }
                 else
                 {
-                    if (node is Composite) GUI.backgroundColor = new Color(0.2f, 0.5f, 1f);
-                    if (node is Decorator) GUI.backgroundColor = new Color(0.4f, 0.7f, 0.7f);
-                    if (node is Task) GUI.backgroundColor = new Color(0.5f, 0.7f, 0.7f);
+                    if (node is Composite) GUI.backgroundColor = new Color(0.5f, 0.7f, 1f);
+                    if (node is Decorator) GUI.backgroundColor = new Color(0.5f, 0.9f, 0.9f);
+                    if (node is Task) GUI.backgroundColor = new Color(0.5f, 0.9f, 0.9f);

                     nameToTagString.TryGetValue(node.Name, out tagName);
                 }


removed timing code

removed timing code

--- Parsley.Core/FrameGrabber.cs
+++ Parsley.Core/FrameGrabber.cs
@@ -51,11 +51,9 @@
           // Note: the image is disposed once the camera gets disposed.
           // Therefore you should copy the image if needed in another
           // thread or make sure the camera is not disposed.
-          DateTime dt = DateTime.Now;
           Image<Bgr, byte> img = _camera.Frame();
           this.FireOnFrame(img);
           img.Dispose();
-          Console.WriteLine("Framegrabber {0}", (DateTime.Now - dt).TotalSeconds);
         }
       }
       e.Cancel = true;


Don't debug log invalid nodes.

Don't debug log invalid nodes.

--- PathMoveable/PathMoveable.cs
+++ PathMoveable/PathMoveable.cs
@@ -144,7 +144,7 @@

 	void OnPathInvalidated (Path path)
 	{
-		Debug.Log ("The path from " + path.StartNode + " to " + path.EndNode + " is no longer valid.");
+		Debug.Log ("The path is no longer valid.");
 		if (path == currentPath)
 		{
 			// Try to recalculate the path.


Make TableSection a struct again

Make TableSection a struct again

--- libwasm/TableSection.cs
+++ libwasm/TableSection.cs
@@ -111,7 +111,7 @@
     /// <summary>
     /// Describes a table in a table section.
     /// </summary>
-    public sealed class TableType
+    public struct TableType
     {
         /// <summary>
         /// Creates a table description from the given element type and limits.
@@ -128,13 +128,13 @@
         /// Gets the type of element in the table.
         /// </summary>
         /// <returns>The type of element in the table.</returns>
-        public WasmType ElementType { get; set; }
+        public WasmType ElementType { get; private set; }

         /// <summary>
         /// Gets the table's limits.
         /// </summary>
         /// <returns>The table's limits.</returns>
-        public ResizableLimits Limits { get; set; }
+        public ResizableLimits Limits { get; private set; }

         /// <summary>
         /// Writes this table description to the given binary WebAssembly file.


apply global gather multiplier

apply global gather multiplier

--- Pluton/Events/GatherEvent.cs
+++ Pluton/Events/GatherEvent.cs
@@ -18,7 +18,7 @@
                 Resource = new Entity(from);
                 resourceDispenser = dispenser;
                 ItemAmount = itemAmt;
-                Amount = amount;
+                Amount = (int)(amount * World.GetWorld().ResourceGatherMultiplier);
             }
         }
     }


Fix orthographic projection creation

Fix orthographic projection creation

--- QuickFont/ProjectionStack.cs
+++ QuickFont/ProjectionStack.cs
@@ -122,8 +122,8 @@
             var currentVp = (Viewport) CurrentViewport;
             //return Matrix4.CreateScale(0.4f);
             var mat = Matrix4.CreateOrthographicOffCenter((float) currentVp.X, (float) currentVp.Width,
-                (float) currentVp.Height, (float) currentVp.Y, -1.0f, 1.0f);
-            mat = Matrix4.CreateOrthographic((float)currentVp.Width, (float)currentVp.Height, -100.0f, 200.0f);
+                (float) currentVp.Y, (float) currentVp.Height, -1.0f, 1.0f);
+            //mat = Matrix4.CreateOrthographic((float)currentVp.Width, (float)currentVp.Height, -100.0f, 200.0f);
             //mat = Matrix4.Mult(Matrix4.CreateScale(200f), mat);
             return mat;
             //return Matrix4.CreateOrthographic((float)currentVp.Width, currentVp.Height, -1.0f, 1.0f);


Inlined ToString

Inlined ToString

--- RDFSharp/Model/RDFLiteral.cs
+++ RDFSharp/Model/RDFLiteral.cs
@@ -37,10 +37,7 @@
         /// <summary>
         /// Gives the string representation of the literal
         /// </summary>
-        public override string ToString()
-        {
-            return this.Value;
-        }
+        public override string ToString() => this.Value;
         #endregion

     }


- comments

- comments

--- RaptorDB/DataTypes/Result.cs
+++ RaptorDB/DataTypes/Result.cs
@@ -25,21 +25,29 @@
             OK = ok;
             EX = ex;
         }
+        /// <summary>
+        /// T=Values return, F=exceptions occurred
+        /// </summary>
         public bool OK { get; set; }
         public Exception EX { get; set; }
+        /// <summary>
+        /// Total number of rows of the query
+        /// </summary>
         public int TotalCount { get; set; }
+        /// <summary>
+        /// Rows returned
+        /// </summary>
         public int Count { get; set; }
         public List<object[]> Rows { get; set; }
+        /// <summary>
+        /// Schema for the rows returned (column names)
+        /// </summary>
+        public List<string> Columns { get; set; }

         // FEATURE : data pending in results
         ///// <summary>
         ///// Data is being indexed, so results will not reflect all documents
         ///// </summary>
         //public bool DataPending { get; set; }
-
-        /// <summary>
-        /// Schema for the rows returned (column names)
-        /// </summary>
-        public List<string> Columns { get; set; }
     }
 }


fixed installFonts()

fixed installFonts()

--- RelicModManager/Installer.cs
+++ RelicModManager/Installer.cs
@@ -849,7 +849,7 @@
                             //get fontreg from the zip file
                             using (ZipFile zip = new ZipFile(Settings.managerInfoDatFile))
                             {
-                                zip.ExtractSelectedEntries("FontReg.exe", null, fontRegPath);
+                                zip.ExtractSelectedEntries("FontReg.exe", null, Path.GetDirectoryName(fontRegPath));
                             }
                         }
                         else
@@ -868,7 +868,8 @@
                         }
                     }
                     ProcessStartInfo info = new ProcessStartInfo();
-                    info.FileName = fontRegPath;
+                    // info.FileName = fontRegPath;
+                    info.FileName = @"FontReg.exe";
                     info.UseShellExecute = true;
                     info.Verb = "runas"; // Provides Run as Administrator
                     info.Arguments = "/copy";


Automatic positioning of Gui controls, relative to previous control.

--- Rusty/Extras/Gui/WinForms.cs
+++ Rusty/Extras/Gui/WinForms.cs
@@ -40,6 +40,7 @@
                 Font = form.Font;
                 Location = form.Location;
                 Size = form.Size;
+                Margin = new Point(form.Margin.Left, form.Margin.Top);
                 WindowColour = form.BackColor;
                 ControlColour = form.ForeColor;
                 form.StartPosition = FormStartPosition.Manual;
@@ -53,6 +54,7 @@
             public override void Add(BaseGui.Control control)
             {
                 form.Controls.Add((System.Windows.Forms.Control)control.NativeComponent);
+                control.Parent.Controls.Add(control);
                 control.Draw();
                 form.PerformLayout();
             }
@@ -291,6 +293,22 @@
         {
             if (!information.Size.IsEmpty && information.Size.Height == 0)
                 information.Size = new Size(information.Size.Width, (int)information.Parent.Font.GetHeight());
+
+            if (information.Location.IsEmpty)
+            {
+                int n = information.Parent.Controls.Count - 1;
+
+                if (n == 0)
+                    information.Location = information.Parent.Margin;
+                else
+                {
+                    var last = information.Parent.Controls[n - 1];
+                    var component = (System.Windows.Forms.Control)information.NativeComponent;
+                    var location = last.Location;
+                    location.Y += last.Size.Height + component.Padding.Bottom;
+                    information.Location = location;
+                }
+            }

             control.Text = information.Contents;
             control.Enabled = information.Enabled;


* Added StripString

* Added StripString

--- Scripts/Utilities/Utility.cs
+++ Scripts/Utilities/Utility.cs
@@ -251,6 +251,26 @@
         }

+        /// <summary>
+        /// Strips the prepending ! statment from string.
+        /// </summary>
+        /// <returns>The string.</returns>
+        /// <param name="s">S.</param>
+        public static string StripString(string s)
+        {
+            string[] delimiter = new string[] {"!", "! "};
+            string[] newString = s.Split(delimiter, System.StringSplitOptions.None);
+            if(newString.Length > 1)
+            {
+                return newString[1];
+            }
+            else
+            {
+                return s;
+            }
+
+        }
+

         #region Cache Generic Deserialization

@@ -332,6 +352,7 @@
             return null;
         }

+
         #endregion

     }


Test Commit to Repo

Test Commit to Repo

--- SmartMirror/MainPage.xaml.cs
+++ SmartMirror/MainPage.xaml.cs
@@ -45,7 +45,7 @@

 // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
-
+// Test Commit Neil Hutson
 namespace SmartMirror
 {
     /// <summary>


fixing tree view double clicking error.

fixing tree view double clicking error.

--- Gui/TreeView/TreeNode.cs
+++ Gui/TreeView/TreeNode.cs
@@ -31,7 +31,6 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Linq;
-using MatterHackers.Agg;
 using MatterHackers.Agg.Font;
 using MatterHackers.Agg.Image;
 using MatterHackers.Agg.Platform;
@@ -86,7 +85,17 @@
 							return;
 						}

-						TreeView.SelectedNode = this;
+						// find the child that is a TreeExpandWidget
+						TreeExpandWidget treeExpandWidget = this.Descendants<TreeExpandWidget>(tew => tew.ContainsFirstUnderMouseRecursive()).FirstOrDefault();
+
+						// if there was a tree expand widget that got clicked (under the mouse)
+						if (treeExpandWidget != null)
+						{
+							// already selected and will have open / close processing done by the treeExpandWidget. Return without doing any double clicking.
+							return;
+                        }
+
+                        TreeView.SelectedNode = this;

 						if (this.Nodes.Count > 0)
 						{


Couple of small tweaks tp TcpSocket.SendAsync(byte[])

--- InSimDotNet/TcpSocket.cs
+++ InSimDotNet/TcpSocket.cs
@@ -203,17 +203,20 @@

         private Task<int> SendInternalAsync(byte[] buffer, int index, int count) {
             // we need to get number of bytes sent so wrap Socket.BeginSend() in a TaskCompletionSource.
-            TaskCompletionSource<int> tcs = new TaskCompletionSource<int>();
-            client.Client.BeginSend(buffer, index, count, SocketFlags.None, r => {
+            Socket socket = client.Client;
+            TaskCompletionSource<int> source = new TaskCompletionSource<int>();
+
+            socket.BeginSend(buffer, index, count, SocketFlags.None, r => {
                 try {
-                    int sent = client.Client.EndSend(r);
-                    tcs.SetResult(sent);
+                    int sent = socket.EndSend(r);
+                    source.SetResult(sent);
                 }
                 catch (Exception ex) {
-                    tcs.SetException(ex);
+                    source.SetException(ex);
                 }
             }, null);
-            return tcs.Task;
+
+            return source.Task;
         }

         private async void ReceiveAsync() {


Move properties to top

Move properties to top

--- MathParser/MathParser.cs
+++ MathParser/MathParser.cs
@@ -22,6 +22,40 @@
     /// </summary>
     public class MathParser
     {
+        #region Properties
+
+        /// <summary>
+        /// All operators should be inside this property.
+        /// The first operator is executed first, et cetera.
+        /// An operator may only be ONE character.
+        /// </summary>
+        public List<string> OperatorList { get; set; } = new List<string>();
+
+        /// <summary>
+        /// When adding a variable in the OperatorList property, you need to assign how that operator should work.
+        /// </summary>
+        public Dictionary<string, Func<double, double, double>> OperatorAction { get; set; } =
+            new Dictionary<string, Func<double, double, double>>();
+
+        /// <summary>
+        /// All functions that you want to define should be inside this property.
+        /// </summary>
+        public Dictionary<string, Func<double[], double>> LocalFunctions { get; set; } =
+            new Dictionary<string, Func<double[], double>>();
+
+        /// <summary>
+        /// All variables that you want to define should be inside this property.
+        /// </summary>
+        public Dictionary<string, double> LocalVariables { get; set; } = new Dictionary<string, double>();
+
+        /// <summary>
+        /// When converting the result from the Parse method or ProgrammaticallyParse method ToString(),
+        /// please use this culture info.
+        /// </summary>
+        public CultureInfo CultureInfo { get; } = CultureInfo.InvariantCulture;
+
+        #endregion
+
         /// <summary>
         /// Initializes a new instance of the MathParser class, and optionally with
         /// predefined functions, operators, and variables.
@@ -141,40 +175,6 @@
                 LocalVariables.Add("minor", 0.38196601125010515179541316563436189);
             }
         }
-
-        #region Properties
-
-        /// <summary>
-        /// All operators should be inside this property.
-        /// The first operator is executed first, et cetera.
-        /// An operator may only be ONE character.
-        /// </summary>
-        public List<string> OperatorList { get; set; } = new List<string>();
-
-        /// <summary>
-        /// When adding a variable in the OperatorList property, you need to assign how that operator should work.
-        /// </summary>
-        public Dictionary<string, Func<double, double, double>> OperatorAction { get; set; } =
-            new Dictionary<string, Func<double, double, double>>();
-
-        /// <summary>
-        /// All functions that you want to define should be inside this property.
-        /// </summary>
-        public Dictionary<string, Func<double[], double>> LocalFunctions { get; set; } =
-            new Dictionary<string, Func<double[], double>>();
-
-        /// <summary>
-        /// All variables that you want to define should be inside this property.
-        /// </summary>
-        public Dictionary<string, double> LocalVariables { get; set; } = new Dictionary<string, double>();
-
-        /// <summary>
-        /// When converting the result from the Parse method or ProgrammaticallyParse method ToString(),
-        /// please use this culture info.
-        /// </summary>
-        public CultureInfo CultureInfo { get; } = CultureInfo.InvariantCulture;
-
-        #endregion

         /// <summary>
         /// Enter the math expression in form of a string.


Added Type field to BasicUserModel

Added Type field to BasicUserModel

--- Models/BasicUserModel.cs
+++ Models/BasicUserModel.cs
@@ -9,7 +9,8 @@
         public long Id { get; set; }
         public string AvatarUrl { get; set; }
         public string GravatarId { get; set; }
-        public string Url { get; set; }
+        public string Url { get; set; }
+        public string Type { get; set; }

         protected bool Equals(BasicUserModel other)
         {


Add support for syncing the system clock

--- MyAir3Api/ZoneStation.cs
+++ MyAir3Api/ZoneStation.cs
@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -73,6 +74,18 @@
             return scheduleRetrievalTasks.Select(s => new Schedule(_aircon, s.ScheduleId, s.ScheduleTask.Result.InnerResponse));
         }

+        public async Task<AirconWebResponse> SyncSystemClockAsync()
+        {
+            var now = DateTime.Now;
+            return await _aircon.GetAsync("setClock?"
+                                            + "hours=" + now.Hour
+                                            + "&minutes=" + now.Minute
+                                            + "&day=" + now.Day
+                                            + "&month=" + now.Month
+                                            + "&year=" + now.Year
+                                            + "&dow=" + ToIntDayOfWeek(now.DayOfWeek));
+        }
+
         public async Task<SleepTimer> GetSleepTimerAsync()
         {
             var zoneTimer = await _aircon.GetAsync("getZoneTimer");
@@ -87,5 +100,28 @@
                 + "&mode=" + (int)InverterMode
                 + "&centralDesiredTemp=" + CentralDesiredTemp);
         }
+
+        private static int ToIntDayOfWeek(DayOfWeek dayOfWeek)
+        {
+            switch (dayOfWeek)
+            {
+                case DayOfWeek.Monday:
+                    return 1;
+                case DayOfWeek.Tuesday:
+                    return 2;
+                case DayOfWeek.Wednesday:
+                    return 3;
+                case DayOfWeek.Thursday:
+                    return 4;
+                case DayOfWeek.Friday:
+                    return 5;
+                case DayOfWeek.Saturday:
+                    return 6;
+                case DayOfWeek.Sunday:
+                    return 7;
+                default:
+                    throw new ArgumentException("Unrecognised day of week: " + dayOfWeek);
+            }
+        }
     }
 }


Handle files > 2GB, provide more feedback during search

--- bstrings/Program.cs
+++ bstrings/Program.cs
@@ -133,26 +133,10 @@
             _logger.Info("");
             }

-
             _sw = new Stopwatch();
             _sw.Start();

-            byte[] rawBytes = null;
-
-            try
-            {
-                rawBytes = File.ReadAllBytes(p.Object.File);
-            }
-            catch (IOException ex)
-            {
-                _logger.Warn("Files larger than 2GB not currently supported. Exiting");
-                return;
-            }
-
-
-
-
-                var hits = new List<string>();
+            var hits = new HashSet<string>();

             var regPattern = p.Object.LookForRegex;

@@ -184,7 +168,6 @@
                         p.Object.SaveTo = string.Empty;

                     }
-
                 }
                 else
                 {
@@ -202,13 +185,6 @@
                 }
             }

-            if (!p.Object.Quiet)
-            {
-                    _logger.Info("Searching...");
-            _logger.Info("");
-            }
-
-
             var minLength = 3;
             if (p.Object.MinimumLength > 0)
             {
@@ -222,30 +198,89 @@
                 maxLength = p.Object.MaximumLength;
             }

-            if (p.Object.GetUnicode)
-            {
-                hits.AddRange(GetUnicodeHits(rawBytes, minLength, maxLength));
-            }
-
-            if (p.Object.GetAscii)
-            {
-                hits.AddRange(GetAsciiHits(rawBytes, minLength, maxLength));
+            // for files > 2gb, we have to cut it up
+            var chunkSizeMb = 512;
+            var chunkSizeBytes = chunkSizeMb * 1024 * 1024;
+
+            long fileSizeBytes = new FileInfo(p.Object.File).Length;
+            long bytesRemaining = fileSizeBytes;
+            var offset = 0;
+
+            var chunkIndex = 1;
+            var totalChunks = (fileSizeBytes / chunkSizeBytes) + 1;
+            var hsuffix = totalChunks == 1 ? "" : "s";
+
+            if (!p.Object.Quiet)
+            {
+                _logger.Info($"Searching {totalChunks:N0} chunk{hsuffix} ({chunkSizeMb} MB each)...");
+                _logger.Info("");
+            }
+
+            using (var mmf = MemoryMappedFile.CreateFromFile(p.Object.File, FileMode.Open, "source"))
+            {
+                while (bytesRemaining > 0)
+                {
+                    if (bytesRemaining <= chunkSizeBytes)
+                    {
+                        chunkSizeBytes = (int)bytesRemaining;
+                    }
+
+                    using (var accessor = mmf.CreateViewStream(offset, chunkSizeBytes, MemoryMappedFileAccess.Read))
+                    {
+                        var chunk = new byte[chunkSizeBytes];
+
+                        accessor.Read(chunk, 0, chunkSizeBytes);
+
+                        offset += chunkSizeBytes;
+                        bytesRemaining -= chunkSizeBytes;
+
+                        if (p.Object.GetUnicode)
+                        {
+                            var uh = GetUnicodeHits(chunk, minLength, maxLength);
+                            foreach (var h in uh)
+                            {
+                                hits.Add(h);
+                            }
+                        }
+
+                        if (p.Object.GetAscii)
+                        {
+                            var ah = GetAsciiHits(chunk, minLength, maxLength);
+                            foreach (var h in ah)
+                            {
+                                hits.Add(h);
+                            }
+                        }
+
+                        if (!p.Object.Quiet)
+                        {
+                            _logger.Info($"Chunk {chunkIndex:N0} of {totalChunks:N0} finished. Total hits so far: {hits.Count:N0} Elapsed time: {_sw.Elapsed.TotalSeconds:N3} seconds");
+                        }
+                    }
+                }
+            }
+            _sw.Stop();
+
+            if (!p.Object.Quiet)
+            {
+                _logger.Info("");
             }

             if (p.Object.SortAlpha)
             {
-                hits.Sort();
+                var tempList = hits.ToList();
+                tempList.Sort();
+                hits = new HashSet<string>(tempList);
             }
             else if (p.Object.SortLength)
             {
-                hits = SortByLength(hits).ToList();
+                var tempList = SortByLength(hits.ToList()).ToList();
+                hits = new HashSet<string>(tempList);
             }

             var counter = 0;

-            var set = new HashSet<string>(hits);
-
-            _sw.Stop();
+

             var reg = new Regex(regPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);

@@ -268,7 +303,7 @@
                 sw = new StreamWriter(p.Object.SaveTo,false);
             }

-            foreach (var hit in set)
+            foreach (var hit in hits)
             {
                 if (hit.Length == 0)
                 {
@@ -308,13 +343,12 @@
                 sw.Close();
             }

-
             if (!p.Object.Quiet)
             {
                  var suffix = counter == 1 ? "" : "s";

-            _logger.Info("");
-            _logger.Info($"Found {counter:N0} string{suffix} in {_sw.Elapsed.TotalSeconds:N3} seconds");
+                _logger.Info("");
+                _logger.Info($"Found {counter:N0} string{suffix} in {_sw.Elapsed.TotalSeconds:N3} seconds");
             }

         }