new tests

new tests

--- test/TokenValidationParamsTests.cs
+++ test/TokenValidationParamsTests.cs
@@ -19,6 +19,7 @@
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using System.Collections.Generic;
 using System.IdentityModel.Tokens;
+using System.Security.Cryptography.X509Certificates;

 namespace System.IdentityModel.Test
 {
@@ -55,55 +56,70 @@

         [TestMethod]
         [TestProperty( "TestCaseID", "5763D198-1A0A-474D-A5D3-A5BBC496EE7B" )]
-        [Description( "ensures that set / gets are working" )]
+        [Description( "ensures that constructor / set / gets are working" )]
         public void SetGet()
         {
-            List<string> validAudiences = new List<string>() { "Audience1" };
-            List<SecurityToken> signingTokens = new List<SecurityToken>(){ KeyingMaterial.AsymmetricX509Token_2048 };
-            List<string> validIssuers =  new List<string>() { "ValidIssuer1" };
+            Int32 clockSkewInSeconds = 600;
+            SecurityKey issuerSigningKey = KeyingMaterial.SymmetricSecurityKey_256;
+            List<SecurityKey> issuerSigningKeys = new List<SecurityKey>() { KeyingMaterial.SymmetricSecurityKey_256 };
+            Int32 maximumTokenSizeInBytes = TokenValidationParameters.DefaultMaximumTokenSizeInBytes * 2;
+            string validAudience = "ValidAudience";
+            List<string> validAudiences = new List<string>() { validAudience };
+            string validIssuer = "ValidIssuer";
+            List<string> validIssuers = new List<string>() { validIssuer };

             TokenValidationParameters tokenValidationParameters = new TokenValidationParameters()
             {
-                AllowedAudience = "AllowedAudience",
-                AudienceUriMode = Selectors.AudienceUriMode.Always,
-                AllowedAudiences = validAudiences,
-                SaveBootstrapContext = true,
-                SigningToken = KeyingMaterial.BinarayToken56BitKey,
-                SigningTokens = signingTokens,
+                ClockSkewInSeconds = clockSkewInSeconds,
+                IssuerSigningKey = issuerSigningKey,
+                IssuerSigningKeys = issuerSigningKeys,
+                MaximumTokenSizeInBytes = maximumTokenSizeInBytes,
+                SaveSigninToken = true,
+                ValidateAudience = false,
                 ValidateIssuer = false,
-                ValidIssuer = "ValidIssuer",
+                ValidAudience = validAudience,
+                ValidAudiences = validAudiences,
+                ValidIssuer = validIssuer,
                 ValidIssuers = validIssuers,
             };

-            Assert.IsFalse( tokenValidationParameters.AllowedAudience != "AllowedAudience" , string.Format( "Expecting: tokenValidationParameters.AllowedAudience == 'AllowedAudience'. Was: '{0}'", tokenValidationParameters.AllowedAudience ) );
+            Assert.IsTrue(tokenValidationParameters.ClockSkewInSeconds == clockSkewInSeconds);
+            Assert.IsTrue(TokenValidationParameters.DefaultMaximumTokenSizeInBytes == 2 * 1024 * 1024);
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.IssuerSigningKey, issuerSigningKey));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.IssuerSigningKeys, issuerSigningKeys));
+            Assert.IsTrue(tokenValidationParameters.MaximumTokenSizeInBytes == maximumTokenSizeInBytes);
+            Assert.IsTrue(tokenValidationParameters.SaveSigninToken);
+            Assert.IsFalse(tokenValidationParameters.ValidateAudience);
+            Assert.IsFalse(tokenValidationParameters.ValidateIssuer);
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidAudience, validAudience));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidAudiences, validAudiences));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidIssuer, validIssuer));

-            Assert.IsFalse( tokenValidationParameters.AudienceUriMode != Selectors.AudienceUriMode.Always , string.Format( "Expecting: tokenValidationParameters.AudienceUriMode == Selectors.AudienceUriMode.Always. Was: '{0}'", tokenValidationParameters.AudienceUriMode ) );
+            tokenValidationParameters = new TokenValidationParameters();
+            tokenValidationParameters.ClockSkewInSeconds = clockSkewInSeconds;
+            tokenValidationParameters.IssuerSigningKey = issuerSigningKey;
+            tokenValidationParameters.IssuerSigningKeys = issuerSigningKeys;
+            tokenValidationParameters.MaximumTokenSizeInBytes = maximumTokenSizeInBytes;
+            tokenValidationParameters.SaveSigninToken = true;
+            tokenValidationParameters.ValidateAudience = false;
+            tokenValidationParameters.ValidateIssuer = false;
+            tokenValidationParameters.ValidAudience = validAudience;
+            tokenValidationParameters.ValidAudiences = validAudiences;
+            tokenValidationParameters.ValidIssuer = validIssuer;
+            tokenValidationParameters.ValidIssuers = validIssuers;

-            Assert.IsFalse( tokenValidationParameters.AllowedAudiences == null , string.Format( "Expecting: tokenValidationParameters.AllowedAudiences != null.") );
-
-            Assert.IsFalse( !object.ReferenceEquals( tokenValidationParameters.AllowedAudiences, validAudiences ) , "object.ReferenceEquals( tokenValidationParameters.AllowedAudiences,  validAudiences ) is false" );
-
-            Assert.IsFalse( !tokenValidationParameters.SaveBootstrapContext , "tokenValidationParameters.SaveBootstrapContext != true" );
-
-            Assert.IsFalse( tokenValidationParameters.SigningToken == null , string.Format( "Expecting: tokenValidationParameters.SigningToken != null." ) );
-
-            Assert.IsFalse( !object.ReferenceEquals( tokenValidationParameters.SigningToken,  KeyingMaterial.BinarayToken56BitKey ) , "object.ReferenceEquals( tokenValidationParameters.SigningToken,  KeyingMaterial.BinarayToken56BitKey ) is false" );
-
-            Assert.IsFalse( tokenValidationParameters.SigningTokens == null , string.Format( "Expecting: tokenValidationParameters.SigningTokens != null." ) );
-
-            Assert.IsFalse( !object.ReferenceEquals( tokenValidationParameters.SigningTokens, signingTokens ) , "object.ReferenceEquals( tokenValidationParameters.SigningTokens, signingTokens ) is false" );
-
-            Assert.IsFalse( tokenValidationParameters.ValidateIssuer , string.Format( "Expecting: tokenValidationParameters.ValidateIssuer to be false" ) );
-
-            Assert.IsFalse( tokenValidationParameters.ValidIssuer == null , string.Format( "Expecting: tokenValidationParameters.ValidIssuer != null." ) );
-
-            Assert.IsFalse( tokenValidationParameters.ValidIssuer != "ValidIssuer" , string.Format( "Expecting: tokenValidationParameters.ValidIssuer !== ValidIssuer. Was: '{0}'", tokenValidationParameters.ValidIssuer ) );
-
-            Assert.IsFalse( tokenValidationParameters.ValidIssuers == null , string.Format( "Expecting: tokenValidationParameters.ValidIssuers != null." ) );
-
-            Assert.IsFalse( !object.ReferenceEquals( tokenValidationParameters.SigningTokens, signingTokens ) , "object.ReferenceEquals( tokenValidationParameters.SigningTokens, signingTokens ) is false" );
+            Assert.IsTrue(tokenValidationParameters.ClockSkewInSeconds == clockSkewInSeconds);
+            Assert.IsTrue(TokenValidationParameters.DefaultMaximumTokenSizeInBytes == 2 * 1024 * 1024);
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.IssuerSigningKey, issuerSigningKey));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.IssuerSigningKeys, issuerSigningKeys));
+            Assert.IsTrue(tokenValidationParameters.MaximumTokenSizeInBytes == maximumTokenSizeInBytes);
+            Assert.IsTrue(tokenValidationParameters.SaveSigninToken);
+            Assert.IsFalse(tokenValidationParameters.ValidateAudience);
+            Assert.IsFalse(tokenValidationParameters.ValidateIssuer);
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidAudience, validAudience));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidAudiences, validAudiences));
+            Assert.IsTrue(object.ReferenceEquals(tokenValidationParameters.ValidIssuer, validIssuer));
         }
-
     }
 }


役割を明確に。それにともない変数名とメソッド名を変更。

役割を明確に。それにともない変数名とメソッド名を変更。

--- Sdx/Util/String.cs
+++ Sdx/Util/String.cs
@@ -11,7 +11,7 @@
   {
     private const string RandomSeeds = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

-    private static readonly Dictionary<char, char> fullWidthCharacterlist = new Dictionary<char, char>{
+    private static readonly Dictionary<char, char> fullWidthNumberlist = new Dictionary<char, char>{
      {'１','1'},{'２','2'},{'３','3'},{'４','4'},{'５','5'},{'６','6'},{'７','7'},{'８','8'},{'９','9'},{'０','0'},
     };

@@ -80,16 +80,13 @@
     }

     /// <summary>
-    /// 文字列に含まれている全角英数字を半角英数字へ変換する。
-    ///
-    /// 2017-03-02時点では、全角数字にしか対応していません。
-    /// 全角英字に対応する場合は、fullWidthCharacterlistメンバ変数に対応リストを追加してください。
+    /// 文字列に含まれている全角数字を半角数字へ変換する。
     /// </summary>
     /// <param name="value"></param>
     /// <returns></returns>
-    public static string ConvertFullWidthAlphanumericToHalfSizeAlphanumeric (string value)
+    public static string ConvertFullWidthNumbersToHalfWidthNumbers(string value)
     {
-      return new string(value.Select( chr => (fullWidthCharacterlist.ContainsKey(chr) ? fullWidthCharacterlist[chr] : chr )).ToArray());
+      return new string(value.Select( chr => (fullWidthNumberlist.ContainsKey(chr) ? fullWidthNumberlist[chr] : chr )).ToArray());
     }
   }
 }


Ensure not disposed

Ensure not disposed

--- Servant/Servant.cs
+++ Servant/Servant.cs
@@ -98,6 +98,31 @@
             typeEntry.Provider = new TypeProvider(this, factory, declaredType, lifestyle, parameterTypes.Select(GetOrAddTypeEntry).ToList());
         }

