Add functionality for CRC encryption.

Add functionality for CRC encryption.

--- src/SilDev/Crypto.cs
+++ src/SilDev/Crypto.cs
@@ -5,7 +5,7 @@
 // ==============================================
 //
 // Filename: Crypto.cs
-// Version:  2018-06-07 09:48
+// Version:  2018-06-10 16:16
 //
 // Copyright (c) 2018, Si13n7 Developments (r)
 // All rights reserved.
@@ -59,6 +59,16 @@
     /// </summary>
     public enum ChecksumAlgorithms
     {
+        /// <summary>
+        ///     Cyclic redundancy check (CRC-16).
+        /// </summary>
+        Crc16,
+
+        /// <summary>
+        ///     Cyclic redundancy check (CRC-32).
+        /// </summary>
+        Crc32,
+
         /// <summary>
         ///     Message-Digest 5.
         /// </summary>
@@ -474,6 +484,10 @@
         {
             switch (algorithm)
             {
+                case ChecksumAlgorithms.Crc16:
+                    return new Crc16().EncryptStream(stream);
+                case ChecksumAlgorithms.Crc32:
+                    return new Crc32().EncryptStream(stream);
                 case ChecksumAlgorithms.Sha1:
                     return new Sha1().EncryptStream(stream);
                 case ChecksumAlgorithms.Sha256:
@@ -500,6 +514,10 @@
         {
             switch (algorithm)
             {
+                case ChecksumAlgorithms.Crc16:
+                    return new Crc16().EncryptBytes(bytes);
+                case ChecksumAlgorithms.Crc32:
+                    return new Crc32().EncryptBytes(bytes);
                 case ChecksumAlgorithms.Sha1:
                     return new Sha1().EncryptBytes(bytes);
                 case ChecksumAlgorithms.Sha256:
@@ -526,6 +544,10 @@
         {
             switch (algorithm)
             {
+                case ChecksumAlgorithms.Crc16:
+                    return new Crc16().EncryptString(text);
+                case ChecksumAlgorithms.Crc32:
+                    return new Crc32().EncryptString(text);
                 case ChecksumAlgorithms.Sha1:
                     return new Sha1().EncryptString(text);
                 case ChecksumAlgorithms.Sha256:
@@ -552,6 +574,10 @@
         {
             switch (algorithm)
             {
+                case ChecksumAlgorithms.Crc16:
+                    return new Crc16().EncryptFile(path);
+                case ChecksumAlgorithms.Crc32:
+                    return new Crc32().EncryptFile(path);
                 case ChecksumAlgorithms.Sha1:
                     return new Sha1().EncryptFile(path);
                 case ChecksumAlgorithms.Sha256:
@@ -1518,6 +1544,192 @@

         #endregion

+        #region Cyclic Redundancy Check
+
+        /// <summary>
+        ///     Initializes a new instance of the <see cref="Crc16"/> class.
+        /// </summary>
+        public class Crc16
+        {
+            /// <summary>
+            ///     Gets the required hash length.
+            /// </summary>
+            public const int HashLength = 4;
+
+            /// <summary>
+            ///     Encrypts the specified stream.
+            /// </summary>
+            /// <param name="stream">
+            ///     The stream to encrypt.
+            /// </param>
+            public virtual string EncryptStream(Stream stream)
+            {
+                int i, x = 0xffff;
+                while ((i = stream.ReadByte()) != -1)
+                    for (var j = 0; j < 8; j++)
+                    {
+                        if (((x ^ i) & 1) == 1)
+                        {
+                            x >>= 1;
+                            x ^= 0xa001;
+                        }
+                        else
+                            x >>= 1;
+                        i >>= 1;
+                    }
+                var ba = new[]
+                {
+                    (byte)(x % 256),
+                    (byte)(x / 256)
+                };
+                var sb = new StringBuilder(ba.Length * 2);
+                foreach (var b in ba)
+                    sb.Append(b.ToString("x2"));
+                return sb.ToString();
+            }
+
+            /// <summary>
+            ///     Encrypts the specified sequence of bytes.
+            /// </summary>
+            /// <param name="bytes">
+            ///     The sequence of bytes to encrypt.
+            /// </param>
+            public string EncryptBytes(byte[] bytes)
+            {
+                if (bytes == null || !bytes.Any())
+                    return string.Empty;
+                string s;
+                using (var ms = new MemoryStream(bytes))
+                    s = EncryptStream(ms);
+                return s;
+            }
+
+            /// <summary>
+            ///     Encrypts the specified string.
+            /// </summary>
+            /// <param name="text">
+            ///     The string to encrypt.
+            /// </param>
+            public string EncryptString(string text) =>
+                EncryptBytes(text?.ToBytes());
+
+            /// <summary>
+            ///     Encrypts the specified file.
+            /// </summary>
+            /// <param name="path">
+            ///     The full path of the file to encrypt.
+            /// </param>
+            public string EncryptFile(string path)
+            {
+                try
+                {
+                    var s = PathEx.Combine(path);
+                    using (var fs = File.OpenRead(s))
+                        s = EncryptStream(fs);
+                    return s;
+                }
+                catch (Exception ex)
+                {
+                    Log.Write(ex);
+                    return string.Empty;
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Initializes a new instance of the <see cref="Crc32"/> class.
+        /// </summary>
+        public class Crc32 : Crc16
+        {
+            /// <summary>
+            ///     Gets the required hash length.
+            /// </summary>
+            public new const int HashLength = 8;
+
+            [SuppressMessage("ReSharper", "InconsistentNaming")]
+            private static readonly uint[] CRC =
+            {
+                0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+                0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+                0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+                0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+                0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+                0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+                0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+                0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+                0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+                0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+                0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+                0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+                0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+                0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+                0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+                0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+                0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+                0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+                0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+                0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+                0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+                0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+                0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+                0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+                0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+                0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+                0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+                0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+                0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+                0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+                0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+                0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+                0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+                0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+                0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+                0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+                0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+                0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+                0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+                0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+                0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+                0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+                0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+                0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+                0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+                0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+                0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+                0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+                0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+                0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+                0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+                0x2d02ef8d
+            };
+
+            /// <summary>
+            ///     Encrypts the specified stream.
+            /// </summary>
+            /// <param name="stream">
+            ///     The stream to encrypt.
+            /// </param>
+            public override string EncryptStream(Stream stream)
+            {
+                int i;
+                var ui = 0xffffffffu;
+                while ((i = stream.ReadByte()) != -1)
+                    ui = (ui >> 8) ^ CRC[(ui & 0xff) ^ i];
+                ui ^= 0xffffffff;
+                var ba = new byte[4];
+                ba[0] = (byte)(ui >> 24);
+                ba[1] = (byte)(ui >> 16);
+                ba[2] = (byte)(ui >> 8);
+                ba[3] = (byte)ui;
+                var sb = new StringBuilder(ba.Length * 2);
+                foreach (var b in ba)
+                    sb.Append(b.ToString("x2"));
+                return sb.ToString();
+            }
+        }
+
+        #endregion
+
         #region Message-Digest 5

         /// <summary>


Correcting the legacy template MakeNew private method so the OnNew event is fired after the design is added and file is created.

--- src/umbraco.cms/businesslogic/template/Template.cs
+++ src/umbraco.cms/businesslogic/template/Template.cs
@@ -398,9 +398,8 @@

         private static Template MakeNew(string name, BusinessLogic.User u, Template master, string design)
         {
-
             // CMSNode MakeNew(int parentId, Guid objectType, int userId, int level, string text, Guid uniqueID)
-            CMSNode n = CMSNode.MakeNew(-1, ObjectType, u.Id, 1, name, Guid.NewGuid());
+            var node = MakeNew(-1, ObjectType, u.Id, 1, name, Guid.NewGuid());

             //ensure unique alias
             name = helpers.Casing.SafeAlias(name);
@@ -413,35 +412,35 @@

             SqlHelper.ExecuteNonQuery("INSERT INTO cmsTemplate (NodeId, Alias, design, master) VALUES (@nodeId, @alias, @design, @master)",
-                                      SqlHelper.CreateParameter("@nodeId", n.Id),
+                                      SqlHelper.CreateParameter("@nodeId", node.Id),
                                       SqlHelper.CreateParameter("@alias", name),
                                       SqlHelper.CreateParameter("@design", ' '),
                                       SqlHelper.CreateParameter("@master", DBNull.Value));

-            Template t = new Template(n.Id);
-            NewEventArgs e = new NewEventArgs();
-            t.OnNew(e);
-
+            var template = new Template(node.Id);
             if (master != null)
-                t.MasterTemplate = master.Id;
-
-			switch (DetermineRenderingEngine(t, design))
+                template.MasterTemplate = master.Id;
+
+			switch (DetermineRenderingEngine(template, design))
 			{
 				case RenderingEngine.Mvc:
-					ViewHelper.CreateViewFile(t);
+					ViewHelper.CreateViewFile(template);
 					break;
 				case RenderingEngine.WebForms:
-					MasterPageHelper.CreateMasterPage(t);
+					MasterPageHelper.CreateMasterPage(template);
 					break;
 			}

 			//if a design is supplied ensure it is updated.
-			if (!design.IsNullOrWhiteSpace())
+			if (design.IsNullOrWhiteSpace() == false)
 			{
-				t.ImportDesign(design);
+				template.ImportDesign(design);
 			}

-            return t;
+            var e = new NewEventArgs();
+            template.OnNew(e);
+
+            return template;
         }

         private static string EnsureUniqueAlias(string alias, int attempts)


Hani Atassi's patch to fix reference handling

--- src/Tasks/Vb6Task.cs
+++ src/Tasks/Vb6Task.cs
@@ -20,6 +20,7 @@

 // Aaron A. Anderson (aaron@skypoint.com | aaron.anderson@farmcreditbank.com)
 // Kevin Dente (kevin_d@mindspring.com)
+// Hani Atassi (haniatassi@users.sourceforge.com)

 using System;
 using System.Collections.Specialized;
@@ -306,6 +307,66 @@
         #region Private Instance Methods

         /// <summary>
+        /// VB6 uses a special algorithm to search for the typelib file. It doesn't
+        /// rely on the API function QueryPathOfRegTypeLib, because VB could use a newer
+        /// version of the TLB.
+        ///
+        /// The algorithm used by VB is not perfect and has some flaws, which you could
+        /// get a newer version even if your requested version is installed. This is because
+        /// the algorithm iterates the registry beneath the Guid - entry by entry - from the
+        /// beginning and returns the first TLB version that is higher or equal to the
+        /// requested version.
+        ///
+        /// pseudo code:
+        /// 1. open the key HKEY_CLASSES_ROOT\TypeLib\{Guid}
+        /// 2. If the key exists:
+        ///     3. Foreach version under the key that has the requested culture entry:
+        ///         4. If the version higher or equal to the requested version:
+        ///             5. Get the TLB filename and returns it
+        /// </summary>
+        /// <param name="guid">The guid of the tlb to look for</param>
+        /// <param name="major">The major version number of the tlb</param>
+        /// <param name="minor16">The minor version number of the tlb. If you parse minor from a string, treat the string as hex value.</param>
+        /// <param name="lcid">The culture id</param>
+        /// <returns>null if couldn't find a match, otherwise it returns the file.</returns>
+        private string VB6GetTypeLibFile(Guid guid, ushort major, ushort minor16, uint lcid) {
+            string tlbFile = null;
+
+            Microsoft.Win32.RegistryKey regKey;
+            regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(string.Format("TypeLib\\{{{0}}}", guid));
+            if (regKey != null) {
+                foreach (string ver in regKey.GetSubKeyNames()) {
+                    Microsoft.Win32.RegistryKey regKeyCulture = regKey.OpenSubKey(string.Format("{0}\\{1}", ver, lcid));
+                    if (regKeyCulture == null)
+                        continue;
+
+                    ushort tmpMajor = 0;
+                    ushort tmpMinor16 = 0;
+                    string [] parts = ver.Split('.');
+                    if (parts.Length > 0) {
+                        tmpMajor = (ushort) double.Parse(parts[0], CultureInfo.InvariantCulture);
+                        if (parts.Length > 1) {
+                            tmpMinor16 = Convert.ToUInt16(parts[1], 16);  // Treat minor as hex
+                        }
+                    }
+
+                    if (major < tmpMajor  || (major == tmpMajor && minor16 <= tmpMinor16)) {
+                        // Found it..
+                        Microsoft.Win32.RegistryKey regKeyWin32 = regKeyCulture.OpenSubKey("win32");
+                        if (regKeyWin32 != null) {
+                            tlbFile = (string)regKeyWin32.GetValue("");
+                            regKeyWin32.Close();
+                            break;
+                        }
+                    }
+                }
+                regKey.Close();
+            }
+
+            return tlbFile;
+        }
+
+        /// <summary>
         /// Parses a VB project file and extracts the source files, reference files, and
         /// the name of the compiled file for the project.
         /// </summary>
@@ -339,7 +400,7 @@
             Regex codeRegEx = new Regex(@"(Class|Module)\s*=\s*\w*;\s*(?<filename>.*($^\.)*)\s*$");

             // Regexp that extracts reference entries from the VBP (Reference=)
-            Regex referenceRegEx = new Regex(@"(Object|Reference)\s*=\s*({|\*\\G{)(?<tlbguid>[0-9\-A-Fa-f]*($^\.)*)}\#(?<majorver>[0-9($^\.)*]*)\.(?<minorver>[0-9]($^\.)*)\#(?<lcid>[0-9]($^\.)*)(;|\#)(?<tlbname>.*)");
+            Regex referenceRegEx = new Regex(@"(Object|Reference)\s*=\s*({|\*\\G{)(?<tlbguid>[0-9\-A-Fa-f]*($^\.)*)}\#(?<majorver>[0-9($^\.)]*)\.(?<minorver>[0-9a-fA-F($^\.)]*)\#(?<lcid>[0-9]($^\.)*)(;|\#)(?<tlbname>.*)");

             string key = String.Empty;
             string keyValue = String.Empty;
@@ -384,8 +445,10 @@
                                     string temp = match.Groups["majorver"].Value;
                                     ushort majorVer = (ushort) double.Parse(temp, CultureInfo.InvariantCulture);

+                                    // Minor is considered a hex value
                                     temp = match.Groups["minorver"].Value;
-                                    ushort minorVer = (ushort) double.Parse(temp, CultureInfo.InvariantCulture);
+                                    ushort minorVer16 = Convert.ToUInt16(temp, 16);
+
                                     temp = match.Groups["lcid"].Value;
                                     uint lcid = 0;

@@ -395,15 +458,18 @@

                                     string tlbGuid = match.Groups["tlbguid"].Value;
                                     Guid guid = new Guid(tlbGuid);
-                                    try {
-                                        QueryPathOfRegTypeLib(ref guid, majorVer, minorVer, lcid, out tlbName);
-                                        tlbName = tlbName.Trim('\0');
-                                        if (File.Exists(tlbName)) {
-                                            references.Includes.Add(tlbName);
+
+                                    // Find the tlb file
+                                    tlbName = VB6GetTypeLibFile(guid, majorVer, minorVer16, lcid);
+                                    if (File.Exists(tlbName)) {
+                                        references.Includes.Add(tlbName);
+                                    } else {
+                                        // Show a warning if we couldn't find the reference. Don't rely on VB.
+                                        if (tlbName == null) {
+                                            Log(Level.Warning, "Couldn't find the tlb file for '{0}' ver.{1}.{2:x}.", guid, majorVer, minorVer16);
+                                        } else {
+                                            Log(Level.Warning, "Couldn't find the file '{0}'.", tlbName);
                                         }
-                                    } catch (COMException) {
-                                        //Typelib wasn't found - vb6 will barf
-                                        //when the compile happens, but we won't worry about it.
                                     }
                                 }
                             }
@@ -446,15 +512,6 @@

         #region Private Static Methods

-        [DllImport("oleaut32.dll", PreserveSig=false)]
-        private static extern void QueryPathOfRegTypeLib(
-            ref Guid guid,
-            ushort majorVer,
-            ushort minorVer,
-            uint lcid,
-            [MarshalAs(UnmanagedType.BStr)] out string path
-            );
-
         #endregion Private Static Methods
     }
 }


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "14.11.0";
-				ClientTag = "dotnet:19-01-03";
+				ClientTag = "dotnet:19-01-04";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "17.5.0";
-				ClientTag = "dotnet:21-07-25";
+				ClientTag = "dotnet:21-07-26";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "18.0.0";
-				ClientTag = "dotnet:22-02-25";
+				ClientTag = "dotnet:22-02-26";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:17-06-15";
+				ClientTag = "dotnet:17-06-16";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:17-10-20";
+				ClientTag = "dotnet:17-10-21";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "18.7.0";
-				ClientTag = "dotnet:22-06-22";
+				ClientTag = "dotnet:22-06-23";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.4.0";
-				ClientTag = "dotnet:19-07-26";
+				ClientTag = "dotnet:19-07-27";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "18.16.0";
-				ClientTag = "dotnet:22-10-12";
+				ClientTag = "dotnet:22-10-13";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "16.19.0";
-				ClientTag = "dotnet:21-03-18";
+				ClientTag = "dotnet:21-03-19";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "17.14.0";
-				ClientTag = "dotnet:21-12-04";
+				ClientTag = "dotnet:21-12-05";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "16.19.0";
-				ClientTag = "dotnet:21-04-05";
+				ClientTag = "dotnet:21-04-06";
 		}

 		#region Properties


(Carriere): unused variable.

(Carriere): unused variable.

--- ArcFormats/Carriere/ArcARC.cs
+++ ArcFormats/Carriere/ArcARC.cs
@@ -133,7 +133,6 @@
             {
                 input = new XoredStream (input, 0xFF);
             }
-            var output = new byte[unpacked_size];
             if ((flags & 2) != 0)
             {
                 input = new LzssStream (input);


quickfix for rotating images

quickfix for rotating images

--- server/ERNI.PhotoDatabase.Server/Utils/Image/ImageManipulation.cs
+++ server/ERNI.PhotoDatabase.Server/Utils/Image/ImageManipulation.cs
@@ -1,16 +1,97 @@
 using System;
 using System.IO;
+using System.Linq;
 using SkiaSharp;

 namespace ERNI.PhotoDatabase.Server.Utils.Image
 {
     public class ImageManipulation : IImageManipulation
     {
+        private SKBitmap RotateAndFlip(SKBitmap original, SKCodecOrigin origin)
+        {
+            // these are the origins that represent a 90 degree turn in some fashion
+            var differentOrientations = new[]
+            {
+                SKCodecOrigin.LeftBottom,
+                SKCodecOrigin.LeftTop,
+                SKCodecOrigin.RightBottom,
+                SKCodecOrigin.RightTop
+            };
+
+            // check if we need to turn the image
+            var isDifferentOrientation = differentOrientations.Any(o => o == origin);
+
+            // define new width/height
+            var width = isDifferentOrientation ? original.Height : original.Width;
+            var height = isDifferentOrientation ? original.Width : original.Height;
+
+            var bitmap = new SKBitmap(width, height, original.AlphaType == SKAlphaType.Opaque);
+
+            // todo: the stuff in this switch statement should be rewritten to use pointers
+            switch (origin)
+            {
+                case SKCodecOrigin.LeftBottom:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(y, original.Width - 1 - x, original.GetPixel(x, y));
+                    break;
+
+                case SKCodecOrigin.RightTop:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(original.Height - 1 - y, x, original.GetPixel(x, y));
+                    break;
+
+                case SKCodecOrigin.RightBottom:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(original.Height - 1 - y, original.Width - 1 - x, original.GetPixel(x, y));
+
+                    break;
+
+                case SKCodecOrigin.LeftTop:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(y, x, original.GetPixel(x, y));
+                    break;
+
+                case SKCodecOrigin.BottomLeft:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(x, original.Height - 1 - y, original.GetPixel(x, y));
+                    break;
+
+                case SKCodecOrigin.BottomRight:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(original.Width - 1 - x, original.Height - 1 - y, original.GetPixel(x, y));
+                    break;
+
+                case SKCodecOrigin.TopRight:
+
+                    for (var x = 0; x < original.Width; x++)
+                        for (var y = 0; y < original.Height; y++)
+                            bitmap.SetPixel(original.Width - 1 - x, y, original.GetPixel(x, y));
+                    break;
+
+            }
+
+            return bitmap;
+        }
+
         public byte[] ResizeTo(byte[] sourceImageData, int size)
         {
             using (var ms = new MemoryStream(sourceImageData))
             using (var inputStream = new SKManagedStream(ms, false))
-            using (var sourceBitmap = SKBitmap.Decode(inputStream))
+            using (var codec = SKCodec.Create(inputStream))
+            using (var bmp = SKBitmap.Decode(codec))
+            using (var sourceBitmap = RotateAndFlip(bmp, codec.Origin))
             {
                 var sourceSize = Math.Max(sourceBitmap.Width, sourceBitmap.Height);
                 var ratio = size / (double)sourceSize;


Implement `Reset()`

Implement `Reset()`

--- osu.Framework.Android/Input/AndroidMouseHandler.cs
+++ osu.Framework.Android/Input/AndroidMouseHandler.cs
@@ -105,6 +105,12 @@
             return true;
         }

+        public override void Reset()
+        {
+            Sensitivity.SetDefault();
+            base.Reset();
+        }
+
         private void updatePointerCapture()
         {
             // Pointer capture is only available on Android 8.0 and up


Removed redundant code

Removed redundant code

--- Assets/Scripts/AncestryWeb.cs
+++ Assets/Scripts/AncestryWeb.cs
@@ -28,8 +28,6 @@
     SettingsScreen settingsScreen = new SettingsScreen();

     private int highestDepth = 0;
-
-    private bool delayFlag = false;

     public enum AncestryState
     {


Use DefaultIfEmpty rather than Take.ToArray

--- osu.Framework/Platform/Windows/Native/IconGroup.cs
+++ osu.Framework/Platform/Windows/Native/IconGroup.cs
@@ -119,18 +119,14 @@
         /// <param name="bpp">The maximum desired bit depth.</param>
         /// <param name="requireRawData">If true, only icon entries that provide raw PNG data will be considered.</param>
         /// <returns>The index of the icon in the icon directory, or -1 if a valid icon could not be found.</returns>
-        private int findClosestEntry(int width, int height, int bpp, bool requireRawData)
-        {
-            var results = Enumerable.Range(0, iconDir.Count)
-                                    .Where(i => iconDir.Entries[i].Width <= width && iconDir.Entries[i].Height <= height && iconDir.Entries[i].BitCount <= bpp)
-                                    .Where(i => iconDir.Entries[i].HasRawData || !requireRawData)
-                                    .OrderByDescending(i => iconDir.Entries[i].Width)
-                                    .ThenByDescending(i => iconDir.Entries[i].Height)
-                                    .ThenByDescending(i => iconDir.Entries[i].BitCount)
-                                    .Take(1).ToArray();
-
-            return results.Length == 0 ? -1 : results[0];
-        }
+        private int findClosestEntry(int width, int height, int bpp, bool requireRawData) =>
+            Enumerable.Range(0, iconDir.Count)
+                      .Where(i => iconDir.Entries[i].Width <= width && iconDir.Entries[i].Height <= height && iconDir.Entries[i].BitCount <= bpp)
+                      .Where(i => iconDir.Entries[i].HasRawData || !requireRawData)
+                      .OrderByDescending(i => iconDir.Entries[i].Width)
+                      .ThenByDescending(i => iconDir.Entries[i].Height)
+                      .ThenByDescending(i => iconDir.Entries[i].BitCount)
+                      .DefaultIfEmpty(-1).First();

         /// <summary>
         /// Attempts to create a Windows-specific icon matching the requested dimensions as closely as possible.


MemoryStream used as buffer for saving to avoid broken save files if something throws on saving

--- Assets/Scripts/GameManager.cs
+++ Assets/Scripts/GameManager.cs
@@ -45,13 +45,17 @@
         {
             Directory.CreateDirectory(SaveFolder);
         }
-        using (var stream = new FileStream(Path.Combine(SaveFolder, SaveFile), FileMode.Create, FileAccess.Write))
-        using (var writer = new BinaryWriter(stream, Encoding.UTF8, false))
+        using (var fileStream = new FileStream(Path.Combine(SaveFolder, SaveFile), FileMode.Create, FileAccess.Write))
+        using (var memoryStream = new MemoryStream())
+        using (var writer = new BinaryWriter(memoryStream, Encoding.UTF8, false))
         {
             var serializationInfo = new SerializationInfo();
             serializationInfo.SetValue(GameManagerSerializationNames.Scene, SceneManager.GetActiveScene().name);
             serializationInfo.SetValue(GameManagerSerializationNames.Mission, missionSerializer);
             serializationInfo.Write(writer);
+
+            memoryStream.Position = 0;
+            memoryStream.CopyTo(fileStream);
         }
     }


Rewrite rank graph test to use more modern style

--- osu.Game.Tests/Visual/Online/TestSceneRankGraph.cs
+++ osu.Game.Tests/Visual/Online/TestSceneRankGraph.cs
@@ -1,13 +1,12 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.
-
-#nullable disable

 using NUnit.Framework;
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Shapes;
+using osu.Framework.Testing;
 using osu.Game.Graphics;
 using osu.Game.Online.API.Requests.Responses;
 using osu.Game.Overlays;
@@ -23,33 +22,14 @@
         [Cached]
         private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);

-        public TestSceneRankGraph()
+        private RankGraph graph = null!;
+
+        private const int history_length = 89;
+
+        [SetUpSteps]
+        public void SetUpSteps()
         {
-            RankGraph graph;
-
-            int[] data = new int[89];
-            int[] dataWithZeros = new int[89];
-            int[] smallData = new int[89];
-            int[] edgyData = new int[89];
-
-            for (int i = 0; i < 89; i++)
-                data[i] = dataWithZeros[i] = (i + 1) * 1000;
-
-            for (int i = 20; i < 60; i++)
-                dataWithZeros[i] = 0;
-
-            for (int i = 79; i < 89; i++)
-                smallData[i] = 100000 - i * 1000;
-
-            bool edge = true;
-
-            for (int i = 0; i < 20; i++)
-            {
-                edgyData[i] = 100000 + (edge ? 1000 : -1000) * (i + 1);
-                edge = !edge;
-            }
-
-            Add(new Container
+            AddStep("create graph", () => Child = new Container
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
@@ -67,8 +47,14 @@
                     }
                 }
             });
+        }

+        [Test]
+        public void TestNullUser() =>
             AddStep("null user", () => graph.Statistics.Value = null);
+
+        [Test]
+        public void TestRankOnly() =>
             AddStep("rank only", () =>
             {
                 graph.Statistics.Value = new UserStatistics
@@ -78,6 +64,14 @@
                 };
             });

+        [Test]
+        public void TestWithRankHistory()
+        {
+            int[] data = new int[history_length];
+
+            for (int i = 0; i < history_length; i++)
+                data[i] = (i + 1) * 1000;
+
             AddStep("with rank history", () =>
             {
                 graph.Statistics.Value = new UserStatistics
@@ -86,10 +80,22 @@
                     PP = 12345,
                     RankHistory = new APIRankHistory
                     {
-                        Data = data,
+                        Data = data
                     }
                 };
             });
+        }
+
+        [Test]
+        public void TestRanksWithZeroValues()
+        {
+            int[] dataWithZeros = new int[history_length];
+
+            for (int i = 0; i < history_length; i++)
+            {
+                if (i < 20 || i >= 60)
+                    dataWithZeros[i] = (i + 1) * 1000;
+            }

             AddStep("with zero values", () =>
             {
@@ -103,6 +109,15 @@
                     }
                 };
             });
+        }
+
+        [Test]
+        public void TestSmallAmountOfData()
+        {
+            int[] smallData = new int[history_length];
+
+            for (int i = history_length - 10; i < history_length; i++)
+                smallData[i] = 100000 - i * 1000;

             AddStep("small amount of data", () =>
             {
@@ -116,6 +131,20 @@
                     }
                 };
             });
+        }
+
+        [Test]
+        public void TestHistoryWithEdges()
+        {
+            int[] edgyData = new int[89];
+
+            bool edge = true;
+
+            for (int i = 0; i < 20; i++)
+            {
+                edgyData[i] = 100000 + (edge ? 1000 : -1000) * (i + 1);
+                edge = !edge;
+            }

             AddStep("graph with edges", () =>
             {


Fix beats stress (int à la place de float)

--- Assets/Scripts/StressBeats.cs
+++ Assets/Scripts/StressBeats.cs
@@ -7,7 +7,7 @@
 public class StressBeats : MonoBehaviour {
 	private AudioSource beat1, beat2, beat3, beat4, beat5, currentBeat; //fichiers audio et beat actuel
 	public float stressLevel; //niveau de stress récupéré (envoyé par le script qui gère le stress)
-	private float sLevel1 = 0.10f, sLevel2 = 0.20f, sLevel3 = 0.50f, sLevel4 = 0.75f, sLevel5 = 0.90f; //seuils de niveaux de stress pour jouer la musique
+	private int sLevel1 = 2, sLevel2 = 4, sLevel3 = 6, sLevel4 = 8, sLevel5 = 9; //seuils de niveaux de stress pour jouer la musique
 	private bool playBeat;

 	// Use this for initialization
@@ -27,6 +27,9 @@

 	// Update is called once per frame
 	void Update () {
+
+		//On recupere le stress level du joueur
+		stressLevel = GameObject.Find ("Player").GetComponent<PlayerController>().playerStress;

 		playBeat = true;
 		//Niveau de stress en dessous du premier seuil : pas de beat


Use `OsuColour.Orange1` instead of pure yellow

--- osu.Game/Beatmaps/Drawables/StarRatingDisplayV2.cs
+++ osu.Game/Beatmaps/Drawables/StarRatingDisplayV2.cs
@@ -86,8 +86,8 @@

                 background.Colour = colours.ForStarDifficulty(c.NewValue.Stars);

-                starIcon.Colour = c.NewValue.Stars >= 6.5 ? Color4.Yellow : colourProvider?.Background5 ?? Color4Extensions.FromHex("303d47");
-                starsText.Colour = c.NewValue.Stars >= 6.5 ? Color4.Yellow : colourProvider?.Background5 ?? Color4.Black.Opacity(0.75f);
+                starIcon.Colour = c.NewValue.Stars >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4Extensions.FromHex("303d47");
+                starsText.Colour = c.NewValue.Stars >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4.Black.Opacity(0.75f);
             }, true);
         }
     }


Passt die Formatierung an.

Passt die Formatierung an.

--- AsyncStreamReader/Programm.cs
+++ AsyncStreamReader/Programm.cs
@@ -5,36 +5,35 @@
 using System.Threading.Tasks;

 class Program {
-  static void Main() {
-  	Task webTask = GetWebContentAsync();
+	static void Main() {
+		Task webTask = GetWebContentAsync();

-  	while(!webTask.IsCompleted)
-  	{
-  		Console.Write(";o ");
-  		Thread.Sleep(100);
-  	}
+		while(!webTask.IsCompleted)
+		{
+			Console.Write(";o ");
+			Thread.Sleep(100);
+		}

-  	Console.WriteLine("FERTIG!");
-  }
+		Console.WriteLine("FERTIG!");
+	}

-  static async Task GetWebContentAsync()
-  {
-	WebClient myClient = new WebClient();
-	Stream response = await myClient.OpenReadTaskAsync("http://www.contoso.com/index.htm");
+	static async Task GetWebContentAsync()
+	{
+		WebClient myClient = new WebClient();
+		Stream response = await myClient.OpenReadTaskAsync("http://www.contoso.com/index.htm");

-	using (var reader = new StreamReader(response))
-	{
-		string line;
-		while((line = await reader.ReadLineAsync()) != null)
-        {
-        	Console.WriteLine();
-            Console.WriteLine(line);
-        }
+		using (var reader = new StreamReader(response))
+		{
+			string line;
+			while((line = await reader.ReadLineAsync()) != null)
+			{
+				Console.WriteLine();
+				Console.WriteLine(line);
+			}

-        reader.Close();
-    }
+			reader.Close();
+		}

-	response.Close();
-  }
-
+		response.Close();
+	}
 }


and forgot this bug

and forgot this bug

--- Avalon/UI/MysticalTomeSlot.cs
+++ Avalon/UI/MysticalTomeSlot.cs
@@ -39,7 +39,7 @@
                 attr = it.allSubClasses[i].GetType().GetCustomAttributes(typeof(TomeSkillAttribute), true)
                     .FirstOrDefault() as TomeSkillAttribute; // there should be only one

-            return base.AllowsItem(it) && attr != null && it.CanEquip(Main.localPlayer, 0);
+            return base.AllowsItem(it) && ((attr != null && it.CanEquip(Main.localPlayer, 0)) || it.IsBlank());
         }
     }
 }


Null-checking for Source property.

Null-checking for Source property.

--- Binary/TablatureBinaryFile.cs
+++ Binary/TablatureBinaryFile.cs
@@ -1,6 +1,7 @@
 #region

 using System;
+using System.Collections.Specialized;
 using System.IO;
 using Tabster.Core.Types;

@@ -39,7 +40,7 @@

                     //source attributes
                     writer.Write((int) SourceType);
-                    writer.Write(Source.ToString());
+                    writer.Write(Source != null ? Source.ToString() : string.Empty);

                     writer.Write(Comment);


Refactor ctor

Refactor ctor

--- BmpListener/Bgp/BgpMessage.cs
+++ BmpListener/Bgp/BgpMessage.cs
@@ -10,9 +10,10 @@
         {
             var bgpHeader = new BgpHeader(data);
             Type = bgpHeader.Type;
+            Length = (int)bgpHeader.Length;
             var offset = data.Offset + 19;
-            Length = (int) bgpHeader.Length;
-            data = new ArraySegment<byte>(data.Array, offset, Length - 19);
+            var count = Length - 19;
+            data = new ArraySegment<byte>(data.Array, offset, count);
         }

         [JsonIgnore]


handle unexpected data from slack http call

--- tests/NewSlackTests.cs
+++ tests/NewSlackTests.cs
@@ -2,6 +2,7 @@
 using Slackbot;
 using Moq;
 using System;
+using System.Threading.Tasks;

 public class NewSlackTests
 {
@@ -21,5 +22,20 @@
             var actual = await sut.GetUsername("", "");
             Assert.Equal("", actual);
         }
+
+        [Fact]
+        public async void when_http_client_returns_non_json()
+        {
+            var mockHttp = new Mock<IHttp>();
+
+            mockHttp
+                .Setup(http => http.Get(It.IsAny<string>()))
+                .Returns(Task.FromResult<HttpGetResult>(new HttpGetResult { Body = "not-json" }));
+
+            var sut = new NewSlack(mockHttp.Object);
+
+            var actual = await sut.GetUsername("", "");
+            Assert.Equal("", actual);
+        }
     }
 }


Avoid canonicalizing pointers. Fixes calling printf

--- src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter.cs
+++ src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter.cs
@@ -126,7 +126,6 @@
             switch (kind)
             {
                 case StackValueKind.Int32:
-                case StackValueKind.NativeInt:
                     {
                         if (!type.IsWellKnownType(WellKnownType.Int32)
                             && !type.IsWellKnownType(WellKnownType.IntPtr)
@@ -146,6 +145,9 @@
                             llvmValue = LLVM.BuildIntCast(_builder, llvmValue, LLVM.Int64Type(), "");
                         }
                     }
+                    break;
+
+                case StackValueKind.NativeInt:
                     break;
             }

@@ -845,13 +847,9 @@
             //conv.u for a pointer should change to a int8*
             if(wellKnownType == WellKnownType.UIntPtr)
             {
-                if (value.Kind == StackValueKind.NativeInt)
+                if (value.Kind == StackValueKind.Int32)
                 {
-                    convertedValue.LLVMValue = LLVM.BuildPointerCast(_builder, value.LLVMValue, LLVM.PointerType(LLVM.Int8Type(), 0), "conv.u");
-                }
-                else if (value.Kind == StackValueKind.Int32)
-                {
-                    //convertedValue.LLVMValue = LLVM.BuildGEP(_builder, LLVM.null, new LLVMValueRef[] { value.LLVMValue }, "conv.u");
+                    convertedValue.LLVMValue = LLVM.BuildIntToPtr(_builder, value.LLVMValue, LLVM.PointerType(LLVM.Int8Type(), 0), "conv.u");
                 }
             }


Initilize prop dict

Initilize prop dict

--- src/Microsoft.Azure.WebJobs.Host/Bindings/ParameterBindingData.cs
+++ src/Microsoft.Azure.WebJobs.Host/Bindings/ParameterBindingData.cs
@@ -1,21 +1,15 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the MIT License. See License.txt in the project root for license information.

-using System;
 using System.Collections.Generic;
-using System.Text;
-using System.Xml.Linq;

 namespace Microsoft.Azure.WebJobs.Script.Abstractions.Description.Binding
 {
     public class ParameterBindingData
     {
         /// <summary>
-        /// Gets or Sets all the properties of ReferenceType
-        /// The storage account connection string
-        /// The name of the container where the blob exists
-        /// The name of the blob
+        /// Dictionary for the properties required to hydrate SDK-type objects.
         /// </summary>
-        public IDictionary<string, string> Properties { get; set; }
+        public IDictionary<string, string> Properties = new Dictionary<string, string>();
     }
 }


Remove unmute timer from database when unmuting.

--- src/MitternachtBot/Modules/Administration/Services/MuteService.cs
+++ src/MitternachtBot/Modules/Administration/Services/MuteService.cs
@@ -74,6 +74,7 @@

 		public async Task UnmuteUser(IGuildUser guildUser) {
 			StopUnmuteTimer(guildUser.GuildId, guildUser.Id);
+			RemoveUnmuteTimerFromDb(guildUser.GuildId, guildUser.Id);

 			//Remove muted role from user.
 			var muteRole = await GetMuteRole(guildUser.Guild).ConfigureAwait(false);


Performance optimisation - For the common case we can avoid these calculations as we'll hit a fast path.

svn path=/trunk/bitsharp/; revision=122141

--- src/MonoTorrent/MonoTorrent.Client/PiecePicking/PriorityPicker.cs
+++ src/MonoTorrent/MonoTorrent.Client/PiecePicking/PriorityPicker.cs
@@ -72,9 +72,6 @@

         public override MessageBundle PickPiece(PeerId id, BitField peerBitfield, List<PeerId> otherPeers, int count, int startIndex, int endIndex)
         {
-            files.Sort();
-            temp.SetAll(false);
-
             // Fast Path - the peer has nothing to offer
             if (peerBitfield.AllFalse)
                 return null;
@@ -95,6 +92,8 @@
                     return base.PickPiece(id, peerBitfield, otherPeers, count, startIndex, endIndex);
             }

+            files.Sort();
+            temp.SetAll(false);
             temp.Or(files[0].Selector);
             for (int i = 1; i < files.Count && files[i].File.Priority != Priority.DoNotDownload; i++)
             {


Added private keyword before Stopwatch declaration

--- CSChecker/Definitions/Unit.cs
+++ CSChecker/Definitions/Unit.cs
@@ -58,7 +58,7 @@
 		/// <summary>
 		///
 		/// </summary>
-		Stopwatch watch;
+		private Stopwatch watch;

 		/// <summary>
 		///


Added alias to build universal framework

--- Cake.Xamarin.Build/Aliases.cs
+++ Cake.Xamarin.Build/Aliases.cs
@@ -192,6 +192,67 @@
             RunLipoCreate(context, workingDirectory, fatLibrary, i386, x86_64, armv7, armv7s, arm64);
         }

+        public static void BuildXCodeUniversalFramework (this ICakeContext context, FilePath xcodeProject, string target, string config = "Release")
+        {
+            var targetsSdks = new Dictionary<string, string> {
+                { "armv7", "iphoneos" },
+                { "armv7s", "iphoneos" },
+                { "arm64", "iphoneos" },
+                { "i386", "iphonesimulator" },
+                { "x86_64", "iphonesimulator" },
+            };
+
+            var projectDir = xcodeProject.GetDirectory ();
+            var libsToLipo = new List<FilePath> ();
+
+            // We need to build for all the target arch's and sdk's
+            foreach (var targetSdk in targetsSdks) {
+                // Build the framework
+                context.XCodeBuild (new XCodeBuildSettings {
+                    Project = xcodeProject.MakeAbsolute (context.Environment).FullPath,
+                    Target = target,
+                    Sdk = targetSdk.Value,
+                    Arch = targetSdk.Key,
+                    Configuration = config,
+                });
+
+                // Get the path to the built static library inside the framework
+                var staticLib = projectDir
+                    .Combine ("build")
+                    .Combine (config + "-" + targetSdk.Value)
+                    .Combine (target)
+                    .Combine (target + ".framework")
+                    .CombineWithFilePath (target);
+
+                var libToLipo = projectDir.CombineWithFilePath ("lib" + target + "-" + targetSdk.Key + ".a");
+
+                // Move the built static lib to a place where we can lipo it later
+                context.MoveFile (
+                    staticLib,
+                    libToLipo);
+
+                libsToLipo.Add (libToLipo);
+            }
+
+            // Make sure the universal target dir exists
+            context.EnsureDirectoryExists (projectDir.Combine ("build").Combine ("universal"));
+
+            // Copy the framework contents from iphoneos to the universal folder
+            // This gets us all the header files and such
+            context.CopyDirectory (projectDir.Combine ("build").Combine (config + "-iphoneos"),
+                                   projectDir.Combine ("build").Combine ("universal"));
+
+            // Lipo the separate static libs into one universal static lib, inside the universal framework
+            context.RunLipoCreate (
+                projectDir,
+                projectDir.Combine ("build")
+                    .Combine ("universal")
+                    .Combine (target)
+                    .Combine (target + ".framework")
+                    .CombineWithFilePath (target),
+                libsToLipo.ToArray ());
+        }
+
         /// <summary>
         /// Cleans an xcodeproj build, and removes any *.a static libraries
         /// </summary>


Update EncryptBehavior.cs

Update EncryptBehavior.cs

--- src/NServiceBus.Newtonsoft.Encryption/Pipeline/EncryptBehavior.cs
+++ src/NServiceBus.Newtonsoft.Encryption/Pipeline/EncryptBehavior.cs
@@ -21,8 +21,7 @@
         context.Headers.WriteKeyAndIv(state.keyId, state.algorithm.IV);
         using (factory.GetEncryptSession(state.algorithm))
         {
-            await next(context)
-                ;
+            await next(context);
         }
     }
 }


