Do not test HKCR / HKLM in OSX

Do not test HKCR / HKLM in OSX

--- source/Htc.Vita.Core.Tests/TestCase.Registry.cs
+++ source/Htc.Vita.Core.Tests/TestCase.Registry.cs
@@ -1,4 +1,5 @@
 using System;
+using Htc.Vita.Core.Runtime;
 using Htc.Vita.Core.Util;
 using Xunit;

@@ -9,53 +10,71 @@
         [Fact]
         public void Registry_0_GetStringValue32_UnderHKCR()
         {
-            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, ".bat", null));
-            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
-            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, ".bat", null));
+                Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
+                Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
         public void Registry_0_GetStringValue32_UnderHKLM()
         {
-            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
-            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
+                Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
         public void Registry_0_GetStringValue64_UnderHKCR()
         {
-            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, ".bat", null));
-            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
-            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, ".bat", null));
+                Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
+                Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
         public void Registry_0_GetStringValue64_UnderHKLM()
         {
-            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
-            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
-            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
+                Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
+                Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
         public void Registry_0_GetStringValue_UnderHKCR()
         {
-            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, ".bat", null));
-            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
-            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, ".bat", null));
+                Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
+                Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
         public void Registry_0_GetStringValue_UnderHKLM()
         {
-            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
-            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
-            Assert.Null(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            if (Platform.IsWindows)
+            {
+                Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
+                Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
+                Assert.Null(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
+            }
         }

         [Fact]
@@ -142,22 +161,31 @@
         [Fact]
         public void Registry_4_GetIntValue32_UnderHKCR()
         {
-            Assert.True(Registry.GetDwordValue32(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
-            Assert.True(Registry.GetDwordValue32(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            if (Platform.IsWindows)
+            {
+                Assert.True(Registry.GetDwordValue32(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
+                Assert.True(Registry.GetDwordValue32(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            }
         }

         [Fact]
         public void Registry_4_GetIntValue64_UnderHKCR()
         {
-            Assert.True(Registry.GetDwordValue64(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
-            Assert.True(Registry.GetDwordValue64(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            if (Platform.IsWindows)
+            {
+                Assert.True(Registry.GetDwordValue64(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
+                Assert.True(Registry.GetDwordValue64(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            }
         }

         [Fact]
         public void Registry_4_GetIntValue_UnderHKCR()
         {
-            Assert.True(Registry.GetIntValue(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
-            Assert.True(Registry.GetIntValue(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            if (Platform.IsWindows)
+            {
+                Assert.True(Registry.GetIntValue(Registry.Hive.ClassesRoot, "textfile", "EditFlags") != 0);
+                Assert.True(Registry.GetIntValue(Registry.Hive.ClassesRoot, "textfile", "EditFlags1") == 0);
+            }
         }

         [Fact]


Fix possible access of null variable in CCLabel.LayoutLabel

--- src/label_nodes/CCLabel.cs
+++ src/label_nodes/CCLabel.cs
@@ -1378,6 +1378,9 @@
             for (int c = 0; c < Children.Count; c++)
             {
                 letterSprite = (CCSprite)Children[c];
+                if (letterSprite == null)
+                    continue;
+
                 int tag = letterSprite.Tag;
                 if(tag >= length)
                 {
@@ -1385,12 +1388,9 @@
                 }
                 else if(tag >= 0)
                 {
-                    if (letterSprite != null)
-                    {
-                        uvRect = lettersInfo[tag].Definition.Subrect;
-                        letterSprite.TextureRectInPixels = uvRect;
-                        letterSprite.ContentSize = uvRect.Size;
-                    }
+                    uvRect = lettersInfo[tag].Definition.Subrect;
+                    letterSprite.TextureRectInPixels = uvRect;
+                    letterSprite.ContentSize = uvRect.Size;
                 }
             }


Added API tests for failing scenarios

Added API tests for failing scenarios


Removed & sorted usings

Removed & sorted usings

--- tests/YAGLi.Tests/DirectedGraph/DirectedGraphContainsFunctionsDefensiveCode.cs
+++ tests/YAGLi.Tests/DirectedGraph/DirectedGraphContainsFunctionsDefensiveCode.cs
@@ -1,6 +1,5 @@
 using NFluent;
 using NUnit.Framework;
-using System;
 using System.Collections.Generic;
 using YAGLi.Tests.Utils;


Added some German abbreviations

Added some German abbreviations

--- source/xcite.tean/lang/GermanLangInfo.cs
+++ source/xcite.tean/lang/GermanLangInfo.cs
@@ -63,7 +63,7 @@
                     return tokenFactory.Consume(coreValue) + "." + (endedByWs ? " " : string.Empty);
                 });

-            /** ISSUE hint
+            /* ISSUE hint
              * The implemented algorithm is correct for sentence (1), but not for (2).
              * (1) Bitte überweisen Sie den fälligen Betrag bis zum 28.02. Wir bestätigen Ihnen umgehend den Eingang.
              * (2) Es gibt lediglich am 28.02. Termine. Bitte suchen Sie sich einen aus.
@@ -102,6 +102,7 @@
             "bzw.", "Bzw.",
             "bzgl.", "Bzgl.",
             "ca.", "Ca.",
+            "co.", "Co.",
             "ders.", "Ders.",
             "dgl.", "Dgl.",
             "dt.", "Dt.",
@@ -142,6 +143,7 @@
             "i.H.v.", "i. H. v.",
             "i.d.S.", "i. d. S.",
             "i.E.", "i. E.",
+            "i.L.", "i. L.",
             "i.S.d.", "i. S. d.",
             "i.S.v.", "i. S. v.",
             "i.ü.", "i. ü.", "i.Ü.", "i. Ü.",


Alter implementation of Reverse to avoid infinite recursion

--- src/AESharp.Core/Extensions/StringExtensions.cs
+++ src/AESharp.Core/Extensions/StringExtensions.cs
@@ -9,7 +9,9 @@
     {
         public static string Reverse( this string s )
         {
-            return new string( s.Reverse().ToArray() );
+            char[] chars = s.ToCharArray();
+            Array.Reverse( chars );
+            return new string( chars );
         }

         public static byte[] ByteRepresentationToByteArray( this string s )


Added constructors

Added constructors

--- src/ApiContractGenerator/CSharpTextFormatter.cs
+++ src/ApiContractGenerator/CSharpTextFormatter.cs
@@ -453,7 +453,7 @@
             writer.Write(')');
         }

-        public void Write(IMetadataMethod metadataMethod, string currentNamespace)
+        public void Write(IMetadataMethod metadataMethod, IMetadataType declaringType, string currentNamespace)
         {
             WriteVisibility(metadataMethod.Visibility);

@@ -468,9 +468,17 @@
             if (metadataMethod.IsOverride)
                 writer.Write("override ");

-            Write(metadataMethod.ReturnType, currentNamespace);
-            writer.Write(' ');
-            writer.Write(metadataMethod.Name);
+            if (metadataMethod.Name == ".ctor")
+            {
+                writer.Write(TrimGenericArity(declaringType.Name));
+            }
+            else
+            {
+                Write(metadataMethod.ReturnType, currentNamespace);
+                writer.Write(' ');
+                writer.Write(metadataMethod.Name);
+            }
+
             WriteGenericSignature(metadataMethod.GenericTypeParameters);
             WriteParameters(metadataMethod.Parameters, currentNamespace);
             writer.WriteLine(';');
@@ -499,9 +507,10 @@

             foreach (var method in metadataType.Methods
                 .OrderByDescending(_ => _.IsStatic)
+                .ThenByDescending(_ => _.Name == ".ctor")
                 .ThenBy(_ => _.Name))
             {
-                Write(method, currentNamespace);
+                Write(method, metadataType, currentNamespace);
             }

             foreach (var nestedType in metadataType.NestedTypes.OrderBy(_ => _.Name))
@@ -632,6 +641,12 @@
                 Write(parts.Prev);
                 writer.Write(parts.Value);
             }
+        }
+
+        private static string TrimGenericArity(string typeName)
+        {
+            var index = typeName.LastIndexOf('`');
+            return index == -1 ? typeName : typeName.Substring(0, index);
         }

         private sealed class ImmutableNode<T>
@@ -715,12 +730,6 @@
                 return new ImmutableNode<string>(array.ElementType.Accept(this), ArraySuffixesByDimension[array.Dimensions], null);
             }

-            private static string TrimGenericArity(string typeName)
-            {
-                var index = typeName.LastIndexOf('`');
-                return index == -1 ? typeName : typeName.Substring(0, index);
-            }
-
             public ImmutableNode<string> Visit(NamespaceTypeReference namespaceTypeReference)
             {
                 var nameNode = new ImmutableNode<string>(null, TrimGenericArity(namespaceTypeReference.Name), null);


Skip test due to language issue on build server

--- src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs
+++ src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs
@@ -1,4 +1,5 @@
-using Arkivverket.Arkade.Test.Tests.Noark5;
+using System.Windows.Media.Animation;
+using Arkivverket.Arkade.Test.Tests.Noark5;
 using Arkivverket.Arkade.Util;
 using Xunit;
 using FluentAssertions;
@@ -19,7 +20,7 @@
             validationErrorMessages.Count.Should().Be(0);
         }

-        [Fact]
+        [Fact (Skip="Language issue")]
         public void ShouldThrowExceptionIfXmlDoesNotValidateAgainstSchema()
         {
             var invalidAddml = addml.Replace("dataset", "datasett");


No logging in appender.

No logging in appender.

In some configurations Debug.WriteLine inside an appender could be risky. fix #5

--- src/Gelf4net/Appender/GelfUdpAppender.cs
+++ src/Gelf4net/Appender/GelfUdpAppender.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Linq;
 using System.Net;
 using System.Net.Sockets;
@@ -97,7 +96,6 @@
             var u = state.SendClient;

             var bytesSent = u.EndSend(ar);
-            Debug.WriteLine("Async bytes sent {0} chunk {1} of {2}", bytesSent, state.SendIndex, state.ChunkCount);

             state.SendIndex++;
             if (state.SendIndex < state.ChunkCount)


fix(maxbreadcrumbs): don't collect breadcrumbs when max is 0

--- src/BugsnagUnity/Native/Fallback/Breadcrumbs.cs
+++ src/BugsnagUnity/Native/Fallback/Breadcrumbs.cs
@@ -45,13 +45,17 @@
         /// <param name="breadcrumb"></param>
         public void Leave(Breadcrumb breadcrumb)
         {
+            if (Configuration.MaximumBreadcrumbs == 0)
+            {
+                return;
+            }
+
             if (breadcrumb != null)
             {
                 lock (_lock)
                 {
-                    var maximumBreadcrumbs = Configuration.MaximumBreadcrumbs;
-
-                    if (_breadcrumbs.Count == maximumBreadcrumbs)
+
+                    if (_breadcrumbs.Count == Configuration.MaximumBreadcrumbs)
                     {
                         _breadcrumbs.RemoveAt(0);
                     }


CallMethodAction should throw better exceptions

--- src/Caliburn.Xaml/Behaviors/CallMethodAction.cs
+++ src/Caliburn.Xaml/Behaviors/CallMethodAction.cs
@@ -222,7 +222,10 @@
         /// <param name="parameter">The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference.</param>
         protected override void Invoke(object parameter)
         {
-            if (Target == null) return;
+            if (Target == null)
+                throw new InvalidOperationException(string.Format("No target found for method {0}.", MethodName));
+            if (_method == null)
+                throw new InvalidOperationException(string.Format("Method {0} not found on target of type {1}.", MethodName, Target.GetType()));

             var context = new CoroutineExecutionContext
             {


Lucene.Net.Core.Analysis.Analyzer refactor: renamed protected fields camelCase prefixed with m_

--- src/Lucene.Net.Core/Analysis/Analyzer.cs
+++ src/Lucene.Net.Core/Analysis/Analyzer.cs
@@ -244,13 +244,13 @@
             /// <summary>
             /// Original source of the tokens.
             /// </summary>
-            protected internal readonly Tokenizer source;
+            protected readonly Tokenizer m_source;

             /// <summary>
             /// Sink tokenstream, such as the outer tokenfilter decorating
             /// the chain. this can be the source if there are no filters.
             /// </summary>
-            protected internal readonly TokenStream sink;
+            protected readonly TokenStream m_sink;

             /// <summary>
             /// Internal cache only used by <seealso cref="Analyzer#tokenStream(String, String)"/>. </summary>
@@ -265,8 +265,8 @@
             ///          the analyzer's resulting token stream </param>
             public TokenStreamComponents(Tokenizer source, TokenStream result)
             {
-                this.source = source;
-                this.sink = result;
+                this.m_source = source;
+                this.m_sink = result;
             }

             /// <summary>
@@ -276,8 +276,8 @@
             ///          the analyzer's tokenizer </param>
             public TokenStreamComponents(Tokenizer source)
             {
-                this.source = source;
-                this.sink = source;
+                this.m_source = source;
+                this.m_sink = source;
             }

             /// <summary>
@@ -290,7 +290,7 @@
             ///           if the component's reset method throws an <seealso cref="IOException"/> </exception>
             protected internal virtual void SetReader(TextReader reader)
             {
-                source.SetReader(reader);
+                m_source.SetReader(reader);
             }

             /// <summary>
@@ -301,7 +301,7 @@
             {
                 get
                 {
-                    return sink;
+                    return m_sink;
                 }
             }

@@ -313,7 +313,7 @@
             {
                 get
                 {
-                    return source;
+                    return m_source;
                 }
             }
         }


Adding BimapIf(...) to StringBuilderExts

--- src/CommandLine/Text/StringBuilderExtensions.cs
+++ src/CommandLine/Text/StringBuilderExtensions.cs
@@ -45,6 +45,12 @@
             return condition ? builder.Append(ifTrue) : builder.Append(ifFalse);
         }

+        private static StringBuilder BimapIf(this StringBuilder builder, bool condition,
+            Func<StringBuilder, StringBuilder> ifTrue, Func<StringBuilder, StringBuilder> ifFalse)
+        {
+            return condition ? ifTrue(builder) : ifFalse(builder);
+        }
+
         public static StringBuilder AppendIfNotEmpty(this StringBuilder builder, params string[] values)
         {
             foreach (var value in values)


Extract LoadCertificate to a local method.

--- src/MySqlConnector/Core/ServerSession.cs
+++ src/MySqlConnector/Core/ServerSession.cs
@@ -1125,81 +1125,9 @@
 				}
 			}

-			if (cs.SslCertificateFile.Length != 0 && cs.SslKeyFile.Length != 0)
-			{
-#if !NETSTANDARD1_3 && !NETSTANDARD2_0
-				m_logArguments[1] = cs.SslKeyFile;
-				Log.Debug("Session{0} loading client key from KeyFile '{1}'", m_logArguments);
-				string keyPem;
-				try
-				{
-					keyPem = File.ReadAllText(cs.SslKeyFile);
-				}
-				catch (Exception ex)
-				{
-					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
-					throw new MySqlException("Could not load client key file: " + cs.SslKeyFile, ex);
-				}
-
-				RSAParameters rsaParameters;
-				try
-				{
-					rsaParameters = Utility.GetRsaParameters(keyPem);
-				}
-				catch (FormatException ex)
-				{
-					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
-					throw new MySqlException("Could not load the client key from " + cs.SslKeyFile, ex);
-				}
-
-				try
-				{
-					RSA rsa;
-					try
-					{
-#pragma warning disable CA1416
-						// SslStream on Windows needs a KeyContainerName to be set
-						var csp = new CspParameters
-						{
-							KeyContainerName = Guid.NewGuid().ToString(),
-						};
-						rsa = new RSACryptoServiceProvider(csp)
-						{
-							PersistKeyInCsp = true,
-						};
-#pragma warning restore
-					}
-					catch (PlatformNotSupportedException)
-					{
-						rsa = RSA.Create();
-					}
-					rsa.ImportParameters(rsaParameters);
-
-#if NET45 || NET461 || NET471
-					var certificate = new X509Certificate2(cs.SslCertificateFile, "", X509KeyStorageFlags.MachineKeySet)
-					{
-						PrivateKey = rsa,
-					};
-#else
-					X509Certificate2 certificate;
-					using (var publicCertificate = new X509Certificate2(cs.SslCertificateFile))
-						certificate = publicCertificate.CopyWithPrivateKey(rsa);
-#endif
-
-					m_clientCertificate = certificate;
-					clientCertificates = new() { certificate };
-				}
-
-				catch (CryptographicException ex)
-				{
-					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
-					if (!File.Exists(cs.SslCertificateFile))
-						throw new MySqlException("Cannot find client certificate file: " + cs.SslCertificateFile, ex);
-					throw new MySqlException("Could not load the client key from " + cs.SslKeyFile, ex);
-				}
-#else
-				throw new NotSupportedException("SslCert and SslKey connection string options are not supported in netstandard1.3 or netstandard2.0.");
-#endif
+			if (cs.SslKeyFile.Length != 0 && cs.SslCertificateFile.Length != 0)
+			{
+				clientCertificates = LoadCertificate(cs.SslKeyFile, cs.SslCertificateFile);
 			}
 			else if (cs.CertificateFile.Length != 0)
 			{
@@ -1398,6 +1326,83 @@
 				caCertificateChain?.Reset();
 #else
 				caCertificateChain?.Dispose();
+#endif
+			}
+
+			// Returns a X509CertificateCollection containing the single certificate contained in 'sslKeyFile' (PEM private key) and 'sslCertificateFile' (PEM certificate).
+			X509CertificateCollection LoadCertificate(string sslKeyFile, string sslCertificateFile)
+			{
+#if !NETSTANDARD1_3 && !NETSTANDARD2_0
+				m_logArguments[1] = sslKeyFile;
+				Log.Debug("Session{0} loading client key from KeyFile '{1}'", m_logArguments);
+				string keyPem;
+				try
+				{
+					keyPem = File.ReadAllText(sslKeyFile);
+				}
+				catch (Exception ex)
+				{
+					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
+					throw new MySqlException("Could not load client key file: " + sslKeyFile, ex);
+				}
+
+				RSAParameters rsaParameters;
+				try
+				{
+					rsaParameters = Utility.GetRsaParameters(keyPem);
+				}
+				catch (FormatException ex)
+				{
+					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
+					throw new MySqlException("Could not load the client key from " + sslKeyFile, ex);
+				}
+
+				try
+				{
+					RSA rsa;
+					try
+					{
+#pragma warning disable CA1416
+						// SslStream on Windows needs a KeyContainerName to be set
+						var csp = new CspParameters
+						{
+							KeyContainerName = Guid.NewGuid().ToString(),
+						};
+						rsa = new RSACryptoServiceProvider(csp)
+						{
+							PersistKeyInCsp = true,
+						};
+#pragma warning restore
+					}
+					catch (PlatformNotSupportedException)
+					{
+						rsa = RSA.Create();
+					}
+					rsa.ImportParameters(rsaParameters);
+
+#if NET45 || NET461 || NET471
+					var certificate = new X509Certificate2(sslCertificateFile, "", X509KeyStorageFlags.MachineKeySet)
+					{
+						PrivateKey = rsa,
+					};
+#else
+					X509Certificate2 certificate;
+					using (var publicCertificate = new X509Certificate2(sslCertificateFile))
+						certificate = publicCertificate.CopyWithPrivateKey(rsa);
+#endif
+
+					m_clientCertificate = certificate;
+					return new() { certificate };
+				}
+				catch (CryptographicException ex)
+				{
+					Log.Error(ex, "Session{0} couldn't load client key from KeyFile '{1}'", m_logArguments);
+					if (!File.Exists(sslCertificateFile))
+						throw new MySqlException("Cannot find client certificate file: " + sslCertificateFile, ex);
+					throw new MySqlException("Could not load the client key from " + sslKeyFile, ex);
+				}
+#else
+				throw new NotSupportedException("SslCert and SslKey connection string options are not supported in netstandard1.3 or netstandard2.0.");
 #endif
 			}
 		}


TINKERPOP-2078 Used Traversal() in .NET template

--- gremlin-dotnet/src/Gremlin.Net.Template/Program.cs
+++ gremlin-dotnet/src/Gremlin.Net.Template/Program.cs
@@ -26,6 +26,8 @@
 using Gremlin.Net.Driver.Remote;
 using Gremlin.Net.Structure;

+using static Gremlin.Net.Process.Traversal.AnonymousTraversalSource;
+
 namespace Gremlin.Net.Template
 {
     internal class Program
@@ -37,7 +39,7 @@
         {
             using (var client = new GremlinClient(new GremlinServer(GremlinServerHostname, GremlinServerPort)))
             {
-                var g = new Graph().Traversal().WithRemote(new DriverRemoteConnection(client));
+                var g = Traversal().WithRemote(new DriverRemoteConnection(client));
                 var service = new Service(g);
                 var creators = service.FindCreatorsOfSoftware("lop");
                 foreach (var c in creators)


Css class which column is currently sorted

--- src/DotVVM.Framework/Controls/GridViewColumn.cs
+++ src/DotVVM.Framework/Controls/GridViewColumn.cs
@@ -13,9 +13,7 @@

         [MarkupOptions(MappingMode = MappingMode.InnerElement)]
         public ITemplate HeaderTemplate { get; set; }
-
-
-
+
         [MarkupOptions(AllowBinding = false)]
         public string SortExpression
         {
@@ -26,6 +24,25 @@
             DotvvmProperty.Register<string, GridViewColumn>(c => c.SortExpression);

+        [MarkupOptions(AllowBinding = false)]
+        public string SortUpCssClass
+        {
+            get { return (string)GetValue(SortUpCssClassProperty); }
+            set { SetValue(SortUpCssClassProperty, value); }
+        }
+        public static readonly DotvvmProperty SortUpCssClassProperty =
+            DotvvmProperty.Register<string, GridViewColumn>(c => c.SortUpCssClass, "SortedUp");
+
+
+        [MarkupOptions(AllowBinding = false)]
+        public string SortDownCssClass
+        {
+            get { return (string)GetValue(SortDownCssClassProperty); }
+            set { SetValue(SortDownCssClassProperty, value); }
+        }
+        public static readonly DotvvmProperty SortDownCssClassProperty =
+            DotvvmProperty.Register<string, GridViewColumn>(c => c.SortDownCssClass, "SortedDown");
+
         [MarkupOptions(AllowBinding = false)]
         public bool AllowSorting { get; set; }

@@ -83,6 +100,8 @@
                 var bindingId = linkButton.GetValue(Internal.UniqueIDProperty) + "_sortBinding";
                 var binding = new CommandBindingExpression(h => sortCommand(sortExpression), bindingId);
                 linkButton.SetBinding(ButtonBase.ClickProperty, binding);
+
+                cell.Attributes["data-bind"] = $"css: {{ {SortDownCssClass}: ko.unwrap($parent.SortExpression) == '{HeaderText}' && $parent.SortDescending(), {SortUpCssClass}: ko.unwrap($parent.SortExpression) == '{HeaderText}' && !$parent.SortDescending()}}";
             }
             else
             {


Ensure OnCommandExecutedAsync gets called for each command

--- src/DotVVM.Framework/Hosting/DotvvmPresenter.cs
+++ src/DotVVM.Framework/Hosting/DotvvmPresenter.cs
@@ -425,17 +425,20 @@
                 }
                 context.CommandException = ex;
             }
-
-            // run OnCommandExecuted on action filters
-            foreach (var filter in methodFilters.Reverse())
-            {
-                await filter.OnCommandExecutedAsync(context, action, context.CommandException);
-            }
-
-            if (context.CommandException != null && !context.IsCommandExceptionHandled)
-            {
-                throw new Exception("Unhandled exception occurred in the command!", context.CommandException);
-            }
+            finally
+            {
+                // run OnCommandExecuted on action filters
+                foreach (var filter in methodFilters.Reverse())
+                {
+                    await filter.OnCommandExecutedAsync(context, action, context.CommandException);
+                }
+
+                if (context.CommandException != null && !context.IsCommandExceptionHandled)
+                {
+                    throw new Exception("Unhandled exception occurred in the command!", context.CommandException);
+                }
+            }
+
             return null;
         }


Use ContinuationBuilder in Coalesce.

Use ContinuationBuilder in Coalesce.

--- src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
+++ src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
@@ -366,27 +366,30 @@
             return continuation(new ChooseBuilder<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, object>(this, this)).TargetQuery;
         }

-        private TReturnQuery Coalesce<TTargetQuery, TReturnQuery>(params Func<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, TTargetQuery>[] traversals)
+        private TReturnQuery Coalesce<TTargetQuery, TReturnQuery>(params Func<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, TTargetQuery>[] continuations)
             where TTargetQuery : IGremlinQueryBase
             where TReturnQuery : IGremlinQueryBase
         {
-            if (traversals.Length == 0)
+            if (continuations.Length == 0)
                 throw new ArgumentException("Coalesce must have at least one subquery.");

-            var coalesceQueries = traversals
-                .Select(traversal => ContinueInner(traversal))
-                .ToArray();
-
-            if (coalesceQueries.All(x => x.IsIdentity()))
-                return this.ChangeQueryType<TReturnQuery>();
-
-            var aggregatedSemantics = coalesceQueries
-                .Select(x => x.AsAdmin().Projection)
-                .Aggregate((x, y) => x.Lowest(y));
-
             return this
-                .AddStep(new CoalesceStep(coalesceQueries.Select(x => x.ToTraversal()).ToImmutableArray()), _ => aggregatedSemantics)
-                .ChangeQueryType<TReturnQuery>();
+                .Continue()
+                .With(continuations)
+                .Build((builder, innerQueries) =>
+                {
+                    if (innerQueries.All(innerQuery => innerQuery.IsIdentity()))
+                        return builder.Build<TReturnQuery>();
+
+                    var aggregatedProjection = innerQueries
+                        .Select(x => x.AsAdmin().Projection)
+                        .Aggregate((x, y) => x.Lowest(y));
+
+                    return builder
+                        .AddStep(new CoalesceStep(innerQueries.Select(x => x.ToTraversal()).ToImmutableArray()))
+                        .WithNewProjection(aggregatedProjection)
+                        .Build<TReturnQuery>();
+                });
         }

         private GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery> Coin(double probability) => AddStep(new CoinStep(probability));


Use Cast instead of Map.

Use Cast instead of Map.

--- src/Facility.Core/Http/HttpContentSerializer.cs
+++ src/Facility.Core/Http/HttpContentSerializer.cs
@@ -37,7 +37,7 @@
 		public async Task<ServiceResult<T>> ReadHttpContentAsync<T>(HttpContent? content, CancellationToken cancellationToken = default)
 			where T : ServiceDto
 		{
-			return (await ReadHttpContentAsync(typeof(T), content, cancellationToken).ConfigureAwait(false)).Map(x => (T) x);
+			return (await ReadHttpContentAsync(typeof(T), content, cancellationToken).ConfigureAwait(false)).Cast<T>();
 		}

 		/// <summary>


Update src/FluentNHibernate/Cfg/Db/DB2Configuration.cs

DB2 Provider is a faster DRDA provider for Informix 11.50+

--- src/FluentNHibernate/Cfg/Db/DB2Configuration.cs
+++ src/FluentNHibernate/Cfg/Db/DB2Configuration.cs
@@ -14,5 +14,10 @@
         {
             get { return new DB2Configuration().Dialect<DB2Dialect>(); }
         }
+
+        public static DB2Configuration Informix1150
+        {
+             get { return new DB2Configuration().Dialect<InformixDialect1000>(); }
+        }
     }
-}+}


Back to drag after add part

Back to drag after add part

--- src/Framework/N2/Web/Parts/CreateUrlProvider.cs
+++ src/Framework/N2/Web/Parts/CreateUrlProvider.cs
@@ -104,15 +104,17 @@
 				url = managementPaths.GetEditNewPageUrl(parent, template.Definition, zone, CreationPosition.Below);
 			}
 			string beforeSortOrder = request["beforeSortOrder"];
-			url = url.AppendQuery("beforeSortOrder", beforeSortOrder);
+			url = url.SetQueryParameter("beforeSortOrder", beforeSortOrder);

 			if (!string.IsNullOrEmpty(request["versionIndex"]))
-				url = url.AppendQuery("vi", request["versionIndex"]);
+				url = url.SetQueryParameter("vi", request["versionIndex"]);
 			if (!string.IsNullOrEmpty(request["versionKey"]))
-				url = url.AppendQuery("versionKey", request["versionKey"]);
+				url = url.SetQueryParameter("versionKey", request["versionKey"]);

 			if (!string.IsNullOrEmpty(request["returnUrl"]))
-				url = url.AppendQuery("returnUrl", request["returnUrl"]);
+				url = url.SetQueryParameter("returnUrl", request["returnUrl"]);
+
+			url = url.SetQueryParameter("edit", "drag");
 			return url;
 		}


Fixed an oversight in sequencer deprecation. This fixes a runaway loop in CommandBinder sequencing

--- extensions/command/impl/CommandBinder.cs
+++ extensions/command/impl/CommandBinder.cs
@@ -128,6 +128,7 @@
 		virtual protected ICommand invokeCommand(Type cmd, ICommandBinding binding, object data, int depth)
 		{
 			ICommand command = createCommand (cmd, data);
+			command.sequenceId = depth;
 			trackCommand (command, binding);
 			executeCommand (command);
 			return command;


launch mount script as vagrant ...

launch mount script as vagrant ...

--- wp6-virtualfolder/src/WP6Service2/WP6Service2/Services/Files/WebDavProvider.cs
+++ wp6-virtualfolder/src/WP6Service2/WP6Service2/Services/Files/WebDavProvider.cs
@@ -47,11 +47,14 @@
             return base.DeleteSettings();
         }

+
+        //TODO sudo as 'vagrant' here or sudo whole 'metadataservice'?
         private async Task Initialize(ProviderItem request)
         {
             int exitcode;
-            request.output = Utils.ExecuteShell("/bin/bash", new string[]
+            request.output = Utils.ExecuteShell("/bin/sudo", new string[]
             {
+                "-H -u vagrant",
                 "/home/vagrant/scripts/mountb2drop.sh",
                 "add",
                 _providerurl,


Issue 10003 - Layout the BusinessLogicComponents

Fixed some tests.

--- BusinessLogicComponents.Tests/Scheduling/NewSession/NewSessionOperationTests.cs
+++ BusinessLogicComponents.Tests/Scheduling/NewSession/NewSessionOperationTests.cs
@@ -112,7 +112,7 @@

                 // Validate the NewSession business exception.
                 Assert.AreEqual(NewSessionBusinessException.ErrorCodes.InvalidSessionCode, newSessionBusinessException.ErrorCode);
-                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession operation returned the InvalidSessionCode error code.", newSessionBusinessException.Message);
+                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession() business operation has thrown the InvalidSessionCode error code.", newSessionBusinessException.Message);
             }
         }

@@ -187,7 +187,7 @@

                 // Validate the NewSession business exception.
                 Assert.AreEqual(NewSessionBusinessException.ErrorCodes.DuplicateSessionCode, newSessionBusinessException.ErrorCode);
-                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession operation returned the DuplicateSessionCode error code.", newSessionBusinessException.Message);
+                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession() business operation has thrown the DuplicateSessionCode error code.", newSessionBusinessException.Message);
             }
         }

@@ -234,7 +234,7 @@

                 // Validate the NewSession business exception.
                 Assert.AreEqual(NewSessionBusinessException.ErrorCodes.InvalidName, newSessionBusinessException.ErrorCode);
-                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession operation returned the InvalidName error code.", newSessionBusinessException.Message);
+                Assert.AreEqual("The SchedulingBusinessLogicComponent.NewSession() business operation has thrown the InvalidName error code.", newSessionBusinessException.Message);
             }
         }


Fixed tests

Fixed tests

--- Coolector.Services.Remarks.Tests/Specs/Handlers/CreateRemarkHandler_specs.cs
+++ Coolector.Services.Remarks.Tests/Specs/Handlers/CreateRemarkHandler_specs.cs
@@ -88,17 +88,6 @@

         Because of = () => CreateRemarkHandler.HandleAsync(Command).Await();

-        It should_call_from_base_64_on_file_resolver = () =>
-        {
-            FileResolverMock.Verify(x => x.FromBase64(Command.Photo.Base64, Command.Photo.Name,
-                Command.Photo.ContentType), Times.Once);
-        };
-
-        It should_call_is_image_on_file_validator = () =>
-        {
-            FileValidatorMock.Verify(x => x.IsImage(File), Times.Once);
-        };
-
         It should_call_create_async_on_remark_service = () =>
         {
             RemarkServiceMock.Verify(x => x.CreateAsync(Moq.It.IsAny<Guid>(), Command.UserId,
@@ -142,17 +131,6 @@

         Because of = () => CreateRemarkHandler.HandleAsync(Command).Await();

-        It should_call_from_base_64_on_file_resolver = () =>
-        {
-            FileResolverMock.Verify(x => x.FromBase64(Command.Photo.Base64, Command.Photo.Name,
-                Command.Photo.ContentType), Times.Once);
-        };
-
-        It should_call_is_image_on_file_validator = () =>
-        {
-            FileValidatorMock.Verify(x => x.IsImage(File), Times.Once);
-        };
-
         It should_call_create_async_on_remark_service = () =>
         {
             RemarkServiceMock.Verify(x => x.CreateAsync(Moq.It.IsAny<Guid>(), Command.UserId,
@@ -177,86 +155,4 @@
                 Moq.It.IsAny<Action<IPublishConfigurationBuilder>>()), Times.Once);
         };
     }
-
-    [Subject("CreateRemarkHandler HandleAsync")]
-    public class when_invoking_create_remark_handle_async_without_file : CreateRemarkHandler_specs
-    {
-        Establish context = () =>
-        {
-            Initialize();
-            FileResolverMock.Setup(x => x.FromBase64(Moq.It.IsAny<string>(),
-                Moq.It.IsAny<string>(), Moq.It.IsAny<string>())).Returns(Maybe<File>.Empty);
-        };
-
-        Because of = () => CreateRemarkHandler.HandleAsync(Command).Await();
-
-        It should_call_from_base_64_on_file_resolver = () =>
-        {
-            FileResolverMock.Verify(x => x.FromBase64(Command.Photo.Base64, Command.Photo.Name,
-                Command.Photo.ContentType), Times.Once);
-        };
-
-
-        It should_not_call_is_image_on_file_validator = () =>
-        {
-            FileValidatorMock.Verify(x => x.IsImage(Moq.It.IsAny<File>()), Times.Never);
-        };
-
-        It should_publish_create_remark_rejected_message = () =>
-        {
-            BusClientMock.Verify(x => x.PublishAsync(Moq.It.Is<CreateRemarkRejected>(m =>
-                    m.RequestId == Command.Request.Id
-                    && m.RemarkId == Command.RemarkId
-                    && m.UserId == Command.UserId
-                    && m.Code == OperationCodes.CannotConvertFile),
-                Moq.It.IsAny<Guid>(),
-                Moq.It.IsAny<Action<IPublishConfigurationBuilder>>()), Times.Once);
-        };
-    }
-
-    [Subject("CreateRemarkHandler HandleAsync")]
-    public class when_invoking_create_remark_handle_async_with_invalid_file : CreateRemarkHandler_specs
-    {
-        static File File;
-
-        Establish context = () =>
-        {
-            Initialize();
-            File = File.Create(Command.Photo.Name, Command.Photo.ContentType, new byte[] { 0x1 });
-            FileResolverMock.Setup(x => x.FromBase64(Moq.It.IsAny<string>(),
-                Moq.It.IsAny<string>(), Moq.It.IsAny<string>())).Returns(File);
-            FileValidatorMock.Setup(x => x.IsImage(Moq.It.IsAny<File>())).Returns(false);
-
-        };
-
-        Because of = () => CreateRemarkHandler.HandleAsync(Command).Await();
-
-        It should_call_from_base_64_on_file_resolver = () =>
-        {
-            FileResolverMock.Verify(x => x.FromBase64(Command.Photo.Base64, Command.Photo.Name,
-                Command.Photo.ContentType), Times.Once);
-        };
-
-        It should_call_is_image_on_file_validator = () =>
-        {
-            FileValidatorMock.Verify(x => x.IsImage(File), Times.Once);
-        };
-
-        It should_not_call_create_async_on_remark_service = () =>
-        {
-            RemarkServiceMock.Verify(x => x.CreateAsync(Moq.It.IsAny<Guid>(), Command.UserId,
-                Command.Category, Moq.It.IsAny<Location>(), Command.Description), Times.Never);
-        };
-
-        It should_publish_create_remark_rejected_message = () =>
-        {
-            BusClientMock.Verify(x => x.PublishAsync(Moq.It.Is<CreateRemarkRejected>(m =>
-                    m.RequestId == Command.Request.Id
-                    && m.RemarkId == Command.RemarkId
-                    && m.UserId == Command.UserId
-                    && m.Code == OperationCodes.InvalidFile),
-                Moq.It.IsAny<Guid>(),
-                Moq.It.IsAny<Action<IPublishConfigurationBuilder>>()), Times.Once);
-        };
-    }
 }


CSV Storage DateTime Field fix by Nekron!

--- DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/CSVFile/CSVStorage.cs
+++ DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/CSVFile/CSVStorage.cs
@@ -23,7 +23,8 @@
         private IEnumerable<DatasetConfigRow> fieldList;
         private string dataTable;
         private DatasetConfig datasetConfig;
-        private string insertCommand = "";
+
+        private string dateFieldName;

         private System.IO.StreamWriter writer = null;

@@ -76,6 +77,17 @@
         private void writeHeader(string filename)
         {
             string zeile = "";
+
+            dateFieldName = datasetConfig.DateTimeDatabaseField;
+
+            if (!string.IsNullOrEmpty(datasetConfig.DateTimeDatabaseField))
+            {
+                if (myConfig.UseQuotes)
+                    zeile += "\"" + datasetConfig.DateTimeDatabaseField + "\"";
+                else
+                    zeile += datasetConfig.DateTimeDatabaseField;
+            }
+
             foreach (DatasetConfigRow myFeld in fieldList)
             {
                 if (zeile != "")
@@ -169,6 +181,16 @@

                 IEnumerable<object> values = _intValueList[n];

+                if (!string.IsNullOrEmpty(dateFieldName))
+                {
+                    string akV = "";
+                    akV = DateTime.Now.ToString("yyyy.MM.dd-HH:mm:ss");
+                    if (myConfig.UseQuotes)
+                        zeile += "\"" + akV + "\"";
+                    else
+                        zeile += akV;
+                }
+
                 foreach (object akValue in values)
                 {
                     if (zeile != "")


Add UPDATE-Statement to MS-SQL Lib

Add UPDATE-Statement to MS-SQL Lib

Add the possibility to update rows with MS-SQL Server

--- DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/MsSQL/MsSQLStorage.cs
+++ DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/MsSQL/MsSQLStorage.cs
@@ -25,6 +25,7 @@
         private IEnumerable<DatasetConfigRow> fieldList;
         private string dataTable;
         private string insertCommand = "";
+        private string updateCommand = "";

         private DbConnection myDBConn;
         private DbCommand myCmd = new SqlCommand();
@@ -171,19 +172,22 @@

             //Create Insert Command
-            string wertliste = "", felderliste = "";
+            string wertliste = "", felderliste = "", updateliste = "";
             foreach (DatasetConfigRow myFeld in createFieldList)
             {
                 if (wertliste != "")
                 {
                     wertliste += ",";
                     felderliste += ",";
+                    updateliste += ",";
                 }

                 felderliste += myFeld.DatabaseField;
                 wertliste += "@" + myFeld.DatabaseField;
+                updateliste += myFeld.DatabaseField + "=@" + myFeld.DatabaseField;
             }
             insertCommand = "INSERT INTO " + dataTable + "(" + felderliste + ") values(" + wertliste + ")";
+            updateCommand = "UPDATE " + dataTable + " SET " + updateliste;
         }

         protected override bool _internal_Write()
@@ -217,7 +221,10 @@
                 {
                     using (DbCommand cmd = myDBConn.CreateCommand())
                     {
-                        cmd.CommandText = insertCommand;
+                        if (datasetConfig.UseDbUpdateNoInsert)
+                            cmd.CommandText = updateCommand + " " + (datasetConfig.UpdateWhereClause ?? "");
+                        else
+                            cmd.CommandText = insertCommand;

                         if (myConfig.CombineMultipleInsertsInATransaction)
                             cmd.Transaction = dbTrans;


Old version number updated.

Old version number updated.

--- SimpleInjector.Extensions.ExecutionContextScoping/Properties/AssemblyInfo.cs
+++ SimpleInjector.Extensions.ExecutionContextScoping/Properties/AssemblyInfo.cs
@@ -35,8 +35,8 @@
 // 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("2.4.0.0")]
-[assembly: AssemblyFileVersion("2.4.0.0")]
+[assembly: AssemblyVersion("3.0.1.0")]
+[assembly: AssemblyFileVersion("3.0.1.0")]

 [assembly: CLSCompliant(true)]
 [assembly: NeutralResourcesLanguageAttribute("en-US")]


[#88] fixed automatic currency recalculation

--- ExpenseManager/ExpenseManager.BusinessLogic/ExchangeRates/ExchangeRateReader.cs
+++ ExpenseManager/ExpenseManager.BusinessLogic/ExchangeRates/ExchangeRateReader.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Net;
@@ -127,7 +128,7 @@
             {
                 Amount = Convert.ToInt32(fields[2]),
                 Code = fields[3],
-                Rate = Convert.ToDecimal(fields[4])
+                Rate = Convert.ToDecimal(fields[4], new NumberFormatInfo {NumberDecimalSeparator = ","})
             };
         }


ISSUE 164 Updated TemplateAndBaseCheck to use linq style solution

--- Source/Glass.Mapper.Sc/Pipelines/ObjectConstruction/EnforcedTemplateCheck.cs
+++ Source/Glass.Mapper.Sc/Pipelines/ObjectConstruction/EnforcedTemplateCheck.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using Glass.Mapper.Pipelines.ObjectConstruction;
 using Glass.Mapper.Sc.Configuration;
 using Sitecore.Data;
@@ -66,16 +67,7 @@
                 return true;
             }

-
-            foreach (var baseTemplate in template.BaseTemplates)
-            {
-                if (TemplateAndBaseCheck(baseTemplate, templateId))
-                {
-                    return true;
-                }
-            }
-
-            return false;
+            return template.BaseTemplates.Any(baseTemplate => TemplateAndBaseCheck(baseTemplate, templateId));
         }
     }
 }


Fixed issue with incorrectly setting Content-Type to null for AspNetCoreServer with ALB

This was here because with API Gateway we have to set null otherwise API Gateway will incorrectly assign a default Content-Type of application/json

--- Libraries/src/Amazon.Lambda.AspNetCoreServer/ApplicationLoadBalancerFunction.cs
+++ Libraries/src/Amazon.Lambda.AspNetCoreServer/ApplicationLoadBalancerFunction.cs
@@ -191,11 +191,6 @@
                 }
             }

-            if (contentType == null)
-            {
-                response.Headers["Content-Type"] = null;
-            }
-
             if (responseFeatures.Body != null)
             {
                 // Figure out how we should treat the response content


Implemented caching for field indexes to improve performance.


working on tests

working on tests

--- Test.Integration/ControllerTests/LanguageControllerTests/AddLanguageShould.cs
+++ Test.Integration/ControllerTests/LanguageControllerTests/AddLanguageShould.cs
@@ -33,31 +33,64 @@
         [TestMethod]
         public void ReturnStatusCodeCreated_WhenGivenValidModel()
         {
-            Assert.Fail();
+            var model = TestObjectGetter.GetAddUpdateLanguageViewModel();
+            var requestContent = RequestHelper.GetRequestContentFromObject(model);
+
+            var response = _client.PostAsync($"{ControllerRouteEnum.LANGUAGE}", requestContent).Result;
+            _languageId = RequestHelper.GetObjectFromResponseContent<LanguageViewModel>(response).Id;
+
+            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
         }

         [TestMethod]
         public void ReturnStatusCodeBadRequest_WhenGivenInvalidModel_WithInvalidName()
         {
-            Assert.Fail();
+            var model = TestObjectGetter.GetAddUpdateLanguageViewModel(null, 1);
+            var requestContent = RequestHelper.GetRequestContentFromObject(model);
+
+            var response = _client.PostAsync($"{ControllerRouteEnum.LANGUAGE}", requestContent).Result;
+
+            Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode);
         }

         [TestMethod]
         public void ReturnStatusCodeBadRequest_WhenGivenInvalidModel_WithInvalidRating()
         {
-            Assert.Fail();
+            var model = TestObjectGetter.GetAddUpdateLanguageViewModel("Java", 0);
+            var requestContent = RequestHelper.GetRequestContentFromObject(model);
+
+            var response = _client.PostAsync($"{ControllerRouteEnum.LANGUAGE}", requestContent).Result;
+
+            Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode);
         }

         [TestMethod]
         public void ReturnCorrectViewModel()
         {
-            Assert.Fail();
+            var model = TestObjectGetter.GetAddUpdateLanguageViewModel();
+            var requestContent = RequestHelper.GetRequestContentFromObject(model);
+
+            var response = _client.PostAsync($"{ControllerRouteEnum.LANGUAGE}", requestContent).Result;
+            var serializedContent = RequestHelper.GetObjectFromResponseContent<LanguageViewModel>(response);
+            _languageId = serializedContent.Id;
+
+            var isCorrectViewModel = AssertHelper.AreLanguageViewModelsEqual(model, serializedContent);
+            Assert.IsTrue(isCorrectViewModel);
         }

         [TestMethod]
         public void SaveCorrectViewModel()
         {
-            Assert.Fail();
+            var model = TestObjectGetter.GetAddUpdateLanguageViewModel();
+            var requestContent = RequestHelper.GetRequestContentFromObject(model);
+
+            var response = _client.PostAsync($"{ControllerRouteEnum.LANGUAGE}", requestContent).Result;
+            _languageId = RequestHelper.GetObjectFromResponseContent<LanguageViewModel>(response).Id;
+            response = _client.GetAsync($"{ControllerRouteEnum.LANGUAGE}/{_languageId}").Result;
+            var serializedContent = RequestHelper.GetObjectFromResponseContent<LanguageViewModel>(response);
+
+            var isCorrectViewModel = AssertHelper.AreLanguageViewModelsEqual(model, serializedContent);
+            Assert.IsTrue(isCorrectViewModel);
         }
     }
 }


日志重定向修正

日志重定向修正

--- UnityGameFramework/Assets/GameFramework/Scripts/Editor/Misc/LogRedirection.cs
+++ UnityGameFramework/Assets/GameFramework/Scripts/Editor/Misc/LogRedirection.cs
@@ -63,7 +63,7 @@
                 }
             }

-            InternalEditorUtility.OpenFileAtLineExternal(Utility.Path.GetCombinePath(Application.dataPath, match.Groups[1].Value.Substring(6)), int.Parse(match.Groups[2].Value));
+            InternalEditorUtility.OpenFileAtLineExternal(Utility.Path.GetCombinePath(Application.dataPath, match.Groups[1].Value.Substring(7)), int.Parse(match.Groups[2].Value));
             return true;
         }


More stuff

More stuff

--- fp-wiki/DataContext/FpWikiDataContext.cs
+++ fp-wiki/DataContext/FpWikiDataContext.cs
@@ -56,6 +56,10 @@
             modelBuilder.Entity<MethodDescriptor>()
                 .HasMany(md => md.Parameters)
                 .WithRequired(p => p.Method);
+
+            modelBuilder.Entity<MethodDescriptor>()
+                .HasRequired(md => md.HelpContent)
+                .WithRequiredPrincipal(hc => hc.Method);
         }
     }
     [Table("Method")]


AST: Fix compilation warning

AST: Fix compilation warning

Fix the following warning by removing the new keyword:

src/AST/Type.cs(230,25): warning CS0109: The member `CppSharp.AST.PointerType.IsReference' does not hide an inherited member. The new keyword is not required

Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@iki.fi>

--- src/AST/Type.cs
+++ src/AST/Type.cs
@@ -232,7 +232,7 @@
             RVReference
         }

-        public new bool IsReference
+        public bool IsReference
         {
             get
             {
@@ -756,4 +756,4 @@
         T VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals);
         T VisitCILType(CILType type, TypeQualifiers quals);
     }
-}+}


Fixed turn optimization operation for closed tours.


EOL fix

EOL fix


honor the 'write only those files' check while burning a CD. Fixes bgo

	* src/CDExport.cs: honor the 'write only those files' check while
	burning a CD. Fixes bgo #371541.

svn path=/trunk/; revision=2899

--- src/CDExport.cs
+++ src/CDExport.cs
@@ -80,10 +80,21 @@

 	                return dest;
 	        }
-
+
+		void Clean ()
+		{
+			Gnome.Vfs.Uri target = dest.Clone ();
+			Gnome.Vfs.XferProgressCallback cb = new Gnome.Vfs.XferProgressCallback (Progress);
+			Gnome.Vfs.Xfer.XferDeleteList (new Gnome.Vfs.Uri [] {target}, Gnome.Vfs.XferErrorMode.Query, Gnome.Vfs.XferOptions.Recursive, cb);
+
+		}
+
 		public void Transfer () {
 			try {
 				Gnome.Vfs.Result result = Gnome.Vfs.Result.Ok;
+
+				if (clean)
+					Clean ();

 				foreach (IBrowsableItem photo in selection.Items) {


Clean the code

Clean the code

--- src/Peachpie.Library.XmlDom/XmlWriter.cs
+++ src/Peachpie.Library.XmlDom/XmlWriter.cs
@@ -28,12 +28,24 @@
         MemoryStream _memoryStream;
         PhpStream _uriPhpStream;

-        // Flags for CData, Comment and PISection, DTD
-        private int _nestedNodesCount = 0;
+        // Counts nodes created in Comment, PI or CData section in order to close them properly in endComment/Pi/Cdata method.
+        private int _unclosedNodesCount = 0;
+        // It checks if Dtd section is empty.
         private bool _dtdStart = false;

-        private enum State { Comment, PI, CDATA, DTD, DtdElement, DtdEntity, DtdAttlist }
-
+        // The State represents a section, where the xmlwriter is situated. e.g. When you call startComment, the xmlwriter changes its state to Comment
+        private enum State
+        {
+            Comment,
+            PI, // Processing instruction
+            CDATA,
+            DTD,
+            DtdElement,
+            DtdEntity,
+            DtdAttlist
+        }
+
+        // There can be actually two levels, where the state of xmlwriter can be situated. You can move to DtdElement if you are in DTD and you can move to CDATA if you are in PI.
         Stack<State> _state = new Stack<State>(2);

         static XmlWriterSettings DefaultSettings = new XmlWriterSettings()
@@ -59,8 +71,8 @@
         {
             if (_state.Count != 0)
             {
-                // Cannot end attributes in comments, where are not elements
-                if ((_state.Peek()== State.Comment || _state.Peek() == State.CDATA) && _nestedNodesCount != 0)
+                // You can end an attribute in these states if and only if there are incomplete nodes.
+                if ((_state.Peek()== State.Comment || _state.Peek() == State.CDATA) && _unclosedNodesCount != 0)
                     return CheckedCall(_writer.WriteEndAttribute);

                 return false;
@@ -76,6 +88,15 @@

             _state.Pop();

+            if (_unclosedNodesCount > 0) // If there are unclosed nodes, close them.
+            {
+                while (_unclosedNodesCount-- > 0)
+                    CheckedCall(() => _writer.WriteEndElement());
+
+                CheckedCall(() => _writer.WriteRaw("]]>"));
+                return false;
+            }
+
             return CheckedCall(() => _writer.WriteRaw("]]>"));
         }

@@ -86,9 +107,9 @@

             _state.Pop();

-            if (_nestedNodesCount > 0)
-            {
-                while (_nestedNodesCount-- > 0)
+            if (_unclosedNodesCount > 0) // If there are unclosed nodes, close them.
+            {
+                while (_unclosedNodesCount-- > 0)
                     CheckedCall(() => _writer.WriteEndElement());

                 CheckedCall(() => _writer.WriteRaw("-->"));
@@ -100,7 +121,7 @@

         public bool endDocument()
         {
-            while (_state.Count != 0)
+            while (_state.Count != 0) // Closes all open sections.
             {
                 switch (_state.Peek())
                 {
@@ -168,7 +189,7 @@
             if (!_state.Contains(State.DTD))
                 return false;

-            switch (_state.Peek())
+            switch (_state.Peek()) // Closes all open Dtd elements. There can't be common elements like tags..
             {
                 case State.DTD:
                     break;
@@ -187,7 +208,7 @@

             _state.Pop();

-            // Ends dtd section.
+            // Closes dtd section.
             string end = _writer.Settings.Indent ? _writer.Settings.NewLineChars : "";
             end += _dtdStart ? ">" : "]>";
             _dtdStart = false;
@@ -195,47 +216,10 @@
             return CheckedCall(() => _writer.WriteRaw(end));
         }

-        private bool CheckStateEnable()
-        {
-            if (_state.Count != 0)
-            {
-                if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
-                {
-                    if (_nestedNodesCount != 0)
-                        return true;
-
-                    if (_state.Peek() == State.Comment)
-                        endComment();
-                    else
-                        endCdata();
-                }
-
-                return false;
-            }
-
-            return true;
-        }
-
         public bool endElement()
         {
-            if (_state.Count != 0)
-            {
-                if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
-                {
-                    if (_nestedNodesCount != 0)
-                    {
-                        _nestedNodesCount--;
-                        return CheckedCall(() => _writer.WriteEndElement());
-                    }
-
-                    if (_state.Peek() == State.Comment)
-                        endComment();
-                    else
-                        endCdata();
-                }
-
-                return false;
-            }
+            if (!EndElementHelper())
+                return false;

             return CheckedCall(() => _writer.WriteEndElement());
         }
@@ -245,7 +229,7 @@
             if (!_state.Contains(State.PI))
                 return false;

-            if (_state.Peek() == State.CDATA)
+            if (_state.Peek() == State.CDATA) // Cdata can be placed into a PI section.
                 endCdata();

             _state.Pop();
@@ -295,24 +279,8 @@

         public bool fullEndElement()
         {
-            if (_state.Count != 0)
-            {
-                if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
-                {
-                    if (_nestedNodesCount != 0)
-                    {
-                        _nestedNodesCount--;
-                        return CheckedCall(() => _writer.WriteFullEndElement());
-                    }
-
-                    if (_state.Peek() == State.Comment)
-                        endComment();
-                    else
-                        endCdata();
-                }
-
-                return false;
-            }
+            if (!EndElementHelper())
+                return false;

             return CheckedCall(() => _writer.WriteFullEndElement());
         }
@@ -368,6 +336,7 @@
             if (_writer.WriteState != WriteState.Start)
                 return false;

+            // The settings is read-only, but we can create a new xmlwriter if the current xmlwriter haven't written anything yet.
             var settings = _writer.Settings.Clone();
             settings.IndentChars = indentString;

@@ -384,6 +353,7 @@
             if (_writer.WriteState != WriteState.Start)
                 return false;

+            // The settings is read-only, but we can create a new xmlwriter if the current xmlwriter haven't written anything yet.
             var settings = _writer.Settings.Clone();
             settings.Indent = indent;

@@ -397,7 +367,7 @@

         public bool startAttributeNs(string prefix, string name, string uri)
         {
-            if (!CheckStateEnable())
+            if (!StartAttributeHelper())
                 return false;

             return CheckedCall(() => _writer.WriteStartAttribute(prefix, name, uri));
@@ -405,7 +375,7 @@

         public bool startAttribute(string name)
         {
-            if (!CheckStateEnable())
+            if (!StartAttributeHelper())
                 return false;

             return CheckedCall(() => _writer.WriteStartAttribute(name));
@@ -430,6 +400,7 @@
                 return false;

             _state.Push(State.Comment);
+
             return CheckedCall(() => _writer.WriteRaw("<!--"));
         }

@@ -448,7 +419,7 @@
             if (string.IsNullOrEmpty(standalone))
             {
                 bool res = CheckedCall(() => _writer.WriteStartDocument());
-                if (!_writer.Settings.Indent)
+                if (!_writer.Settings.Indent) // Php writes a new line character after prolog.
                     res &= CheckedCall(() => _writer.WriteRaw(_writer.Settings.NewLineChars));

                 return res;
@@ -456,7 +427,7 @@
             else
             {
                 bool res = CheckedCall(() => _writer.WriteStartDocument(standalone == "yes"));
-                if (!_writer.Settings.Indent)
+                if (!_writer.Settings.Indent) // Php writes a new line character after prolog.
                     res &= CheckedCall(() => _writer.WriteRaw(_writer.Settings.NewLineChars));

                 return res;
@@ -465,42 +436,43 @@

         public bool startDtdAttlist(string name)
         {
+            // DTD elements can be only placed in DTD or Default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

             _state.Push(State.DtdAttlist);

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ATTLIST {name} "));
         }

         public bool startDtdElement(string qualifiedName)
         {
-            // DTD elements can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

             _state.Push(State.DtdElement);

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ELEMENT {qualifiedName} "));
         }

         public bool startDtdEntity(string name, bool isparam)
         {
-            // DTD entity can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

             _state.Push(State.DtdEntity);

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw(isparam ? $"<!ENTITY % {name} \"" : $"<!ENTITY {name} \""));
         }

         public bool startDtd(string qualifiedName, string publicId = null, string systemId = null)
         {
-            if (_state.Count != 0||
+            if (_state.Count != 0 || // DTD can be only placed in default section and prolog.
               (_writer.Settings.ConformanceLevel == ConformanceLevel.Document && _writer.WriteState != WriteState.Prolog && _writer.WriteState != WriteState.Start))
             {
                 PhpException.Throw(PhpError.Warning, Resources.XmlWritterDtdInProlog);
@@ -513,14 +485,14 @@
                 return false;
             }

-            // Makes doctype
+            // Makes a doctype
             string doctype = $"<!DOCTYPE {qualifiedName}";
             if (!String.IsNullOrEmpty(publicId))
                 doctype += _writer.Settings.Indent ? $"{_writer.Settings.NewLineChars}PUBLIC \"{publicId}\"" : $" PUBLIC \"{publicId}\"";
             if (!String.IsNullOrEmpty(systemId))
                 doctype += _writer.Settings.Indent ? $"{_writer.Settings.NewLineChars}SYSTEM \"{systemId}\"" : $" SYSTEM \"{systemId}\"";

-            CheckDtdStart();
+            CheckDtdStartHelper();
             _state.Push(State.DTD);
             _dtdStart = true;

@@ -533,7 +505,7 @@
             {
                 if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
                 {
-                    _nestedNodesCount++;
+                    _unclosedNodesCount++;
                     return CheckedCall(() => _writer.WriteStartElement(prefix, name, uri));
                 }

@@ -549,7 +521,7 @@
             {
                 if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
                 {
-                    _nestedNodesCount++;
+                    _unclosedNodesCount++;
                     return CheckedCall(() => _writer.WriteStartElement(name));
                 }

@@ -571,21 +543,21 @@
         public bool text(string content)
         {
             if (_state.Count == 0 ||
-                ((_state.Peek() == State.Comment || _state.Peek() == State.CDATA) && _nestedNodesCount != 0))
+                ((_state.Peek() == State.Comment || _state.Peek() == State.CDATA) && _unclosedNodesCount != 0))
             {
                 // Escapes characters
                 return CheckedCall(() => _writer.WriteRaw(content.Escape()));
             }

             if (_state.Peek() == State.DTD)
-                CheckDtdStart();
+                CheckDtdStartHelper();

             return CheckedCall(() => _writer.WriteRaw(content));
         }

         public bool writeAttributeNs(string prefix, string name, string uri, string content)
         {
-            if (!CheckStateEnable())
+            if (!StartAttributeHelper())
                 return false;

             // WriteAttributeString does not escape "
@@ -598,7 +570,7 @@

         public bool writeAttribute(string name, string content)
         {
-            if (!CheckStateEnable())
+            if (!StartAttributeHelper())
                 return false;

             // WriteAttributeString does not escape "
@@ -630,57 +602,57 @@

         public bool writeDtdAttlist(string name, string content)
         {
-            // DTD attlist can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ATTLIST {name} {content}>"));
         }

         public bool writeDtdElement(string name, string content)
         {
-            // DTD elements can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ELEMENT {name} {content}>"));
         }

         public bool writeDtdEntity(string name, string content, bool pe, string pubid, string sysid, string ndataid)
         {
-            // DTD entity can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

             if (pe)
                 return false;

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ENTITY {name} PUBLIC \"{pubid}\" \"{sysid}\" NDATA {ndataid}>"));
         }

         public bool writeDtdEntity(string name, string content, bool pe, string pubid, string sysid)
         {
-            // DTD entity can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

             if (pe)
                 return false;

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw($"<!ENTITY {name} PUBLIC \"{pubid}\" \"{sysid}\">"));
         }

         public bool writeDtdEntity(string name, string content, bool pe = false)
         {
-            // DTD entity can be only in DTD or Default section.
+            // DTD elements can be only placed in DTD or default section.
             if (_state.Count != 0 && _state.Peek() != State.DTD)
                 return false;

-            CheckDtdStart();
+            CheckDtdStartHelper();
             return CheckedCall(() => _writer.WriteRaw(pe ? $"<!ENTITY % {name} \"{content}\">" : $"<!ENTITY {name} \"{content}\">"));
         }

@@ -709,24 +681,15 @@
                 doctype += $" [{subset}]";
             doctype += ">";

-            CheckDtdStart();
+            CheckDtdStartHelper();

             return CheckedCall(() => _writer.WriteRaw(doctype));
         }

         public bool writeElementNs(string prefix, string name, string uri, string content = null)
         {
-            if (_state.Count != 0)
-            {
-                if (_state.Peek() != State.Comment && _state.Peek() != State.CDATA)
-                {
-                    return false;
-                }
-                else
-                {
-                    _nestedNodesCount++;
-                }
-            }
+            if (_state.Count != 0 && _state.Peek() != State.Comment  && _state.Peek() != State.CDATA)
+                 return false;

             // WriteElementString does not escape "
             bool res = true;
@@ -738,17 +701,8 @@

         public bool writeElement(string name, string content = null)
         {
-            if (_state.Count != 0)
-            {
-                if (_state.Peek() != State.Comment && _state.Peek() != State.CDATA)
-                {
-                    return false;
-                }
-                else
-                {
-                    _nestedNodesCount++;
-                }
-            }
+            if (_state.Count != 0 && _state.Peek() != State.Comment && _state.Peek() != State.CDATA)
+                return false;

             // WriteElementString does not escape "
             bool res = true;
@@ -773,9 +727,9 @@
         #region Implementation

         /// <summary>
-        /// If it is needed, it adds a new line or "[" while using DTD.
+        /// It checks the beginning of Dtd and appends "[" if it is a first element in dtd section or a new line if it is placed in prolog as a first element.
         /// </summary>
-        private void CheckDtdStart()
+        private void CheckDtdStartHelper()
         {
             if (_dtdStart) // We are first in DTD section
             {
@@ -790,6 +744,58 @@
                 if (_state.Count !=0 && _state.Peek() == State.DTD)
                     _writer.WriteRaw(" ");
             }
+        }
+
+        /// <summary>
+        /// Checks a validity of calling startAttribute method.
+        /// </summary>
+        private bool StartAttributeHelper()
+        {
+            if (_state.Count != 0)
+            {
+                if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
+                {
+                    if (_unclosedNodesCount != 0)
+                        return true;
+
+                    if (_state.Peek() == State.Comment)
+                        endComment();
+                    else
+                        endCdata();
+                }
+
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// Checks a validity of calling endElement method.
+        /// </summary>
+        private bool EndElementHelper()
+        {
+            if (_state.Count != 0)
+            {
+                // There is only the one correct situation when it closes an element created in section Comment or CDATA.
+                if (_state.Peek() == State.Comment || _state.Peek() == State.CDATA)
+                {
+                    if (_unclosedNodesCount != 0)
+                    {
+                        _unclosedNodesCount--;
+                        return true;
+                    }
+
+                    if (_state.Peek() == State.Comment)
+                        endComment();
+                    else
+                        endCdata();
+                }
+
+                return false;
+            }
+
+            return true;
         }

         private void Clear()
@@ -802,7 +808,7 @@

             _state = new Stack<State>(2);
             _dtdStart = false;
-            _nestedNodesCount = 0;
+            _unclosedNodesCount = 0;
         }

         private bool CheckedCall(Action operation)


hopefully fix serialization error

hopefully fix serialization error

--- src/LagoVista.IoT.DeviceAdmin/Models/UnitSet.cs
+++ src/LagoVista.IoT.DeviceAdmin/Models/UnitSet.cs
@@ -2,6 +2,7 @@
 using LagoVista.Core.Interfaces;
 using LagoVista.Core.Validation;
 using LagoVista.IoT.DeviceAdmin.Resources;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -21,6 +22,7 @@
             Units = new ObservableCollection<Unit>();
         }

+        [JsonProperty]
         [FormField(LabelResource: Resources.DeviceLibraryResources.Names.UnitSet_Units, ResourceType: typeof(DeviceLibraryResources))]
         public ObservableCollection<Unit> Units { get; set; }


Exceptions type and messages changed.

Exceptions type and messages changed.

--- XOMNI.SDK/XOMNI.SDK.Public.Test/Fixtures/Clients/Utility/QRCodeClientFixture.cs
+++ XOMNI.SDK/XOMNI.SDK.Public.Test/Fixtures/Clients/Utility/QRCodeClientFixture.cs
@@ -65,12 +65,12 @@
         {
             await base.SDKExceptionResponseTestAsync(
                 (QRCodeClient c) => c.GetAsync(0, "test"),
-                new ArgumentException("moduleSize")
+                new ArgumentException("moduleSize must be greater than or equal to 1.")
             );

             await base.SDKExceptionResponseTestAsync(
                (QRCodeClient c) => c.GetAsync(1, null),
-               new ArgumentNullException("data")
+               new ArgumentException("data can not be empty or null.")
            );
         }


Added a virtual method to override the validation of the data source location.

--- src/MbUnit/MbUnit/Framework/ContentAttribute.cs
+++ src/MbUnit/MbUnit/Framework/ContentAttribute.cs
@@ -146,6 +146,13 @@
         /// <summary>
         /// Opens the contents as a stream.
         /// </summary>
+        /// <remarks>
+        /// <para>
+        /// If you override this method to return data from a different stream, consider
+        /// also overriding <see cref="ValidateSource" /> in case the manner in which the
+        /// data source location is specified has also changed.
+        /// </para>
+        /// </remarks>
         /// <param name="codeElement">The code element to which the attribute was applied</param>
         /// <returns>The stream</returns>
         protected virtual Stream OpenStream(ICodeElementInfo codeElement)
@@ -162,6 +169,13 @@
         /// <summary>
         /// Opens the contents as a text reader.
         /// </summary>
+        /// <remarks>
+        /// <para>
+        /// If you override this method to return data from a different stream, consider
+        /// also overriding <see cref="ValidateSource" /> in case the manner in which the
+        /// data source location is specified has also changed.
+        /// </para>
+        /// </remarks>
         /// <param name="codeElement">The code element to which the attribute was applied</param>
         /// <returns>The text reader</returns>
         protected virtual TextReader OpenTextReader(ICodeElementInfo codeElement)
@@ -189,6 +203,23 @@
         {
             base.Validate(scope, codeElement);

+            ValidateSource(scope, codeElement);
+        }
+
+        /// <summary>
+        /// Validates the data source properties of the content attribute.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// Throws a <see cref="PatternUsageErrorException" /> if none of the source
+        /// properties, such as <see cref="Contents"/>, <see cref="FilePath" /> or
+        /// <see cref="ResourcePath"/> have been set.
+        /// </para>
+        /// </remarks>
+        /// <param name="scope">The pattern scope</param>
+        /// <param name="codeElement">The code element to which the attribute was applied</param>
+        protected virtual void ValidateSource(IPatternScope scope, ICodeElementInfo codeElement)
+        {
             if (contents == null && filePath == null && resourcePath == null)
                 ThrowUsageErrorException("At least one source property must be specified.");
         }


added -t (#292)

added -t (#292)

--- src/Microsoft.TemplateEngine.Cli/New3Command.cs
+++ src/Microsoft.TemplateEngine.Cli/New3Command.cs
@@ -28,7 +28,7 @@
         private ExtendedCommandParser _app;
         private HostSpecificTemplateData _hostSpecificTemplateData;
         private IReadOnlyList<IFilteredTemplateInfo> _matchedTemplates;
-        private CommandArgument _templateName;
+        private CommandArgument _templateNameArgument;
         private ITemplateInfo _unambiguousTemplateToUse;
         private readonly TemplateCreator _templateCreator;
         private readonly TemplateCache _templateCache;
@@ -44,7 +44,7 @@
         private bool _forceAmbiguousFlow;
         private readonly Action<IEngineEnvironmentSettings, IInstaller> _onFirstRun;

-        public New3Command(string commandName, ITemplateEngineHost host, Action<IEngineEnvironmentSettings, IInstaller> onFirstRun, ExtendedCommandParser app, CommandArgument templateNames)
+        public New3Command(string commandName, ITemplateEngineHost host, Action<IEngineEnvironmentSettings, IInstaller> onFirstRun, ExtendedCommandParser app, CommandArgument templateName)
         {
             host = new ExtendedTemplateEngineHost(host, this);
             EnvironmentSettings = new EngineEnvironmentSettings(host, x => new SettingsLoader(x));
@@ -55,7 +55,7 @@
             CommandName = commandName;
             _paths = new Paths(EnvironmentSettings);
             _app = app;
-            _templateName = templateNames;
+            _templateNameArgument = templateName;
             _onFirstRun = onFirstRun;
         }

@@ -90,6 +90,17 @@
         public string Name => _app.InternalParamValue("--name");

         public string OutputPath => _app.InternalParamValue("--output");
+
+        public string TemplateType => _app.InternalParamValue("--type");
+
+        public string TemplateName
+        {
+            get
+            {
+                // prefer the -t param over the argument value
+                return !string.IsNullOrEmpty(TemplateType) ? TemplateType : _templateNameArgument.Value;
+            }
+        }

         public bool SkipUpdateCheck => _app.InternalParamHasValue("--skip-update-check");

@@ -220,7 +231,7 @@
                 return CreationResultStatus.CreateFailed;
             }

-            string resultTemplateName = string.IsNullOrEmpty(instantiateResult.TemplateFullName) ? _templateName.Value : instantiateResult.TemplateFullName;
+            string resultTemplateName = string.IsNullOrEmpty(instantiateResult.TemplateFullName) ? TemplateName : instantiateResult.TemplateFullName;

             switch (instantiateResult.Status)
             {
@@ -321,7 +332,7 @@

         private Task<CreationResultStatus> EnterAmbiguousTemplateManipulationFlowAsync()
         {
-            if (!string.IsNullOrEmpty(_templateName.Value))
+            if (!string.IsNullOrEmpty(TemplateName))
             {
                 bool anyPartialMatchesDisplayed = ShowTemplateNameMismatchHelp();
                 ShowUsageHelp();
@@ -525,7 +536,7 @@

             try
             {
-                if (string.IsNullOrWhiteSpace(_templateName.Value))
+                if (string.IsNullOrWhiteSpace(TemplateName))
                 {
                     return await EnterMaintenanceFlowAsync().ConfigureAwait(false);
                 }
@@ -771,9 +782,9 @@
             IReadOnlyCollection<IFilteredTemplateInfo> templates = _templateCreator.List
             (
                 false,
-                WellKnownSearchFilters.AliasFilter(_templateName.Value),
-                WellKnownSearchFilters.NameFilter(_templateName.Value),
-                WellKnownSearchFilters.ClassificationsFilter(_templateName.Value),
+                WellKnownSearchFilters.AliasFilter(TemplateName),
+                WellKnownSearchFilters.NameFilter(TemplateName),
+                WellKnownSearchFilters.ClassificationsFilter(TemplateName),
                 WellKnownSearchFilters.LanguageFilter(Language),
                 WellKnownSearchFilters.ContextFilter(context)
             );
@@ -848,6 +859,7 @@
             appExt.HiddenInternalOption("--locale", "--locale", CommandOptionType.SingleValue);
             appExt.HiddenInternalOption("--quiet", "--quiet", CommandOptionType.NoValue);
             appExt.HiddenInternalOption("-i|--install", "--install", CommandOptionType.MultipleValue);
+            appExt.HiddenInternalOption("-t|--type", "--type", CommandOptionType.SingleValue);

             // reserved but not currently used
             appExt.HiddenInternalOption("-up|--update", "--update", CommandOptionType.MultipleValue);
@@ -991,11 +1003,11 @@

             if (contextProblemMatches.Keys.Count + remainingPartialMatches.Keys.Count > 1)
             {
-                Reporter.Error.WriteLine(string.Format(LocalizableStrings.AmbiguousInputTemplateName, _templateName.Value));
+                Reporter.Error.WriteLine(string.Format(LocalizableStrings.AmbiguousInputTemplateName, TemplateName));
             }
             else if (contextProblemMatches.Keys.Count + remainingPartialMatches.Keys.Count == 0)
             {
-                Reporter.Error.WriteLine(string.Format(LocalizableStrings.NoTemplatesMatchName, _templateName.Value));
+                Reporter.Error.WriteLine(string.Format(LocalizableStrings.NoTemplatesMatchName, TemplateName));
                 Reporter.Error.WriteLine();
                 return false;
             }


Fixes bug where usage help is displayed twice if -h is specified

--- src/Microsoft.TemplateEngine.Cli/New3Command.cs
+++ src/Microsoft.TemplateEngine.Cli/New3Command.cs
@@ -414,7 +414,6 @@
             }

             //No other cases specified, we've fallen through to "Usage help + List"
-            HelpForTemplateResolution.ShowUsageHelp(_commandInput);
             TemplateListResolutionResult templateResolutionResult = QueryForTemplateMatches();
             HelpForTemplateResolution.CoordinateHelpAndUsageDisplay(templateResolutionResult, EnvironmentSettings, _commandInput, _hostDataLoader, _telemetryLogger, _templateCreator, _defaultLanguage);


9356: 1 degree for horizontal fit

9356: 1 degree for horizontal fit

--- a_mini/projects/PixelFarm/Typography/Typography.AutoFit/GlyphTriangleAndEdge.cs
+++ a_mini/projects/PixelFarm/Typography/Typography.AutoFit/GlyphTriangleAndEdge.cs
@@ -82,7 +82,7 @@

         static readonly double _88degreeToRad = MyMath.DegreesToRadians(88);
         static readonly double _85degreeToRad = MyMath.DegreesToRadians(85);
-        static readonly double _15degreeToRad = MyMath.DegreesToRadians(15);
+        static readonly double _01degreeToRad = MyMath.DegreesToRadians(1);
         static readonly double _90degreeToRad = MyMath.DegreesToRadians(90);

         public TriangulationPoint p;
@@ -119,7 +119,7 @@
                 {
                     SlopeKind = LineSlopeKind.Vertical;
                 }
-                else if (SlopAngle < _15degreeToRad)
+                else if (SlopAngle < _01degreeToRad)
                 {
                     SlopeKind = LineSlopeKind.Horizontal;
                 }


Fix NullReferenceException in N5.29

Fix NullReferenceException in N5.29

ARKADE-453

--- src/Arkivverket.Arkade.Core/Testing/Noark5/N5_29_NumberOfEachDocumentFormat.cs
+++ src/Arkivverket.Arkade.Core/Testing/Noark5/N5_29_NumberOfEachDocumentFormat.cs
@@ -66,7 +66,7 @@
             }

             foreach (var item in documentObjectsWithFormatMismatch)
-                testResults.Add(new TestResult(ResultType.Error, new Location(""),
+                testResults.Add(new TestResult(ResultType.Error, new Location(ArkadeConstants.ArkivstrukturXmlFileName),
                     string.Format(
                         Noark5Messages.NumberOfEachDocumentFormatMessage_FormatMismatch,
                         item.Format,
@@ -126,7 +126,7 @@
             public bool HasFormatMismatch()
             {
                 var fileExtension = Path.GetExtension(FileReference);
-                return fileExtension != null && !fileExtension.ToLower().Equals($".{Format.ToLower()}");
+                return Format != null && fileExtension != null && !fileExtension.ToLower().Equals($".{Format.ToLower()}");
             }
         }
     }


[InternetArchive] Show intro text about IA

--- src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs
+++ src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs
@@ -103,6 +103,8 @@
             foreach (var item in Item.LoadAll ()) {
                 AddChildSource (new DetailsSource (item));
             }
+
+            ShowIntroText ();
         }

         public void Reload ()
@@ -197,5 +199,25 @@
                 actions.Dispose ();
             }
         }
+
+        private void ShowIntroText ()
+        {
+            if (show_intro.Get ()) {
+                string intro_txt = Catalog.GetString ("The Internet Archive, a 501(c)(3) non-profit, is building a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, and the general public.");
+
+                SetStatus (intro_txt, true, false, "gtk-info");
+
+                MessageNotify += (o, a) => {
+                    var msg = CurrentMessage;
+                    if (msg != null) {
+                        if (msg.IsHidden && msg.Text == intro_txt) {
+                            show_intro.Set (false);
+                        }
+                    }
+                };
+            }
+        }
+
+        private SchemaEntry<bool> show_intro = new SchemaEntry<bool> ("plugins.internetarchive", "show_intro", true, null, null);
     }
 }


Catch more exceptions (#59526)

Catch more exceptions (#59526)

--- src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
+++ src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
@@ -101,7 +101,7 @@

                         new FileInfo(filePath).IsReadOnly = true;
                     }
-                    catch (IOException ex)
+                    catch (Exception ex) when (IOUtilities.IsNormalIOException(ex))
                     {
                         _logger?.Log(FeaturesResources._0_found_in_embedded_PDB_but_could_not_write_file_1, sourceDocument.FilePath, ex.Message);
                         return null;


Minor fix of clear binaries tests

Minor fix of clear binaries tests

--- src/Galaxy.Tests/DeploymentAndOperations/OperationsTests/ClearBinariesTests.cs
+++ src/Galaxy.Tests/DeploymentAndOperations/OperationsTests/ClearBinariesTests.cs
@@ -2,6 +2,7 @@
 using System.IO;
 using System.Linq;
 using Codestellation.Galaxy.Domain;
+using Codestellation.Galaxy.Infrastructure;
 using Codestellation.Galaxy.ServiceManager.Operations;
 using Codestellation.Galaxy.Tests.Helpers;
 using NUnit.Framework;
@@ -20,10 +21,7 @@
         {
             _nugetFeedFolder = Path.Combine(Environment.CurrentDirectory, "testnuget");

-            if (Directory.Exists(_nugetFeedFolder))
-            {
-                Directory.Delete(_nugetFeedFolder, true);
-            }
+            Folder.Delete(_nugetFeedFolder);

             var version10 = new Version(1, 0);

@@ -99,7 +97,7 @@
         [TearDown]
         public void Cleanup()
         {
-            Directory.Delete(_nugetFeedFolder, true);
+            Folder.Delete(_nugetFeedFolder);
         }
     }
 }