+        /// <summary>
+        /// Specifies that an already registered singleton can be served via another of its interfaces or base classes.
+        /// </summary>
+        /// <remarks>
+        /// A singleton many have as many aliases as it has interfaces or base classes.
+        /// <para />
+        /// Aliasing a singleton does not effect disposal behaviour when the container is disposed.
+        /// </remarks>
+        /// <typeparam name="TAlias">The new interface or base class via which the singleton can be served.</typeparam>
+        /// <typeparam name="TDeclared">The type under which the singleton is already registered.</typeparam>
+        /// <exception cref="ServantException"><typeparamref name="TDeclared"/> has not yet been registered with the container.</exception>
+        /// <exception cref="ServantException"><typeparamref name="TAlias"/> has already been registered with the container.</exception>
+        public void AliasSingleton<TAlias, TDeclared>() where TDeclared : TAlias
+        {
+            if (!_entryByType.TryGetValue(typeof(TDeclared), out var declaredEntry) || declaredEntry.Provider == null)
+                throw new ServantException($"Declared type {typeof(TDeclared)} not yet registered.");
+
+            var aliasEntry = GetOrAddTypeEntry(typeof(TAlias));
+
+            if (aliasEntry.Provider != null)
+                throw new ServantException($"Alias type \"{typeof(TAlias)}\" already registered.");
+
+            aliasEntry.Provider = declaredEntry.Provider;
+        }
+
         private static bool DependsUpon(TypeEntry dependant, Type dependent)
         {
             if (dependant.Provider == null)
@@ -197,6 +222,8 @@

         internal void PushDisposableSingleton(IDisposable disposableSingletonInstance)
         {
+            EnsureNotDisposed();
+
             // We push disposable instances onto a stack and dispose them in reverse order
             _disposableSingletons.Push(disposableSingletonInstance);
         }


Improve FAT performance by optimizing lookup of free clusters.

--- src/Fat/FatBuffer.cs
+++ src/Fat/FatBuffer.cs
@@ -53,6 +53,7 @@

         private FatType _type;
         private byte[] _buffer;
+        private uint _nextFreeCandidate;

         public FatBuffer(FatType type, byte[] buffer)
         {
@@ -127,6 +128,10 @@

         internal void SetFree(uint cluster)
         {
+            if (cluster < _nextFreeCandidate)
+            {
+                _nextFreeCandidate = cluster;
+            }
             SetNext(cluster, FreeCluster);
         }

@@ -186,9 +191,11 @@
             uint numEntries = (uint)NumEntries;
             for (uint i = 0; i < numEntries; i++)
             {
-                if (IsFree(GetNext(i)))
-                {
-                    cluster = i;
+                uint candidate = (i + _nextFreeCandidate) % numEntries;
+                if (IsFree(GetNext(candidate)))
+                {
+                    cluster = candidate;
+                    _nextFreeCandidate = candidate + 1;
                     return true;
                 }
             }


Optimize OpenPlaylist

Optimize OpenPlaylist

--- Sounds/MainForm.cs
+++ Sounds/MainForm.cs
@@ -794,7 +794,7 @@
             var splitText = Regex.Split(text, @"\r?\n");
             foreach (var f in M3UParser.Parse(splitText, Path.GetDirectoryName(fileName)))
             {
-                AddItem(f);
+                AddItem(f, false);
             }
             Dirty = append; // appending always dirty, opening is not
             UpdatePlaylistTotal();


* Improved settings file parsing to avoid throwing handled exceptions.

--- Source/Settings.cs
+++ Source/Settings.cs
@@ -661,27 +661,48 @@
                     XmlDocument doc = new XmlDocument();
                     doc.Load(fileName);
                     XmlNode data = doc.FirstChild;
-                    try { settings.defaultArguments = data.SelectSingleNode("defaultArguments").InnerText; } catch { }
-                    try { settings.defaultApartmentState = (ApartmentState) Enum.Parse(typeof(ApartmentState), data.SelectSingleNode("defaultApartmentState").InnerText, false); } catch { }
-                    try { settings.reportDetailedErrorInfo = data.SelectSingleNode("reportDetailedErrorInfo").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.UseAlternativeCompiler = data.SelectSingleNode("useAlternativeCompiler").InnerText; } catch { }
-                    try { settings.UsePostProcessor = data.SelectSingleNode("usePostProcessor").InnerText; } catch { }
-                    try { settings.SearchDirs = data.SelectSingleNode("searchDirs").InnerText; } catch { }
-                    try { settings.cleanupShellCommand = data.SelectSingleNode("cleanupShellCommand").InnerText; } catch { }
-                    try { settings.doCleanupAfterNumberOfRuns = uint.Parse(data.SelectSingleNode("doCleanupAfterNumberOfRuns").InnerText); } catch { }
-                    try { settings.hideOptions = (HideOptions) Enum.Parse(typeof(HideOptions), data.SelectSingleNode("hideOptions").InnerText, true); } catch { }
-                    try { settings.autoClass_DecorateAsCS6 = data.SelectSingleNode("autoclass.decorateAsCS6").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.autoClass_DecorateAlways = data.SelectSingleNode("autoclass.decorateAlways").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.hideCompilerWarnings = data.SelectSingleNode("hideCompilerWarnings").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.inMemoryAsm = data.SelectSingleNode("inMemoryAsm").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.concurrencyControl = (ConcurrencyControl) Enum.Parse(typeof(ConcurrencyControl), data.SelectSingleNode("ConcurrencyControl").InnerText, false); } catch { }
-                    try { settings.TargetFramework = data.SelectSingleNode("TragetFramework").InnerText; } catch { }
-                    try { settings.defaultRefAssemblies = data.SelectSingleNode("defaultRefAssemblies").InnerText; } catch { }
-                    try { settings.useSurrogatepHostingProcess = data.SelectSingleNode("useSurrogatepHostingProcess").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.OpenEndDirectiveSyntax = data.SelectSingleNode("openEndDirectiveSyntax").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.Precompiler = data.SelectSingleNode("Precompiler").InnerText; } catch { }
-                    try { settings.CustomHashing = data.SelectSingleNode("CustomHashing").InnerText.ToLower() == "true"; } catch { }
-                    try { settings.ConsoleEncoding = data.SelectSingleNode("ConsoleEncoding").InnerText; } catch { }
+                    var node = data.SelectSingleNode("defaultArguments"); if (node != null) settings.defaultArguments = node.InnerText;
+                    node = data.SelectSingleNode("defaultApartmentState"); if (node != null) settings.defaultApartmentState = (ApartmentState) Enum.Parse(typeof(ApartmentState), node.InnerText, false);
+                    node = data.SelectSingleNode("reportDetailedErrorInfo"); if (node != null) settings.reportDetailedErrorInfo = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("useAlternativeCompiler"); if (node != null) settings.UseAlternativeCompiler = node.InnerText;
+                    node = data.SelectSingleNode("usePostProcessor"); if (node != null) settings.UsePostProcessor = node.InnerText;
+                    node = data.SelectSingleNode("searchDirs"); if (node != null) settings.SearchDirs = node.InnerText;
+                    node = data.SelectSingleNode("cleanupShellCommand"); if (node != null) settings.cleanupShellCommand = node.InnerText;
+                    node = data.SelectSingleNode("doCleanupAfterNumberOfRuns"); if (node != null) settings.doCleanupAfterNumberOfRuns = uint.Parse(node.InnerText);
+                    node = data.SelectSingleNode("hideOptions"); if (node != null) settings.hideOptions = (HideOptions) Enum.Parse(typeof(HideOptions), node.InnerText, true);
+                    node = data.SelectSingleNode("autoclass.decorateAsCS6"); if (node != null) settings.autoClass_DecorateAsCS6 = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("autoclass.decorateAlways"); if (node != null) settings.autoClass_DecorateAlways = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("hideCompilerWarnings"); if (node != null) settings.hideCompilerWarnings = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("inMemoryAsm"); if (node != null) settings.inMemoryAsm = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("ConcurrencyControl"); if (node != null) settings.concurrencyControl = (ConcurrencyControl) Enum.Parse(typeof(ConcurrencyControl), node.InnerText, false);
+                    node = data.SelectSingleNode("TragetFramework"); if (node != null) settings.TargetFramework = node.InnerText;
+                    node = data.SelectSingleNode("defaultRefAssemblies"); if (node != null) settings.defaultRefAssemblies = node.InnerText;
+                    node = data.SelectSingleNode("useSurrogatepHostingProcess"); if (node != null) settings.useSurrogatepHostingProcess = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("openEndDirectiveSyntax"); if (node != null) settings.OpenEndDirectiveSyntax = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("Precompiler"); if (node != null) settings.Precompiler = node.InnerText;
+                    node = data.SelectSingleNode("CustomHashing"); if (node != null) settings.CustomHashing = node.InnerText.ToLower() == "true";
+                    node = data.SelectSingleNode("ConsoleEncoding"); if (node != null) settings.ConsoleEncoding = node.InnerText;
+                    //try { settings.defaultArguments = data.SelectSingleNode("defaultArguments").InnerText; } catch { }
+                    //try { settings.defaultApartmentState = (ApartmentState) Enum.Parse(typeof(ApartmentState), data.SelectSingleNode("defaultApartmentState").InnerText, false); } catch { }
+                    //try { settings.reportDetailedErrorInfo = data.SelectSingleNode("reportDetailedErrorInfo").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.UseAlternativeCompiler = data.SelectSingleNode("useAlternativeCompiler").InnerText; } catch { }
+                    //try { settings.UsePostProcessor = data.SelectSingleNode("usePostProcessor").InnerText; } catch { }
+                    //try { settings.SearchDirs = data.SelectSingleNode("searchDirs").InnerText; } catch { }
+                    //try { settings.cleanupShellCommand = data.SelectSingleNode("cleanupShellCommand").InnerText; } catch { }
+                    //try { settings.doCleanupAfterNumberOfRuns = uint.Parse(data.SelectSingleNode("doCleanupAfterNumberOfRuns").InnerText); } catch { }
+                    //try { settings.hideOptions = (HideOptions) Enum.Parse(typeof(HideOptions), data.SelectSingleNode("hideOptions").InnerText, true); } catch { }
+                    //try { settings.autoClass_DecorateAsCS6 = data.SelectSingleNode("autoclass.decorateAsCS6").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.autoClass_DecorateAlways = data.SelectSingleNode("autoclass.decorateAlways").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.hideCompilerWarnings = data.SelectSingleNode("hideCompilerWarnings").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.inMemoryAsm = data.SelectSingleNode("inMemoryAsm").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.concurrencyControl = (ConcurrencyControl) Enum.Parse(typeof(ConcurrencyControl), data.SelectSingleNode("ConcurrencyControl").InnerText, false); } catch { }
+                    //try { settings.TargetFramework = data.SelectSingleNode("TragetFramework").InnerText; } catch { }
+                    //try { settings.defaultRefAssemblies = data.SelectSingleNode("defaultRefAssemblies").InnerText; } catch { }
+                    //try { settings.useSurrogatepHostingProcess = data.SelectSingleNode("useSurrogatepHostingProcess").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.OpenEndDirectiveSyntax = data.SelectSingleNode("openEndDirectiveSyntax").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.Precompiler = data.SelectSingleNode("Precompiler").InnerText; } catch { }
+                    //try { settings.CustomHashing = data.SelectSingleNode("CustomHashing").InnerText.ToLower() == "true"; } catch { }
+                    //try { settings.ConsoleEncoding = data.SelectSingleNode("ConsoleEncoding").InnerText; } catch { }
                 }
                 catch
                 {


- Added CLI command `-config:set:roslyn`

--- Source/csscript.cs
+++ Source/csscript.cs
@@ -2204,13 +2204,33 @@
                 }
                 else if (command.StartsWith("set:"))
                 {
-                    //set:DefaultArguments=-ac
-                    string[] tokens = command.Substring(4).Split(new char[] { '=', ':' }, 2);
-                    if (tokens.Length != 2)
-                        throw new CLIException("Invalid set config property expression. Must be in name 'set:<name>=<value>' format.");
-
-                    string name = tokens[0];
-                    string value = tokens[1].Trim().Trim('"');
+                    // set:DefaultArguments=-ac
+                    // set:roslyn
+                    string name, value;
+
+                    if (string.Compare(command, "set:roslyn", ignoreCase: true) == 0)
+                    {
+                        var asmDir = Assembly.GetExecutingAssembly().GetAssemblyDirectoryName();
+
+                        var providerFile = ExistingFile(asmDir, "CSSRoslynProvider.dll") ??
+                                           ExistingFile(asmDir, "Lib", "CSSRoslynProvider.dll");
+                        if (providerFile != null)
+                        {
+                            name = "UseAlternativeCompiler";
+                            value = providerFile;
+                        }
+                        else
+                            throw new CLIException("Cannot locate Roslyn provider CSSRoslynProvider.dll");
+                    }
+                    else
+                    {
+                        string[] tokens = command.Substring(4).Split(new char[] { '=', ':' }, 2);
+                        if (tokens.Length != 2)
+                            throw new CLIException("Invalid set config property expression. Must be in name 'set:<name>=<value>' format.");
+
+                        name = tokens[0];
+                        value = tokens[1].Trim().Trim('"');
+                    }

                     var currentConfig = Settings.Load(true) ?? new Settings();
                     currentConfig.Set(name, value);


Fixed a bug checking for appended ACKs

Fixed a bug checking for appended ACKs

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@66 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife-cs/NetworkManager.cs
+++ libsecondlife-cs/NetworkManager.cs
@@ -344,7 +344,7 @@
 				// Retrieve the incoming packet
 				int numBytes = Connection.EndReceiveFrom(result, ref endPoint);

-				if ((Buffer[Buffer.Length - 1] & Helpers.MSG_APPENDED_ACKS) != 0)
+				if ((Buffer[0] & Helpers.MSG_APPENDED_ACKS) != 0)
 				{
 					// Grab the ACKs that are appended to this packet
 					byte numAcks = Buffer[Buffer.Length - 1];


宽度减少一半，高度也减少了？

宽度减少一半，高度也减少了？

--- TTF2Bmps/Font3D.cs
+++ TTF2Bmps/Font3D.cs
@@ -70,9 +70,9 @@
             {
                 //  Create the bitmap.
                 System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(
-                    width,
+                    width / 2,
                     bmpGlyph.obj.bitmap.rows,
-                    width * 4,
+                    width * 4 / 2,
                     System.Drawing.Imaging.PixelFormat.Format32bppRgb,
                     expanded.Header);
                 string path = Path.Combine(outputDir, string.Format("{0}.bmp", c));


Fix unit test

Fix unit test

--- tests/NLog.UnitTests/Targets/TargetTests.cs
+++ tests/NLog.UnitTests/Targets/TargetTests.cs
@@ -353,7 +353,7 @@
         public void WrongMyTargetShouldThrowException()
         {

-            Assert.Throws<NLogConfigurationException>(() =>
+            Assert.Throws<NLogRuntimeException>(() =>
             {
                 var target = new WrongMyTarget();
                 LogManager.ThrowExceptions = true;


Code cleanup to remove unnecessary method.

--- cocos2d/events/CCEventDispatcher.cs
+++ cocos2d/events/CCEventDispatcher.cs
@@ -821,34 +821,6 @@
 		}

-//		void RemoveAllListenersInVector (List<CCEventListener> listenerVector, string listenerId)
-//		{
-//			if (listenerVector == null)
-//				return;
-//
-//			for (auto iter = listenerVector->begin(); iter != listenerVector->end();)
-//			{
-//				auto l = *iter;
-//				l->setRegistered(false);
-//				if (l->getSceneGraphPriority() != nullptr)
-//				{
-//					dissociateNodeAndEventListener(l->getSceneGraphPriority(), l);
-//				}
-//
-//				if (_inDispatch == 0)
-//				{
-//					iter = listenerVector->erase(iter);
-//					CC_SAFE_RELEASE(l);
-//				}
-//				else
-//				{
-//					++iter;
-//				}
-//			}
-//
-//		}
-
-
         /// <summary>
         /// Removes all listeners with the same event listener ID
         /// </summary>


Fix CCLabel System Font layout differences between different devices and versions.

+ It seems Android's StaticLayout calculations have changed between version so GetLineMax returned different results.  We now take the Math.Ceiling of this value to be used in the subsequent calculations which fixes the drawing layout between the different versions.

See Issue https://github.com/mono/CocosSharp/issues/218

--- src/label_nodes/CCLabel-Android.cs
+++ src/label_nodes/CCLabel-Android.cs
@@ -123,10 +123,10 @@
             for (int lc = 0; lc < lineCount; lc++)
             {
                 layout.GetLineBounds(lc, lineBounds);
-                var max = layout.GetLineMax(lc);
+                var max = (int)Math.Ceiling(layout.GetLineMax(lc));

                 if (boundingRect.Right < max)
-                    boundingRect.Right = (int)max;
+                    boundingRect.Right = max;

                 boundingRect.Bottom = lineBounds.Bottom;
             }


Fix 'char' handling. Thanks to chris for reporting the bug!

CCMAIL: chris@detrino.org

svn path=/trunk/KDE/kdebindings/csharp/; revision=1045869

--- qyoto/src/SmokeInvocation.cs
+++ qyoto/src/SmokeInvocation.cs
@@ -174,6 +174,8 @@
 						args[i] = stackPtr[i+1].s_char;
 					} else if (parameters[i].ParameterType == typeof(byte)) {
 						args[i] = stackPtr[i+1].s_uchar;
+					} else if (parameters[i].ParameterType == typeof(char)) {
+						args[i] = (char) stackPtr[i+1].s_uchar;
 					} else if (parameters[i].ParameterType == typeof(short)) {
 						args[i] = stackPtr[i+1].s_short;
 					} else if (parameters[i].ParameterType == typeof(ushort)) {
@@ -226,6 +228,8 @@
 					stackPtr[0].s_char = (sbyte) returnValue;
 				} else if (returnType == typeof(byte)) {
 					stackPtr[0].s_uchar = (byte) returnValue;
+				} else if (returnType == typeof(char)) {
+					stackPtr[0].s_uchar = (byte) (char) returnValue;
 				} else if (returnType == typeof(short)) {
 					stackPtr[0].s_short = (short) returnValue;
 				} else if (returnType == typeof(ushort)) {
@@ -285,6 +289,8 @@
 						args[i] = stackPtr[i].s_char;
 					} else if (parameters[i].ParameterType == typeof(byte)) {
 						args[i] = stackPtr[i].s_uchar;
+					} else if (parameters[i].ParameterType == typeof(char)) {
+						args[i] = (char) stackPtr[i].s_uchar;
 					} else if (parameters[i].ParameterType == typeof(short)) {
 						args[i] = stackPtr[i].s_short;
 					} else if (parameters[i].ParameterType == typeof(ushort)) {
@@ -387,6 +393,8 @@
 						args[i] = stackPtr[i].s_char;
 					} else if (parameters[i].ParameterType == typeof(byte)) {
 						args[i] = stackPtr[i].s_uchar;
+					} else if (parameters[i].ParameterType == typeof(char)) {
+						args[i] = (char) stackPtr[i].s_uchar;
 					} else if (parameters[i].ParameterType == typeof(short)) {
 						args[i] = stackPtr[i].s_short;
 					} else if (parameters[i].ParameterType == typeof(ushort)) {
@@ -592,6 +600,8 @@
 					stack[k].s_char = (sbyte) args[i+1];
 				} else if (args[i] == typeof(byte)) {
 					stack[k].s_uchar = (byte) args[i+1];
+				} else if (args[i] == typeof(char)) {
+					stack[k].s_uchar = (byte) (char) args[i+1];
 				} else {
 #if DEBUG
 					stack[k].s_class = (IntPtr) DebugGCHandle.Alloc(args[i+1]);
@@ -719,6 +729,8 @@
 						stack[i + 1].s_char = (sbyte) callMessage.Args[i];
 					} else if (types[i] == typeof(byte)) {
 						stack[i + 1].s_uchar = (byte) callMessage.Args[i];
+					} else if (types[i] == typeof(char)) {
+						stack[i + 1].s_uchar = (byte) (char) callMessage.Args[i];
 					} else if (types[i] == typeof(short)) {
 						stack[i + 1].s_short = (short) callMessage.Args[i];
 					} else if (types[i] == typeof(ushort)) {
@@ -775,6 +787,8 @@
 						returnValue.ReturnValue = stack[0].s_char;
 					} else if (returnType == typeof(byte)) {
 						returnValue.ReturnValue = stack[0].s_uchar;
+					} else if (returnType == typeof(char)) {
+						returnValue.ReturnValue = (char) stack[0].s_uchar;
 					} else if (returnType == typeof(short)) {
 						returnValue.ReturnValue = stack[0].s_short;
 					} else if (returnType == typeof(ushort)) {


fixed typo

fixed typo

--- Tomes/TomeArray.cs
+++ Tomes/TomeArray.cs
@@ -225,7 +225,7 @@

 	//
 	public void Push(JToken item) {
-		this.Set(this.Count, Tome.Conjure(item, root));
+		this.Set(this.Count, item);
 	}

 	//


RF+AF

RF+AF

--- UI/UIWindowBase.cs
+++ UI/UIWindowBase.cs
@@ -1,4 +1,4 @@
-//   UIWindowBase.cs
+//   UIWindowBase.cs
 //
 //  Author:
 //       Allis Tauri <allista@gmail.com>
@@ -56,8 +56,8 @@
             window.onPointerExitEvent.AddListener(onPointerExit);
         }

-        protected virtual void onGamePause() {}
-        protected virtual void onGameUnpause() {}
+        protected virtual void onGamePause() { }
+        protected virtual void onGameUnpause() { }
         protected virtual void onGameSaved(ConfigNode node) => saveState();

         protected virtual void onPointerEnter(PointerEventData eventData)
@@ -72,7 +72,7 @@

         private bool in_progress;

-        public IEnumerator Show()
+        private IEnumerator Show()
         {
             if(in_progress || Controller != null || bundle.BundleNotFound || prefabNotFound)
                 yield break;


parameterのAssertを追加

parameterのAssertを追加

--- UnitTest/DbTest.cs
+++ UnitTest/DbTest.cs
@@ -844,6 +844,9 @@
        db.Command.CommandText
       );

+      Assert.Equal(1, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);
+
       select.Where.Add("name", "foo", "shop");

       db.Command = select.Build();
@@ -851,6 +854,10 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} WHERE {0}id{1} = @id@0 AND {0}shop{1}.{0}name{1} = @name@1"),
        db.Command.CommandText
       );
+
+      Assert.Equal(2, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);
+      Assert.Equal("foo", db.Command.Parameters[1].Value);

       //tableに対する呼び出し
       select = db.Factory.CreateSelect();
@@ -863,6 +870,9 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} WHERE {0}shop{1}.{0}id{1} = @id@0"),
        db.Command.CommandText
       );
+
+      Assert.Equal(1, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);

       //WhereのAdd
       select = db.Factory.CreateSelect();
@@ -879,6 +889,10 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} WHERE ({0}id{1} = @id@0 OR {0}id{1} = @id@1)"),
        db.Command.CommandText
       );
+
+      Assert.Equal(2, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);
+      Assert.Equal("2", db.Command.Parameters[1].Value);

       //Where2つをORでつなぐ
       select = db.Factory.CreateSelect();
@@ -900,6 +914,12 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} WHERE ({0}id{1} = @id@0 AND {0}id{1} = @id@1) OR ({0}id{1} = @id@2 OR {0}id{1} = @id@3)"),
        db.Command.CommandText
       );