apch cars v1

apch cars v1


Added tests for the Allow and Deny routes.

--- src/Nancy.OAuth2.IntegrationTests/Modules/AuthorizeModuleTests.cs
+++ src/Nancy.OAuth2.IntegrationTests/Modules/AuthorizeModuleTests.cs
@@ -64,6 +64,84 @@
             Assert.AreEqual("Authorize", response.Context.NegotiationContext.ViewName);
         }

+        [Test]
+        public void Post_Allow_When_Not_Logged_In_Should_Return_401()
+        {
+            var browser = GetBrowser();
+
+            var response = browser.Post("/oauth/authorize/allow", with => with.HttpRequest());
+
+            Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode);
+        }
+
+        [Test]
+        public void Post_Allow_When_No_Request_In_Session_Should_Return_500()
+        {
+            var browser = GetAuthenticatedBrowser("testuser");
+
+            var response = browser.Post("/oauth/authorize/allow", with => with.HttpRequest());
+
+            Assert.AreEqual(HttpStatusCode.InternalServerError, response.StatusCode);
+        }
+
+        [Test]
+        public void Post_Allow_Should_Redirect_To_RedirectUrl_With_AuthorizationResponse_In_Query_String()
+        {
+            var browser = GetAuthenticatedBrowser("testuser", new Dictionary<string, object>
+            {
+                {
+                    "testuser", new AuthorizationRequest
+                    {
+                        RedirectUrl = "http://localhost/callback",
+                        State = "123"
+                    }
+                }
+            });
+
+            var response = browser.Post("/oauth/authorize/allow", with => with.HttpRequest());
+
+            response.ShouldHaveRedirectedTo("http://localhost:80/callback??code=12345678&state=123");
+        }
+
+        [Test]
+        public void Post_Deny_When_Not_Logged_In_Should_Return_401()
+        {
+            var browser = GetBrowser();
+
+            var response = browser.Post("/oauth/authorize/deny", with => with.HttpRequest());
+
+            Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode);
+        }
+
+        [Test]
+        public void Post_Deny_When_No_Request_In_Session_Should_Return_500()
+        {
+            var browser = GetAuthenticatedBrowser("testuser");
+
+            var response = browser.Post("/oauth/authorize/deny", with => with.HttpRequest());
+
+            Assert.AreEqual(HttpStatusCode.InternalServerError, response.StatusCode);
+        }
+
+        [Test]
+        public void Post_Deny_Should_Redirect_To_RedirectUrl_With_ErrorResponse_In_Query_String()
+        {
+            var browser = GetAuthenticatedBrowser("testuser", new Dictionary<string, object>
+            {
+                {
+                    "testuser", new AuthorizationRequest
+                    {
+                        RedirectUrl = "http://localhost/callback",
+                        State = "123"
+                    }
+                }
+            });
+
+            var response = browser.Post("/oauth/authorize/deny", with => with.HttpRequest());
+
+            response.ShouldHaveRedirectedTo("http://localhost/callback?error=access_denied&errordescription=The+user+denied+your+request.&state=123");
+        }
+
         private static Browser GetBrowser()
         {
             return new Browser(with =>


Trumbowyg jQuery dependency (#4788)

Trumbowyg jQuery dependency (#4788)

--- src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs
+++ src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs
@@ -206,6 +206,7 @@

             manifest
                 .DefineScript("trumbowyg")
+                .SetDependencies("jQuery")
                 .SetUrl("~/OrchardCore.Resources/Scripts/trumbowyg.js", "~/OrchardCore.Resources/Scripts/trumbowyg.js")
                 .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/Trumbowyg/2.19.1/trumbowyg.min.js", "https://cdnjs.cloudflare.com/ajax/libs/Trumbowyg/2.19.1/trumbowyg.js")
                 .SetCdnIntegrity("sha384-6T5zd/UY6O+/GBXh9vN5ePib6hyqnP59uZzmwjpVDxoNc08ia4etj/IDPyrJS7R1", "sha384-2Mr/QWbCuYpU62KR2U8ObtDO47hBIlbpqZlH2V6+i2e/KTfV3yCc2/7UdOvkxAf4")


Remove IsWindowsXp from DependencyChecker

--- CefSharp/DependencyChecker.cs
+++ CefSharp/DependencyChecker.cs
@@ -21,18 +21,6 @@
         /// </summary>
         public const string LocalesPackFile = @"locales\en-US.pak";

-        /// <summary>
-        /// IsWindowsXp - Special case for legacy XP support
-        /// </summary>
-        public static bool IsWindowsXp
-        {
-            get
-            {
-                var osVersion = Environment.OSVersion;
-                return osVersion.Platform == PlatformID.Win32NT && osVersion.Version.Major < 6;
-            }
-        }
-
         /// <summary>
         /// List of Cef Dependencies
         /// </summary>
@@ -69,7 +57,7 @@
             // Note: Without these components HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function.
             "libEGL.dll",
             "libGLESv2.dll",
-            (IsWindowsXp ? "d3dcompiler_43.dll" : "d3dcompiler_47.dll")
+            "d3dcompiler_47.dll"
         };

         /// <summary>


Add test catching lifetime change while KeepAlive is true

--- osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs
+++ osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs
@@ -117,8 +117,12 @@
             AddStep("Modify start time", () => entry.HitObject.StartTime = 100);
             AddAssert("Drawable lifetime is correct", () => dho.LifetimeStart == double.MinValue);

+            AddStep("Set LifetimeEnd", () => dho.LifetimeEnd = 999);
+            AddAssert("Lifetime change is blocked", () => dho.LifetimeEnd == double.MaxValue);
+
             AddStep("KeepAlive = false", () => entry.KeepAlive = false);
-            AddAssert("Drawable lifetime is restored", () => dho.LifetimeStart == 100 - TestLifetimeEntry.INITIAL_LIFETIME_OFFSET);
+            AddAssert("Drawable lifetime is restored", () =>
+                dho.LifetimeStart == 100 - TestLifetimeEntry.INITIAL_LIFETIME_OFFSET && dho.LifetimeEnd == 999);
         }

         private class TestDrawableHitObject : DrawableHitObject


Fixing a bug

Fixing a bug

--- Assets/MixedRealityToolkit/Utilities/Editor/ScriptedImporterAssetReimporter.cs
+++ Assets/MixedRealityToolkit/Utilities/Editor/ScriptedImporterAssetReimporter.cs
@@ -16,7 +16,7 @@
     /// </summary>
     public class ScriptedImporterAssetReimporter : AssetPostprocessor
     {
-        private readonly static Dictionary<string, int> assetsAttemptedToReimport = new Dictionary<string, int>();
+        private static readonly Dictionary<string, int> assetsAttemptedToReimport = new Dictionary<string, int>();

         public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
         {
@@ -28,7 +28,7 @@
                     Type assetType = AssetDatabase.GetMainAssetTypeAtPath(asset);
                     if (assetType == typeof(DefaultAsset))
                     {
-                        if (assetsAttemptedToReimport.TryGetValue(asset, out int numAttempts))
+                        if (!assetsAttemptedToReimport.TryGetValue(asset, out int numAttempts))
                         {
                             numAttempts = 0;
                         }
@@ -37,7 +37,7 @@

                         if (numAttempts <= 3)
                         {
-                            Debug.LogWarning($"Asset '{asset}' appears to have failed importing, will attempt to re-import.");
+                            Debug.LogWarning($"Asset '{asset}' appears to have failed importing, will attempt to re-import. Attempt: {numAttempts}");
                             AssetDatabase.ImportAsset(asset);
                         }
                         else


Added custom cookie name for IdP

Added custom cookie name for IdP

--- idp/Startup.cs
+++ idp/Startup.cs
@@ -1,6 +1,7 @@
-using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography.X509Certificates;
 using IdentityServer4;
 using IdentityServer4.Quickstart.UI;
+using Microsoft.AspNetCore.Authentication.Cookies;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
@@ -54,7 +55,10 @@
             //builder.AddInMemoryIdentityResources(Configuration.GetSection("IdentityResources"));
             //builder.AddInMemoryApiResources(Configuration.GetSection("ApiResources"));
             //builder.AddInMemoryClients(Configuration.GetSection("clients"));
-
+
+            builder.Services.Configure<CookieAuthenticationOptions>(IdentityServerConstants.DefaultCookieAuthenticationScheme,
+                cookie => { cookie.Cookie.Name = "idsrv.idp"; });
+
             services.AddAuthentication()
                 .AddGoogle(options =>
                 {


Resolves #831

Resolves #831

--- CompatBot/Commands/Invites.cs
+++ CompatBot/Commands/Invites.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Threading.Tasks;
 using CompatApiClient.Utils;
@@ -9,6 +10,7 @@
 using CompatBot.Utils;
 using DSharpPlus.CommandsNext;
 using DSharpPlus.CommandsNext.Attributes;
+using DSharpPlus.Entities;
 using Microsoft.EntityFrameworkCore;

 namespace CompatBot.Commands
@@ -59,12 +61,17 @@
                 if (!string.IsNullOrEmpty(item.InviteCode))
                     link = linkPrefix + item.InviteCode;
                 //discord expands invite links even if they're inside the code block for some reason
-                table.Add(item.Id.ToString(), item.GuildId.ToString(), link + StringUtils.InvisibleSpacer, guildName.Sanitize());
+                table.Add(item.Id.ToString(), item.GuildId.ToString(), link /* + StringUtils.InvisibleSpacer*/, guildName.Sanitize());
             }
             var result = new StringBuilder()
                 .AppendLine("Whitelisted discord servers:")
-                .Append(table);
-            await ctx.SendAutosplitMessageAsync(result).ConfigureAwait(false);
+                .Append(table.ToString(false));
+
+            await using var output = Config.MemoryStreamManager.GetStream();
+            await using (var writer = new StreamWriter(output, leaveOpen: true))
+                await writer.WriteAsync(result.ToString()).ConfigureAwait(false);
+            output.Seek(0, SeekOrigin.Begin);
+            await ctx.Channel.SendMessageAsync(new DiscordMessageBuilder().WithFile("invites.txt", output)).ConfigureAwait(false);
         }

         [Command("whitelist"), Aliases("add", "allow"), Priority(10)]
@@ -80,7 +87,6 @@
                 await ctx.ReactWithAsync(Config.Reactions.Success, "Invite whitelist was successfully updated!").ConfigureAwait(false);
             else
                 await ctx.ReactWithAsync(Config.Reactions.Failure, $"Failed to add {errors} invite{StringUtils.GetSuffix(errors)} to the whitelist").ConfigureAwait(false);
-            await List(ctx).ConfigureAwait(false);
         }

         [Command("whitelist"), Priority(0)]


Added event listener sample

Added event listener sample

--- ConsoleInteraction/Samples.cs
+++ ConsoleInteraction/Samples.cs
@@ -16,6 +16,7 @@
             Construction();
             SimpleScriptingSample();
             ExtendedScriptingSample();
+            EventScriptingExample();
         }

         static void FirstExample()
@@ -193,5 +194,52 @@
             //HTML will have changed completely (e.g., no more script element)
             Console.WriteLine(document.DocumentElement.OuterHtml);
         }
+
+        public static void EventScriptingExample()
+        {
+            //We require a custom configuration
+            var config = new Configuration();
+
+            //Including a script engine
+            config.Register(new JavaScriptEngine());
+
+            //And enabling scripting + styling (should be enabled anyway)
+            config.IsScripting = true;
+            config.IsStyling = true;
+
+            //This is our sample source, we will trigger the load event
+            var source = @"<!doctype html>
+
+<title>Event sample</title>
+
+
+";
+            var document = DocumentBuilder.Html(source, config);
+
+            //HTML should be output in the end
+            Console.WriteLine(document.DocumentElement.OuterHtml);
+
+            //Register Hello event listener from C# (we also have one in JS)
+            document.AddEventListener("hello", (s, ev) =>
+            {
+                Console.WriteLine("hello world from C#!");
+            });
+
+            var e = document.CreateEvent("event");
+            e.Init("hello", false, false);
+            document.Dispatch(e);
+        }
     }
 }


