Map cleanup

Map cleanup

Cleaned up code in Map.cs based on resharper suggestions

--- EOLib/Map.cs
+++ EOLib/Map.cs
@@ -276,9 +276,6 @@
 				GfxRows[layer] = new List<GFXRow>();
 			}

-			int outersize;
-			int innersize;
-
 			Packet file = new Packet(File.ReadAllBytes(fileName));
 			if (file.Length == 0)
 				throw new FileLoadException("The file is empty.");
@@ -320,11 +317,12 @@
 			WarpLookup = new Warp[Height + 1, Width + 1];
 			TileLookup = new Tile[Height + 1, Width + 1];

-			outersize = file.GetChar();
-
-			for (int i = 0; i < outersize; ++i)
-			{
-				NPCSpawns.Add(new NPCSpawn()
+			int innersize;
+			int outersize = file.GetChar();
+
+			for (int i = 0; i < outersize; ++i)
+			{
+				NPCSpawns.Add(new NPCSpawn
 				{
 					x = file.GetChar(),
 					y = file.GetChar(),
@@ -346,7 +344,7 @@

 			for (int i = 0; i < outersize; ++i)
 			{
-				Chests.Add(new MapChest()
+				Chests.Add(new MapChest
 				{
 					x = file.GetChar(),
 					y = file.GetChar(),
@@ -365,7 +363,7 @@
 				byte y = file.GetChar();
 				innersize = file.GetChar();

-				TileRow row = new TileRow()
+				TileRow row = new TileRow
 				{
 					y = y,
 					tiles = new List<Tile>(innersize)
@@ -392,11 +390,7 @@
 				byte y = file.GetChar();
 				innersize = file.GetChar();

-				WarpRow row = new WarpRow()
-				{
-					y = y,
-					tiles = new List<Warp>(innersize)
-				};
+				WarpRow row = new WarpRow { y = y, tiles = new List<Warp>(innersize) };

 				for (int ii = 0; ii < innersize; ++ii)
 				{
@@ -441,13 +435,7 @@
 					byte y = file.GetChar();
 					innersize = file.GetChar();

-					GFXRow row = new GFXRow()
-					{
-						y = y,
-						tiles = new List<GFX>(innersize)
-					};
-
-					row.tiles = new List<GFX>(innersize);
+					GFXRow row = new GFXRow { y = y, tiles = new List<GFX>(innersize) };

 					for (int ii = 0; ii < innersize; ++ii)
 					{
@@ -455,13 +443,9 @@
 						ushort temptile = (ushort)file.GetShort();
 						if (row.y <= Height && tempx <= Width)
 						{
-							GFXRows[layer, row.y].column[tempx].tile = (int)temptile;
+							GFXRows[layer, row.y].column[tempx].tile = temptile;
 						}
-						row.tiles.Add(new GFX()
-						{
-							x = tempx,
-							tile = temptile
-						});
+						row.tiles.Add(new GFX { x = tempx, tile = temptile });
 					}

 					GfxRows[layer].Add(row);
@@ -472,10 +456,8 @@

 			for (int i = 0; i < outersize; ++i)
 			{
-				MapSign sign = new MapSign();
-
-				sign.x = file.GetChar();
-				sign.y = file.GetChar();
+				MapSign sign = new MapSign {x = file.GetChar(), y = file.GetChar()};
+
 				int msgLength = file.GetShort() - 1;
 				string data = decodeEmfString(file.GetBytes(msgLength));
 				int titleLength = file.GetChar();


Version 1.5.4

Version 1.5.4

--- HeroesParserData/Properties/AssemblyInfo.cs
+++ HeroesParserData/Properties/AssemblyInfo.cs
@@ -49,5 +49,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.3")]
-[assembly: AssemblyFileVersion("1.5.3")]
+[assembly: AssemblyVersion("1.5.4")]
+[assembly: AssemblyFileVersion("1.5.4")]


Cancel the infinite delay

Cancel the infinite delay

--- BTCPayServer/Extensions.cs
+++ BTCPayServer/Extensions.cs
@@ -179,19 +179,26 @@

         public static async Task<T> WithCancellation<T>(this Task<T> task, CancellationToken cancellationToken)
         {
-            var waiting = Task.Delay(-1, cancellationToken);
-            var doing = task;
-            await Task.WhenAny(waiting, doing);
-            cancellationToken.ThrowIfCancellationRequested();
-            return await doing;
+            using (var delayCTS = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))
+            {
+                var waiting = Task.Delay(-1, delayCTS.Token);
+                var doing = task;
+                await Task.WhenAny(waiting, doing);
+                delayCTS.Cancel();
+                cancellationToken.ThrowIfCancellationRequested();
+                return await doing;
+            }
         }
         public static async Task WithCancellation(this Task task, CancellationToken cancellationToken)
         {
-            var waiting = Task.Delay(-1, cancellationToken);
-            var doing = task;
-            await Task.WhenAny(waiting, doing);
-            cancellationToken.ThrowIfCancellationRequested();
-            await doing;
+            using (var delayCTS = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))
+            {
+                var waiting = Task.Delay(-1, delayCTS.Token);
+                var doing = task;
+                await Task.WhenAny(waiting, doing);
+                delayCTS.Cancel();
+                cancellationToken.ThrowIfCancellationRequested();
+            }
         }

         public static (string Signature, String Id, String Authorization) GetBitpayAuth(this HttpContext ctx)


ajuste comentario

ajuste comentario

--- Boleto2.Net/Banco/Banco.cs
+++ Boleto2.Net/Banco/Banco.cs
@@ -38,7 +38,7 @@
         public List<string> IdsRetornoCnab400RegistroDetalhe => _banco.IdsRetornoCnab400RegistroDetalhe;

         /// <summary>
-        ///     Formata campo livre - Cada banco implementa de uma maneira diferente...
+        ///     Formata Cedente
         /// </summary>
         public void FormataCedente()
         {
@@ -53,7 +53,7 @@
         }

         /// <summary>
-        ///     Formata campo livre - Cada banco implementa de uma maneira diferente...
+        ///     Formata Campo Livre
         /// </summary>
         public string FormataCodigoBarraCampoLivre(Boleto boleto)
         {


Fix error running unit tests (#2940)

Fix error running unit tests (#2940)

When running tests, the following error occurs:
	VSTest: Could not locate executable.

https://github.com/cake-build/cake/issues/1522#issuecomment-341612194
indicates that there's an issue using VS 2019, and presents a workaround
to find the correct path

--- Build/Cake/unit-tests.cake
+++ Build/Cake/unit-tests.cake
@@ -2,7 +2,7 @@
 Task("EnsureAllProjectsBuilt")
   .IsDependentOn("UpdateDnnManifests")
   .IsDependentOn("Restore-NuGet-Packages")
-  .Does(() =>
+  .Does(() =>
   {
     MSBuild("DNN_Platform.sln", new MSBuildSettings {
       Verbosity = Verbosity.Minimal,
@@ -13,21 +13,31 @@

 Task("UnitTests")
   .IsDependentOn("EnsureAllProjectsBuilt")
-  .Does(() =>
+  .Does(() =>
   {
     var testAssemblies = GetFiles($@"**\bin\{configuration}\DotNetNuke.Tests.*.dll");
     testAssemblies -= GetFiles(@"**\DotNetNuke.Tests.Data.dll");
     testAssemblies -= GetFiles(@"**\DotNetNuke.Tests.Integration.dll");
     testAssemblies -= GetFiles(@"**\DotNetNuke.Tests.Utilities.dll");
     testAssemblies -= GetFiles(@"**\DotNetNuke.Tests.Urls.dll");
-
-    foreach(var file in testAssemblies) {
-        VSTest(file.FullPath, new VSTestSettings() {
-          Logger = $"trx;LogFileName={file.GetFilename()}.xml",
-          Parallel = true,
-          EnableCodeCoverage = true,
-          FrameworkVersion = VSTestFrameworkVersion.NET45,
-          TestAdapterPath = @"tools\NUnitTestAdapter.2.1.1\tools"
-        });
+
+    foreach (var file in testAssemblies) {
+      VSTest(file.FullPath, FixToolPath(new VSTestSettings() {
+        Logger = $"trx;LogFileName={file.GetFilename()}.xml",
+        Parallel = true,
+        EnableCodeCoverage = true,
+        FrameworkVersion = VSTestFrameworkVersion.NET45,
+        TestAdapterPath = @"tools\NUnitTestAdapter.2.1.1\tools"
+      }));
     }
   });
+
+// https://github.com/cake-build/cake/issues/1522
+VSTestSettings FixToolPath(VSTestSettings settings)
+{
+    #tool vswhere
+    settings.ToolPath =
+        VSWhereLatest(new VSWhereLatestSettings { Requires = "Microsoft.VisualStudio.PackageGroup.TestTools.Core" })
+        .CombineWithFilePath(File(@"Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"));
+    return settings;
+}


WIP on sql builders.

WIP on sql builders.

--- src/Dommel/DommelMapper.cs
+++ src/Dommel/DommelMapper.cs
@@ -17,13 +17,20 @@
         private static readonly IDictionary<string, string> _columnNameCache = new Dictionary<string, string>();
         private static readonly IDictionary<Type, PropertyInfo> _typeKeyPropertyCache = new Dictionary<Type, PropertyInfo>();
         private static readonly IDictionary<Type, PropertyInfo[]> _typePropertiesCache = new Dictionary<Type, PropertyInfo[]>();
+        private static readonly IDictionary<string, ISqlBuilder> _sqlBuilders = new Dictionary<string, ISqlBuilder>
+                                                                                {
+                                                                                { "sqlconnection", new SqlServerSqlBuilder() },
+                                                                                { "npgsqlconnection", new SqlServerSqlBuilder() },
+                                                                                { "sqliteconnection", new SqlServerSqlBuilder() },
+                                                                                { "mysqlconnection", new SqlServerSqlBuilder() }
+                                                                                };

         private static readonly IDictionary<Type, string> _getQueryCache = new Dictionary<Type, string>();
         private static readonly IDictionary<Type, string> _getAllQueryCache = new Dictionary<Type, string>();
         private static readonly IDictionary<Type, string> _insertQueryCache = new Dictionary<Type, string>();
         private static readonly IDictionary<Type, string> _updateQueryCache = new Dictionary<Type, string>();
         private static readonly IDictionary<Type, string> _deleteQueryCache = new Dictionary<Type, string>();
-
+
         /// <summary>
         /// Retrieves the entity of type <typeparamref name="TEntity"/> with the specified id.
         /// </summary>
@@ -96,13 +103,12 @@
                 var typeProperties = GetTypeProperties(type).Where(p => p != keyProperty).ToList();

                 string[] columnNames = typeProperties.Select(p => GetColumnName(type, p)).ToArray();
-                string[] paramNams = typeProperties.Select(p => "@" + p.Name).ToArray();
+                string[] paramNames = typeProperties.Select(p => "@" + p.Name).ToArray();
+
+                var builder = GetBuilder(connection);

                 // todo: scope_identity() is not supported in sql ce.
-                sql = string.Format("set nocount on insert into {0} ({1}) values ({2}) select cast(scope_identity() as int)",
-                    tableName,
-                    string.Join(", ", columnNames),
-                    string.Join(", ", paramNams));
+                sql = builder.BuildInsert(tableName, columnNames, paramNames);

                 _insertQueryCache[type] = sql;
             }
@@ -369,5 +375,34 @@
             }
         }
         #endregion
+
+        public static void AddSqlBuilder(string connectionName, ISqlBuilder builder)
+        {
+            _sqlBuilders.Add(connectionName, builder);
+        }
+
+        private static ISqlBuilder GetBuilder(IDbConnection connection)
+        {
+            string connectionName = connection.GetType().Name.ToLower();
+            ISqlBuilder builder;
+            return _sqlBuilders.TryGetValue(connectionName, out builder) ? builder : new SqlServerSqlBuilder();
+        }
+
+        public interface ISqlBuilder
+        {
+            string BuildInsert(string tableName, string[] columnNames, string[] paramNames);
+        }
+
+        private sealed class SqlServerSqlBuilder : DommelMapper.ISqlBuilder
+        {
+            public string BuildInsert(string tableName, string[] columnNames, string[] paramNames)
+            {
+                // todo: scope_identity() is not supported in sql ce.
+                return string.Format("set nocount on insert into {0} ({1}) values ({2}) select cast(scope_identity() as int)",
+                    tableName,
+                    string.Join(", ", columnNames),
+                    string.Join(", ", paramNames));
+            }
+        }
     }
 }


Removed GetLinkerTime, functionality didn't work in dotnet 6

--- src/Utils/Helper.cs
+++ src/Utils/Helper.cs
@@ -150,38 +150,6 @@
             }

             return array;
-        }
-
-        /// <summary>
-        /// Extension method for determining build time
-        /// </summary>
-        /// <param name="assembly"></param>
-        /// <param name="target"></param>
-        /// <source>http://stackoverflow.com/a/1600990</source>
-        /// <returns></returns>
-        public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null)
-        {
-            //var filePath = assembly.Location;
-            //const int c_PeHeaderOffset = 60;
-            //const int c_LinkerTimestampOffset = 8;
-
-            //var buffer = new byte[2048];
-
-            //using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) {
-            //    stream.Read(buffer, 0, 2048);
-            //}
-
-            //var offset = BitConverter.ToInt32(buffer, c_PeHeaderOffset);
-            //var secondsSince1970 = BitConverter.ToInt32(buffer, offset + c_LinkerTimestampOffset);
-            //var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
-
-            //var linkTimeUtc = epoch.AddSeconds(secondsSince1970);
-
-            //var tz = target ?? TimeZoneInfo.Local;
-            //var localTime = TimeZoneInfo.ConvertTimeFromUtc(linkTimeUtc, tz);
-
-            //return localTime;
-            return new DateTime();
         }

         /// <summary>


improve visibility example

improve visibility example

--- src/ExampleMenu/Program.cs
+++ src/ExampleMenu/Program.cs
@@ -202,8 +202,9 @@
 		private class DisabledItem : CMenuItem
 		{
 			public DisabledItem ()
-				: base ("command")
+				: base ("subclassed")
 			{
+				HelpText = "This command, which is defined in its own class, is disabled by default.";
 			}

 			public override bool IsVisible ()
@@ -213,7 +214,7 @@

 			public override void Execute (string arg)
 			{
-				Console.WriteLine ("Command was enabled!");
+				Console.WriteLine ("Disabled subclassed command was enabled!");
 			}
 		}


Remove unused overload from ExceptionList.

--- src/Fixie/ExceptionList.cs
+++ src/Fixie/ExceptionList.cs
@@ -11,11 +11,6 @@
         public void Add(Exception exception)
         {
             exceptions.Add(exception);
-        }
-
-        public void Add(ExceptionList exceptionList)
-        {
-            exceptions.AddRange(exceptionList.exceptions);
         }

         public int Count


Fixes comment typo

Fixes comment typo

--- CSVSerializer/CsvWriter.cs
+++ CSVSerializer/CsvWriter.cs
@@ -364,7 +364,7 @@
             return validcolumnNames;
         }

-        //Checks if the property is of an acceptable type and outputs a ValidType. Only gets sent properties that exist in the collumn names
+        //Checks if the property is of an acceptable type and outputs a ValidTypeInfo. Only gets sent properties that exist in the collumn names
         private bool CheckForValidProperty(PropertyDescriptor property, out ValidTypeInfo validType)
         {
             if (property.PropertyType.IsGenericType)


Add support for ControlH

Add support for ControlH

--- src/ReadLine/KeyHandler.cs
+++ src/ReadLine/KeyHandler.cs
@@ -125,6 +125,7 @@
             _keyActions["ControlF"] = MoveCursorRight;
             _keyActions["ControlE"] = MoveCursorEnd;
             _keyActions["Backspace"] = Backspace;
+            _keyActions["ControlH"] = Backspace;
         }

         public void Handle(ConsoleKeyInfo keyInfo)


Stylecop for app.

Stylecop for app.

--- src/Tagger.Wpf/App.xaml.cs
+++ src/Tagger.Wpf/App.xaml.cs
@@ -17,16 +17,17 @@
     /// <summary>
     /// Interaction logic for App.xaml
     /// </summary>
-    public partial class App: Application
+    public partial class App : Application
     {
         /// <summary>
-        /// Application settings window
+        /// Gets application settings window
         /// </summary>
         public static Window MainSettingsWindow { get; private set; }

         /// <summary>
         /// Initiailize application scale events
         /// </summary>
+        /// <param name="ea">Startup event arguments</param>
         protected override void OnStartup(StartupEventArgs ea)
         {
             base.OnStartup(ea);
@@ -35,7 +36,7 @@
             AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

             // Register unhandled exception handler with logging
-            App.Current.DispatcherUnhandledException += (sender, args) =>
+            Application.Current.DispatcherUnhandledException += (sender, args) =>
             {
                 var filePath = Path.Combine(
                     Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
@@ -53,13 +54,13 @@
             };

             // Check windows OS edition
-            var isWindows7orWin2008R2orHigher =
-                Environment.OSVersion.Version.Major >= 6 &&
+            var isWindows7OrWin2008R2OrHigher =
+                Environment.OSVersion.Version.Major >= 6 &&
                 Environment.OSVersion.Version.Minor >= 1;
-            if ( !isWindows7orWin2008R2orHigher )
+            if (!isWindows7OrWin2008R2OrHigher)
             {
-                MessageBox.Show(@"
-This program was tested only on Windows 7 and Windows
+                MessageBox.Show(
+@"This program was tested only on Windows 7 and Windows
 2008 Server R2. To track console windows it uses conhost.exe
 process that was not used in previous editions of Windows.
 To find mapping between conhost.exe and console application
@@ -73,8 +74,7 @@
 exception on the first attempt to create a tag.

 If you want to add support for some old OS, fork Tagger
-https://github.com/FallenGameR/Tagger
-",
+https://github.com/FallenGameR/Tagger",
                     "Windows Version Compatibility",
                     MessageBoxButton.OK,
                     MessageBoxImage.Warning);
@@ -85,6 +85,13 @@
             App.MainSettingsWindow.Show();
         }

+        /// <summary>
+        /// Get deflated assembly from resources by assembly full name
+        /// </summary>
+        /// <param name="assemblyName">Full name of the assembly</param>
+        /// <returns>
+        /// Byte representation of a deflated assembly from resources
+        /// </returns>
         private static byte[] GetDeflatedAssembly(string assemblyName)
         {
             switch (assemblyName)
@@ -112,10 +119,19 @@
         /// <summary>
         /// Custom assembly resolver to use deflated referenced assemblies from resources
         /// </summary>
-        private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
+        /// <param name="sender">The parameter is not used.</param>
+        /// <param name="args">Resolve event arguments</param>
+        /// <returns>
+        /// Loaded assembly object if the resolving assembly is stored deflated in resources,
+        /// otherwise null. Null would force .NET to use default resolution method.
+        /// </returns>
+        private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
         {
             var knownAssembly = GetDeflatedAssembly(args.Name);
-            if (knownAssembly == null) { return null; }
+            if (knownAssembly == null)
+            {
+                return null;
+            }

             // Loading of deflated dll from resources
             using (var resource = new MemoryStream(knownAssembly))
@@ -130,5 +146,4 @@
             }
         }
     }
-}
-
+}


Creating a new connection for each session

--- src/YesSql.Core/Session.cs
+++ src/YesSql.Core/Session.cs
@@ -458,6 +458,7 @@
                 if (_connection != null)
                 {
                     _store.Configuration.ConnectionFactory.CloseConnection(_connection);
+                    _connection = null;
                 }

                 Release();


Delete Parse_Private_IndividualUnits.cs

Delete Parse_Private_IndividualUnits.cs

--- 1_units/everything/UnitParser/Source/Parse/Parse_Private_IndividualUnits.cs
+++ 1_units/everything/UnitParser/Source/Parse/Parse_Private_IndividualUnits.cs
@@ -1,224 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace FlexibleParser
-{
-    public partial class UnitP
-    {
-        private static ParsedUnit InitialParseActions(ParsedUnit parsedUnit)
-        {
-            parsedUnit.InputToParse = parsedUnit.InputToParse.Trim();
-
-            foreach (string symbol in UnitP.IgnoredUnitSymbols)
-            {
-                parsedUnit.InputToParse = parsedUnit.InputToParse.Replace(symbol, "");
-            }
-
-            return parsedUnit;
-        }
-
-        private static ParsedUnit PrefixAnalysis(ParsedUnit parsedUnit)
-        {
-            parsedUnit = BeforePrefixAnalysis(parsedUnit);
-
-            return
-            (
-                parsedUnit.UnitInfo.Unit == Units.None ?
-                CheckPrefixes(parsedUnit) : parsedUnit
-            );
-        }
-
-        private static ParsedUnit BeforePrefixAnalysis(ParsedUnit parsedUnit)
-        {
-            parsedUnit.UnitInfo.Unit = GetUnitFromString(parsedUnit.InputToParse);
-
-            if (parsedUnit.UnitInfo.Unit != Units.None)
-            {
-                if (AllPrefixBeforeUnits.Contains(parsedUnit.UnitInfo.Unit))
-                {
-                    //The default behaviour is preferring units before prefixes but this
-                    //rule has exceptions.
-                    parsedUnit.UnitInfo = new UnitInfo(parsedUnit.UnitInfo.Value);
-                }
-            }
-
-            return parsedUnit;
-        }
-
-        private static ParsedUnit CheckPrefixes(ParsedUnit parsedUnit)
-        {
-            if (parsedUnit.InputToParse.Length < 2) return parsedUnit;
-
-            string origString = parsedUnit.InputToParse;
-
-            parsedUnit.UnitInfo.Prefix = new Prefix
-            (
-                parsedUnit.UnitInfo.Prefix.PrefixUsage
-            );
-
-            ParsedUnit tempSI = CheckSIPrefixes(new ParsedUnit(parsedUnit));
-            ParsedUnit tempBinary = CheckBinaryPrefixes(new ParsedUnit(parsedUnit));
-
-            if (tempSI.UnitInfo.Prefix.Factor != 1m)
-            {
-                if (tempBinary.UnitInfo.Prefix.Factor != 1m)
-                {
-                    //Both SI and binary prefixes were detected, what is an error.
-                    parsedUnit = new ParsedUnit();
-                    parsedUnit.InputToParse = origString;
-                    parsedUnit.UnitInfo.Error = new ErrorInfo(ErrorTypes.InvalidUnit);
-                }
-                else parsedUnit = new ParsedUnit(tempSI);
-            }
-            else if (tempBinary.UnitInfo.Prefix.Factor != 1m)
-            {
-                parsedUnit = new ParsedUnit(tempBinary);
-            }
-
-            return parsedUnit;
-        }
-
-        private static ParsedUnit CheckBinaryPrefixes(ParsedUnit parsedUnit)
-        {
-            return CheckPrefixes
-            (
-                parsedUnit, PrefixTypes.Binary,
-                AllBinaryPrefixSymbols, AllBinaryPrefixNames
-            );
-        }
-
-        private static ParsedUnit CheckSIPrefixes(ParsedUnit parsedUnit)
-        {
-            return CheckPrefixes
-            (
-                parsedUnit, PrefixTypes.SI,
-                AllSIPrefixSymbols, AllSIPrefixNames
-            );
-        }
-
-        private static ParsedUnit CheckPrefixes(ParsedUnit parsedUnit, PrefixTypes prefixType, Dictionary<string, decimal> allPrefixes, Dictionary<string, string> allPrefixNames)
-        {
-            string remString = "";
-            foreach (var prefix in allPrefixes)
-            {
-                if (parsedUnit.InputToParse.ToLower().StartsWith(allPrefixNames[prefix.Key]))
-                {
-                    remString = parsedUnit.InputToParse.Substring(allPrefixNames[prefix.Key].Length);
-                }
-                else if (parsedUnit.InputToParse.StartsWith(prefix.Key))
-                {
-                    remString = parsedUnit.InputToParse.Substring(prefix.Key.Length);
-                }
-                if (remString != "")
-                {
-                    return AnalysePrefix
-                    (
-                        parsedUnit, prefixType, prefix, remString
-                    );
-                }
-            }
-
-            return parsedUnit;
-        }
-
-        private static ParsedUnit AnalysePrefix(ParsedUnit parsedUnit, PrefixTypes prefixType, KeyValuePair<string, decimal> prefix, string remString)
-        {
-            Units unit = GetUnitFromString(remString);
-
-            if (unit != Units.None && PrefixCanBeUsedBasic(unit, prefixType, parsedUnit.UnitInfo.Prefix.PrefixUsage))
-            {
-                parsedUnit.UnitInfo = UpdateUnitInformation
-                (
-                    parsedUnit.UnitInfo, unit, new Prefix
-                    (
-                        prefix.Value, parsedUnit.UnitInfo.Prefix.PrefixUsage
-                    )
-                );
-
-                //Useful in case of looking for further prefixes.
-                parsedUnit.InputToParse = remString;
-            }
-
-            return parsedUnit;
-        }
-
-        private static UnitInfo UpdateUnitInformation(UnitInfo unitInfo, Units unit, Prefix prefix)
-        {
-            unitInfo.Unit = unit;
-            unitInfo.Prefix = new Prefix(prefix);
-            unitInfo.Parts = GetUnitParts(unitInfo).Parts;
-
-            return unitInfo;
-        }
-
-        private static bool PrefixCanBeUsedBasic(Units unit, PrefixTypes prefixType, PrefixUsageTypes prefixUsage)
-        {
-            if (prefixUsage == PrefixUsageTypes.AllUnits) return true;
-
-            if (prefixType == PrefixTypes.SI)
-            {
-                if (AllOtherSIPrefixUnits.Contains(unit)) return true;
-
-                UnitSystems system = GetSystemFromUnit(unit);
-                return (system == UnitSystems.SI || system == UnitSystems.CGS);
-            }
-            else if (prefixType == PrefixTypes.Binary && GetTypeFromUnit(unit) == UnitTypes.Information)
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-        private static string GetUnitStringIndividual(UnitInfo unitInfo)
-        {
-            string unitString = "None";
-
-            if (unitInfo.Unit != Units.None && unitInfo.Unit != Units.Unitless && !AllUnnamedUnits.ContainsValue(unitInfo.Unit))
-            {
-                if (AllUnitSymbols.ContainsValue(unitInfo.Unit))
-                {
-                    unitString = AllUnitSymbols.First(x => x.Value == unitInfo.Unit).Key;
-                    if (unitInfo.Prefix.Symbol != "")
-                    {
-                        unitString = unitInfo.Prefix.Symbol + unitString;
-                    }
-                }
-            }
-
-            return unitString;
-        }
-
-        private static ParsedUnit ImproveIndividualUnitPart(ParsedUnit parsedUnit)
-        {
-            if (parsedUnit.UnitInfo.Unit == Units.None || parsedUnit.UnitInfo.Error.Type != ErrorTypes.None)
-            {
-                return parsedUnit;
-            }
-
-            if (parsedUnit.UnitInfo.Parts.Count == 0)
-            {
-                parsedUnit.UnitInfo = GetUnitParts(parsedUnit.UnitInfo);
-            }
-
-            if (parsedUnit.UnitInfo.Parts.Count == 1)
-            {
-                //Parsing an individual unit might output more than 1 part.
-                if (parsedUnit.UnitInfo.Parts[0].Prefix.Factor != 1m)
-                {
-                    //A unit like 1 km should be understood as 1 metre with a kilo prefix, formed
-                    //by one part of a meter (no prefix). Note that the compound parsing methods
-                    //take care of this issue automatically.
-                    parsedUnit.UnitInfo.Prefix = new Prefix
-                    (
-                        parsedUnit.UnitInfo.Parts[0].Prefix
-                    );
-                    parsedUnit.UnitInfo.Parts[0].Prefix = new Prefix(parsedUnit.UnitInfo.Parts[0].Prefix.PrefixUsage);
-                }
-            }
-
-            return parsedUnit;
-        }
-    }
-}


Only creating a composite member population when necessary

--- AgileMapper/PopulationProcessing/NullNestedSourceMemberPopulationGuarder.cs
+++ AgileMapper/PopulationProcessing/NullNestedSourceMemberPopulationGuarder.cs
@@ -2,6 +2,7 @@
 {
     using System.Collections.Generic;
     using System.Linq;
+    using Extensions;
     using ObjectPopulation;

     internal class NullNestedSourceMemberPopulationGuarder : IPopulationProcessor
@@ -13,7 +14,9 @@
             var guardedPopulations = populations
                 .GroupBy(p => string.Join(",", p.NestedSourceMemberAccesses.Select(m => m.ToString())))
                 .OrderBy(grp => grp.Key)
-                .Select(grp => new CompositeMemberPopulation(grp.ToArray()))
+                .Select(grp => grp.HasOne()
+                    ? grp.First()
+                    : new CompositeMemberPopulation(grp.ToArray()))
                 .Select(GetGuardedPopulation)
                 .ToArray();


Update property naming convention

Update property naming convention

--- Assets/MixedRealityToolkit.Services/InputSimulation/SimulatedGestureHand.cs
+++ Assets/MixedRealityToolkit.Services/InputSimulation/SimulatedGestureHand.cs
@@ -32,7 +32,7 @@
         private Vector3 cumulativeDelta = Vector3.zero;
         private MixedRealityPose currentGripPose = MixedRealityPose.ZeroIdentity;

-        private Vector3 navigationDelta => new Vector3(
+        private Vector3 NavigationDelta => new Vector3(
             Mathf.Clamp(cumulativeDelta.x, -1.0f, 1.0f) * currentRailsUsed.x,
             Mathf.Clamp(cumulativeDelta.y, -1.0f, 1.0f) * currentRailsUsed.y,
             Mathf.Clamp(cumulativeDelta.z, -1.0f, 1.0f) * currentRailsUsed.z);
@@ -293,7 +293,7 @@
             if (navigationInProgress)
             {
                 UpdateNavigationRails();
-                CoreServices.InputSystem?.RaiseGestureUpdated(this, navigationAction, navigationDelta);
+                CoreServices.InputSystem?.RaiseGestureUpdated(this, navigationAction, NavigationDelta);
             }
         }

@@ -301,7 +301,7 @@
         {
             if (navigationInProgress)
             {
-                CoreServices.InputSystem?.RaiseGestureCompleted(this, navigationAction, navigationDelta);
+                CoreServices.InputSystem?.RaiseGestureCompleted(this, navigationAction, NavigationDelta);
                 navigationInProgress = false;
                 return true;
             }


Finished changes to group to use join statements and some group cleanup.

--- Aurora/Services/DataService/Connectors/Local/LocalGroupsServiceConnector.cs
+++ Aurora/Services/DataService/Connectors/Local/LocalGroupsServiceConnector.cs
@@ -105,7 +105,7 @@
             //Add everyone role to group
             AddRoleToGroup(founderID, groupID, UUID.Zero, "Everyone", "Everyone in the group is in the everyone role.", "Member of " + name, EveryonePowers);

-            ulong groupPowers = 296868139497678;
+            const ulong groupPowers = 296868139497678;

             UUID officersRole = UUID.Random();
             //Add officers role to group
@@ -160,7 +160,7 @@
                 Dictionary<string, object> row = new Dictionary<string, object>(10);
                 row["GroupID"] = groupID;
                 row["NoticeID"] = noticeID;
-                row["Timestamp"] = ((uint) Util.UnixTimeSinceEpoch());
+                row["Timestamp"] = ((uint)Util.UnixTimeSinceEpoch());
                 row["FromName"] = fromName.MySqlEscape(50);
                 row["Subject"] = subject.MySqlEscape(50);
                 row["Message"] = message.MySqlEscape(1024);
@@ -182,7 +182,7 @@

             QueryFilter filter = new QueryFilter();
             filter.andFilters["AgentID"] = AgentID;
-            if (data.Query(new string[1] { "*" }, "osagent", filter, null, null, null).Count != 0)
+            if (data.Query(new[] { "*" }, "osagent", filter, null, null, null).Count != 0)
             {
                 Dictionary<string, object> values = new Dictionary<string, object>(1);
                 values["ActiveGroupID"] = GroupID;
@@ -205,7 +205,7 @@
         {
             object remoteValue = DoRemote(RequestingAgentID, AgentID);
             if (remoteValue != null || m_doRemoteOnly)
-                return (UUID)remoteValue;
+                return (UUID)remoteValue; // note: this is bad, you can't cast a null object to a UUID

             QueryFilter filter = new QueryFilter();
             filter.andFilters["AgentID"] = AgentID;
@@ -245,7 +245,7 @@
             where["AgentID"] = AgentID;
             where["GroupID"] = GroupID;

-            if (data.Query(new string[1] { "*" }, "osgroupmembership", new QueryFilter
+            if (data.Query(new[] { "*" }, "osgroupmembership", new QueryFilter
             {
                 andFilters = where
             }, null, null, null).Count != 0)
@@ -253,17 +253,14 @@
                 MainConsole.Instance.Error("[AGM]: Agent " + AgentID + " is already in " + GroupID);
                 return;
             }
-            else
-            {
-                Dictionary<string, object> row = new Dictionary<string, object>(6);
-                row["GroupID"] = GroupID;
-                row["AgentID"] = AgentID;
-                row["SelectedRoleID"] = RoleID;
-                row["Contribution"] = 0;
-                row["ListInProfile"] = 1;
-                row["AcceptNotices"] = 1;
-                data.Insert("osgroupmembership", row);
-            }
+            Dictionary<string, object> row = new Dictionary<string, object>(6);
+            row["GroupID"] = GroupID;
+            row["AgentID"] = AgentID;
+            row["SelectedRoleID"] = RoleID;
+            row["Contribution"] = 0;
+            row["ListInProfile"] = 1;
+            row["AcceptNotices"] = 1;
+            data.Insert("osgroupmembership", row);

             // Make sure they're in the Everyone role
             AddAgentToRole(requestingAgentID, AgentID, GroupID, UUID.Zero);
@@ -281,7 +278,7 @@
             //Allow kicking yourself
             object remoteValue = DoRemote(requestingAgentID, AgentID, GroupID);
             if (remoteValue != null || m_doRemoteOnly)
-                return remoteValue == null ? false : (bool)remoteValue;
+                return remoteValue != null && (bool)remoteValue;

             if ((CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.RemoveMember)) && (requestingAgentID != AgentID))
             {
@@ -289,7 +286,7 @@
                 filter.andFilters["AgentID"] = AgentID;
                 filter.andFilters["ActiveGroupID"] = GroupID;

-                Dictionary<string, object> values = new Dictionary<string,object>(1);
+                Dictionary<string, object> values = new Dictionary<string, object>(1);
                 values["ActiveGroupID"] = UUID.Zero;

                 // 1. If group is agent's active group, change active group to uuidZero
@@ -310,9 +307,9 @@
         }

         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
-        public void AddRoleToGroup(UUID requestingAgentID, UUID GroupID, UUID RoleID, string Name, string Description, string Title, ulong Powers)
-        {
-            object remoteValue = DoRemote(requestingAgentID, GroupID, RoleID, Name, Description, Title, Powers);
+        public void AddRoleToGroup(UUID requestingAgentID, UUID GroupID, UUID RoleID, string NameOf, string Description, string Title, ulong Powers)
+        {
+            object remoteValue = DoRemote(requestingAgentID, GroupID, RoleID, NameOf, Description, Title, Powers);
             if (remoteValue != null || m_doRemoteOnly)
                 return;

@@ -321,7 +318,7 @@
                 Dictionary<string, object> row = new Dictionary<string, object>(6);
                 row["GroupID"] = GroupID;
                 row["RoleID"] = RoleID;
-                row["Name"] = Name.MySqlEscape(50);
+                row["Name"] = NameOf.MySqlEscape(50);
                 row["Description"] = Description.MySqlEscape(50);
                 row["Title"] = Title;
                 row["Powers"] = Powers;
@@ -330,9 +327,9 @@
         }

         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
-        public void UpdateRole(UUID requestingAgentID, UUID GroupID, UUID RoleID, string Name, string Desc, string Title, ulong Powers)
-        {
-            object remoteValue = DoRemote(requestingAgentID, GroupID, RoleID, Name, Desc, Title, Powers);
+        public void UpdateRole(UUID requestingAgentID, UUID GroupID, UUID RoleID, string NameOf, string Desc, string Title, ulong Powers)
+        {
+            object remoteValue = DoRemote(requestingAgentID, GroupID, RoleID, NameOf, Desc, Title, Powers);
             if (remoteValue != null || m_doRemoteOnly)
                 return;

@@ -340,9 +337,9 @@
             {
                 Dictionary<string, object> values = new Dictionary<string, object>();
                 values["RoleID"] = RoleID;
-                if (Name != null)
-                {
-                    values["Name"] = Name.MySqlEscape(512);
+                if (NameOf != null)
+                {
+                    values["Name"] = NameOf.MySqlEscape(512);
                 }
                 if (Desc != null)
                 {
@@ -395,10 +392,10 @@
             if (remoteValue != null || m_doRemoteOnly)
                 return;

-            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.AssignMember))
+            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.AssignMember))
             {
                 //This isn't an open and shut case, they could be setting the agent to their role, which would allow for AssignMemberLimited
-                if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.AssignMemberLimited))
+                if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.AssignMemberLimited))
                 {
                     MainConsole.Instance.Warn("[AGM]: User " + requestingAgentID + " attempted to add user " + AgentID +
                                " to group " + GroupID + ", but did not have permissions to do so!");
@@ -411,7 +408,7 @@
             filter.andFilters["RoleID"] = RoleID;
             filter.andFilters["AgentID"] = AgentID;
             //Make sure they arn't already in this role
-            if (uint.Parse(data.Query(new string[1] { "COUNT(AgentID)" }, "osgrouprolemembership", filter, null, null, null)[0]) == 0)
+            if (uint.Parse(data.Query(new[] { "COUNT(AgentID)" }, "osgrouprolemembership", filter, null, null, null)[0]) == 0)
             {
                 Dictionary<string, object> row = new Dictionary<string, object>(3);
                 row["GroupID"] = GroupID;
@@ -582,8 +579,7 @@
             OpenMetaverse.StructuredData.OSDMap map = GenericUtils.GetGeneric(p.GroupID, p.VoteID.ToString(), agentID.ToString(), data);
             if (map != null)
                 return map["Vote"];
-            else
-                return "";
+            return "";
         }

         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
@@ -606,10 +602,9 @@
         {
             object remoteValue = DoRemote(requestingAgentID, GroupID);
             if (remoteValue != null || m_doRemoteOnly)
-                return (uint)remoteValue;
-
-            List<UUID> GroupIDs = new List<UUID>();
-            GroupIDs.Add(GroupID);
+                return (uint)remoteValue; // note: this is bad, you can't cast a null object to a uint
+
+            List<UUID> GroupIDs = new List<UUID> { GroupID };
             return GetNumberOfGroupNotices(requestingAgentID, GroupIDs);
         }

@@ -618,20 +613,22 @@
         {
             object remoteValue = DoRemote(requestingAgentID, GroupIDs);
             if (remoteValue != null || m_doRemoteOnly)
-                return (uint)remoteValue;
+                return (uint)remoteValue; // note: this is bad, you can't cast a null object to a uint

             bool had = GroupIDs.Count > 0;

             List<UUID> groupIDs = new List<UUID>();
             if (!agentsCanBypassGroupNoticePermsCheck.Contains(requestingAgentID))
             {
+#if (!ISWIN)
                 foreach (UUID GroupID in GroupIDs)
                 {
                     if (CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.ReceiveNotices))
-                    {
                         groupIDs.Add(GroupID);
-                    }
                 }
+#else
+                groupIDs.AddRange(GroupIDs.Where(GroupID => CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.ReceiveNotices)));
+#endif
             }
             else
             {
@@ -645,16 +642,13 @@

             QueryFilter filter = new QueryFilter();
             List<object> filterGroupIDs = new List<object>(groupIDs.Count);
-            foreach (UUID GroupID in groupIDs)
-            {
-                filterGroupIDs.Add(GroupID);
-            }
+            filterGroupIDs.AddRange(groupIDs.Cast<object>());
             if (filterGroupIDs.Count > 0)
             {
                 filter.orMultiFilters["GroupID"] = filterGroupIDs;
             }

-            return uint.Parse(data.Query(new string[1] { "COUNT(NoticeID)" }, "osgroupnotice", filter, null, null, null)[0]);
+            return uint.Parse(data.Query(new[] { "COUNT(NoticeID)" }, "osgroupnotice", filter, null, null, null)[0]);
         }

         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
@@ -662,24 +656,26 @@
         {
             object remoteValue = DoRemote(requestingAgentID, boolFields);
             if (remoteValue != null || m_doRemoteOnly)
-                return (uint)remoteValue;
+                return (uint)remoteValue; // note: this is bad, you can't cast a null object to a uint

             QueryFilter filter = new QueryFilter();

             string[] BoolFields = { "OpenEnrollment", "ShowInList", "AllowPublish", "MaturePublish" };
             foreach (string field in BoolFields)
             {
-                if (boolFields.ContainsKey(field) == true)
+                if (boolFields.ContainsKey(field))
                 {
                     filter.andFilters[field] = boolFields[field] ? "1" : "0";
                 }
             }

-            return uint.Parse(data.Query(new string[1] { "COUNT(GroupID)" }, "osgroup", filter, null, null, null)[0]);
-        }
-
-        private static GroupRecord GroupRecordQueryResult2GroupRecord(List<String> result){
-            return new GroupRecord{
+            return uint.Parse(data.Query(new[] { "COUNT(GroupID)" }, "osgroup", filter, null, null, null)[0]);
+        }
+
+        private static GroupRecord GroupRecordQueryResult2GroupRecord(List<String> result)
+        {
+            return new GroupRecord
+            {
                 GroupID = UUID.Parse(result[0]),
                 GroupName = result[1],
                 Charter = result[2],
@@ -701,12 +697,8 @@
             if (remoteValue != null || m_doRemoteOnly)
                 return (GroupRecord)remoteValue;

-            GroupRecord record = new GroupRecord();
-
-            QueryFilter filter = new QueryFilter();
-
-            List<string> Keys = new List<string>();
-            List<object> Values = new List<object>();
+            QueryFilter filter = new QueryFilter();
+
             if (GroupID != UUID.Zero)
             {
                 filter.andFilters["GroupID"] = GroupID;
@@ -719,7 +711,7 @@
             {
                 return null;
             }
-            List<string> osgroupsData = data.Query(new string[11]{
+            List<string> osgroupsData = data.Query(new[]{
                 "GroupID",
                 "Name",
                 "Charter",
@@ -738,7 +730,7 @@
         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
         public List<GroupRecord> GetGroupRecords(UUID requestingAgentID, uint start, uint count, Dictionary<string, bool> sort, Dictionary<string, bool> boolFields)
         {
-//            List<string> filter = new List<string>();
+            //            List<string> filter = new List<string>();

             object remoteValue = DoRemote(requestingAgentID, start, count, boolFields);
             if (remoteValue != null || m_doRemoteOnly)
@@ -746,11 +738,10 @@

             string[] sortAndBool = { "OpenEnrollment", "MaturePublish" };
             string[] BoolFields = { "OpenEnrollment", "ShowInList", "AllowPublish", "MaturePublish" };
-            string[] SortFields = { "Name", "MembershipFee", "OpenEnrollment", "MaturePublish" };

             foreach (string field in sortAndBool)
             {
-                if (boolFields.ContainsKey(field) == true && sort.ContainsKey(field) == true)
+                if (boolFields.ContainsKey(field) && sort.ContainsKey(field))
                 {
                     sort.Remove(field);
                 }
@@ -760,7 +751,7 @@

             foreach (string field in BoolFields)
             {
-                if (boolFields.ContainsKey(field) == true)
+                if (boolFields.ContainsKey(field))
                 {
                     filter.andFilters[field] = boolFields[field] ? "1" : "0";
                 }
@@ -768,7 +759,7 @@

             List<GroupRecord> Reply = new List<GroupRecord>();

-            List<string> osgroupsData = data.Query(new string[]{
+            List<string> osgroupsData = data.Query(new[]{
                 "GroupID",
                 "Name",
                 "Charter",
@@ -786,7 +777,7 @@
             {
                 return Reply;
             }
-            for (int i = 0; i < osgroupsData.Count; i+= 11)
+            for (int i = 0; i < osgroupsData.Count; i += 11)
             {
                 Reply.Add(GroupRecordQueryResult2GroupRecord(osgroupsData.GetRange(i, 11)));
             }
@@ -813,7 +804,7 @@
                 filter.orMultiFilters["GroupID"].Add(groupID);
             }

-            List<string> osgroupsData = data.Query(new string[11]{
+            List<string> osgroupsData = data.Query(new[]{
                 "GroupID",
                 "Name",
                 "Charter",
@@ -845,7 +836,7 @@
             if (remoteValue != null || m_doRemoteOnly)
                 return (GroupProfileData)remoteValue;

-            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.MemberVisible))
+            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.MemberVisible))
                 return new GroupProfileData();

             GroupProfileData GPD = new GroupProfileData();
@@ -858,19 +849,19 @@
             QueryFilter filter2 = new QueryFilter();
             filter2.andFilters["GroupID"] = GroupID;

-            List<string> Membership = data.Query(new string[3]{
+            List<string> Membership = data.Query(new[]{
                 "Contribution",
                 "ListInProfile",
                 "SelectedRoleID"
             }, "osgroupmembership", filter1, null, null, null);

-            int GroupMemCount = int.Parse(data.Query(new string[] { "COUNT(AgentID)" }, "osgroupmembership", filter2, null, null, null)[0]);
-
-            int GroupRoleCount = int.Parse(data.Query(new string[] { "COUNT(RoleID)" }, "osrole", filter2, null, null, null)[0]);
+            int GroupMemCount = int.Parse(data.Query(new[] { "COUNT(AgentID)" }, "osgroupmembership", filter2, null, null, null)[0]);
+
+            int GroupRoleCount = int.Parse(data.Query(new[] { "COUNT(RoleID)" }, "osrole", filter2, null, null, null)[0]);

             QueryFilter filter3 = new QueryFilter();
             filter3.andFilters["RoleID"] = Membership[2];
-            List<string> GroupRole = data.Query(new string[] {
+            List<string> GroupRole = data.Query(new[] {
                 "Name",
                 "Powers"
             }, "osrole", filter3, null, null, null);
@@ -901,7 +892,7 @@
         {
             object remoteValue = DoRemote(requestingAgentID, GroupID, AgentID);
             if (remoteValue != null || m_doRemoteOnly)
-                return (GroupMembershipData) remoteValue;
+                return (GroupMembershipData)remoteValue;

             if (GroupID == UUID.Zero)
                 GroupID = GetAgentActiveGroup(requestingAgentID, AgentID);
@@ -910,7 +901,7 @@
             tables.AddTable("osgroup", "osg");
             tables.AddTable("osgroupmembership", "osgm", JoinType.Inner, new[,] { { "osg.GroupID", "osgm.GroupID" } });
             tables.AddTable("osrole", "osr", JoinType.Inner, new[,] { { "osgm.SelectedRoleID", "osr.RoleID" } });
-
+
             QueryFilter filter = new QueryFilter();
             filter.andFilters["osg.GroupID"] = GroupID;
             filter.andFilters["osgm.AgentID"] = AgentID;
@@ -934,28 +925,28 @@
                     "osg.ShowInList"
                 };
             List<string> Membership = data.Query(fields, tables, filter, null, null, null);
-
+
             GroupMembershipData GMD = new GroupMembershipData
-                {
-                    AcceptNotices = int.Parse(Membership[0]) == 1,
-                    Active = true, //TODO: Figure out what this is and its effects if false
-                    ActiveRole = UUID.Parse(Membership[3]),
-                    AllowPublish = int.Parse(Membership[6]) == 1,
-                    Charter = Membership[7],
-                    Contribution = int.Parse(Membership[1]),
-                    FounderID = UUID.Parse(Membership[8]),
-                    GroupID = GroupID,
-                    GroupName = Membership[9],
-                    GroupPicture = UUID.Parse(Membership[10]),
-                    GroupPowers = ulong.Parse(Membership[5]),
-                    GroupTitle = Membership[4],
-                    ListInProfile = int.Parse(Membership[2]) == 1,
-                    MaturePublish = int.Parse(Membership[11]) == 1,
-                    MembershipFee = int.Parse(Membership[12]),
-                    OpenEnrollment = int.Parse(Membership[13]) == 1,
-                    ShowInList = int.Parse(Membership[14]) == 1
-                };
-
+            {
+                AcceptNotices = int.Parse(Membership[0]) == 1,
+                Active = true, //TODO: Figure out what this is and its effects if false
+                ActiveRole = UUID.Parse(Membership[3]),
+                AllowPublish = int.Parse(Membership[6]) == 1,
+                Charter = Membership[7],
+                Contribution = int.Parse(Membership[1]),
+                FounderID = UUID.Parse(Membership[8]),
+                GroupID = GroupID,
+                GroupName = Membership[9],
+                GroupPicture = UUID.Parse(Membership[10]),
+                GroupPowers = ulong.Parse(Membership[5]),
+                GroupTitle = Membership[4],
+                ListInProfile = int.Parse(Membership[2]) == 1,
+                MaturePublish = int.Parse(Membership[11]) == 1,
+                MembershipFee = int.Parse(Membership[12]),
+                OpenEnrollment = int.Parse(Membership[13]) == 1,
+                ShowInList = int.Parse(Membership[14]) == 1
+            };
+

             return GMD;
         }
@@ -983,9 +974,9 @@
                 "osr.Name"
             }, tables, filter, null, null, null);

-
+
             List<GroupTitlesData> titles = new List<GroupTitlesData>();
-            for (int loop = 0; loop < Membership.Count(); loop+=3)
+            for (int loop = 0; loop < Membership.Count(); loop += 3)
             {
                 titles.Add(new GroupTitlesData { Name = Membership[loop + 2], UUID = UUID.Parse(Membership[loop + 1]), Selected = Membership[loop + 0] == Membership[loop + 1] });
             }
@@ -1031,26 +1022,26 @@
             for (int loop = 0; loop < Membership.Count; loop += fields.Length)
             {
                 results.Add(new GroupMembershipData
-                                {
-                                    AcceptNotices = int.Parse(Membership[loop + 0]) == 1,
-                                    Active = true,
-                                    //TODO: Figure out what this is and its effects if false
-                                    ActiveRole = UUID.Parse(Membership[loop + 3]),
-                                    AllowPublish = int.Parse(Membership[loop + 6]) == 1,
-                                    Charter = Membership[loop + 7],
-                                    Contribution = int.Parse(Membership[loop + 1]),
-                                    FounderID = UUID.Parse(Membership[loop + 8]),
-                                    GroupID = UUID.Parse(Membership[loop + 15]),
-                                    GroupName = Membership[loop + 9],
-                                    GroupPicture = UUID.Parse(Membership[loop + 10]),
-                                    GroupPowers = ulong.Parse(Membership[loop + 5]),
-                                    GroupTitle = Membership[loop + 4],
-                                    ListInProfile = int.Parse(Membership[loop + 2]) == 1,
-                                    MaturePublish = int.Parse(Membership[loop + 11]) == 1,
-                                    MembershipFee = int.Parse(Membership[loop + 12]),
-                                    OpenEnrollment = int.Parse(Membership[loop + 13]) == 1,
-                                    ShowInList = int.Parse(Membership[loop + 14]) == 1
-                                });
+                {
+                    AcceptNotices = int.Parse(Membership[loop + 0]) == 1,
+                    Active = true,
+                    //TODO: Figure out what this is and its effects if false
+                    ActiveRole = UUID.Parse(Membership[loop + 3]),
+                    AllowPublish = int.Parse(Membership[loop + 6]) == 1,
+                    Charter = Membership[loop + 7],
+                    Contribution = int.Parse(Membership[loop + 1]),
+                    FounderID = UUID.Parse(Membership[loop + 8]),
+                    GroupID = UUID.Parse(Membership[loop + 15]),
+                    GroupName = Membership[loop + 9],
+                    GroupPicture = UUID.Parse(Membership[loop + 10]),
+                    GroupPowers = ulong.Parse(Membership[loop + 5]),
+                    GroupTitle = Membership[loop + 4],
+                    ListInProfile = int.Parse(Membership[loop + 2]) == 1,
+                    MaturePublish = int.Parse(Membership[loop + 11]) == 1,
+                    MembershipFee = int.Parse(Membership[loop + 12]),
+                    OpenEnrollment = int.Parse(Membership[loop + 13]) == 1,
+                    ShowInList = int.Parse(Membership[loop + 14]) == 1
+                });
             }
             return results;
         }
@@ -1068,7 +1059,8 @@
             where["AgentID"] = requestingAgentID;
             where["InviteID"] = inviteID;

-            List<string> groupInvite = data.Query(new string[1] { "*" }, "osgroupinvite", new QueryFilter{
+            List<string> groupInvite = data.Query(new[] { "*" }, "osgroupinvite", new QueryFilter
+            {
                 andFilters = where
             }, null, null, null);

@@ -1095,7 +1087,7 @@
             if (remoteValue != null || m_doRemoteOnly)
                 return (List<GroupInviteInfo>)remoteValue;

-            List<string> groupInvite = data.Query(new string[1] { "*" }, "osgroupinvite", filter, null, null, null);
+            List<string> groupInvite = data.Query(new[] { "*" }, "osgroupinvite", filter, null, null, null);

             List<GroupInviteInfo> invites = new List<GroupInviteInfo>();

@@ -1166,22 +1158,22 @@
         {
             object remoteValue = DoRemote(requestingAgentID, GroupID);
             if (remoteValue != null || m_doRemoteOnly)
-                return (List<GroupMembersData>) remoteValue;
-
-            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.None))
+                return (List<GroupMembersData>)remoteValue;
+
+            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.None))
             {
                 return new List<GroupMembersData>(0);
             }

             QueryTables tables = new QueryTables();
             tables.AddTable("osgroupmembership", "osgmPerm");
-            tables.AddTable("osgroupmembership", "osgm", JoinType.Inner, new[,] {{"osgmPerm.GroupID", "osgm.GroupID"}});
+            tables.AddTable("osgroupmembership", "osgm", JoinType.Inner, new[,] { { "osgmPerm.GroupID", "osgm.GroupID" } });
             tables.AddTable("osrole", "osr", JoinType.Inner,
-                            new[,] {{"osgm.SelectedRoleID", "osr.RoleID"}, {"osr.GroupID", "osgmPerm.GroupID"}});
-            tables.AddTable("osgroup", "osg", JoinType.Inner, new[,] {{"osg.GroupID", "osgmPerm.GroupID"}});
+                            new[,] { { "osgm.SelectedRoleID", "osr.RoleID" }, { "osr.GroupID", "osgmPerm.GroupID" } });
+            tables.AddTable("osgroup", "osg", JoinType.Inner, new[,] { { "osg.GroupID", "osgmPerm.GroupID" } });
             // left join means it doesn't have to exist
             tables.AddTable("osgrouprolemembership", "osgmOwn", JoinType.Left,
-                            new[,] {{"osg.OwnerRoleID", "osgmOwn.RoleID"}, {"osgm.AgentID", "osgmOwn.AgentID"}});
+                            new[,] { { "osg.OwnerRoleID", "osgmOwn.RoleID" }, { "osgm.AgentID", "osgmOwn.AgentID" } });

             QueryFilter filter = new QueryFilter();
             filter.andFilters["osgmPerm.GroupID"] = GroupID;
@@ -1205,16 +1197,16 @@
             for (int loop = 0; loop < Membership.Count; loop += fields.Length)
             {
                 GroupMembersData GMD = new GroupMembersData
-                                           {
-                                               AcceptNotices = (Membership[loop + 0]) == "1",
-                                               AgentID = UUID.Parse(Membership[loop + 7]),
-                                               Contribution = int.Parse(Membership[loop + 1]),
-                                               IsOwner = Membership[loop + 6] != null,
-                                               ListInProfile = (Membership[loop + 2]) == "1",
-                                               AgentPowers = ulong.Parse(Membership[loop + 5]),
-                                               Title = Membership[loop + 4],
-                                               OnlineStatus = "(Online)"
-                                           };
+                {
+                    AcceptNotices = (Membership[loop + 0]) == "1",
+                    AgentID = UUID.Parse(Membership[loop + 7]),
+                    Contribution = int.Parse(Membership[loop + 1]),
+                    IsOwner = Membership[loop + 6] != null,
+                    ListInProfile = (Membership[loop + 2]) == "1",
+                    AgentPowers = ulong.Parse(Membership[loop + 5]),
+                    Title = Membership[loop + 4],
+                    OnlineStatus = "(Online)"
+                };
                 OpenSim.Services.Interfaces.UserInfo info =
                     m_registry.RequestModuleInterface<OpenSim.Services.Interfaces.IAgentInfoService>().GetUserInfo(
                         GMD.AgentID.ToString());
@@ -1239,7 +1231,7 @@
             QueryFilter filter = new QueryFilter();
             filter.andLikeFilters["Name"] = "%" + search.MySqlEscape(50) + "%";

-            List<string> retVal = data.Query(new string[5]{
+            List<string> retVal = data.Query(new[]{
                 "GroupID",
                 "Name",
                 "ShowInList",
@@ -1248,12 +1240,11 @@
             }, "osgroup", filter, null, (uint)StartQuery, 50);

             List<DirGroupsReplyData> Reply = new List<DirGroupsReplyData>();
-            DirGroupsReplyData dirgroup;

             for (int i = 0; i < retVal.Count; i += 5)
             {
                 if (retVal[i + 2] == "0")// (ShowInList param) They don't want to be shown in search.. respect this
-                {
+                {
                     continue;
                 }

@@ -1265,14 +1256,10 @@
                     }
                 }

-                dirgroup = new DirGroupsReplyData();
-
-                dirgroup.groupID = UUID.Parse(retVal[i]);
-                dirgroup.groupName = retVal[i + 1];
-
+                DirGroupsReplyData dirgroup = new DirGroupsReplyData { groupID = UUID.Parse(retVal[i]), groupName = retVal[i + 1] };
                 filter = new QueryFilter();
                 filter.andFilters["GroupID"] = dirgroup.groupID;
-                dirgroup.members = int.Parse(data.Query(new string[1] { "COUNT(AgentID)" }, "osgroupmembership", filter, null, null, null)[0]);
+                dirgroup.members = int.Parse(data.Query(new[] { "COUNT(AgentID)" }, "osgroupmembership", filter, null, null, null)[0]);

                 Reply.Add(dirgroup);
             }
@@ -1291,7 +1278,7 @@

             QueryTables tables = new QueryTables();
             tables.AddTable("osgrouprolemembership", "osgm");
-            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] {{ "osgm.RoleID", "osr.RoleID" }});
+            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] { { "osgm.RoleID", "osr.RoleID" } });

             QueryFilter filter = new QueryFilter();
             filter.andFilters["osgm.AgentID"] = AgentID;
@@ -1311,11 +1298,11 @@

             List<GroupRolesData> RolesData = new List<GroupRolesData>();

-            for (int loop = 0; loop < Roles.Count; loop+=fields.Length)
+            for (int loop = 0; loop < Roles.Count; loop += fields.Length)
             {
                 RolesData.Add(new GroupRolesData
                 {
-                    RoleID = UUID.Parse(Roles[loop+4]),
+                    RoleID = UUID.Parse(Roles[loop + 4]),
                     Name = Roles[loop + 0],
                     Description = Roles[loop + 1],
                     Powers = ulong.Parse(Roles[loop + 3]),
@@ -1343,7 +1330,7 @@

             QueryFilter rolesFilter = new QueryFilter();
             rolesFilter.andFilters["GroupID"] = GroupID;
-            List<string> Roles = data.Query(new string[5]{
+            List<string> Roles = data.Query(new[]{
                 "Name",
                 "Description",
                 "Title",
@@ -1357,7 +1344,7 @@
             for (int i = 0; i < Roles.Count; i += 5)
             {
                 filter.andFilters["RoleID"] = UUID.Parse(Roles[i + 4]);
-                int Count = int.Parse(data.Query(new string[1] { "COUNT(AgentID)" }, "osgrouprolemembership", filter, null, null, null)[0]);
+                int Count = int.Parse(data.Query(new[] { "COUNT(AgentID)" }, "osgrouprolemembership", filter, null, null, null)[0]);

                 GroupRoles.Add(new GroupRolesData
                 {
@@ -1424,7 +1411,7 @@

             QueryFilter filter = new QueryFilter();
             filter.andFilters["NoticeID"] = noticeID;
-            List<string> notice = data.Query(new string[9]{
+            List<string> notice = data.Query(new[]{
                 "GroupID",
                 "Timestamp",
                 "FromName",
@@ -1463,7 +1450,7 @@

             QueryFilter filter = new QueryFilter();
             filter.andFilters["NoticeID"] = noticeID;
-            List<string> notice = data.Query(new string[9]{
+            List<string> notice = data.Query(new[]{
                 "GroupID",
                 "Timestamp",
                 "FromName",
@@ -1486,7 +1473,7 @@
             if (GND.HasAttachment)
             {
                 GND.ItemID = UUID.Parse(notice[4]);
-                GND.AssetType = (byte) int.Parse(notice[7]);
+                GND.AssetType = (byte)int.Parse(notice[7]);
                 GND.ItemName = notice[8];
             }

@@ -1528,7 +1515,7 @@
             if (remoteValue != null || m_doRemoteOnly)
                 return (List<GroupNoticeData>)remoteValue;

-            return GetGroupNotices(requestingAgentID, start, count, new List<UUID>(new UUID[1] { GroupID }));
+            return GetGroupNotices(requestingAgentID, start, count, new List<UUID>(new[] { GroupID }));
         }

         [CanBeReflected(ThreatLevel = OpenSim.Services.Interfaces.ThreatLevel.Low)]
@@ -1541,6 +1528,7 @@
             List<UUID> groupIDs = new List<UUID>();
             if (!agentsCanBypassGroupNoticePermsCheck.Contains(requestingAgentID))
             {
+#if (!ISWIN)
                 foreach (UUID GroupID in GroupIDs)
                 {
                     if (CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.ReceiveNotices))
@@ -1548,6 +1536,9 @@
                         groupIDs.Add(GroupID);
                     }
                 }
+#else
+                groupIDs.AddRange(GroupIDs.Where(GroupID => CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.ReceiveNotices)));
+#endif
             }
             else
             {
@@ -1565,17 +1556,17 @@
                     filter.orMultiFilters["GroupID"].Add(groupID);
                 }

-                Dictionary<string, bool> sort = new Dictionary<string,bool>(1);
+                Dictionary<string, bool> sort = new Dictionary<string, bool>(1);
                 sort["Timestamp"] = false;
-
+
                 uint? s = null;
-                if(start != 0)
+                if (start != 0)
                     s = start;
                 uint? c = null;
-                if(count != 0)
+                if (count != 0)
                     c = count;

-                List<string> notice = data.Query(new string[]{
+                List<string> notice = data.Query(new[]{
                     "GroupID",
                     "Timestamp",
                     "FromName",


Clear also NonAddressBookMembers.

Clear also NonAddressBookMembers.

--- CalDavSynchronizer/Implementation/DistributionLists/DistListEntityMapper.cs
+++ CalDavSynchronizer/Implementation/DistributionLists/DistListEntityMapper.cs
@@ -45,6 +45,7 @@
     public Task<DistributionList> Map1To2(GenericComObjectWrapper<DistListItem> source, DistributionList target, IEntityMappingLogger logger, DistributionListSychronizationContext context)
     {
       target.Members.Clear();
+      target.NonAddressBookMembers.Clear();
       target.Name = source.Inner.DLName;
       target.Description = source.Inner.Body;


Small fixes to PR #2290

Small fixes to PR #2290

--- Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectTeams.cs
+++ Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectTeams.cs
@@ -903,13 +903,25 @@

         private static string ReplaceAccentedCharactersWithLatin(string str)
         {
-            const string a = "[äåàá]";
-            var regex = new Regex(a);
+            const string a = "[äåàáâã]";
+            var regex = new Regex(a, RegexOptions.IgnoreCase);
             str = regex.Replace(str, "a");

-            const string o = "[öòó]";
-            regex = new Regex(o);
+            const string e = "[èéêë]";
+            regex = new Regex(e, RegexOptions.IgnoreCase);
+            str = regex.Replace(str, "e");
+
+            const string i = "[ìíîï]";
+            regex = new Regex(i, RegexOptions.IgnoreCase);
+            str = regex.Replace(str, "i");
+
+            const string o = "[öòóôõ]";
+            regex = new Regex(o, RegexOptions.IgnoreCase);
             str = regex.Replace(str, "o");
+
+            const string u = "[üùúû]";
+            regex = new Regex(u, RegexOptions.IgnoreCase);
+            str = regex.Replace(str, "u");

             return str;
         }


Added comment on InsertShapes.

Added comment on InsertShapes.


Update FindingDataOrFormulasUsingFindOptions.cs

--- Examples/CSharp/Data/Handling/Find/FindingDataOrFormulasUsingFindOptions.cs
+++ Examples/CSharp/Data/Handling/Find/FindingDataOrFormulasUsingFindOptions.cs
@@ -9,6 +9,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -52,7 +53,7 @@
             {
                 Console.WriteLine("Record not found ");
             }
-
+            //ExEnd:1
         }
     }
-}+}


Correct falt. Non-duplicate solution are considering all locations when performing its tasks, however it have to consider only the current location.

--- LocationCodeRefactoring/Spg.LocationRefactor.Controller/EditorController.cs
+++ LocationCodeRefactoring/Spg.LocationRefactor.Controller/EditorController.cs
@@ -10,7 +10,6 @@
 using Spg.ExampleRefactoring.Synthesis;
 using Spg.ExampleRefactoring.Util;
 using Spg.LocationRefactor.Location;
-using Spg.LocationRefactor.Node;
 using Spg.LocationRefactor.Observer;
 using Spg.LocationRefactor.Operator.Filter;
 using Spg.LocationRefactor.Operator.Map;
@@ -104,7 +103,6 @@
         /// </summary>
         public Dictionary<string, bool> FilesOpened { get; set; }

-
         /// <summary>
         /// Locations computed so far
         /// </summary>
@@ -360,7 +358,6 @@
         /// <summary>
         /// Retrieve locations
         /// </summary>
-        /// <param name="program">Selected program</param>
         public void RetrieveLocations()
         {
             if (ProgramsWithNegatives != null)
@@ -597,10 +594,9 @@
             List<CodeLocation> clocations = new List<CodeLocation>();
             var groupedLocations = RegionManager.GetInstance().GroupLocationsBySourceFile(locations);

-            bool[] analized = Enumerable.Repeat(false, locations.Count).ToArray();
-
             foreach (KeyValuePair<string, List<CodeLocation>> item in groupedLocations)
             {
+                bool[] analized = Enumerable.Repeat(false, item.Value.Count).ToArray();
                 for (int i = 0; i < item.Value.Count; i++)
                 {
                     CodeLocation location = item.Value[i];
@@ -627,6 +623,11 @@
             return clocations;
         }

+        /// <summary>
+        /// Examine locations that are inside other locations
+        /// </summary>
+        /// <param name="locations">Locations</param>
+        /// <returns>Remove locations that are inside other locations</returns>
         private List<CodeLocation> SegmentBySyntaxKind(List<CodeLocation> locations)
         {
             Dictionary<CodeLocation, List<CodeLocation>> intersections = new Dictionary<CodeLocation, List<CodeLocation>>();


Implement AdapterInformation.SupportedDisplayModes

--- Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterInformation.cs
+++ Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterInformation.cs
@@ -30,7 +30,7 @@

 		public DisplayModeCollection SupportedDisplayModes {
 			get {
-				throw new NotImplementedException ();
+				return new DisplayModeCollection();
 			}
 		}


write culture invariant decimals

write culture invariant decimals

--- model/Models/Table.cs
+++ model/Models/Table.cs
@@ -185,6 +185,8 @@
 									data.Write(new SoapHexBinary((byte[])dr[c.Name]).ToString());
 								else if (dr[c.Name] is DateTime)
 									data.Write(((DateTime)dr[c.Name]).ToString(_dateTimeFormat, CultureInfo.InvariantCulture));
+								else if (dr[c.Name] is float || dr[c.Name] is Double || dr[c.Name] is Decimal)
+									data.Write(Convert.ToString(dr[c.Name],CultureInfo.InvariantCulture));
 								else
 									data.Write(dr[c.Name].ToString()
 										.Replace(_tab, _escapeTab)


cs 6.0

cs 6.0

--- NLog.Extensions/NLog.Extensions/Targets/Wrappers/ConcurrentTargetWrapper.cs
+++ NLog.Extensions/NLog.Extensions/Targets/Wrappers/ConcurrentTargetWrapper.cs
@@ -43,10 +43,7 @@

         protected override void CloseTarget()
         {
-            if (timer != null)
-            {
-                timer.Dispose();
-            }
+            timer?.Dispose();
             ProcessQueue(null);

             base.CloseTarget();
@@ -133,10 +130,7 @@

                 if (eventLogQueue.Count == 0)
                 {
-                    if (asyncContinuation != null)
-                    {
-                        asyncContinuation(null);
-                    }
+                    asyncContinuation?.Invoke(null);
                 }
                 else
                 {