+
+      Assert.Equal(4, db.Command.Parameters.Count);
+      Assert.Equal("3", db.Command.Parameters[0].Value);
+      Assert.Equal("4", db.Command.Parameters[1].Value);
+      Assert.Equal("1", db.Command.Parameters[2].Value);
+      Assert.Equal("2", db.Command.Parameters[3].Value);
     }

     [Fact]
@@ -929,6 +949,8 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} INNER JOIN (SELECT id FROM category WHERE id = 1) AS {0}sub_cat{1} ON {0}shop{1}.category_id = {0}sub_cat{1}.id"),
        db.Command.CommandText
       );
+
+      Assert.Equal(0, db.Command.Parameters.Count);
     }

     [Fact]
@@ -953,7 +975,7 @@
       sub
         .From("category")
         .AddColumn("id")
-        .Where.Add("id", "1");
+        .Where.Add("id", "2");

       select.Table("shop").InnerJoin(sub, "{0}.category_id = {1}.id", "sub_cat");

@@ -962,6 +984,10 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} INNER JOIN (SELECT {0}category{1}.{0}id{1} FROM {0}category{1} WHERE {0}category{1}.{0}id{1} = @id@0) AS {0}sub_cat{1} ON {0}shop{1}.category_id = {0}sub_cat{1}.id WHERE {0}shop{1}.{0}id{1} = @id@1"),
        db.Command.CommandText
       );
+
+      Assert.Equal(2, db.Command.Parameters.Count);
+      Assert.Equal("2", db.Command.Parameters[0].Value);//サブクエリのWhereの方が先にAddされる
+      Assert.Equal("1", db.Command.Parameters[1].Value);
     }

     [Fact]
@@ -986,7 +1012,7 @@
       sub
         .From("category")
         .AddColumn("id")
-        .Where.Add("id", "1");
+        .Where.Add("id", "2");

       select.Table("shop").Where.Add("category_id", sub, comparison:Sdx.Db.Query.Comparison.In);

@@ -995,6 +1021,10 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1} WHERE {0}shop{1}.{0}id{1} = @id@0 AND {0}shop{1}.{0}category_id{1} IN (SELECT {0}category{1}.{0}id{1} FROM {0}category{1} WHERE {0}category{1}.{0}id{1} = @id@1)"),
        db.Command.CommandText
       );