Fix bug in ProgramLocationAnnotater. The variables attached to implementations are different instances from those attached to procedures so we have to annotate procedure in and out params as well.

--- src/Symbooglix/Annotation/ProgramLocationAnnotater.cs
+++ src/Symbooglix/Annotation/ProgramLocationAnnotater.cs
@@ -26,19 +26,6 @@
                 foreach (var variable in prog.TopLevelDeclarations.OfType<Variable>())
                     variable.SetMetadata( (int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(variable));

-
-                // Requires, ensures and Modset on procedures
-                foreach (var procedure in prog.TopLevelDeclarations.OfType<Procedure>())
-                {
-                    foreach (var require in procedure.Requires)
-                        require.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(require));
-
-                    foreach (var ensure in procedure.Ensures)
-                        ensure.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(ensure));
-
-                    // TODO: Modset
-                }
-
                 // Local variables in implementations
                 foreach (var impl in prog.TopLevelDeclarations.OfType<Implementation>())
                 {
@@ -51,6 +38,28 @@
                     foreach (var local in impl.LocVars)
                         local.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(local));
                 }
+
+                // Requires, ensures and Modset on procedures
+                foreach (var procedure in prog.TopLevelDeclarations.OfType<Procedure>())
+                {
+                    foreach (var require in procedure.Requires)
+                        require.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(require));
+
+                    foreach (var ensure in procedure.Ensures)
+                        ensure.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(ensure));
+
+                    // HACK: This is gross but the inParam and outParams on procedure are not the same
+                    // instances in Boogie. So we need to annotate those as well! Boogie really needs fixing!
+                    foreach (var inParam in procedure.InParams)
+                        inParam.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(inParam));
+
+                    foreach (var outParam in procedure.OutParams)
+                        outParam.SetMetadata((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(outParam));
+
+                    // TODO: Modset
+                }
+
+

                 // Commands in basic blocks
                 foreach (var bb in prog.Blocks())


Manual change as per patch in mantis #7212. (the patch failed to apply, but the fix was good) Thanks FreakyTech.

--- OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -244,7 +244,7 @@
                             if (inventoryURL != null && inventoryURL != string.Empty)
                             {
                                 inventoryURL = inventoryURL.Trim(new char[] { '/' });
-                                m_InventoryURLs.Add(userID, inventoryURL);
+                                m_InventoryURLs[userID] = inventoryURL;
                                 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
                                 return;
                             }


(NEW) Added reasoning rule on owl:symmetricProperty;

--- Plugins/Semantics/RDFSharp.Semantics/Reasoning/RDFOntologyReasoningRuleSets.cs
+++ Plugins/Semantics/RDFSharp.Semantics/Reasoning/RDFOntologyReasoningRuleSets.cs
@@ -352,6 +352,11 @@
             /// SameAsEntailment implements data entailments based on 'owl:SameAs' taxonomy
             /// </summary>
             public static RDFOntologyReasoningRule SameAsEntailment { get; internal set; }
+
+            /// <summary>
+            /// SymmetricPropertyEntailment implements data entailments based on 'owl:SymmetricProperty' axiom
+            /// </summary>
+            public static RDFOntologyReasoningRule SymmetricPropertyEntailment { get; internal set; }
             #endregion

             #region Ctors