+
+      Assert.Equal(2, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);
+      Assert.Equal("2", db.Command.Parameters[1].Value);
     }

     [Fact]
@@ -1025,6 +1055,9 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1}, (SELECT id FROM category WHERE id = 1) AS {0}sub_cat{1} WHERE {0}shop{1}.{0}id{1} = @id@0"),
        db.Command.CommandText
       );
+
+      Assert.Equal(1, db.Command.Parameters.Count);
+      Assert.Equal("1", db.Command.Parameters[0].Value);
     }

     [Fact]
@@ -1049,7 +1082,7 @@
       sub
         .From("category")
         .AddColumn("id")
-        .Where.Add("id", "1");
+        .Where.Add("id", "2");

       select.From(sub, "sub_cat");

@@ -1058,6 +1091,10 @@
        db.Sql("SELECT {0}shop{1}.* FROM {0}shop{1}, (SELECT {0}category{1}.{0}id{1} FROM {0}category{1} WHERE {0}category{1}.{0}id{1} = @id@0) AS {0}sub_cat{1} WHERE {0}shop{1}.{0}id{1} = @id@1"),
        db.Command.CommandText
       );
+
+      Assert.Equal(2, db.Command.Parameters.Count);
+      Assert.Equal("2", db.Command.Parameters[0].Value);//サブクエリーのWhereの方が先にAddされる
+      Assert.Equal("1", db.Command.Parameters[1].Value);
     }

     [Fact]
@@ -1086,6 +1123,7 @@
        db.Command.CommandText
       );

+      Assert.Equal(4, db.Command.Parameters.Count);
       Assert.Equal("1", db.Command.Parameters[0].Value);
       Assert.Equal("2", db.Command.Parameters[1].Value);
       Assert.Equal("3", db.Command.Parameters[2].Value);


Provide color schemes for both Pro and Normal skins where needed.

--- UnityREPLHelper.cs
+++ UnityREPLHelper.cs
@@ -286,7 +286,7 @@
       if(_OutputStyle == null) {
         _OutputStyle = new GUIStyle(Default)
           .Named("OutputStyle")
-          .BaseTextColor(new Color(0f, 0.5f, 0f, 1f));
+          .BaseTextColor(new Color(0f, 0.5f, 0f, 1f), new Color(0f, 0.75f, 0f, 1f));
       }
       return _OutputStyle;
     }
@@ -298,7 +298,7 @@
       if(_EvaluationErrorStyle == null) {
         _EvaluationErrorStyle = new GUIStyle(Default)
           .Named("EvaluationErrorStyle")
-          .BaseTextColor(new Color(0.5f, 0f, 0f, 1f));
+          .BaseTextColor(new Color(0.5f, 0f, 0f, 1f), new Color(0.75f, 0.25f, 0.25f, 1f));
       }
       return _EvaluationErrorStyle;
     }
@@ -310,7 +310,7 @@
       if(_SystemConsoleStyle == null) {
         _SystemConsoleStyle = new GUIStyle(Default)
           .Named("SystemConsoleStyle")
-          .BaseTextColor(new Color(0.5f, 0.5f, 0f, 1f));
+          .BaseTextColor(new Color(0.5f, 0.5f, 0f, 1f), new Color(0.75f, 0.75f, 0f, 1f));
       }
       return _SystemConsoleStyle;
     }
@@ -344,7 +344,7 @@
       if(_ConsoleLogWarningStyle == null) {
         _ConsoleLogWarningStyle = new GUIStyle(ConsoleLogStyle)
           .Named("ConsoleLogWarningStyle")
-          .BaseTextColor(new Color(0.5f, 0.5f, 0f, 1f));
+          .BaseTextColor(new Color(0.5f, 0.5f, 0f, 1f), new Color(0.75f, 0.75f, 0f, 1f));
       }
       return _ConsoleLogWarningStyle;
     }
@@ -356,7 +356,7 @@
       if(_ConsoleLogErrorStyle == null) {
         _ConsoleLogErrorStyle = new GUIStyle(ConsoleLogStyle)
           .Named("ConsoleLogErrorStyle")
-          .BaseTextColor(new Color(0.5f, 0f, 0f, 1f));
+          .BaseTextColor(new Color(0.5f, 0f, 0f, 1f), new Color(0.75f, 0.25f, 0.25f, 1f));
       }
       return _ConsoleLogErrorStyle;
     }
@@ -368,7 +368,7 @@
       if(_ConsoleLogStackTraceStyle == null) {
         _ConsoleLogStackTraceStyle = new GUIStyle(ConsoleLogStyle)
           .Named("ConsoleLogStackTraceStyle")
-          .BaseTextColor(new Color(0.25f, 0.25f, 0.25f, 1f));
+          .BaseTextColor(new Color(0.25f, 0.25f, 0.25f, 1f), new Color(0.5f, 0.5f, 0.5f, 1f));
       }
       return _ConsoleLogStackTraceStyle;
     }


VariantGroup を処理対象に追加

VariantGroup を処理対象に追加

--- XCProject.cs
+++ XCProject.cs
@@ -31,6 +31,7 @@
 		// Objects
 		private PBXDictionary<PBXBuildFile> _buildFiles;
 		private PBXDictionary<PBXGroup> _groups;
+		private PBXDictionary<PBXVariantGroup> _variantGroups;
 		private PBXDictionary<PBXFileReference> _fileReferences;
 		private PBXDictionary<PBXNativeTarget> _nativeTargets;

@@ -146,6 +147,15 @@
 			}
 		}

+		public PBXDictionary<PBXVariantGroup> variantGroups {
+			get {
+				if( _variantGroups == null ) {
+					_variantGroups = new PBXDictionary<PBXVariantGroup>( _objects );
+				}
+				return _variantGroups;
+			}
+		}
+
 		public PBXDictionary<PBXFileReference> fileReferences {
 			get {
 				if( _fileReferences == null ) {
@@ -1005,6 +1015,7 @@
 			PBXDictionary consolidated = new PBXDictionary();
 			consolidated.Append<PBXBuildFile>( this.buildFiles );
 			consolidated.Append<PBXGroup>( this.groups );
+			consolidated.Append<PBXVariantGroup>( this.variantGroups );
 			consolidated.Append<PBXFileReference>( this.fileReferences );
 //			consolidated.Append<PBXProject>( this.project );
 			consolidated.Append<PBXNativeTarget>( this.nativeTargets );


fix omitted closing brace

fix omitted closing brace

--- XCProject.cs
+++ XCProject.cs
@@ -553,8 +553,9 @@
 					Debug.LogWarning ("not prepending a path to " + headerpath);
 					this.AddHeaderSearchPaths( headerpath );
 				} else {
-				string absoluteHeaderPath = System.IO.Path.Combine( mod.path, headerpath );
-				this.AddHeaderSearchPaths( absoluteHeaderPath );
+					string absoluteHeaderPath = System.IO.Path.Combine( mod.path, headerpath );
+					this.AddHeaderSearchPaths( absoluteHeaderPath );
+				}
 			}

 			Debug.Log( "Adding linker flags..." );


Bumped version to 0.1.5..2

Bumped version to 0.1.5..2

--- src/managed/shared/AssemblyInfo.cs
+++ src/managed/shared/AssemblyInfo.cs
@@ -29,5 +29,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.1.5.1")]
-[assembly: AssemblyFileVersion("0.1.5.1")]
+[assembly: AssemblyVersion("0.1.5.2")]
+[assembly: AssemblyFileVersion("0.1.5.2")]


Fix all the cases in NSDistributedNotificationCenter that allowed nulls, and change the broken 'string anObject' to 'NSObject anObject'

--- src/foundation.cs
+++ src/foundation.cs
@@ -4095,22 +4095,22 @@
 		void AddObserver (NSObject observer, Selector selector, [NullAllowed] string notificationName, [NullAllowed] string notificationSenderc, NSNotificationSuspensionBehavior suspensionBehavior);

 		[Export ("postNotificationName:object:userInfo:deliverImmediately:")]
-		void PostNotificationName (string name, string anObject, [NullAllowed] NSDictionary userInfo, bool deliverImmediately);
+		void PostNotificationName (string name, [NullAllowed] string anObject, [NullAllowed] NSDictionary userInfo, bool deliverImmediately);

 		[Export ("postNotificationName:object:userInfo:options:")]
-		void PostNotificationName (string name, string anObject, [NullAllowed] NSDictionary userInfo, NSNotificationFlags options);
+		void PostNotificationName (string name, [NullAllowed] string anObjecb, [NullAllowed] NSDictionary userInfo, NSNotificationFlags options);

 		[Export ("addObserver:selector:name:object:")]
-		void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] string aName, [NullAllowed] string anObject);
+		void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] string aName, [NullAllowed] NSObject anObject);

 		[Export ("postNotificationName:object:")]
-		void PostNotificationName (string aName, string anObject);
+		void PostNotificationName (string aName, [NullAllowed] string anObject);

 		[Export ("postNotificationName:object:userInfo:")]
-		void PostNotificationName (string aName, string anObject, [NullAllowed] NSDictionary aUserInfo);
+		void PostNotificationName (string aName, [NullAllowed] string anObject, [NullAllowed] NSDictionary aUserInfo);

 		[Export ("removeObserver:name:object:")]
-		void RemoveObserver (NSObject observer, string aName, string anObject);
+		void RemoveObserver (NSObject observer, [NullAllowed] string aName, [NullAllowed] NSObject anObject);

 		//Detected properties
 		[Export ("suspended")]


Fix bug #688016

Fix bug #688016

--- src/foundation.cs
+++ src/foundation.cs
@@ -1298,7 +1298,7 @@
 		string [] ISOCurrencyCodes { get; }

 		[Export ("ISOCountryCodes")][Static]
-		string ISOCountryCodes { get; }
+		string [] ISOCountryCodes { get; }

 		[Export ("commonISOCurrencyCodes")][Static]
 		string [] CommonISOCurrencyCodes { get; }


Finish moving Guid to shared partition

Finish moving Guid to shared partition

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

--- src/mscorlib/shared/System/Guid.cs
+++ src/mscorlib/shared/System/Guid.cs
@@ -160,24 +160,23 @@
         // This will store the result of the parsing.  And it will eventually be used to construct a Guid instance.
         private struct GuidResult
         {
-            internal Guid parsedGuid;
-            internal GuidParseThrowStyle throwStyle;
-
-            internal ParseFailureKind m_failure;
-            internal string m_failureMessageID;
-            internal object m_failureMessageFormatArgument;
-            internal string m_failureArgumentName;
-            internal Exception m_innerException;
+            internal Guid _parsedGuid;
+            internal GuidParseThrowStyle _throwStyle;
+
+            private ParseFailureKind _failure;
+            private string _failureMessageID;
+            private object _failureMessageFormatArgument;
+            private string _failureArgumentName;
+            private Exception _innerException;

             internal void Init(GuidParseThrowStyle canThrow)
             {
-                parsedGuid = Guid.Empty;
-                throwStyle = canThrow;
+                _throwStyle = canThrow;
             }
             internal void SetFailure(Exception nativeException)
             {
-                m_failure = ParseFailureKind.NativeException;
-                m_innerException = nativeException;
+                _failure = ParseFailureKind.NativeException;
+                _innerException = nativeException;
             }
             internal void SetFailure(ParseFailureKind failure, string failureMessageID)
             {
@@ -191,12 +190,12 @@
                                      string failureArgumentName, Exception innerException)
             {
                 Debug.Assert(failure != ParseFailureKind.NativeException, "ParseFailureKind.NativeException should not be used with this overload");
-                m_failure = failure;
-                m_failureMessageID = failureMessageID;
-                m_failureMessageFormatArgument = failureMessageFormatArgument;
-                m_failureArgumentName = failureArgumentName;
-                m_innerException = innerException;
-                if (throwStyle != GuidParseThrowStyle.None)
+                _failure = failure;
+                _failureMessageID = failureMessageID;
+                _failureMessageFormatArgument = failureMessageFormatArgument;
+                _failureArgumentName = failureArgumentName;
+                _innerException = innerException;
+                if (_throwStyle != GuidParseThrowStyle.None)
                 {
                     throw GetGuidParseException();
                 }
@@ -204,25 +203,25 @@

             internal Exception GetGuidParseException()
             {
-                switch (m_failure)
+                switch (_failure)
                 {
                     case ParseFailureKind.ArgumentNull:
-                        return new ArgumentNullException(m_failureArgumentName, SR.GetResourceString(m_failureMessageID));
+                        return new ArgumentNullException(_failureArgumentName, SR.GetResourceString(_failureMessageID));

                     case ParseFailureKind.FormatWithInnerException:
-                        return new FormatException(SR.GetResourceString(m_failureMessageID), m_innerException);
+                        return new FormatException(SR.GetResourceString(_failureMessageID), _innerException);

                     case ParseFailureKind.FormatWithParameter:
-                        return new FormatException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument));
+                        return new FormatException(SR.Format(SR.GetResourceString(_failureMessageID), _failureMessageFormatArgument));

                     case ParseFailureKind.Format:
-                        return new FormatException(SR.GetResourceString(m_failureMessageID));
+                        return new FormatException(SR.GetResourceString(_failureMessageID));

                     case ParseFailureKind.NativeException:
-                        return m_innerException;
+                        return _innerException;

                     default:
-                        Debug.Assert(false, "Unknown GuidParseFailure: " + m_failure);
+                        Debug.Assert(false, "Unknown GuidParseFailure: " + _failure);
                         return new FormatException(SR.Format_GuidUnrecognized);
                 }
             }