@@ -406,6 +411,12 @@
                                                                               "((F1 P F2) AND (F2 SAMEAS F3)) => (F1 P F3)",
                                                                               SameAsEntailmentExec);

+                //SymmetricPropertyEntailment
+                SymmetricPropertyEntailment    = new RDFOntologyReasoningRule("SymmetricPropertyEntailment",
+                                                                              "SymmetricPropertyEntailment implements data entailments based on 'owl:SymmetricProperty' axiom:" +
+                                                                              "((F1 P F2) AND (P TYPE SYMMETRICPROPERTY)) => (F2 P F1)",
+                                                                              SymmetricPropertyEntailmentExec);
+
             }
             #endregion

@@ -685,6 +696,43 @@
                     }
                 }
             }
+
+            /// <summary>
+            /// SymmetricPropertyEntailment implements data entailments based on 'owl:SymmetricProperty' axiom:
+            /// ((F1 P F2) AND (P TYPE SYMMETRICPROPERTY)) => (F2 P F1)
+            /// </summary>
+            internal static void SymmetricPropertyEntailmentExec(RDFOntology ontology, RDFOntologyReasoningReport report) {
+                foreach(var p              in ontology.Model.PropertyModel) {
+                    if(p.IsSymmetricProperty()) {
+
+                        //Filter the assertions using the current property (F1 P F2)
+                        var pAsns           = ontology.Data.Relations.Assertions.SelectEntriesByPredicate(p);
+
+                        //Iterate those assertions
+                        foreach(var pAsn   in pAsns) {
+
+                            //Taxonomy-check for securing inference consistency
+                            if(pAsn.TaxonomyObject.IsFact()) {
+
+                                //Create the inference as a taxonomy entry
+                                var spInfer = new RDFOntologyTaxonomyEntry(pAsn.TaxonomyObject, p, pAsn.TaxonomySubject).SetInference(true);
+
+                                //Enrich the data with the inference
+                                var taxCnt  = ontology.Data.Relations.Assertions.EntriesCount;
+                                ontology.Data.Relations.Assertions.AddEntry(spInfer);
+
+                                //Add the inference into the reasoning report
+                                if(ontology.Data.Relations.Assertions.EntriesCount > taxCnt) {
+                                   report.AddEvidence(new RDFOntologyReasoningEvidence(RDFSemanticsEnums.RDFOntologyReasoningEvidenceCategory.Data, "SymmetricPropertyEntailment", spInfer));
+                                }
+
+                            }
+
+                        }
+
+                    }
+                }
+            }
             #endregion

         }


Unified assembly description for all platforms

--- SimplePersistence.Model/src/SimplePersistence.Model/Properties/AssemblyInfo.cs
+++ SimplePersistence.Model/src/SimplePersistence.Model/Properties/AssemblyInfo.cs
@@ -26,21 +26,7 @@
 using System.Reflection;
 using System.Runtime.InteropServices;

-#if PORTABLE40
-[assembly: AssemblyTitle("SimplePersistence.Model Portable .NET 4.0")]
-#elif NETCORE45
-[assembly: AssemblyTitle("SimplePersistence.Model Portable")]
-#elif DOTNET
-[assembly: AssemblyTitle("SimplePersistence.Model .NET Platform")]
-#elif NET20
-[assembly: AssemblyTitle("SimplePersistence.Model .NET 2.0")]
-#elif NET35
-[assembly: AssemblyTitle("SimplePersistence.Model .NET 3.5")]
-#elif NET40
-[assembly: AssemblyTitle("SimplePersistence.Model .NET 4.0")]
-#else
 [assembly: AssemblyTitle("SimplePersistence.Model")]
-#endif

 [assembly: AssemblyDescription("Library with helper interfaces and classes to provide consistency across application models. Implementations are ORM compatible and should be usable in most databases.")]
 [assembly: AssemblyConfiguration("")]


Added details for the parameters passed via constructor.

--- Data/Piranha.RavenDb/Store.cs
+++ Data/Piranha.RavenDb/Store.cs
@@ -38,6 +38,9 @@
 		/// <param name="defaultDatabase">The default database</param>
 		/// <param name="waitForStaleResults">If the store should wait for stale results</param>
 		/// <param name="allowQueriesOnId">If LINQ queries on Id should be allowed</param>