@@ -249,7 +248,7 @@
             result.Init(GuidParseThrowStyle.All);
             if (TryParseGuid(g, GuidStyles.Any, ref result))
             {
-                this = result.parsedGuid;
+                this = result._parsedGuid;
             }
             else
             {
@@ -270,7 +269,7 @@
             result.Init(GuidParseThrowStyle.AllButOverflow);
             if (TryParseGuid(input, GuidStyles.Any, ref result))
             {
-                return result.parsedGuid;
+                return result._parsedGuid;
             }
             else
             {
@@ -284,7 +283,7 @@
             parseResult.Init(GuidParseThrowStyle.None);
             if (TryParseGuid(input, GuidStyles.Any, ref parseResult))
             {
-                result = parseResult.parsedGuid;
+                result = parseResult._parsedGuid;
                 return true;
             }
             else
@@ -339,7 +338,7 @@
             result.Init(GuidParseThrowStyle.AllButOverflow);
             if (TryParseGuid(input, style, ref result))
             {
-                return result.parsedGuid;
+                return result._parsedGuid;
             }
             else
             {
@@ -389,7 +388,7 @@
             parseResult.Init(GuidParseThrowStyle.None);
             if (TryParseGuid(input, style, ref parseResult))
             {
-                result = parseResult.parsedGuid;
+                result = parseResult._parsedGuid;
                 return true;
             }
             else
@@ -546,7 +545,7 @@
             }

-            if (!StringToInt(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result.parsedGuid._a, ref result))
+            if (!StringToInt(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result._parsedGuid._a, ref result))
                 return false;

             // Check for '0x'
@@ -565,7 +564,7 @@
             }

             // Read in the number
-            if (!StringToShort(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result.parsedGuid._b, ref result))
+            if (!StringToShort(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result._parsedGuid._b, ref result))
                 return false;
             // Check for '0x'
             if (!IsHexPrefix(guidString, numStart + numLen + 1))
@@ -583,7 +582,7 @@
             }

             // Read in the number
-            if (!StringToShort(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result.parsedGuid._c, ref result))
+            if (!StringToShort(guidString.Substring(numStart, numLen) /*first DWORD*/, -1, ParseNumbers.IsTight, out result._parsedGuid._c, ref result))
                 return false;

             // Check for '{'
@@ -646,14 +645,14 @@
                 bytes[i] = (byte)number;
             }

-            result.parsedGuid._d = bytes[0];
-            result.parsedGuid._e = bytes[1];
-            result.parsedGuid._f = bytes[2];
-            result.parsedGuid._g = bytes[3];
-            result.parsedGuid._h = bytes[4];
-            result.parsedGuid._i = bytes[5];
-            result.parsedGuid._j = bytes[6];
-            result.parsedGuid._k = bytes[7];
+            result._parsedGuid._d = bytes[0];
+            result._parsedGuid._e = bytes[1];
+            result._parsedGuid._f = bytes[2];
+            result._parsedGuid._g = bytes[3];
+            result._parsedGuid._h = bytes[4];
+            result._parsedGuid._i = bytes[5];
+            result._parsedGuid._j = bytes[6];
+            result._parsedGuid._k = bytes[7];

             // Check for last '}'
             if (numStart + numLen + 1 >= guidString.Length || guidString[numStart + numLen + 1] != '}')
@@ -706,15 +705,15 @@
                 return false;
             }

-            if (!StringToInt(guidString.Substring(startPos, 8) /*first DWORD*/, -1, ParseNumbers.IsTight, out result.parsedGuid._a, ref result))
+            if (!StringToInt(guidString.Substring(startPos, 8) /*first DWORD*/, -1, ParseNumbers.IsTight, out result._parsedGuid._a, ref result))
                 return false;

             startPos += 8;
-            if (!StringToShort(guidString.Substring(startPos, 4), -1, ParseNumbers.IsTight, out result.parsedGuid._b, ref result))
+            if (!StringToShort(guidString.Substring(startPos, 4), -1, ParseNumbers.IsTight, out result._parsedGuid._b, ref result))
                 return false;

             startPos += 4;
-            if (!StringToShort(guidString.Substring(startPos, 4), -1, ParseNumbers.IsTight, out result.parsedGuid._c, ref result))
+            if (!StringToShort(guidString.Substring(startPos, 4), -1, ParseNumbers.IsTight, out result._parsedGuid._c, ref result))
                 return false;

             startPos += 4;
@@ -733,16 +732,16 @@
                 return false;
             }

-            result.parsedGuid._d = (byte)(temp >> 8);
-            result.parsedGuid._e = (byte)(temp);
+            result._parsedGuid._d = (byte)(temp >> 8);
+            result._parsedGuid._e = (byte)(temp);
             temp = (int)(templ >> 32);
-            result.parsedGuid._f = (byte)(temp >> 8);
-            result.parsedGuid._g = (byte)(temp);
+            result._parsedGuid._f = (byte)(temp >> 8);
+            result._parsedGuid._g = (byte)(temp);
             temp = (int)(templ);
-            result.parsedGuid._h = (byte)(temp >> 24);
-            result.parsedGuid._i = (byte)(temp >> 16);
-            result.parsedGuid._j = (byte)(temp >> 8);
-            result.parsedGuid._k = (byte)(temp);
+            result._parsedGuid._h = (byte)(temp >> 24);
+            result._parsedGuid._i = (byte)(temp >> 16);
+            result._parsedGuid._j = (byte)(temp >> 8);
+            result._parsedGuid._k = (byte)(temp);

             return true;
         }
@@ -793,17 +792,17 @@
             currentPos = startPos;
             if (!StringToInt(guidString, ref currentPos, 8, ParseNumbers.NoSpace, out temp, ref result))
                 return false;
-            result.parsedGuid._a = temp;
+            result._parsedGuid._a = temp;
             ++currentPos; //Increment past the '-';

             if (!StringToInt(guidString, ref currentPos, 4, ParseNumbers.NoSpace, out temp, ref result))
                 return false;
-            result.parsedGuid._b = (short)temp;
+            result._parsedGuid._b = (short)temp;
             ++currentPos; //Increment past the '-';

             if (!StringToInt(guidString, ref currentPos, 4, ParseNumbers.NoSpace, out temp, ref result))
                 return false;
-            result.parsedGuid._c = (short)temp;
+            result._parsedGuid._c = (short)temp;
             ++currentPos; //Increment past the '-';

             if (!StringToInt(guidString, ref currentPos, 4, ParseNumbers.NoSpace, out temp, ref result))
@@ -819,64 +818,58 @@
                 result.SetFailure(ParseFailureKind.Format, "Format_GuidInvLen");
                 return false;
             }
-            result.parsedGuid._d = (byte)(temp >> 8);
-            result.parsedGuid._e = (byte)(temp);
+            result._parsedGuid._d = (byte)(temp >> 8);
+            result._parsedGuid._e = (byte)(temp);
             temp = (int)(templ >> 32);
-            result.parsedGuid._f = (byte)(temp >> 8);
-            result.parsedGuid._g = (byte)(temp);
+            result._parsedGuid._f = (byte)(temp >> 8);
+            result._parsedGuid._g = (byte)(temp);
             temp = (int)(templ);
-            result.parsedGuid._h = (byte)(temp >> 24);
-            result.parsedGuid._i = (byte)(temp >> 16);
-            result.parsedGuid._j = (byte)(temp >> 8);
-            result.parsedGuid._k = (byte)(temp);
+            result._parsedGuid._h = (byte)(temp >> 24);
+            result._parsedGuid._i = (byte)(temp >> 16);
+            result._parsedGuid._j = (byte)(temp >> 8);
+            result._parsedGuid._k = (byte)(temp);

             return true;
         }

-        //
-        // StringToShort, StringToInt, and StringToLong are wrappers around COMUtilNative integer parsing routines;
-
-        private static unsafe bool StringToShort(String str, int requiredLength, int flags, out short result, ref GuidResult parseResult)
-        {
-            return StringToShort(str, null, requiredLength, flags, out result, ref parseResult);
-        }
-        private static unsafe bool StringToShort(String str, int* parsePos, int requiredLength, int flags, out short result, ref GuidResult parseResult)
+        private static bool StringToShort(String str, int requiredLength, int flags, out short result, ref GuidResult parseResult)
+        {
+            int parsePos = 0;
+            return StringToShort(str, ref parsePos, requiredLength, flags, out result, ref parseResult);
+        }
+
+        private static bool StringToShort(String str, ref int parsePos, int requiredLength, int flags, out short result, ref GuidResult parseResult)
         {
             result = 0;
             int x;
-            bool retValue = StringToInt(str, parsePos, requiredLength, flags, out x, ref parseResult);
+            bool retValue = StringToInt(str, ref parsePos, requiredLength, flags, out x, ref parseResult);
             result = (short)x;
             return retValue;
         }

-        private static unsafe bool StringToInt(String str, int requiredLength, int flags, out int result, ref GuidResult parseResult)
-        {
-            return StringToInt(str, null, requiredLength, flags, out result, ref parseResult);
-        }
-        private static unsafe bool StringToInt(String str, ref int parsePos, int requiredLength, int flags, out int result, ref GuidResult parseResult)
-        {
-            fixed (int* ppos = &parsePos)
-            {
-                return StringToInt(str, ppos, requiredLength, flags, out result, ref parseResult);
-            }
-        }
-        private static unsafe bool StringToInt(String str, int* parsePos, int requiredLength, int flags, out int result, ref GuidResult parseResult)
+        private static bool StringToInt(String str, int requiredLength, int flags, out int result, ref GuidResult parseResult)
+        {
+            int parsePos = 0;
+            return StringToInt(str, ref parsePos, requiredLength, flags, out result, ref parseResult);
+        }
+
+        private static bool StringToInt(String str, ref int parsePos, int requiredLength, int flags, out int result, ref GuidResult parseResult)
         {
             result = 0;

-            int currStart = (parsePos == null) ? 0 : (*parsePos);
+            int currStart = parsePos;
             try
             {
-                result = ParseNumbers.StringToInt(str, 16, flags, parsePos);
+                result = ParseNumbers.StringToInt(str, 16, flags, ref parsePos);
             }
             catch (OverflowException ex)
             {
-                if (parseResult.throwStyle == GuidParseThrowStyle.All)
+                if (parseResult._throwStyle == GuidParseThrowStyle.All)
                 {
                     throw;
                 }
-                else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow)
+                else if (parseResult._throwStyle == GuidParseThrowStyle.AllButOverflow)
                 {
                     throw new FormatException(SR.Format_GuidUnrecognized, ex);
                 }
@@ -888,7 +881,7 @@
             }
             catch (Exception ex)
             {
-                if (parseResult.throwStyle == GuidParseThrowStyle.None)
+                if (parseResult._throwStyle == GuidParseThrowStyle.None)
                 {
                     parseResult.SetFailure(ex);
                     return false;
@@ -900,35 +893,29 @@
             }

             //If we didn't parse enough characters, there's clearly an error.
-            if (requiredLength != -1 && parsePos != null && (*parsePos) - currStart != requiredLength)
+            if (requiredLength != -1 && parsePos - currStart != requiredLength)
             {
                 parseResult.SetFailure(ParseFailureKind.Format, "Format_GuidInvalidChar");
                 return false;
             }
             return true;
         }
+
         private static unsafe bool StringToLong(String str, ref int parsePos, int flags, out long result, ref GuidResult parseResult)
         {
-            fixed (int* ppos = &parsePos)
-            {
-                return StringToLong(str, ppos, flags, out result, ref parseResult);
-            }
-        }
-        private static unsafe bool StringToLong(String str, int* parsePos, int flags, out long result, ref GuidResult parseResult)
-        {
             result = 0;

             try
             {
-                result = ParseNumbers.StringToLong(str, 16, flags, parsePos);
+                result = ParseNumbers.StringToLong(str, 16, flags, ref parsePos);
             }
             catch (OverflowException ex)
             {
-                if (parseResult.throwStyle == GuidParseThrowStyle.All)
+                if (parseResult._throwStyle == GuidParseThrowStyle.All)
                 {
                     throw;
                 }
-                else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow)
+                else if (parseResult._throwStyle == GuidParseThrowStyle.AllButOverflow)
                 {
                     throw new FormatException(SR.Format_GuidUnrecognized, ex);
                 }
@@ -940,7 +927,7 @@
             }
             catch (Exception ex)
             {
-                if (parseResult.throwStyle == GuidParseThrowStyle.None)
+                if (parseResult._throwStyle == GuidParseThrowStyle.None)
                 {
                     parseResult.SetFailure(ex);
                     return false;
@@ -1015,7 +1002,7 @@
             return ToString("D", null);
         }

-        public unsafe override int GetHashCode()
+        public override int GetHashCode()
         {
             // Simply XOR all the bits of the GUID 32 bits at a time.
             return _a ^ Unsafe.Add(ref _a, 1) ^ Unsafe.Add(ref _a, 2) ^ Unsafe.Add(ref _a, 3);
@@ -1032,200 +1019,176 @@
             else g = (Guid)o;

             // Now compare each of the elements
+            return g._a == _a &&
+                Unsafe.Add(ref g._a, 1) == Unsafe.Add(ref _a, 1) &&
+                Unsafe.Add(ref g._a, 2) == Unsafe.Add(ref _a, 2) &&
+                Unsafe.Add(ref g._a, 3) == Unsafe.Add(ref _a, 3);
+        }
+
+        public bool Equals(Guid g)
+        {
+            // Now compare each of the elements
+            return g._a == _a &&
+                Unsafe.Add(ref g._a, 1) == Unsafe.Add(ref _a, 1) &&
+                Unsafe.Add(ref g._a, 2) == Unsafe.Add(ref _a, 2) &&
+                Unsafe.Add(ref g._a, 3) == Unsafe.Add(ref _a, 3);
+        }
+
+        private int GetResult(uint me, uint them)
+        {
+            if (me < them)
+            {
+                return -1;
+            }
+            return 1;
+        }
+
+        public int CompareTo(Object value)
+        {
+            if (value == null)
+            {
+                return 1;
+            }
+            if (!(value is Guid))
+            {
+                throw new ArgumentException(SR.Arg_MustBeGuid, nameof(value));
+            }
+            Guid g = (Guid)value;
+
             if (g._a != _a)
-                return false;
-            if (Unsafe.Add(ref g._a, 1) != Unsafe.Add(ref _a, 1))
-                return false;
-            if (Unsafe.Add(ref g._a, 2) != Unsafe.Add(ref _a, 2))
-                return false;
-            if (Unsafe.Add(ref g._a, 3) != Unsafe.Add(ref _a, 3))
-                return false;
-
-            return true;
-        }
-
-        public bool Equals(Guid g)
+            {
+                return GetResult((uint)_a, (uint)g._a);
+            }
+
+            if (g._b != _b)
+            {
+                return GetResult((uint)_b, (uint)g._b);
+            }
+
+            if (g._c != _c)
+            {
+                return GetResult((uint)_c, (uint)g._c);
+            }
+
+            if (g._d != _d)
+            {
+                return GetResult((uint)_d, (uint)g._d);
+            }
+
+            if (g._e != _e)
+            {
+                return GetResult((uint)_e, (uint)g._e);
+            }
+
+            if (g._f != _f)
+            {
+                return GetResult((uint)_f, (uint)g._f);
+            }
+
+            if (g._g != _g)
+            {
+                return GetResult((uint)_g, (uint)g._g);
+            }
+
+            if (g._h != _h)
+            {
+                return GetResult((uint)_h, (uint)g._h);
+            }
+
+            if (g._i != _i)
+            {
+                return GetResult((uint)_i, (uint)g._i);
+            }
+
+            if (g._j != _j)
+            {
+                return GetResult((uint)_j, (uint)g._j);
+            }
+
+            if (g._k != _k)
+            {
+                return GetResult((uint)_k, (uint)g._k);
+            }
+
+            return 0;
+        }
+
+        public int CompareTo(Guid value)
+        {
+            if (value._a != _a)
+            {
+                return GetResult((uint)_a, (uint)value._a);
+            }
+
+            if (value._b != _b)
+            {
+                return GetResult((uint)_b, (uint)value._b);
+            }
+
+            if (value._c != _c)
+            {
+                return GetResult((uint)_c, (uint)value._c);
+            }
+
+            if (value._d != _d)
+            {
+                return GetResult((uint)_d, (uint)value._d);
+            }
+
+            if (value._e != _e)
+            {
+                return GetResult((uint)_e, (uint)value._e);
+            }
+
+            if (value._f != _f)
+            {
+                return GetResult((uint)_f, (uint)value._f);
+            }
+
+            if (value._g != _g)
+            {
+                return GetResult((uint)_g, (uint)value._g);
+            }
+
+            if (value._h != _h)
+            {
+                return GetResult((uint)_h, (uint)value._h);
+            }
+
+            if (value._i != _i)
+            {
+                return GetResult((uint)_i, (uint)value._i);
+            }
+
+            if (value._j != _j)
+            {
+                return GetResult((uint)_j, (uint)value._j);
+            }
+
+            if (value._k != _k)
+            {
+                return GetResult((uint)_k, (uint)value._k);
+            }
+
+            return 0;
+        }
+
+        public static bool operator ==(Guid a, Guid b)
         {
             // Now compare each of the elements
-            if (g._a != _a)
-                return false;
-            if (Unsafe.Add(ref g._a, 1) != Unsafe.Add(ref _a, 1))
-                return false;
-            if (Unsafe.Add(ref g._a, 2) != Unsafe.Add(ref _a, 2))
-                return false;
-            if (Unsafe.Add(ref g._a, 3) != Unsafe.Add(ref _a, 3))
-                return false;
-
-            return true;
-        }
-
-        private int GetResult(uint me, uint them)
-        {
-            if (me < them)
-            {
-                return -1;
-            }
-            return 1;
-        }
-
-        public int CompareTo(Object value)
-        {
-            if (value == null)
-            {
-                return 1;
-            }
-            if (!(value is Guid))
-            {
-                throw new ArgumentException(SR.Arg_MustBeGuid, nameof(value));
-            }
-            Guid g = (Guid)value;
-
-            if (g._a != _a)
-            {
-                return GetResult((uint)_a, (uint)g._a);
-            }
-
-            if (g._b != _b)
-            {
-                return GetResult((uint)_b, (uint)g._b);
-            }
-
-            if (g._c != _c)
-            {
-                return GetResult((uint)_c, (uint)g._c);
-            }
-
-            if (g._d != _d)
-            {
-                return GetResult((uint)_d, (uint)g._d);
-            }
-
-            if (g._e != _e)
-            {
-                return GetResult((uint)_e, (uint)g._e);
-            }
-
-            if (g._f != _f)
-            {
-                return GetResult((uint)_f, (uint)g._f);
-            }
-
-            if (g._g != _g)
-            {
-                return GetResult((uint)_g, (uint)g._g);
-            }
-
-            if (g._h != _h)
-            {
-                return GetResult((uint)_h, (uint)g._h);
-            }
-
-            if (g._i != _i)
-            {
-                return GetResult((uint)_i, (uint)g._i);
-            }
-
-            if (g._j != _j)
-            {
-                return GetResult((uint)_j, (uint)g._j);
-            }
-
-            if (g._k != _k)
-            {
-                return GetResult((uint)_k, (uint)g._k);
-            }
-
-            return 0;
-        }
-
-        public int CompareTo(Guid value)
-        {
-            if (value._a != _a)
-            {
-                return GetResult((uint)_a, (uint)value._a);
-            }
-
-            if (value._b != _b)
-            {
-                return GetResult((uint)_b, (uint)value._b);
-            }
-
-            if (value._c != _c)
-            {
-                return GetResult((uint)_c, (uint)value._c);
-            }
-
-            if (value._d != _d)
-            {
-                return GetResult((uint)_d, (uint)value._d);
-            }
-
-            if (value._e != _e)
-            {
-                return GetResult((uint)_e, (uint)value._e);
-            }
-
-            if (value._f != _f)
-            {
-                return GetResult((uint)_f, (uint)value._f);
-            }
-
-            if (value._g != _g)
-            {
-                return GetResult((uint)_g, (uint)value._g);
-            }
-
-            if (value._h != _h)
-            {
-                return GetResult((uint)_h, (uint)value._h);
-            }
-
-            if (value._i != _i)
-            {
-                return GetResult((uint)_i, (uint)value._i);
-            }
-
-            if (value._j != _j)
-            {
-                return GetResult((uint)_j, (uint)value._j);
-            }
-
-            if (value._k != _k)
-            {
-                return GetResult((uint)_k, (uint)value._k);
-            }
-
-            return 0;
-        }
-
-        public static bool operator ==(Guid a, Guid b)
+            return a._a == b._a &&
+                Unsafe.Add(ref a._a, 1) == Unsafe.Add(ref b._a, 1) &&
+                Unsafe.Add(ref a._a, 2) == Unsafe.Add(ref b._a, 2) &&
+                Unsafe.Add(ref a._a, 3) == Unsafe.Add(ref b._a, 3);
+        }
+
+        public static bool operator !=(Guid a, Guid b)
         {
             // Now compare each of the elements
-            if (a._a != b._a)
-                return false;
-            if (Unsafe.Add(ref a._a, 1) != Unsafe.Add(ref b._a, 1))
-                return false;
-            if (Unsafe.Add(ref a._a, 2) != Unsafe.Add(ref b._a, 2))
-                return false;
-            if (Unsafe.Add(ref a._a, 3) != Unsafe.Add(ref b._a, 3))
-                return false;
-
-            return true;
-        }
-
-        public static bool operator !=(Guid a, Guid b)
-        {
-            // Now compare each of the elements
-            if (a._a != b._a)
-                return true;
-            if (Unsafe.Add(ref a._a, 1) != Unsafe.Add(ref b._a, 1))
-                return true;
-            if (Unsafe.Add(ref a._a, 2) != Unsafe.Add(ref b._a, 2))
-                return true;
-            if (Unsafe.Add(ref a._a, 3) != Unsafe.Add(ref b._a, 3))
-                return true;
-
-            return false;
+            return a._a != b._a ||
+                Unsafe.Add(ref a._a, 1) != Unsafe.Add(ref b._a, 1) ||
+                Unsafe.Add(ref a._a, 2) != Unsafe.Add(ref b._a, 2) ||
+                Unsafe.Add(ref a._a, 3) != Unsafe.Add(ref b._a, 3);
         }

         public String ToString(String format)


Fix unnecessary positioning