+		/// <param name="maxNumberOfRequestsPerSession">Set the maximum number of requests per session to override safe defaults</param>
+		/// <param name="useOptimisticConcurrency">Flag to set whether optimistic concurrency should be used</param>
+		/// <param name="useEmbeddedInMemoryStore">Flag to set whether embedded in memory store should be used. This primarily used for unit tests</param>
 		public Store(string url, string defaultDatabase, bool waitForStaleResults = false, bool allowQueriesOnId = false, int maxNumberOfRequestsPerSession = Int32.MaxValue, bool useOptimisticConcurrency = false, bool useEmbeddedInMemoryStore = false)
 		{
 			// Create the store


Updated DateTime as atomic operation

Updated DateTime as atomic operation

--- DataAccess/Cache/CacheItem.cs
+++ DataAccess/Cache/CacheItem.cs
@@ -1,13 +1,15 @@
 using System;
+using System.Threading;

 namespace DbParallel.DataAccess
 {
 	public class CacheItem<TValue> : IEquatable<CacheItem<TValue>>
 	{
-		private DateTime _LastRefreshed;
+		private long _LastRefreshedBinary;
 		public DateTime LastRefreshed
 		{
-			get { return _LastRefreshed; }
+			get { return DateTime.FromBinary(Interlocked.Read(ref _LastRefreshedBinary)); }
+			private set { Interlocked.Exchange(ref _LastRefreshedBinary, value.ToBinary()); }
 		}

 		private TValue _Value;
@@ -20,7 +22,7 @@
 			set
 			{
 				_Value = value;
-				_LastRefreshed = DateTime.Now;
+				LastRefreshed = DateTime.Now;
 			}
 		}


MySQL Tests: make schema teardown depend on spinup


cleaning up

cleaning up


Internal improvements in text selection.


DateTimeTest formatting

DateTimeTest formatting

--- tests/DateTimeTest.cs
+++ tests/DateTimeTest.cs
@@ -35,12 +35,12 @@
 		[Test]
 		public void AsStrings ()
 		{
-			var db = new TestDb (storeDateTimeAsTicks: false);
+			var db = new TestDb (storeDateTimeAsTicks: false);
 			TestDateTime (db);
 		}

-		[TestCase("o")]
-		[TestCase("MMM'-'dd'-'yyyy' 'HH':'mm':'ss'.'fffffff")]
+		[TestCase ("o")]
+		[TestCase ("MMM'-'dd'-'yyyy' 'HH':'mm':'ss'.'fffffff")]
 		public void AsCustomStrings (string format)
 		{
 			var db = new TestDb (CustomDateTimeString (format));
@@ -61,8 +61,8 @@
 			TestAsyncDateTime (db);
 		}

-		[TestCase("o")]
-		[TestCase("MMM'-'dd'-'yyyy' 'HH':'mm':'ss'.'fffffff")]
+		[TestCase ("o")]
+		[TestCase ("MMM'-'dd'-'yyyy' 'HH':'mm':'ss'.'fffffff")]
 		public void AsyncAsCustomStrings (string format)
 		{
 			var db = new SQLiteAsyncConnection (CustomDateTimeString (format));


fix build

fix build

--- tests/RecoveryTest.cs
+++ tests/RecoveryTest.cs
@@ -389,7 +389,7 @@
             await producer.Close();
             _log.Info("Producer closed.");

-            var parts = await router.GetPartitionsInfo(topic);
+            var parts = await router.FetchPartitionsInfo(topic);
             _log.Info("Sum of offsets: {0}", parts.Select(p => p.Tail - p.Head).Sum());
             _log.Info("Offsets: [{0}]", string.Join(",", parts.Select(p => p.ToString())));


Fix ExecuteReaderAsync

Fix ExecuteReaderAsync

--- src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs
+++ src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs
@@ -1701,7 +1701,7 @@
             {
                 RegisterForConnectionCloseNotification(ref returnedTask);

-                Task<SqlDataReader>.Factory.FromAsync(BeginExecuteReader, EndExecuteReader, behavior, null).ContinueWith((t) =>
+                Task<SqlDataReader>.Factory.FromAsync((commandBehavior, callback, stateObject) => BeginExecuteReader(callback, stateObject, commandBehavior), EndExecuteReader, behavior, null).ContinueWith((t) =>
                 {
                     registration.Dispose();
                     if (t.IsFaulted)


typo: Double word "in" (dotnet/corefx#36270)

* typo: Double word "in"

* Update src/System.Console/src/System/Console.cs

Co-Authored-By: nschonni <nschonni@gmail.com>

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/System.Private.CoreLib/shared/System/CurrentSystemTimeZone.cs
+++ src/System.Private.CoreLib/shared/System/CurrentSystemTimeZone.cs
@@ -209,7 +209,7 @@
             return (DaylightTime)m_CachedDaylightChanges[objYear];
         }

-        // The per-year information is cached in in this instance value. As a result it can
+        // The per-year information is cached in this instance value. As a result it can
         // be cleaned up by CultureInfo.ClearCachedData, which will clear the instance of this object
         private readonly Hashtable m_CachedDaylightChanges = new Hashtable();


Fix Thread.ExecutionContext breaking change (#22882)

Its getter is a public API and can't be made internal.

--- src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
+++ src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
@@ -254,10 +254,10 @@
             }
         }

-        internal ExecutionContext ExecutionContext
+        public ExecutionContext ExecutionContext
         {
             get { return m_ExecutionContext; }
-            set { m_ExecutionContext = value; }
+            internal set { m_ExecutionContext = value; }
         }

         internal SynchronizationContext SynchronizationContext


Minor code cleanup

Minor code cleanup

--- src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs
+++ src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs
@@ -282,10 +282,11 @@
 				var ignoreFileBytes = await ioManager.ReadAllBytes(StaticIgnorePath(), cancellationToken).ConfigureAwait(false);
 				var ignoreFileText = Encoding.UTF8.GetString(ignoreFileBytes);

+				var results = new List<string> { StaticIgnoreFile };
+
 				//we don't want to lose trailing whitespace on linux
-
-				var results = new List<string> { StaticIgnoreFile };
-				using (var reader = new StringReader(ignoreFileText)) {
+				using (var reader = new StringReader(ignoreFileText))
+				{
 					cancellationToken.ThrowIfCancellationRequested();
 					var line = await reader.ReadLineAsync().ConfigureAwait(false);
 					if (!String.IsNullOrEmpty(line))
@@ -306,7 +307,7 @@
 					task = ioManager.GetDirectories(GameStaticFilesSubdirectory, cancellationToken);
 				var entries = await task.ConfigureAwait(false);

-				await Task.WhenAll(task.Result.Select(async x =>
+				await Task.WhenAll(entries.Select(async x =>
 				{
 					var fileName = ioManager.GetFileName(x);


Use Area instead of ConservativeArea

Use Area instead of ConservativeArea

--- osu.Framework/Graphics/OpenGL/Textures/TextureGLSingle.cs
+++ osu.Framework/Graphics/OpenGL/Textures/TextureGLSingle.cs
@@ -224,7 +224,7 @@
                 Colour = drawColour.BottomRight.Linear,
             });

-            FrameStatistics.Add(StatisticsCounterType.Pixels, (long)vertexTriangle.ConservativeArea);
+            FrameStatistics.Add(StatisticsCounterType.Pixels, (long)vertexTriangle.Area);
         }

         public const int VERTICES_PER_QUAD = 4;


PublishedContent - get published properties to report the CLR type of the value

--- src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
+++ src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
@@ -82,6 +82,8 @@
         private PropertyCacheLevel _objectCacheLevel;
         private PropertyCacheLevel _xpathCacheLevel;

+        private Type _clrType = typeof (object);
+
         private void InitializeConverters()
         {
             var converters = PropertyValueConvertersResolver.Current.Converters.ToArray();
@@ -107,6 +109,13 @@
             _objectCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.XPath);
             if (_objectCacheLevel < _sourceCacheLevel) _objectCacheLevel = _sourceCacheLevel;
             if (_xpathCacheLevel < _sourceCacheLevel) _xpathCacheLevel = _sourceCacheLevel;
+
+            if (_converter != null)
+            {
+                var attr = _converter.GetType().GetCustomAttribute<PropertyValueTypeAttribute>(false);
+                if (attr != null)
+                    _clrType = attr.Type;
+            }
         }

         static PropertyCacheLevel GetCacheLevel(IPropertyValueConverter converter, PropertyCacheValue value)
@@ -202,6 +211,9 @@
             return source;
         }

+        // gets the property CLR type
+        public Type ClrType { get { return _clrType; } }
+
         #endregion

         #region Compat


Fix namespace

Fix namespace

--- osu.Game.Rulesets.Taiko.Tests/Judgements/JudgementTest.cs
+++ osu.Game.Rulesets.Taiko.Tests/Judgements/JudgementTest.cs
@@ -17,7 +17,7 @@
 using osu.Game.Screens.Play;
 using osu.Game.Tests.Visual;

-namespace osu.Game.Rulesets.Taiko.Tests
+namespace osu.Game.Rulesets.Taiko.Tests.Judgements
 {
     public class JudgementTest : RateAdjustedBeatmapTestScene
     {


Tidy up test case

Tidy up test case

--- osu.Game.Tests/Visual/TestCaseUserProfileRecentSection.cs
+++ osu.Game.Tests/Visual/TestCaseUserProfileRecentSection.cs
@@ -28,26 +28,25 @@

         public TestCaseUserProfileRecentSection()
         {
-            var flow = new FillFlowContainer<DrawableRecentActivity>
+            Children = new Drawable[]
             {
-                RelativeSizeAxes = Axes.X,
-                AutoSizeAxes = Axes.Y,
-                Direction = FillDirection.Vertical,
+                new Box
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Colour = OsuColour.Gray(0.2f)
+                },
+                new ScrollContainer
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Child = new FillFlowContainer<DrawableRecentActivity>
+                    {
+                        RelativeSizeAxes = Axes.X,
+                        AutoSizeAxes = Axes.Y,
+                        Direction = FillDirection.Vertical,
+                        ChildrenEnumerable = createDummyActivities().Select(a => new DrawableRecentActivity(a))
+                    },
+                }
             };
-
-            flow.AddRange(createDummyActivities().Select(a => new DrawableRecentActivity(a)));
-
-            Add(new Box
-            {
-                RelativeSizeAxes = Axes.Both,
-                Colour = OsuColour.Gray(0.2f)
-            });
-
-            Add(new ScrollContainer
-            {
-                RelativeSizeAxes = Axes.Both,
-                Child = flow,
-            });
         }

         private IEnumerable<RecentActivity> createDummyActivities()


Utilizing struct defaults

Utilizing struct defaults

--- src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
@@ -415,9 +415,6 @@
     [Location("cache/repoinfo.yaml", LocationAttribute.Location.LibraryFolder)]
     sealed class RepositoryInfoCache : ManagedCacheBase<RepositoryInfoCache>, IRepositoryInfoCache
     {
-        public static readonly GitRemote DefaultGitRemote = new GitRemote();
-        public static readonly GitBranch DefaultGitBranch = new GitBranch();
-
         [SerializeField] private string lastUpdatedAtString = DateTimeOffset.MinValue.ToString();
         [SerializeField] private string lastVerifiedAtString = DateTimeOffset.MinValue.ToString();
         [SerializeField] private GitRemote gitRemote;
@@ -428,7 +425,7 @@
             get
             {
                 ValidateData();
-                return gitRemote.Equals(DefaultGitRemote) ? (GitRemote?)null : gitRemote;
+                return gitRemote.Equals(GitRemote.Default) ? (GitRemote?)null : gitRemote;
             }
             set
             {
@@ -439,7 +436,7 @@

                 if (!Nullable.Equals(gitRemote, value))
                 {
-                    gitRemote = value ?? DefaultGitRemote;
+                    gitRemote = value ?? GitRemote.Default;
                     isUpdated = true;
                 }

@@ -452,7 +449,7 @@
             get
             {
                 ValidateData();
-                return gitBranch.Equals(DefaultGitBranch) ? (GitBranch?)null : gitBranch;
+                return gitBranch.Equals(GitBranch.Default) ? (GitBranch?)null : gitBranch;
             }
             set
             {
@@ -463,7 +460,7 @@

                 if (!Nullable.Equals(gitBranch, value))
                 {
-                    gitBranch = value ?? DefaultGitBranch;
+                    gitBranch = value ?? GitBranch.Default;
                     isUpdated = true;
                 }


Move code.

Move code.

--- src/VisualStudio/CSharp/Impl/Options/Formatting/StyleViewModel.cs
+++ src/VisualStudio/CSharp/Impl/Options/Formatting/StyleViewModel.cs
@@ -671,6 +671,43 @@
                 new CodeStylePreference(CSharpVSResources.Prefer_explicit_type, isChecked: false),
             };

+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyFieldAccess, CSharpVSResources.Qualify_field_access_with_this, s_fieldDeclarationPreviewTrue, s_fieldDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyPropertyAccess, CSharpVSResources.Qualify_property_access_with_this, s_propertyDeclarationPreviewTrue, s_propertyDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyMethodAccess, CSharpVSResources.Qualify_method_access_with_this, s_methodDeclarationPreviewTrue, s_methodDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyEventAccess, CSharpVSResources.Qualify_event_access_with_this, s_eventDeclarationPreviewTrue, s_eventDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
+
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, ServicesVSResources.For_locals_parameters_and_members, s_intrinsicPreviewDeclarationTrue, s_intrinsicPreviewDeclarationFalse, this, optionSet, predefinedTypesGroupTitle, predefinedTypesPreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, ServicesVSResources.For_member_access_expressions, s_intrinsicPreviewMemberAccessTrue, s_intrinsicPreviewMemberAccessFalse, this, optionSet, predefinedTypesGroupTitle, predefinedTypesPreferences));
+
+            // Use var
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeForIntrinsicTypes, CSharpVSResources.For_built_in_types, s_varForIntrinsicsPreviewTrue, s_varForIntrinsicsPreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeWhereApparent, CSharpVSResources.When_variable_type_is_apparent, s_varWhereApparentPreviewTrue, s_varWhereApparentPreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeWherePossible, CSharpVSResources.Elsewhere, s_varWherePossiblePreviewTrue, s_varWherePossiblePreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
+
+            // Code block
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferBraces, ServicesVSResources.Prefer_braces, s_preferBraces, s_preferBraces, this, optionSet, codeBlockPreferencesGroupTitle));
+
+            // Expression preferences
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferObjectInitializer, ServicesVSResources.Prefer_object_initializer, s_preferObjectInitializer, s_preferObjectInitializer, this, optionSet, expressionPreferencesGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferCollectionInitializer, ServicesVSResources.Prefer_collection_initializer, s_preferCollectionInitializer, s_preferCollectionInitializer, this, optionSet, expressionPreferencesGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferPatternMatchingOverIsWithCastCheck, CSharpVSResources.Prefer_pattern_matching_over_is_with_cast_check, s_preferPatternMatchingOverIsWithCastCheck, s_preferPatternMatchingOverIsWithCastCheck, this, optionSet, expressionPreferencesGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferPatternMatchingOverAsWithNullCheck, CSharpVSResources.Prefer_pattern_matching_over_as_with_null_check, s_preferPatternMatchingOverAsWithNullCheck, s_preferPatternMatchingOverAsWithNullCheck, this, optionSet, expressionPreferencesGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferExplicitTupleNames, ServicesVSResources.Prefer_explicit_tuple_name, s_preferExplicitTupleName, s_preferExplicitTupleName, this, optionSet, expressionPreferencesGroupTitle));
+
+            AddExpressionBodyOptions(optionSet, expressionPreferencesGroupTitle);
+
+            // Variable preferences
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferInlinedVariableDeclaration, ServicesVSResources.Prefer_inlined_variable_declaration, s_preferInlinedVariableDeclaration, s_preferInlinedVariableDeclaration, this, optionSet, variablePreferencesGroupTitle));
+
+            // Null preferences.
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferThrowExpression, CSharpVSResources.Prefer_throw_expression, s_preferThrowExpression, s_preferThrowExpression, this, optionSet, nullCheckingGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferConditionalDelegateCall, CSharpVSResources.Prefer_conditional_delegate_call, s_preferConditionalDelegateCall, s_preferConditionalDelegateCall, this, optionSet, nullCheckingGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferCoalesceExpression, ServicesVSResources.Prefer_coalesce_expression, s_preferCoalesceExpression, s_preferCoalesceExpression, this, optionSet, nullCheckingGroupTitle));
+            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferNullPropagation, ServicesVSResources.Prefer_null_propagation, s_preferNullPropagation, s_preferNullPropagation, this, optionSet, nullCheckingGroupTitle));
+        }
+
+        private void AddExpressionBodyOptions(OptionSet optionSet, string expressionPreferencesGroupTitle)
+        {
             var expressionBodyPreferences = new List<CodeStylePreference>
             {
                 new CodeStylePreference(CSharpVSResources.Never, isChecked: false),
@@ -678,43 +715,6 @@
                 new CodeStylePreference(CSharpVSResources.When_on_single_line, isChecked: false),
             };

-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyFieldAccess, CSharpVSResources.Qualify_field_access_with_this, s_fieldDeclarationPreviewTrue, s_fieldDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyPropertyAccess, CSharpVSResources.Qualify_property_access_with_this, s_propertyDeclarationPreviewTrue, s_propertyDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyMethodAccess, CSharpVSResources.Qualify_method_access_with_this, s_methodDeclarationPreviewTrue, s_methodDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.QualifyEventAccess, CSharpVSResources.Qualify_event_access_with_this, s_eventDeclarationPreviewTrue, s_eventDeclarationPreviewFalse, this, optionSet, qualifyGroupTitle, qualifyMemberAccessPreferences));
-
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, ServicesVSResources.For_locals_parameters_and_members, s_intrinsicPreviewDeclarationTrue, s_intrinsicPreviewDeclarationFalse, this, optionSet, predefinedTypesGroupTitle, predefinedTypesPreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, ServicesVSResources.For_member_access_expressions, s_intrinsicPreviewMemberAccessTrue, s_intrinsicPreviewMemberAccessFalse, this, optionSet, predefinedTypesGroupTitle, predefinedTypesPreferences));
-
-            // Use var
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeForIntrinsicTypes, CSharpVSResources.For_built_in_types, s_varForIntrinsicsPreviewTrue, s_varForIntrinsicsPreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeWhereApparent, CSharpVSResources.When_variable_type_is_apparent, s_varWhereApparentPreviewTrue, s_varWhereApparentPreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.UseImplicitTypeWherePossible, CSharpVSResources.Elsewhere, s_varWherePossiblePreviewTrue, s_varWherePossiblePreviewFalse, this, optionSet, varGroupTitle, typeStylePreferences));
-
-            // Code block
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferBraces, ServicesVSResources.Prefer_braces, s_preferBraces, s_preferBraces, this, optionSet, codeBlockPreferencesGroupTitle));
-
-            // Expression preferences
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferObjectInitializer, ServicesVSResources.Prefer_object_initializer, s_preferObjectInitializer, s_preferObjectInitializer, this, optionSet, expressionPreferencesGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferCollectionInitializer, ServicesVSResources.Prefer_collection_initializer, s_preferCollectionInitializer, s_preferCollectionInitializer, this, optionSet, expressionPreferencesGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferPatternMatchingOverIsWithCastCheck, CSharpVSResources.Prefer_pattern_matching_over_is_with_cast_check, s_preferPatternMatchingOverIsWithCastCheck, s_preferPatternMatchingOverIsWithCastCheck, this, optionSet, expressionPreferencesGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferPatternMatchingOverAsWithNullCheck, CSharpVSResources.Prefer_pattern_matching_over_as_with_null_check, s_preferPatternMatchingOverAsWithNullCheck, s_preferPatternMatchingOverAsWithNullCheck, this, optionSet, expressionPreferencesGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferExplicitTupleNames, ServicesVSResources.Prefer_explicit_tuple_name, s_preferExplicitTupleName, s_preferExplicitTupleName, this, optionSet, expressionPreferencesGroupTitle));
-
-            AddExpressionBodyOptions(optionSet, expressionPreferencesGroupTitle, expressionBodyPreferences);
-
-            // Variable preferences
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferInlinedVariableDeclaration, ServicesVSResources.Prefer_inlined_variable_declaration, s_preferInlinedVariableDeclaration, s_preferInlinedVariableDeclaration, this, optionSet, variablePreferencesGroupTitle));
-
-            // Null preferences.
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferThrowExpression, CSharpVSResources.Prefer_throw_expression, s_preferThrowExpression, s_preferThrowExpression, this, optionSet, nullCheckingGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.PreferConditionalDelegateCall, CSharpVSResources.Prefer_conditional_delegate_call, s_preferConditionalDelegateCall, s_preferConditionalDelegateCall, this, optionSet, nullCheckingGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferCoalesceExpression, ServicesVSResources.Prefer_coalesce_expression, s_preferCoalesceExpression, s_preferCoalesceExpression, this, optionSet, nullCheckingGroupTitle));
-            CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CodeStyleOptions.PreferNullPropagation, ServicesVSResources.Prefer_null_propagation, s_preferNullPropagation, s_preferNullPropagation, this, optionSet, nullCheckingGroupTitle));
-        }
-
-        private void AddExpressionBodyOptions(OptionSet optionSet, string expressionPreferencesGroupTitle, List<CodeStylePreference> expressionBodyPreferences)
-        {
             CodeStyleItems.Add(new EnumCodeStyleOptionViewModel<ExpressionBodyPreference>(
                 CSharpCodeStyleOptions.PreferExpressionBodiedMethods,
                 ServicesVSResources.Use_expression_body_for_methods,