Fix unnecessary positioning

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -451,7 +451,6 @@
             loadComponentSingleFile(loginOverlay = new LoginOverlay
             {
                 GetToolbarHeight = () => ToolbarOffset,
-                Position = new Vector2(-ToolbarButton.WIDTH, 0),
                 Anchor = Anchor.TopRight,
                 Origin = Anchor.TopRight,
             }, floatingOverlayContent.Add);


--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -79,6 +79,8 @@

         private SettingsOverlay settings;

+        private bool exiting;
+
         public OsuGame(string[] args = null)
         {
             this.args = args;
@@ -117,6 +119,13 @@
             Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;

             muteWhenInactive = LocalConfig.GetBindable<bool>(OsuSetting.MuteWhenInactive);
+            Host.Window.Exited += () =>
+            {
+                //Prevent not saving audio levels when user alt tabs before the window closes
+                if (volume.IsMuted)
+                    volume.Unmute();
+                exiting = true;
+            };
         }

         private ScheduledDelegate scoreLoad;
@@ -394,7 +403,7 @@
         protected override void OnDeactivated()
         {
             base.OnDeactivated();
-            if (muteWhenInactive)
+            if (muteWhenInactive && !exiting)
             {
                 wasMuted = volume.IsMuted;
                 volume.Mute();
@@ -404,7 +413,7 @@
         protected override void OnActivated()
         {
             base.OnActivated();
-            if (IsLoaded && muteWhenInactive && !wasMuted)
+            if (IsLoaded && muteWhenInactive && !wasMuted && !exiting)
             {
                 volume.Unmute();
             }


Improved plural pattern parser

Improved plural pattern parser

Since the plural header is turned into C# code, it can't be allowed to
use characters that might allow misusage.

--- nettext/PoFile.cs
+++ nettext/PoFile.cs
@@ -273,9 +273,9 @@
 		/// </example>
 		private void LoadPluralEvaluator(string pluralForms)
 		{
-			var match = Regex.Match(pluralForms, @"^nplurals=(?<nplurals>[0-9]+);\s*plural=(?<plural>[^;]+);?$");
+			var match = Regex.Match(pluralForms, @"^nplurals=(?<nplurals>[0-9]+);\s*plural=(?<plural>[0-9n\?:\(\)!=\s%<>|&]+);?$");
 			if (!match.Success)
-				throw new ArgumentException("Invalid Plural-Forms value.");
+				throw new ArgumentException("Invalid Plural-Forms value: " + pluralForms);

 			// Read number and rules
 			_nplurals = Convert.ToInt32(match.Groups["nplurals"].Value);


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpListenerResponse.cs
+++ websocket-sharp/Net/HttpListenerResponse.cs
@@ -349,12 +349,26 @@
       }

       set {
-        checkDisposedOrHeadersSent ();
+        if (_disposed)
+          throw new ObjectDisposedException (GetType ().ToString ());
+
+        if (_headersSent) {
+          var msg = "The response is already being sent.";
+          throw new InvalidOperationException (msg);
+        }
+
         if (value == null)
           throw new ArgumentNullException ("value");

-        if (value.Major != 1 || (value.Minor != 0 && value.Minor != 1))
-          throw new ArgumentException ("Not 1.0 or 1.1.", "value");
+        if (value.Major != 1) {
+          var msg = "Its Major property is not 1.";
+          throw new ArgumentException (msg, "value");
+        }
+
+        if (value.Minor < 0 || value.Minor > 1) {
+          var msg = "Its Minor property is not 0 or 1.";
+          throw new ArgumentException (msg, "value");
+        }

         _version = value;
       }


reinforce unsubscription mechanism

reinforce unsubscription mechanism

--- h-opc/Ua/UaClient.cs
+++ h-opc/Ua/UaClient.cs
@@ -110,7 +110,14 @@
       {
         var p = (MonitoredItemNotification)args.NotificationValue;
         var t = p.Value.WrappedValue.Value;
-        callback((T)t, () => _session.RemoveSubscription(sub));
+        Action unsubscribe = () =>
+        {
+          sub.RemoveItems(sub.MonitoredItems);
+          sub.Delete(true);
+          _session.RemoveSubscription(sub);
+          sub.Dispose();
+        };
+        callback((T)t, unsubscribe);
       };
     }


* Removed C# 3-ness (var) from AccessErrorLog otherwise builds for older versions was broken (the perils of working in most current IDE).

--- src/Elmah/AccessErrorLog.cs
+++ src/Elmah/AccessErrorLog.cs
@@ -377,7 +377,7 @@
                         // A few seconds should be plenty of time to create the database.
                         //

-                        var tolerance = TimeSpan.FromSeconds(2);
+                        TimeSpan tolerance = TimeSpan.FromSeconds(2);
                         if (!process.WaitForExit((int) tolerance.TotalMilliseconds))
                         {
                             //


feat: 增加对特定异常的过滤处理。 :exclamation: :pray:

--- src/Http/ExceptionFilter.cs
+++ src/Http/ExceptionFilter.cs
@@ -34,6 +34,7 @@
 {
 	public class ExceptionFilter : ExceptionFilterAttribute
 	{
+		#region 重写方法
 		public override void OnException(HttpActionExecutedContext actionExecutedContext)
 		{
 			if(actionExecutedContext.Exception == null)
@@ -48,13 +49,31 @@
 				return;
 			}

+			if(actionExecutedContext.Exception is System.NotSupportedException)
+			{
+				actionExecutedContext.Response = this.GetExceptionResponse(actionExecutedContext.Exception, HttpStatusCode.MethodNotAllowed);
+
+				//退出，不用记录日志
+				return;
+			}
+
+			if(actionExecutedContext.Exception is System.NotImplementedException)
+			{
+				actionExecutedContext.Response = this.GetExceptionResponse(actionExecutedContext.Exception, HttpStatusCode.NotImplemented);
+
+				//退出，不用记录日志
+				return;
+			}
+
 			//生成返回的异常消息内容
 			actionExecutedContext.Response = this.GetExceptionResponse(actionExecutedContext.Exception);

 			//默认将异常信息写入日志文件
 			Zongsoft.Diagnostics.Logger.Error(actionExecutedContext.Exception, this.GetLoggingMessage(actionExecutedContext));
 		}
+		#endregion

+		#region 私有方法
 		private HttpResponseMessage GetExceptionResponse(Exception exception, HttpStatusCode status = HttpStatusCode.InternalServerError)
 		{
 			if(exception == null)
@@ -102,5 +121,6 @@

 			return string.Join("|", values);
 		}
+		#endregion
 	}
 }


Added GetFetchMode to interface - H2.0.3 Synch

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@349

--- src/NHibernate/ICriteria.cs
+++ src/NHibernate/ICriteria.cs
@@ -109,6 +109,13 @@
 		System.Type PersistentClass { get; }

 		/// <summary>
+		/// Gets the association's fetching strategy.
+		/// </summary>
+		/// <param name="path"></param>
+		/// <returns></returns>
+		FetchMode GetFetchMode(string path);
+
+		/// <summary>
 		/// Specify an association fetching strategy.  Currently, only
 		/// one-to-many and one-to-one associations are supported.
 		/// </summary>


XmlParserResource.Parse handles underlying exception

shows warning, does not throw System.Xml.XmlException

--- src/Peachpie.Library/Xml.cs
+++ src/Peachpie.Library/Xml.cs
@@ -125,15 +125,12 @@
             /// </summary>
             internal bool InputQueueIsEmpty { get { return _inputQueue == null || _inputQueue.Count == 0; } }

-            public int CurrentLineNumber { get { return _lastLineNumber; } }
-            private int _lastLineNumber;
-
-            public int CurrentColumnNumber { get { return _lastColumnNumber; } }
-            private int _lastColumnNumber;
-
-            public int CurrentByteIndex { get { return _lastByteIndex; } }
-            private int _lastByteIndex;
-
+            public int CurrentLineNumber { get; private set; }
+
+            public int CurrentColumnNumber { get; private set; }
+
+            public int CurrentByteIndex { get; private set; }
+
             public IPhpCallable DefaultHandler { get; set; }

             public IPhpCallable StartElementHandler { get; set; }
@@ -154,8 +151,7 @@

             public bool EnableSkipWhitespace { get; set; }

-            public int ErrorCode { get { return _errorCode; } }
-            private int _errorCode;
+            public int ErrorCode { get; private set; }

             #endregion

@@ -168,8 +164,7 @@

             internal static XmlParserResource ValidResource(PhpResource handle)
             {
-                var xmlParserResource = handle as XmlParserResource;
-                if (xmlParserResource != null && xmlParserResource.IsValid)
+                if (handle is XmlParserResource xmlParserResource && xmlParserResource.IsValid)
                 {
                     return xmlParserResource;
                 }
@@ -246,9 +241,8 @@
                 else
                 {
                     //just reset these values - we are still in the beginning
-                    _lastLineNumber = 0;
-                    _lastColumnNumber = 0;
-                    _lastLineNumber = 0;
+                    CurrentLineNumber = 0;
+                    CurrentColumnNumber = 0;

                     if (!string.IsNullOrEmpty(input))
                     {
@@ -267,6 +261,18 @@
                 return ParseInternal(input, values, indices);
             }

+            private bool HandleException(XmlException exception)
+            {
+                CurrentLineNumber = exception.LineNumber; // ((IXmlLineInfo)reader).LineNumber;
+                CurrentColumnNumber = exception.LinePosition; // ((IXmlLineInfo)reader).LinePosition;
+                CurrentByteIndex = -1; // dunno
+                ErrorCode = (int)XmlParserError.XML_ERROR_GENERIC;
+
+                PhpException.Throw(PhpError.E_NOTICE, exception.Message); // TODO: is it the same as in PHP ?
+
+                return false;
+            }
+
             private bool ParseInternal(string xml, PhpArray values, PhpArray indices)
             {
                 var stringReader = new StringReader(xml);
@@ -280,22 +286,17 @@
                     {
                         reader.Read();
                     }
-                    catch (XmlException)
+                    catch (XmlException exception)
                     {
-                        _lastLineNumber = ((IXmlLineInfo)reader).LineNumber;
-                        _lastColumnNumber = ((IXmlLineInfo)reader).LinePosition;
-                        _lastByteIndex = -1;
-                        _errorCode = (int)XmlParserError.XML_ERROR_GENERIC;
-                        return false;
+                        return HandleException(exception);
                     }

                     //these are usually required
-                    _lastLineNumber = ((IXmlLineInfo)reader).LineNumber;
-                    _lastColumnNumber = ((IXmlLineInfo)reader).LinePosition;
+                    CurrentLineNumber = ((IXmlLineInfo)reader).LineNumber;
+                    CurrentColumnNumber = ((IXmlLineInfo)reader).LinePosition;

                     // we cannot do this - we could if we had underlying stream, but that would require
                     // encoding string -> byte[] which is pointless
-

                     switch (reader.ReadState)
                     {
@@ -313,7 +314,16 @@
                         case ReadState.Interactive:
                             //debug step, that prints out the current state of the parser (pretty printed)
                             //Debug_ParseStep(reader);
-                            ParseStep(reader, elementStack, ref textChunk, values, indices);
+
+                            try
+                            {
+                                ParseStep(reader, elementStack, ref textChunk, values, indices);
+                            }
+                            catch (XmlException exception)
+                            {
+                                return HandleException(exception);
+                            }
+
                             break;
                     }


Update tests

Update tests

--- src/Polarize.Tests/Tests.cs
+++ src/Polarize.Tests/Tests.cs
@@ -320,6 +320,39 @@
             TestContraintsHelper(expected, filterJSON);
         }

+        /// <summary>
+        /// Test to make sure we get two things back
+        /// </summary>
+        [Test]
+        public void TestConstraints4()
+        {
+            var expected = "["
+                +"{"
+                    + "\"A\":\"1\","
+                    + "\"C\":\"3\""
+                + "},"
+                + "{"
+                    + "\"A\":\"1\","
+                    + "\"C\":\"3\""
+                + "}"
+            +"]";
+
+            var filterJSON = @"{
+                ""fields"" : [
+                    ""A"",
+                    ""C""
+                ],
+                ""constraints"" : {
+                    """" : {
+                        ""limit"": 2,
+                        ""offset"": 1
+                    }
+                }
+            }";
+
+            TestContraintsHelper(expected, filterJSON);
+        }
+
         private static void TestContraintsHelper(string expected, string filterJSON)
         {
             var dict = new Dictionary<string, string>()


Removed extra tracing.

Removed extra tracing.

--- src/Renci.SshNet/Session.cs
+++ src/Renci.SshNet/Session.cs
@@ -839,12 +839,8 @@

             if (_keyExchangeInProgress && !(message is IKeyExchangedAllowed))
             {
-                DiagnosticAbstraction.Log(string.Format("[{0}] Waiting for KEX to complete to send '{1}': '{2}'.", ToHex(SessionId), message.GetType().Name, message));
-
                 //  Wait for key exchange to be completed
                 WaitOnHandle(_keyExchangeCompletedWaitHandle);
-
-                DiagnosticAbstraction.Log(string.Format("[{0}] KEX complete to send '{1}': '{2}'.", ToHex(SessionId), message.GetType().Name, message));
             }

             DiagnosticAbstraction.Log(string.Format("[{0}] SendMessage to server '{1}': '{2}'.", ToHex(SessionId), message.GetType().Name, message));


Can read ripple feeds and nugets from ripple.config

--- src/Ripple2Paket/Program.cs
+++ src/Ripple2Paket/Program.cs
@@ -24,15 +24,20 @@
             }

             copyPaketExe(directory);
-            return 0;
+
             var ripple = new XmlDocument();
             ripple.Load(directory.AppendPath("ripple.config"));
+
+            var feeds = findFeeds(ripple).ToArray();

-            var feeds = findFeeds(ripple);
-            var nugets = findNugets(ripple);
+
+            var nugets = findNugets(ripple).ToArray();

-
+            nugets.Each(x => Console.WriteLine(x));
+            Console.ReadLine();
+
+            return 0;

             var dependencies = readRippleDependencies(directory);

@@ -83,12 +88,23 @@

         private static IEnumerable<Nuget> findNugets(XmlDocument ripple)
         {
-            throw new NotImplementedException();
+            foreach (XmlElement element in ripple.DocumentElement.SelectNodes("//Dependency"))
+            {
+                yield return new Nuget
+                {
+                    Name = element.GetAttribute("Name"),
+                    Version = element.GetAttribute("Version"),
+                    Floated = element.GetAttribute("Mode") == "Float"
+                };
+            }
         }

         private static IEnumerable<string> findFeeds(XmlDocument ripple)
         {
-            throw new NotImplementedException();
+            foreach (XmlElement elem in ripple.DocumentElement.SelectNodes("//Feed"))
+            {
+                yield return elem.GetAttribute("Url");
+            }
         }
     }

@@ -97,6 +113,12 @@
         public string Name;
         public string Version;
         public bool Floated;
+
+
+        public override string ToString()
+        {
+            return string.Format("name: {0}, version: {1}, floated: {2}", Name, Version, Floated);
+        }
     }

     public class ProjectDependency


Fix product Update number detection

Fix product Update number detection

--- src/SIM.Products/Product.cs
+++ src/SIM.Products/Product.cs
@@ -477,17 +477,19 @@
     {
       get
       {
-        var version = Service.GetVersions("Sitecore CMS").FirstOrDefault(x => x.MajorMinor.StartsWith(this.Version) || this.Version.StartsWith(x.MajorMinor));
-        var releases = version.Releases.Values.OrderBy(x => x.Version.Revision).ToArray();
-        for (int i = 0; i < releases.Length; i++)
-        {
-          if (Revision.Equals(releases[i].Version.Revision))
-          {
-            return i;
-          }
-        }
-
-        return 0;
+        var productName = "Sitecore CMS";
+        var versions = Service.GetVersions(productName)?.ToArray();
+        Assert.IsNotNull(versions, nameof(versions));
+
+        var ver = new Version(Version);
+        var majorMinor = $"{ver.Major}.{ver.Minor}";
+        var version = versions.FirstOrDefault(x => x.MajorMinor.Equals(majorMinor, StringComparison.Ordinal));
+        Assert.IsNotNull(version, $"Cannot find {productName} version {majorMinor}");
+
+        var release = version.Releases.TryGetValue(Revision);
+        Assert.IsNotNull(release, $"Cannot find {productName} version {majorMinor} revision {Revision}");
+
+        return release.Update;
       }
     }


Fix SXA recognition (closes #170)

Fix SXA recognition (closes #170)

--- src/SIM.Products/Product.cs
+++ src/SIM.Products/Product.cs
@@ -31,7 +31,7 @@

     private const string ProductNamePattern = @"([a-zA-Z][a-zA-Z\d\-\s\._]*[a-zA-Z0-9])";

-    private const string ProductRevisionPattern = @"(\d\d\d\d\d\d[\d\w\s_\-\!\(\)]*)"; // @"(\d\d\d\d\d\d)";
+    private const string ProductRevisionPattern = @"(\d\d\d\d\d\d.*)"; // @"(\d\d\d\d\d\d)";

     private const string ProductVersionPattern = @"(\d\.\d(\.?\d?))";


Cleanup.

Cleanup.

--- src/SparkPost/DataMapper.cs
+++ src/SparkPost/DataMapper.cs
@@ -248,8 +248,7 @@
                 var name = SnakeCase.Convert(property.Name);
                 if (results.ContainsKey(name)) continue;

-                var theValue = GetTheValue(property.PropertyType, property.GetValue(target));
-                results[name] = theValue;
+                results[name] = GetTheValue(property.PropertyType, property.GetValue(target));
             }
             return RemoveNulls(results);
         }


Fix opencl dll import

Fix opencl dll import

--- src/YC.OpenCL.NET/Cl.API.cs
+++ src/YC.OpenCL.NET/Cl.API.cs
@@ -44,24 +44,19 @@

             if (libraryName == Library)
             {
-                if (NativeLibrary.TryLoad(Library, assembly, searchPath, out libHandle))
-                {
-                    return libHandle;
-                }
-                else if (NativeLibrary.TryLoad(envOclPath, assembly, searchPath, out libHandle))
-                {
-                    return libHandle;
-                }
-
                 try
                 {
                     if (OperatingSystem.IsLinux())
                     {
-                        libHandle = NativeLibrary.Load("/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0", assembly, searchPath);
+                        libHandle = NativeLibrary.Load(envOclPath ?? "/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0", assembly, searchPath);
                     }
                     else if (OperatingSystem.IsMacOS())
                     {
-                        libHandle = NativeLibrary.Load("/System/Library/Frameworks/OpenCL.framework/OpenCL", assembly, searchPath);
+                        libHandle = NativeLibrary.Load(envOclPath ?? "/System/Library/Frameworks/OpenCL.framework/OpenCL", assembly, searchPath);
+                    }
+                    else
+                    {
+                        libHandle = NativeLibrary.Load(envOclPath ?? Library, assembly, searchPath);
                     }
                 }
                 catch (DllNotFoundException e)


moved the lamb to the slaughter

moved the lamb to the slaughter

--- ARGame/Assets/Scripts/Projection/MetaLink.cs
+++ ARGame/Assets/Scripts/Projection/MetaLink.cs
@@ -23,7 +23,7 @@
         /// <summary>
         /// like cattle this class is driven all around it's very position consumed by the meta, please no cow tipping with the lamb
         /// </summary>
-        private GameObject lamb = new GameObject();
+		private GameObject lamb;

         /// <summary>
         /// meta object required for tracking
@@ -40,6 +40,7 @@
         /// </summary>
         public MetaLink()
         {
+			lamb = new GameObject("lamb");
             this.markerdetectorGO = MarkerDetector.Instance.gameObject;

             // hide markerindicator
@@ -51,7 +52,7 @@
         /// Sets up the detector and marker indicator to find this marker.
         /// </summary>
         public void Start()
-        {
+		{	lamb = new GameObject("lamb");
             this.markerdetectorGO = MarkerDetector.Instance.gameObject;
             //// hide markerindicator
             this.marketTargetindicator = this.markerdetectorGO.GetComponent<MarkerTargetIndicator>();


Update SpellDatabase.cs

Update SpellDatabase.cs

--- AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
+++ AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
@@ -1756,9 +1756,9 @@

             });

-                Spells.Add(
-                new SpellData
-                {
+            Spells.Add(
+            new SpellData
+            {
                 CharName = "Khazix",
                 Dangerlevel = SpellDangerLevel.Normal,
                 MissileName = "khazixe",
@@ -1771,9 +1771,9 @@
                 SpellName = "KhazixE",
                 SpellType = SpellType.Circular,
             });
-                Spells.Add(
-                new SpellData
-                {
+            Spells.Add(
+            new SpellData
+            {
                 CharName = "Khazix",
                 Dangerlevel = SpellDangerLevel.Normal,
                 MissileName = "khazixelong",
@@ -1798,7 +1798,7 @@
                 CharName = "Kled",
                 Dangerlevel = SpellDangerLevel.Normal,
                 IsThreeWay = true,
-                missileName = "KledRiderQMissile",
+                MissileName = "KledRiderQMissile",
                 Name = "Pocket Pistol",
                 ProjectileSpeed = 3000,
                 Radius = 40,


Not allowed OK

Not allowed OK

--- Ada/AdaBot/Controllers/MessagesController.cs
+++ Ada/AdaBot/Controllers/MessagesController.cs
@@ -16,7 +16,7 @@
 using Newtonsoft.Json.Linq;

 namespace AdaBot
-{
+{
     [BotAuthentication]
     public class MessagesController : ApiController
     {


Update AssemblyInfo.cs

Update AssemblyInfo.cs

Bumped copyright to2020
Bumped Version to 1.1.1

--- AirtableApiClient/Properties/AssemblyInfo.cs
+++ AirtableApiClient/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("AirtableApiClient")]
-[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,6 +32,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0")]
-[assembly: AssemblyFileVersion("1.1.0")]
+[assembly: AssemblyVersion("1.1.1")]
+[assembly: AssemblyFileVersion("1.1.1")]
 [assembly: InternalsVisibleTo("AirtableApiClient.Tests")]


Added more functions to demo app

Added more functions to demo app

--- Altairis.Fakturoid.Client.DemoApp/Program.cs
+++ Altairis.Fakturoid.Client.DemoApp/Program.cs
@@ -62,6 +62,10 @@
             newInvoice.lines.Add(new JsonInvoiceLine { name = "Položka 2", quantity = 3, unit_name = "hod.", unit_price = 1234, vat_rate = 21 });
             var newInvoiceId = context.Invoices.Create(newInvoice);
             Console.WriteLine("OK, ID={0}", newInvoiceId);
+
+            Console.Write("Reading back invoice information...");
+            newInvoice = context.Invoices.SelectSingle(newInvoiceId);
+            Console.WriteLine("OK");

             Console.Write("Sending invoice by e-mail...");
             context.Invoices.SendMessage(newInvoiceId, InvoiceMessageType.InvoiceMessage);


Clear sections when loading INI

Clear sections when loading INI

--- IniManager.cs
+++ IniManager.cs
@@ -220,6 +220,8 @@
         {
             if (!File.Exists(this.Filename))
                 return;
+
+            this.p_Sections.Clear();

             using (var reader = new StreamReader(this.Filename))
             {


Expose Colour as virtual.

Expose Colour as virtual.

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -714,7 +714,7 @@
         /// Colour of this Drawable in sRGB space. Only valid if no individual colours
         /// have been specified for each corner vertex via <see cref="ColourInfo"/>.
         /// </summary>
-        public SRGBColour Colour
+        public virtual SRGBColour Colour
         {
             get
             {


Fix headless crashing due to no Window available during bootstrap

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -604,7 +604,6 @@
                     Child = new SafeAreaTargetContainer
                     {
                         RelativeSizeAxes = Axes.Both,
-                        SafeAreaPadding = Window.SafeAreaPadding,
                         Child = game
                     }
                 }