fix formatting

fix formatting

--- src/CorvusAlba.MyLittleLispy.Runtime/Context.cs
+++ src/CorvusAlba.MyLittleLispy.Runtime/Context.cs
@@ -42,102 +42,102 @@
         {
             _parser = parser;
             _specialForms = new Dictionary<string, Func<Node[], Value>>
-		    {
-		        {"define", args => Define(args[0], new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
-								          Concat(args.Skip(1)).ToArray())) },
-		        {"defmacro", args => DefineMacro(args[0].Quote(this).To<string>(), args[1], new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
-								          Concat(args.Skip(2)).ToArray())) },
-		        {
-		            "macroexpand", args =>
-		            {
-		                _evalMacro = false;
-		                var result = Trampoline(args[0].Eval(this)).ToExpression().Eval(this);
-		                _evalMacro = true;
-		                return result;
-		            }
-		        },
-		        {"quote", args => args[0].Quote(this) },
-		        {"quasiquote", Quasiquote },
-		        {"unquote", args => Trampoline(args[0].Eval(this)) },
-		        {"unquote-splicing", args => Trampoline(args[0].Eval(this)) },
-		        {"lambda", args => new Closure(this, args[0],
-						       new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
-								      Concat(args.Skip(1)).ToArray())) },
-		        {"when", args => Trampoline(args[0].Eval(this)).To<bool>()
-		             ? (Value) new Closure(this, null, new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
-								      Concat(args.Skip(1)).ToArray()), true)
-		             : (Value) Null.Value },
-		        {"unless", args => !Trampoline(args[0].Eval(this)).To<bool>()
-		             ? (Value) new Closure(this, null, new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
-								      Concat(args.Skip(1)).ToArray()), true)
-		             : (Value) Null.Value },
-		        {
-			    "cond", args =>
-			    {
-			        var clauses = args.Cast<Expression>().ToArray();
-
-			        foreach (var clause in clauses.Take(args.Count() - 1))
-			        {
-				        var condition = Trampoline(clause.Head.Eval(this));
-				        if (condition.To<bool>())
-				        {
-				            return InvokeCondClause(clause, condition);
-				        }
-			        }
-
-			        var lastClause = clauses.Last();
-			        var head = lastClause.Head.Quote(this);
-			        if (head is SymbolValue && head.To<string>() == "else")
-			        {
-				        return InvokeCondClause(lastClause);
-			        }
-
-			        var lastCondition = Trampoline(lastClause.Head.Eval(this));
-			        if (lastCondition.To<bool>())
-			        {
-				        return InvokeCondClause(lastClause, lastCondition);
-			        }
-
-			        return Null.Value;
-			    }
-		        },
-		        {
-			    "if", args =>
-			    {
-			        var condition = Trampoline(args[0].Eval(this)).To<bool>();
-			        if (condition)
-			        {
-				        return new Closure(this, null, args[1], true);
-			        }
-			        if (args.Length > 2)
-			        {
-				        return new Closure(this, null, args[2], true);
-			        }
-			        return Null.Value;
-			    }
-		        },
-		        {"let", Let},
-		        {"let*", LetSequential},
-		        {"set!", Set},
-		        {
-			    "begin", args =>
-			    {
-			        foreach (var arg in args.Take(args.Count() - 1))
-			        {
+            {
+                {"define", args => Define(args[0], new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
+                                          Concat(args.Skip(1)).ToArray())) },
+                {"defmacro", args => DefineMacro(args[0].Quote(this).To<string>(), args[1], new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
+                                          Concat(args.Skip(2)).ToArray())) },
+                {
+                    "macroexpand", args =>
+                    {
+                        _evalMacro = false;
+                        var result = Trampoline(args[0].Eval(this)).ToExpression().Eval(this);
+                        _evalMacro = true;
+                        return result;
+                    }
+                },
+                {"quote", args => args[0].Quote(this) },
+                {"quasiquote", Quasiquote },
+                {"unquote", args => Trampoline(args[0].Eval(this)) },
+                {"unquote-splicing", args => Trampoline(args[0].Eval(this)) },
+                {"lambda", args => new Closure(this, args[0],
+                               new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
+                                      Concat(args.Skip(1)).ToArray())) },
+                {"when", args => Trampoline(args[0].Eval(this)).To<bool>()
+                     ? (Value) new Closure(this, null, new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
+                                      Concat(args.Skip(1)).ToArray()), true)
+                     : (Value) Null.Value },
+                {"unless", args => !Trampoline(args[0].Eval(this)).To<bool>()
+                     ? (Value) new Closure(this, null, new Expression(new [] { new Symbol(new SymbolValue("begin")) }.
+                                      Concat(args.Skip(1)).ToArray()), true)
+                     : (Value) Null.Value },
+                {
+                "cond", args =>
+                {
+                    var clauses = args.Cast<Expression>().ToArray();
+
+                    foreach (var clause in clauses.Take(args.Count() - 1))
+                    {
+                        var condition = Trampoline(clause.Head.Eval(this));
+                        if (condition.To<bool>())
+                        {
+                            return InvokeCondClause(clause, condition);
+                        }
+                    }
+
+                    var lastClause = clauses.Last();
+                    var head = lastClause.Head.Quote(this);
+                    if (head is SymbolValue && head.To<string>() == "else")
+                    {
+                        return InvokeCondClause(lastClause);
+                    }
+
+                    var lastCondition = Trampoline(lastClause.Head.Eval(this));
+                    if (lastCondition.To<bool>())
+                    {
+                        return InvokeCondClause(lastClause, lastCondition);
+                    }
+
+                    return Null.Value;
+                }
+                },
+                {
+                "if", args =>
+                {
+                    var condition = Trampoline(args[0].Eval(this)).To<bool>();
+                    if (condition)
+                    {
+                        return new Closure(this, null, args[1], true);
+                    }
+                    if (args.Length > 2)
+                    {
+                        return new Closure(this, null, args[2], true);
+                    }
+                    return Null.Value;
+                }
+                },
+                {"let", Let},
+                {"let*", LetSequential},
+                {"set!", Set},
+                {
+                "begin", args =>
+                {
+                    foreach (var arg in args.Take(args.Count() - 1))
+                    {
                                     Trampoline(arg.Eval(this));
-			        }
-			        return new Closure(this, null, args.Last(), true);
-			    }
-		        },
+                    }
+                    return new Closure(this, null, args.Last(), true);
+                }
+                },
                         {"do", Do},
-		        {"import", Import},
-		        {"and", And},
-		        {"or", Or},
-
-		        // TODO for jit-compiler letrec and letrec* will have different implementations
-		        {"letrec", Let},
-		        {"letrec*", LetSequential},
-		    };
+                {"import", Import},
+                {"and", And},
+                {"or", Or},
+
+                // TODO for jit-compiler letrec and letrec* will have different implementations
+                {"letrec", Let},
+                {"letrec*", LetSequential},
+            };

             _globalFrame = new Frame();
             _callStack.Push(_globalFrame);
@@ -155,7 +155,7 @@
             return new Cons(expression.Nodes.SelectMany(node =>
                     {
                         bool isNested = false;
-
+
                         var expressionNode = node as Expression;
                         if (expressionNode != null)
                         {
@@ -182,9 +182,9 @@
                             }
                             if (isNested)
                             {
-                                return new [] { expressionNode.Quote(this).ToExpression() };
+                                return new[] { expressionNode.Quote(this).ToExpression() };
                             }
-                            return new [] { Quasiquote(new Node[] { expressionNode }).ToExpression() };
+                            return new[] { Quasiquote(new Node[] { expressionNode }).ToExpression() };
                         }
                         return new[] { node };
                     }).Select(node => node.Quote(this)).ToArray());
@@ -236,7 +236,7 @@
         private Value Do(Node[] args)
         {
             var variableClauses = args[0].Quote(this).To<IEnumerable<Value>>().Select(v => v.ToExpression()).Cast<Expression>().ToArray();
-            var testClause = (Expression) args[1];
+            var testClause = (Expression)args[1];
             var body = new Expression(new[] { new Symbol(new SymbolValue("begin")) }.
                                       Concat(args.Skip(2)).ToArray());

@@ -246,9 +246,9 @@
                 foreach (var clause in variableClauses)
                 {
                     CurrentFrame.Bind(clause.Head.Quote(this).To<string>(), Trampoline(clause.Tail.First().Eval(this)));
-                }
-
-                while(!Trampoline(testClause.Head.Eval(this)).To<bool>())
+                }
+
+                while (!Trampoline(testClause.Head.Eval(this)).To<bool>())
                 {
                     Trampoline(body.Eval(this));
                     foreach (var clause in variableClauses)
@@ -257,7 +257,7 @@
                         {
                             CurrentFrame.Set(clause.Head.Quote(this).To<string>(), Trampoline(clause.Tail.Skip(1).First().Eval(this)));
                         }
-                    }
+                    }
                 }
                 return new Closure(this, null, new Expression(new[] { new Symbol(new SymbolValue("begin")) }.
                                                               Concat(testClause.Tail).ToArray()), true);
@@ -267,7 +267,7 @@
                 CurrentFrame.Pop();
             }
         }
-
+
         private Value Let(Node[] args)
         {
             var frameArgs = new List<string>();
@@ -280,7 +280,7 @@
                 name = args[0].Quote(this).To<string>();
                 args = args.Skip(1).ToArray();
             }
-
+
             foreach (var clause in args[0].Quote(this).To<IEnumerable<Value>>().Select(v => v.ToExpression()).Cast<Expression>())
             {
                 frameArgs.Add(clause.Head.Quote(this).To<string>());
@@ -312,7 +312,7 @@
         {
             var name = string.Empty;
             var argNodes = new List<Node>();
-
+
             if (args[0] is Symbol)
             {
                 name = args[0].Quote(this).To<string>();
@@ -335,7 +335,7 @@
                                                         new Expression(new[] { new Symbol(new SymbolValue("begin")) }.
                                                                        Concat(args.Skip(1)).ToArray()), false));
                 }
-
+
                 var result = new Closure(this, null, new Expression(new[] { new Symbol(new SymbolValue("begin")) }.
                                                                     Concat(args.Skip(1)).ToArray()), true);
                 return result;
@@ -382,7 +382,7 @@
             Value call;
             call = Trampoline(head.Eval(this));
             if (call is Undefined)
-            {
+            {
                 if (head is Symbol)
                 {
                     call = head.Quote(this);
@@ -466,7 +466,7 @@
                 Push();
                 CurrentFrame.Import(closure.Scopes);
             }
-            CurrentFrame.Push(closure.Args, arguments);
+            CurrentFrame.Push(closure.Args, arguments);
             try
             {
                 Value result;
@@ -484,7 +484,7 @@
             }
             finally
             {
-                CurrentFrame.Pop();
+                CurrentFrame.Pop();
                 if (!closure.IsMacro)
                 {
                     if (closure.Scopes != null)


Fixed Webhook avatarUrls

Fixed Webhook avatarUrls

--- src/Discord.Net.Webhook/DiscordWebhookClient.cs
+++ src/Discord.Net.Webhook/DiscordWebhookClient.cs
@@ -55,7 +55,7 @@
             if (username != null)
                 args.Username = username;
             if (avatarUrl != null)
-                args.AvatarUrl = username;
+                args.AvatarUrl = avatarUrl;
             await ApiClient.CreateWebhookMessageAsync(_webhookId, args, options).ConfigureAwait(false);
         }


Remove unused closure parameter.

Remove unused closure parameter.

--- src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
+++ src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
@@ -123,9 +123,9 @@
             .Continue()
             .With(andContinuations)
             .Build(
-                static (builder, traversals, andContinuations) =>
+                static (builder, traversals) =>
                 {
-                    if (andContinuations.Length == 0)
+                    if (traversals.Length == 0)
                     {
                         return builder
                             .AddStep(AndStep.Infix)
@@ -166,8 +166,7 @@
                             .AddStep(new AndStep(fusedTraversals))
                             .Build()
                     };
-                },
-                andContinuations);
+                });

         private TTargetQuery As<TTargetQuery>(Func<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, StepLabel<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, TElement>, TTargetQuery> continuation)
             where TTargetQuery : IGremlinQueryBase


rollback DiagnosticData.cs

rollback DiagnosticData.cs

the file belongs to different changes accidentally got checked in with telemetry change

I rolling back the change. (changeset 1410406)

--- src/Features/Core/Diagnostics/DiagnosticData.cs
+++ src/Features/Core/Diagnostics/DiagnosticData.cs
@@ -268,7 +268,7 @@
                 diagnostic.DefaultSeverity,
                 diagnostic.Descriptor.IsEnabledByDefault,
                 diagnostic.WarningLevel,
-                diagnostic.CustomTags.AsImmutableOrEmpty(),
+                diagnostic.Descriptor.CustomTags.AsImmutableOrEmpty(),
                 project.Solution.Workspace,
                 project.Id,
                 title: diagnostic.Descriptor.Title.ToString(CultureInfo.CurrentUICulture),
@@ -304,7 +304,7 @@
                 diagnostic.DefaultSeverity,
                 diagnostic.Descriptor.IsEnabledByDefault,
                 diagnostic.WarningLevel,
-                diagnostic.CustomTags.AsImmutableOrEmpty(),
+                diagnostic.Descriptor.CustomTags.AsImmutableOrEmpty(),
                 document.Project.Solution.Workspace,
                 document.Project.Id,
                 document.Id,


Add missing unit tests for Range equality.

--- src/FindRandomNumber.Tests/Common/RangeTests.cs
+++ src/FindRandomNumber.Tests/Common/RangeTests.cs
@@ -25,5 +25,42 @@
         Assert.That(actual.Maximum, Is.EqualTo(200));
       }
     }
+
+    [TestFixture]
+    public class Equality : RangeTests {
+      [Test]
+      public void EmptyInstances_AreEqual() {
+        var obj1 = new Range();
+        var obj2 = new Range();
+
+        Assert.That(obj1.Equals(obj2));
+        Assert.That(obj1.GetHashCode(), Is.EqualTo(obj2.GetHashCode()));
+        Assert.That(obj1 == obj2);
+      }
+
+      [Test]
+      public void ObjectsWithEqualValues_AreEqual() {
+        var obj1 = new Range(321, 456);
+        var obj2 = new Range(321, 456);
+
+        Assert.That(obj1.Equals(obj2));
+        Assert.That(obj1 == obj2);
+        Assert.That(obj1.GetHashCode(), Is.EqualTo(obj2.GetHashCode()));
+      }
+
+      [Test]
+      public void ObjectsWithDifferentValues_AreNotEqual() {
+        var obj1 = new Range(1, 123);
+        var obj2 = new Range(1, 124);
+        var obj3 = new Range(0, 123);
+
+        Assert.That(!obj1.Equals(obj2));
+        Assert.That(obj1 != obj2);
+        Assert.That(!obj2.Equals(obj3));
+        Assert.That(obj2 != obj3);
+        Assert.That(!obj1.Equals(obj3));
+        Assert.That(obj1 != obj3);
+      }
+    }
   }
 }


Fixed broken TDNet test.

Fixed broken TDNet test.

--- src/Gallio/Gallio.Reports/VtlReportFormatter.cs
+++ src/Gallio/Gallio.Reports/VtlReportFormatter.cs
@@ -146,8 +146,9 @@
         private VtlReportWriter GetReportWriter(VelocityEngine velocityEngine, VelocityContext velocityContext, IReportWriter reportWriter, FormatHelper helper)
         {
             HtmlReportSplitSettings settings = preferenceManager.HtmlReportSplitSettings;
+            int testCount = (reportWriter.Report.TestPackageRun == null) ? 0 : reportWriter.Report.TestPackageRun.Statistics.TestCount;

-            if (supportSplit && settings.Enabled && reportWriter.Report.TestPackageRun.Statistics.TestCount > settings.PageSize)
+            if (supportSplit && settings.Enabled && testCount > settings.PageSize)
                 return new MultipleFilesVtlReportWriter(velocityEngine, velocityContext, reportWriter, templatePath, contentType, extension, helper, settings.PageSize);

             return new SingleFileVtlReportWriter(velocityEngine, velocityContext, reportWriter, templatePath, contentType, extension, helper);


Fixes a bug with incorrect asset name

Fixes a bug with incorrect asset name

--- source/Pulsar/Assets/AssetFolder.cs
+++ source/Pulsar/Assets/AssetFolder.cs
@@ -153,7 +153,12 @@
         /// <returns>Returns the loaded asset</returns>
         public T LoadWithFullPath<T>(string assetName, object parameters = null)
         {
-            return LoadWithFullPath<T>(assetName, assetName, parameters);
+            if (assetName == null)
+                throw new ArgumentNullException("assetName");
+
+            assetName = PathHelpers.CleanPath(assetName);
+
+            return InternalLoad<T>(assetName, assetName, parameters);
         }

         /// <summary>
@@ -166,9 +171,13 @@
         /// <returns>Returns the loaded asset</returns>
         public T LoadWithFullPath<T>(string assetName, string path, object parameters = null)
         {
-            if(path == null)
+            if (assetName == null)
+                throw new ArgumentNullException("assetName");
+
+            if (path == null)
                 throw new ArgumentNullException("path");

+            assetName = PathHelpers.CleanPath(assetName);
             path = PathHelpers.RemoveRoot(path, _directoryPath);

             return InternalLoad<T>(assetName, path, parameters);
@@ -183,7 +192,12 @@
         /// <returns>Returns the loaded asset</returns>
         public T Load<T>(string assetName, object parameters = null)
         {
-            return Load<T>(assetName, assetName, parameters);
+            if (assetName == null)
+                throw new ArgumentNullException("assetName");
+
+            assetName = PathHelpers.CleanPath(assetName);
+
+            return InternalLoad<T>(assetName, assetName, parameters);
         }

         /// <summary>
@@ -196,8 +210,14 @@
         /// <returns>Returns the loaded asset</returns>
         public T Load<T>(string assetName, string path, object parameters = null)
         {
-            if(path != null)
-                path = PathHelpers.CleanPath(path);
+            if(assetName == null)
+                throw new ArgumentNullException("assetName");
+
+            if (path == null)
+                throw new ArgumentNullException("path");
+
+            assetName = PathHelpers.CleanPath(assetName);
+            path = PathHelpers.CleanPath(path);

             return InternalLoad<T>(assetName, path, parameters);
         }


fixed an issue with the twain ui and when we deliver msg_xferready...

--- source/TwainDirect.OnTwain/TWAIN.cs
+++ source/TwainDirect.OnTwain/TWAIN.cs
@@ -19,7 +19,7 @@
 //  M.McLaughlin    27-Feb-2014     2.3.0.1     AnyCPU support
 //  M.McLaughlin    21-Oct-2013     2.3.0.0     Initial Release
 ///////////////////////////////////////////////////////////////////////////////////////
-//  Copyright (C) 2013-2018 Kodak Alaris Inc.
+//  Copyright (C) 2013-2019 Kodak Alaris Inc.
 //
 //  Permission is hereby granted, free of charge, to any person obtaining a
 //  copy of this software and associated documentation files (the "Software"),
@@ -8677,7 +8677,15 @@
                         // call to MSG_ENABLEDS.  We can just do it...
                         else
                         {
-                            m_blAcceptXferReady = false;
+                            // To handle data sources that return MSG_XFERREADY in
+                            // the midst of processing MSG_ENABLEDS, we need to clear
+                            // the flag so we don't get in here again. However, if
+                            // the UI is up, we DO want to see all MSG_XFERREADYs.
+                            if (m_twuserinterface.ShowUI == 0)
+                            {
+                                m_blAcceptXferReady = false;
+                            }
+
                             m_state = STATE.S6;
                             m_blIsMsgxferready = true;
                             // TBD
@@ -11023,11 +11031,8 @@
                 }
                 if (!ms_blOpened)
                 {
-                    // Add logging on / off
-                    if (ms_iLevel > 0)
-                    {
-                        Open("Twain", ".", ms_iLevel);
-                    }
+                    // We'll assume they want logging, since they didn't tell us...
+                    Open("Twain", ".", 1);
                 }
                 Trace.UseGlobalLock = true;
                 ms_blFirstPass = false;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -289,10 +289,13 @@
     private void broadcast (Opcode opcode, Stream stream, Action completed)
     {
       var cache = new Dictionary<CompressionMethod, Stream> ();
+
       try {
         foreach (var host in Hosts) {
-          if (_state != ServerState.Start)
+          if (_state != ServerState.Start) {
+            _log.Error ("The server is shutting down.");
             break;
+          }

           host.Sessions.Broadcast (opcode, stream, cache);
         }


[Modify] Add it

[Modify] Add it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -593,6 +593,67 @@
     }

     /// <summary>
+    /// Removes a WebSocket service with the specified <paramref name="path"/>.
+    /// </summary>
+    /// <remarks>
+    /// <paramref name="path"/> is converted to a URL-decoded string and
+    /// / is trimmed from the end of the converted string if any.
+    /// </remarks>
+    /// <returns>
+    /// <c>true</c> if the service is successfully found and removed;
+    /// otherwise, <c>false</c>.
+    /// </returns>
+    /// <param name="path">
+    /// A <see cref="string"/> that represents an absolute path to
+    /// the service to remove.
+    /// </param>
+    /// <exception cref="ArgumentNullException">
+    /// <paramref name="path"/> is <see langword="null"/>.
+    /// </exception>
+    /// <exception cref="ArgumentException">
+    ///   <para>
+    ///   <paramref name="path"/> is empty.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
+    ///   <paramref name="path"/> is invalid.
+    ///   </para>
+    /// </exception>
+    public bool RemoveService (string path)
+    {
+      if (path == null)
+        throw new ArgumentNullException ("path");
+
+      if (path.Length == 0)
+        throw new ArgumentException ("An empty string.", "path");
+
+      if (path[0] != '/')
+        throw new ArgumentException ("Not an absolute path.", "path");
+
+      if (path.IndexOfAny (new[] { '?', '#' }) > -1) {
+        var msg = "It includes either or both query and fragment components.";
+        throw new ArgumentException (msg, "path");
+      }
+
+      path = HttpUtility.UrlDecode (path).TrimSlashFromEnd ();
+
+      WebSocketServiceHost host;
+      lock (_sync) {
+        if (!_hosts.TryGetValue (path, out host))
+          return false;
+
+        _hosts.Remove (path);
+      }
+
+      if (host.State == ServerState.Start)
+        host.Stop (1001, String.Empty);
+
+      return true;
+    }
+
+    /// <summary>
     /// Tries to get the WebSocket service host with
     /// the specified <paramref name="path"/>.
     /// </summary>


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketSessionManager.cs
+++ websocket-sharp/Server/WebSocketSessionManager.cs
@@ -574,7 +574,8 @@
     public void Broadcast (string data)
     {
       if (_state != ServerState.Start) {
-        var msg = "The current state of the manager is not Start.";
+        var msg = "The current state of the service is not Start.";
+
         throw new InvalidOperationException (msg);
       }

@@ -582,8 +583,10 @@
         throw new ArgumentNullException ("data");

       byte[] bytes;
+
       if (!data.TryGetUTF8EncodedBytes (out bytes)) {
         var msg = "It could not be UTF-8-encoded.";
+
         throw new ArgumentException (msg, "data");
       }


Revert Changes

Revert Changes

Reverting changes to match the other addins

--- source/CoordinateConversion/ArcMapAddinCoordinateConversion/CCUserControlProxy.cs
+++ source/CoordinateConversion/ArcMapAddinCoordinateConversion/CCUserControlProxy.cs
@@ -18,8 +18,21 @@

         IActiveViewEvents_Event avEvents = null;

-        public void SyncDocEvents()
+        public IApplication ArcMapApplication
         {
+            set
+            {
+                if (value != null)
+                {
+                    ArcMap.Application = value;
+                    this.SyncEvents();
+                }
+            }
+        }
+
+        public void SyncEvents()
+        {
+            // TODO: this will not be called when CC DockWindow is open on ArcMap launch so should be moved
             if (ArcMap.Events != null)
             {
                 ArcMap.Events.NewDocument += ArcMap_NewOpenDocument;


fix: Remove test with non-valid input data

* Test currently contains non-valid input data will be fixed when issue
  #93 is delivered

--- test/Helsenorge.Registries.Tests/CertificateValidatorTests.cs
+++ test/Helsenorge.Registries.Tests/CertificateValidatorTests.cs
@@ -25,6 +25,7 @@
             Assert.AreEqual(CertificateErrors.None, error);
         }
         [TestMethod]
+        [TestCategory("X509Chain"), Ignore]
         public void CertificateValidation_StartDate()
         {
             var validator = new CertificateValidator();


Improve deployment provider error message. (#329)

--- source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
+++ source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
@@ -313,6 +313,8 @@
         private async System.Threading.Tasks.Task<string> CheckNativeAssembliesAvailabilityAsync(List<CLRCapabilities.NativeAssemblyProperties> nativeAssemblies, List<DeploymentAssembly> peCollection)
         {
             string errorMessage = string.Empty;
+            string wrongAssemblies = string.Empty;
+            string missingAssemblies = string.Empty;

             // loop through each PE to deploy...
             foreach (var peItem in peCollection)
@@ -320,6 +322,7 @@
                 // open the PE file and load content
                 using (FileStream fs = File.Open(peItem.Path, FileMode.Open, FileAccess.Read))
                 {
+                    CLRCapabilities.NativeAssemblyProperties nativeAssembly;
                     // get PE checksum
                     byte[] buffer = new byte[4];
                     fs.Position = 0x14;
@@ -335,7 +338,7 @@
                     // try to find a native assembly matching the checksum for this PE
                     if (nativeAssemblies.Exists(a => a.Checksum == peChecksum))
                     {
-                        var nativeAssembly = nativeAssemblies.Find(a => a.Checksum == peChecksum);
+                        nativeAssembly = nativeAssemblies.Find(a => a.Checksum == peChecksum);

                         // check the version now
                         if (nativeAssembly.Version.ToString(4) == peItem.Version)
@@ -343,6 +346,11 @@
                             // we are good with this one
                             continue;
                         }
+
+                        // no suitable native assembly found build a (hopefully) helpful message to the developer
+                        wrongAssemblies += $"Couldn't find a valid native assembly required by {Path.GetFileNameWithoutExtension(peItem.Path)} v{peItem.Version}, checksum 0x{peChecksum.ToString("X8")}." + Environment.NewLine +
+                                        $"This project is referencing {Path.GetFileNameWithoutExtension(peItem.Path)} NuGet package with v{peItem.Version}." + Environment.NewLine +
+                                        $"The connected target is has support for v{nativeAssembly.Version.ToString(4)}." + Environment.NewLine;
                     }
                     else
                     {
@@ -361,19 +369,41 @@
                             // we are good with this one
                             continue;
                         }
+
+                        // no suitable native assembly found build a (hopefully) helpful message to the developer
+                        missingAssemblies = $"Couldn't find a valid native assembly required by {Path.GetFileNameWithoutExtension(peItem.Path)} v{peItem.Version}, checksum 0x{peChecksum.ToString("X8")}." + Environment.NewLine +
+                                        $"This project is referencing {Path.GetFileNameWithoutExtension(peItem.Path)} NuGet package with v{peItem.Version}." + Environment.NewLine +
+                                        $"The connected target does not have support for {Path.GetFileNameWithoutExtension(peItem.Path)}." + Environment.NewLine;
+
                     }
-
-                    if (string.IsNullOrEmpty(errorMessage))
-                    {
-                        // init error message
-                        errorMessage = "Deploy failed." + Environment.NewLine +
-                                        "***************************************" + Environment.NewLine;
-                    }
-
-                    // no suitable native assembly found present a (hopefully) helpful message to the developer
-                    errorMessage += $"Couldn't find a valid native assembly required by {Path.GetFileNameWithoutExtension(peItem.Path)} v{peItem.Version}, checksum 0x{peChecksum.ToString("X8")}." + Environment.NewLine;
                 }
             }
+
+
+            if (!string.IsNullOrEmpty(wrongAssemblies) ||
+                !string.IsNullOrEmpty(missingAssemblies))
+            {
+                // init error message
+                errorMessage = "Deploy failed." + Environment.NewLine +
+                                "***************************************" + Environment.NewLine;
+            }
+
+            if (!string.IsNullOrEmpty(wrongAssemblies))
+            {
+                errorMessage += wrongAssemblies;
+                errorMessage += $"Please check: " + Environment.NewLine +
+                               $"  1) if the target is running the most updated image." + Environment.NewLine +
+                               $"  2) if the project is referring the appropriate version of the assembly." + Environment.NewLine;
+            }
+
+            if (string.IsNullOrEmpty(missingAssemblies))
+            {
+                errorMessage += missingAssemblies;
+                errorMessage += "Please check: " + Environment.NewLine +
+                                    "  1) if the target is running the most updated image." + Environment.NewLine +
+                                    "  2) if the target image was built to include support for referenced assembly." + Environment.NewLine;
+            }
+

             // close error message, if needed
             if (!string.IsNullOrEmpty(errorMessage))


Snap slider to 0, display integer values

--- contractConfig.cs
+++ contractConfig.cs
@@ -406,7 +406,7 @@
 			GUILayout.BeginHorizontal();
 				string offers = "";
 				if (contractType.MaxOffer < 10)
-					offers = string.Format("Max Offered: {0}", contractType.MaxOffer * 10);
+					offers = string.Format("Max Offered: {0:N0}", contractType.MaxOffer * 10);
 				else
 					offers = ("Max Offered: ∞");
 				GUILayout.Label(offers, GUILayout.Width(110));
@@ -423,7 +423,7 @@

 				string actives = "";
 				if (contractType.MaxActive < 10)
-					actives = string.Format("Max Active: {0}", contractType.MaxActive * 10);
+					actives = string.Format("Max Active: {0:N0}", contractType.MaxActive * 10);
 				else
 					actives = "Max Active: ∞";
 				GUILayout.Label(actives, GUILayout.Width(100));
@@ -552,9 +552,14 @@
 			else
 				GUI.HorizontalSlider(r, f, min, max);

-			if (f >= -1 && f < 0)
+			if (f >= -1 && f < -0.05)
 				newVal = f + 1;
-			else if (f >= 0 && f < 1)
+			else if (f >= -0.05 && f < 0.05)
+			{
+				f = 0;
+				newVal = 1;
+			}
+			else if (f >= 0.05 && f < 1)
 				newVal = (float)Math.Pow(10, f);
 			else
 				newVal = 10f;
@@ -572,17 +577,6 @@
 			}

 			return newVal;
-		}
-
-		//Simple linear scale slider for integer values
-		private float linearSlider (ref float f, float min, float max, Rect r)
-		{
-			if (!dropDown)
-				f = Mathf.RoundToInt(GUI.HorizontalSlider(r, f, min, max));
-			else
-				GUI.HorizontalSlider(r, f, min, max);
-
-			return f;
 		}

 		private void setContractType(contractTypeContainer c)


Plugin.cs のリファクタ

Plugin.cs のリファクタ

--- Plugin.cs
+++ Plugin.cs
@@ -148,13 +148,12 @@

         public IEnumerable<string> GetSongs(string query)
         {
-            if (mbApiInterface.Library_QueryFiles(query))
+            if (!mbApiInterface.Library_QueryFiles(query)) yield break;
+
+            string file;
+            while ((file = mbApiInterface.Library_QueryGetNextFile()) != null)
             {
-                string file;
-                while ((file = mbApiInterface.Library_QueryGetNextFile()) != null)
-                {
-                    yield return file;
-                }
+                yield return file;
             }
         }
     }


set assume id to be constant

set assume id to be constant

--- HearthStone/HearthStone.Library.Test/CardRecordUnitTest.cs
+++ HearthStone/HearthStone.Library.Test/CardRecordUnitTest.cs
@@ -21,6 +21,12 @@
             }
         }

+        // assume the following IDs are always valid/invalid for testing
+        public const int assumeValidCardID = 1;
+        public const int assumeValidCardRecordID = 1;
+        public const int assumeInvalidCardID = int.MinValue;
+        public const int assumeInvalidCardRecordID = int.MinValue;
+
         [TestMethod]
         public void CardRecordIDTestMethod1()
         {
@@ -29,11 +35,9 @@

             if (CardManager.Instance.Cards.Count<Card>() > 0)
             {
-                int anyValidCardID = CardManager.Instance.Cards.First<Card>().CardID;
-
                 foreach (int id in new int[] { 0, 1, 2, 3, 4 })
                 {
-                    TestCardRecord test = new TestCardRecord(id, anyValidCardID);
+                    TestCardRecord test = new TestCardRecord(id, assumeValidCardID);
                     Assert.IsTrue(test.CardRecordID == id, "Invalid Constructor Setter for CardRecordID: " + id);
                 }
             }
@@ -63,10 +67,9 @@
             {
                 Assert.Fail("Unable to run the test case, no valid card");
             }
-            int validCardRecordID = 0; // assume 0 is always valid
             foreach (Card card in CardManager.Instance.Cards)
             {
-                TestCardRecord test = new TestCardRecord(validCardRecordID, card.CardID);
+                TestCardRecord test = new TestCardRecord(assumeValidCardRecordID, card.CardID);
                 Assert.IsTrue(test.CardID == card.CardID, "Invalid Constructor Setter for CardRecordID: " + card.CardID);
             }
         }
@@ -76,10 +79,9 @@
         {
             Assert.IsNotNull(CardManager.Instance);
             Assert.IsNotNull(CardManager.Instance.Cards);
-            int invalidID = int.MinValue; // assume this ID is always invalid
             try
             {
-                new TestCardRecord(0, invalidID);
+                new TestCardRecord(0, assumeInvalidCardID);
                 Assert.Fail("CardRecord should created with an invalid CardID");
             } catch (Exception)
             {
@@ -95,10 +97,9 @@
             {
                 Assert.Fail("Unable to run the test case, no valid card");
             }
-            int validCardRecordID = 0; // assume 0 is always valid
             foreach (Card card in CardManager.Instance.Cards)
             {
-                TestCardRecord test = new TestCardRecord(validCardRecordID, card.CardID);
+                TestCardRecord test = new TestCardRecord(assumeValidCardRecordID, card.CardID);
                 Assert.IsTrue(test.Card == card, "Invalid Card getter for " + card.CardID);
             }
         }
@@ -155,16 +156,14 @@

                 Assert.IsNotNull(CardManager.Instance);
                 Assert.IsNotNull(CardManager.Instance.Cards);
-                bool hasCards = false;
-                int validCardRecordID = 0; // assume 0 is always valid
+                if (CardManager.Instance.Cards.Count() == 0)
+                {
+                    Assert.Fail("Unable to run the test case, no valid card");
+                }
+
                 foreach (Card card in CardManager.Instance.Cards)
                 {
-                    hasCards = true;
-                    new TestCardRecord(validCardRecordID, card.CardID);
-                }
-                if (!hasCards)
-                {
-                    Assert.Fail("Unable to run the test case, no valid card");
+                    new TestCardRecord(assumeValidCardRecordID, card.CardID);
                 }
             }
             catch (Exception)
@@ -178,9 +177,7 @@
         {
             try
             {
-                int invalidCardID = int.MinValue; // assume int.MinValue is always invalid
-                int invalidCardRecordID = int.MinValue; // assume int.MinValue is always invalid
-                new TestCardRecord(invalidCardRecordID, invalidCardID);
+                new TestCardRecord(assumeInvalidCardRecordID, assumeInvalidCardID);
                 Assert.Fail("An invalid CardRecord should not be created");
             }
             catch (Exception)


ISearchResult: make indentaion relative. Add bottom margin to split results from each other.

--- Joinrpg/Views/Shared/DisplayTemplates/ISearchResult.cshtml
+++ Joinrpg/Views/Shared/DisplayTemplates/ISearchResult.cshtml
@@ -7,7 +7,8 @@

@@ -15,22 +16,21 @@

         @{
-            var gameObjectLinkViewModel = Model.SearchResult.AsObjectLink();
+          var gameObjectLinkViewModel = Model.SearchResult.AsObjectLink();
         }
         @Html.DisplayFor(model => gameObjectLinkViewModel)

-

+

         @{
-          string descriptionToShow = (Model.SearchResult.Description.ToPlainText() ?? "");
+          string descriptionToShow = Model.SearchResult.Description.ToPlainText();

           const int maxLengthToShow = 200;
           descriptionToShow = StringFormatHelper.TruncateString(descriptionToShow, Model.SearchTarget, maxLengthToShow);

           descriptionToShow = Regex.Replace(
-            descriptionToShow,
-            Model.SearchTarget,
-            "" + Model.SearchTarget + "", RegexOptions.IgnoreCase);
-
+              descriptionToShow,
+              Model.SearchTarget,
+              "" + Model.SearchTarget + "", RegexOptions.IgnoreCase);
         }
         @Html.Raw(descriptionToShow)


Removed a hard-coded path that wasn't used - but it being gone should cause a little less confusion!

--- LINQToTTree/LINQToTTreeLib.Tests/TTreeQueryExecutorTest.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/TTreeQueryExecutorTest.cs
@@ -155,7 +155,7 @@
         /// </summary>
         public class ntuple_with_proxy
         {
-            public static string _gProxyFile = @"C:\Users\gwatts\Documents\ATLAS\Code\LINQtoROOT\DemosAndTests\GenerateNtupleXMLSpec\ntuple_btag.h";
+            public static string _gProxyFile;
         }

         /// <summary>


Found bug in the way the root object was being cached. No real test at this level to check that yet. :(

--- LINQToTTree/LINQToTTreeLib/TranslatingExpressionVisitor.cs
+++ LINQToTTree/LINQToTTreeLib/TranslatingExpressionVisitor.cs
@@ -220,7 +220,7 @@
             /// Ok, at this point we are ready to start rebuilding the array access
             ///

-            var targetArray = Expression.MakeMemberAccess(TranslateRootObject(memberAccessArray, translateAttribute.TargetClassType), targetMemberInfo);
+            var targetArray = Expression.MakeMemberAccess(TranslateRootObject(memberAccessArray.Expression, translateAttribute.TargetClassType), targetMemberInfo);
             var arrayLookup = Expression.MakeBinary(ExpressionType.ArrayIndex, targetArray, arrayIndexOperation.Right);

             return arrayLookup;


Lucene.Net.Search.ConjunctionScorer refactor: renamed private/internal fields camelCase

--- src/Lucene.Net.Core/Search/ConjunctionScorer.cs
+++ src/Lucene.Net.Core/Search/ConjunctionScorer.cs
@@ -53,11 +53,11 @@

         private class ComparatorAnonymousInnerClassHelper : IComparer<DocsAndFreqs>
         {
-            private readonly ConjunctionScorer OuterInstance;
+            private readonly ConjunctionScorer outerInstance;

             public ComparatorAnonymousInnerClassHelper(ConjunctionScorer outerInstance)
             {
-                this.OuterInstance = outerInstance;
+                this.outerInstance = outerInstance;
             }

             public virtual int Compare(DocsAndFreqs o1, DocsAndFreqs o2)


fix: set hint path

fix: set hint path

--- src/Marten/MartenServiceCollectionExtensions.cs
+++ src/Marten/MartenServiceCollectionExtensions.cs
@@ -54,7 +54,7 @@
             string path = AppContext.BaseDirectory.ToFullPath();
             if (hintPath.IsNotEmpty())
             {
-                path.AppendPath(hintPath).ToFullPath();
+                path = path.AppendPath(hintPath).ToFullPath();
             }
             else
             {


Lazily initialize DefaultHttpContext

Lazily initialize DefaultHttpContext

Lazily initialize sub objects of DefaultHttpContext

Resolves #470

--- src/Microsoft.AspNet.Http/DefaultHttpContext.cs
+++ src/Microsoft.AspNet.Http/DefaultHttpContext.cs
@@ -18,8 +18,8 @@
     {
         private readonly HttpRequest _request;
         private readonly HttpResponse _response;
-        private readonly ConnectionInfo _connection;
-        private readonly AuthenticationManager _authenticationManager;
+        private ConnectionInfo _connection;
+        private AuthenticationManager _authenticationManager;

         private IItemsFeature _items;
         private IServiceProvidersFeature _serviceProviders;
@@ -43,8 +43,6 @@
             _features = features;
             _request = new DefaultHttpRequest(this, features);
             _response = new DefaultHttpResponse(this, features);
-            _connection = new DefaultConnectionInfo(features);
-            _authenticationManager = new DefaultAuthenticationManager(features);
         }

         void IFeatureCache.CheckFeaturesRevision()
@@ -133,9 +131,29 @@

         public override HttpResponse Response { get { return _response; } }

-        public override ConnectionInfo Connection { get { return _connection; } }
-
-        public override AuthenticationManager Authentication { get { return _authenticationManager; } }
+        public override ConnectionInfo Connection
+        {
+            get
+            {
+                if (_connection == null)
+                {
+                    _connection = new DefaultConnectionInfo(_features);
+                }
+                return _connection;
+            }
+        }
+
+        public override AuthenticationManager Authentication
+        {
+            get
+            {
+                if (_authenticationManager == null)
+                {
+                    _authenticationManager = new DefaultAuthenticationManager(_features);
+                }
+                return _authenticationManager;
+            }
+        }

         public override ClaimsPrincipal User
         {


Fix case where tab completion is not at end of command

--- src/Microsoft.PowerShell.Linux.Host/readline.cs
+++ src/Microsoft.PowerShell.Linux.Host/readline.cs
@@ -84,6 +84,11 @@
         /// To keep track of whether we have hit "enter" key since last arrow up/down key
         /// </summary>
         private bool newHistory = false;
+
+        /// <summary>
+        /// Save buffer at time we hit <tab>
+        /// </summary>
+        private string preTabBuffer;

         /// <summary>
         /// Initializes a new instance of the ConsoleReadLine class.
@@ -235,7 +240,8 @@
             //if the buffer has been modified in any way, get the new command completion
             if (previousKeyPress.Key != ConsoleKey.Tab)
             {
-                cmdCompleteOpt = CommandCompletion.CompleteInput(this.buffer.ToString(), this.current, options, powershell);
+                this.preTabBuffer = this.buffer.ToString();
+                cmdCompleteOpt = CommandCompletion.CompleteInput(this.preTabBuffer, this.current, options, powershell);
             }

             if (cmdCompleteOpt.CompletionMatches.Count == 0)
@@ -263,24 +269,24 @@
             if (!String.IsNullOrEmpty(tabResult))
             {
                 var replaceIndex = cmdCompleteOpt.ReplacementIndex;
-                string replaceBuffer = this.buffer.ToString();
+                string replaceBuffer = this.preTabBuffer;

                 if (replaceBuffer.Length < replaceIndex)
                 {
-                    replaceIndex = replaceBuffer.Length;
+                    // something is wrong
+                    return;
                 }

                 if (replaceBuffer.Length == replaceIndex)
                 {
-                    tabResult = replaceBuffer + tabResult;
+                    replaceBuffer = replaceBuffer + tabResult;
                 }
                 else
                 {
-                    replaceBuffer = replaceBuffer.Remove(replaceIndex);
-                    tabResult = replaceBuffer + tabResult;
-                }
-
-                BufferFromString(tabResult);
+                    replaceBuffer = replaceBuffer.Remove(replaceIndex, cmdCompleteOpt.ReplacementLength).Insert(replaceIndex, tabResult);
+}
+
+                BufferFromString(replaceBuffer);
                 this.Render();

                 if (moveLeftOneSpace)


Lock on the right variable. Patch from karthik.

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

--- src/MonoTorrent/MonoTorrent.Client/NetworkIO.cs
+++ src/MonoTorrent/MonoTorrent.Client/NetworkIO.cs
@@ -97,7 +97,7 @@

         public static int HalfOpens
         {
-            get { lock (connects) return connects.Count; }
+            get { lock (locker) return connects.Count; }
         }

         static NetworkIO()


Go bananas again

Go bananas again

--- src/Nardax.UnitTests/DateTimeExtensionsTests.cs
+++ src/Nardax.UnitTests/DateTimeExtensionsTests.cs
@@ -24,7 +24,12 @@
             var timespan = new TimeSpan(0, 1, 0, 0);

             var actualDateTime = _date.Floor(timespan);
-
+            hmjghkjhknm,
+            hjjjjjjjjjjjjj åä'¨¨cvbcvb
+
+
+
+                '
             Assert.AreEqual(expectedDateTime, actualDateTime);
         }


Comment the security check so it's obvious what its for.

--- src/NuGetGallery/Controllers/PagesController.cs
+++ src/NuGetGallery/Controllers/PagesController.cs
@@ -18,6 +18,7 @@
         // This will let you add 'static' cshtml pages to the site under View/Pages or Branding/Views/Pages
         public virtual ActionResult Page(string pageName)
         {
+            // Prevent traversal attacks and serving non-pages by disallowing ., /, %, and more!
             if (pageName == null || pageName.Any(c => !Char.IsLetterOrDigit(c)))
             {
                 return HttpNotFound();


removed unintentional double (copy-paste?)

--- src/OpenSage.Game/Terrain/Roads/TextureAtlas.cs
+++ src/OpenSage.Game/Terrain/Roads/TextureAtlas.cs
@@ -81,14 +81,7 @@
                     halfRoadWidth,
                     MathUtility.ToRadians(30)));

-            _coordinates.Add(
-                RoadTextureType.BroadCurve,
-                TextureCoordinates.Curve(
-                    TileCenter(0),
-                    halfRoadWidth,
-                    MathUtility.ToRadians(30)));
-
-            // TODO: TightCurve, SymmetricY, Join
+            // TODO: TightCurve, Join
         }

         /// <summary>


Optimized GetTableReference and TablePayloadFormat.JsonNoMetadata.

--- src/Orleans/AzureUtils/AzureTableDataManager.cs
+++ src/Orleans/AzureUtils/AzureTableDataManager.cs
@@ -55,7 +55,7 @@
         /// <summary> Connection string for the Azure storage account used to host this table. </summary>
         protected string ConnectionString { get; set; }

-        private readonly CloudTableClient tableOperationsClient;
+        private CloudTable tableReference;

         private readonly CounterStatistic numServerBusy = CounterStatistic.FindOrCreate(StatisticNames.AZURE_SERVER_BUSY, true);

@@ -72,7 +72,6 @@
             ConnectionString = storageConnectionString;

             AzureStorageUtils.ValidateTableName(tableName);
-            tableOperationsClient = GetCloudTableOperationsClient();
         }

         /// <summary>
@@ -87,17 +86,20 @@
             try
             {
                 CloudTableClient tableCreationClient = GetCloudTableCreationClient();
-                CloudTable tableReference = tableCreationClient.GetTableReference(TableName);
+                CloudTable tableRef = tableCreationClient.GetTableReference(TableName);
                 bool didCreate = await Task<bool>.Factory.FromAsync(
-                     tableReference.BeginCreateIfNotExists,
-                     tableReference.EndCreateIfNotExists,
+                     tableRef.BeginCreateIfNotExists,
+                     tableRef.EndCreateIfNotExists,
                      null);

                 Logger.Info(ErrorCode.AzureTable_01, "{0} Azure storage table {1}", (didCreate ? "Created" : "Attached to"), TableName);

-                await InitializeTableSchemaFromEntity(tableCreationClient);
+                await InitializeTableSchemaFromEntity(tableRef);

                 Logger.Info(ErrorCode.AzureTable_36, "Initialized schema for Azure storage table {0}", TableName);
+
+                CloudTableClient tableOperationsClient = GetCloudTableOperationsClient();
+                tableReference = tableOperationsClient.GetTableReference(TableName);
             }
             catch (Exception exc)
             {
@@ -163,7 +165,6 @@
                 // svc.AddObject(TableName, data);
                 // SaveChangesOptions.None

-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                 try
                 {
                     // Presumably FromAsync(BeginExecute, EndExecute) has a slightly better performance then CreateIfNotExistsAsync.
@@ -201,11 +202,10 @@

             try
             {
-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                 try
                 {
                     // WAS:
-                    // svc.AttachTo(TableName, data, ANY_ETAG);
+                    // svc.AttachTo(TableName, data, null);
                     // svc.UpdateObject(data);
                     // SaveChangesOptions.ReplaceOnUpdate,

@@ -251,7 +251,6 @@
                     // svc.AttachTo(TableName, data, ANY_ETAG);
                     // svc.UpdateObject(data);

-                    CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                     data.ETag = eTag;
                     // Merge requires an ETag (which may be the '*' wildcard).
                     var opResult = await Task<TableResult>.Factory.FromAsync(
@@ -291,7 +290,6 @@
             {
                 try
                 {
-                    CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                     data.ETag = dataEtag;

                     var opResult = await Task<TableResult>.Factory.FromAsync(
@@ -328,8 +326,7 @@
             if (Logger.IsVerbose2) Logger.Verbose2("{0} table {1}  entry {2}", operation, TableName, data);

             try
-            {
-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
+            {
                 data.ETag = eTag;

                 try
@@ -371,8 +368,6 @@
             {
                 try
                 {
-                    CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
-
                     TableResult retrievedResult = await Task<TableResult>.Factory.FromAsync(
                         tableReference.BeginExecute,
                         tableReference.EndExecute,
@@ -430,30 +425,29 @@
         /// </summary>
         /// <param name="list">List of data entries and their corresponding etags to be deleted from the table.</param>
         /// <returns>Completion promise for this storage operation.</returns>
-        public async Task DeleteTableEntriesAsync(IReadOnlyCollection<Tuple<T, string>> list)
+        public async Task DeleteTableEntriesAsync(IReadOnlyCollection<Tuple<T, string>> collection)
         {
             const string operation = "DeleteTableEntries";
             var startTime = DateTime.UtcNow;
-            if (Logger.IsVerbose2) Logger.Verbose2("Deleting {0} table entries: {1}", TableName, Utils.EnumerableToString(list));
-
-            if (list == null) throw new ArgumentNullException("list");
-
-            if (list.Count > AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
-            {
-                throw new ArgumentOutOfRangeException("data", list.Count,
+            if (Logger.IsVerbose2) Logger.Verbose2("Deleting {0} table entries: {1}", TableName, Utils.EnumerableToString(collection));
+
+            if (collection == null) throw new ArgumentNullException("list");
+
+            if (collection.Count > AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
+            {
+                throw new ArgumentOutOfRangeException("collection", collection.Count,
                         "Too many rows for bulk delete - max " + AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS);
             }

-            if (list == null || !list.Any())
+            if (collection.Count == 0)
             {
                 return;
             }

             try
             {
-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                 var entityBatch = new TableBatchOperation();
-                foreach (var tuple in list)
+                foreach (var tuple in collection)
                 {
                     // WAS:
                     // svc.AttachTo(TableName, tuple.Item1, tuple.Item2);
@@ -476,7 +470,7 @@
                 {
                     Logger.Warn(ErrorCode.AzureTable_08,
                         String.Format("Intermediate error deleting entries {0} from the table {1}.",
-                            Utils.EnumerableToString(list), TableName), exc);
+                            Utils.EnumerableToString(collection), TableName), exc);
                     throw;
                 }
             }
@@ -498,7 +492,6 @@

             try
             {
-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                 TableQuery<T> cloudTableQuery = tableReference.CreateQuery<T>().Where(predicate).AsTableQuery();
                 try
                 {
@@ -550,18 +543,23 @@
         /// </summary>
         /// <param name="list">List of data entries to be inserted into the table.</param>
         /// <returns>Completion promise for this storage operation.</returns>
-        public async Task BulkInsertTableEntries(IReadOnlyCollection<T> data)
+        public async Task BulkInsertTableEntries(IReadOnlyCollection<T> collection)
         {
             const string operation = "BulkInsertTableEntries";
-            if (data == null) throw new ArgumentNullException("data");
-            if (data.Count > AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
-            {
-                throw new ArgumentOutOfRangeException("data", data.Count,
+            if (collection == null) throw new ArgumentNullException("data");
+            if (collection.Count > AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
+            {
+                throw new ArgumentOutOfRangeException("data", collection.Count,
                         "Too many rows for bulk update - max " + AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS);
             }

-            var startTime = DateTime.UtcNow;
-            if (Logger.IsVerbose2) Logger.Verbose2("Bulk inserting {0} entries to {1} table", data.Count, TableName);
+            if (collection.Count == 0)
+            {
+                return;
+            }
+
+            var startTime = DateTime.UtcNow;
+            if (Logger.IsVerbose2) Logger.Verbose2("Bulk inserting {0} entries to {1} table", collection.Count, TableName);

             try
             {
@@ -573,9 +571,8 @@
                 // SaveChangesOptions.None == Insert-or-merge operation, SaveChangesOptions.Batch == Batch transaction
                 // http://msdn.microsoft.com/en-us/library/hh452241.aspx

-                CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                 var entityBatch = new TableBatchOperation();
-                foreach (T entry in data)
+                foreach (T entry in collection)
                 {
                     entityBatch.Insert(entry);
                 }
@@ -595,7 +592,7 @@
                 catch (Exception exc)
                 {
                     Logger.Warn(ErrorCode.AzureTable_37, String.Format("Intermediate error bulk inserting {0} entries in the table {1}",
-                        data.Count, TableName), exc);
+                        collection.Count, TableName), exc);

                     var dsre = exc.GetBaseException() as DataServiceRequestException;
                     if (dsre != null)
@@ -613,7 +610,7 @@

                 // Bulk insert failed, so try to insert rows one by one instead
                 var promises = new List<Task>();
-                foreach (T entry in data)
+                foreach (T entry in collection)
                 {
                     promises.Add(CreateTableEntryAsync(entry));
                 }
@@ -649,7 +646,6 @@
                     // EntityDescriptor dataResult = svc.GetEntityDescriptor(data);
                     // return dataResult.ETag;

-                    CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                     var entityBatch = new TableBatchOperation();
                     entityBatch.Add(TableOperation.Insert(data1));
                     data2.ETag = data2Etag;
@@ -700,7 +696,6 @@
                     // EntityDescriptor dataResult = svc.GetEntityDescriptor(data);
                     // return dataResult.ETag;

-                    CloudTable tableReference = tableOperationsClient.GetTableReference(TableName);
                     var entityBatch = new TableBatchOperation();
                     data1.ETag = data1Etag;
                     entityBatch.Add(TableOperation.Replace(data1));
@@ -743,6 +738,8 @@
                 CloudTableClient operationsClient = storageAccount.CreateCloudTableClient();
                 operationsClient.DefaultRequestOptions.RetryPolicy = AzureTableDefaultPolicies.TableOperationRetryPolicy;
                 operationsClient.DefaultRequestOptions.ServerTimeout = AzureTableDefaultPolicies.TableOperationTimeout;
+                // Values supported can be AtomPub, Json, JsonFullMetadata or JsonNoMetadata with Json being the default value
+                operationsClient.DefaultRequestOptions.PayloadFormat = TablePayloadFormat.JsonNoMetadata;
                 return operationsClient;
             }
             catch (Exception exc)
@@ -757,10 +754,12 @@
             try
             {
                 CloudStorageAccount storageAccount = AzureStorageUtils.GetCloudStorageAccount(ConnectionString);
-                CloudTableClient client = storageAccount.CreateCloudTableClient();
-                client.DefaultRequestOptions.RetryPolicy = AzureTableDefaultPolicies.TableCreationRetryPolicy;
-                client.DefaultRequestOptions.ServerTimeout = AzureTableDefaultPolicies.TableCreationTimeout;
-                return client;
+                CloudTableClient creationClient = storageAccount.CreateCloudTableClient();
+                creationClient.DefaultRequestOptions.RetryPolicy = AzureTableDefaultPolicies.TableCreationRetryPolicy;
+                creationClient.DefaultRequestOptions.ServerTimeout = AzureTableDefaultPolicies.TableCreationTimeout;
+                // Values supported can be AtomPub, Json, JsonFullMetadata or JsonNoMetadata with Json being the default value
+                creationClient.DefaultRequestOptions.PayloadFormat = TablePayloadFormat.JsonNoMetadata;
+                return creationClient;
             }
             catch (Exception exc)
             {
@@ -770,7 +769,7 @@
         }

         // Based on: http://blogs.msdn.com/b/cesardelatorre/archive/2011/03/12/typical-issue-one-of-the-request-inputs-is-not-valid-when-working-with-the-wa-development-storage.aspx
-        private async Task InitializeTableSchemaFromEntity(CloudTableClient tableClient)
+        private async Task InitializeTableSchemaFromEntity(CloudTable tableRef)
         {
             const string operation = "InitializeTableSchemaFromEntity";
             var startTime = DateTime.UtcNow;
@@ -801,12 +800,11 @@
                 // svc.AddObject(TableName, entity);
                 // SaveChangesOptions.None,

-                CloudTable tableReference = tableClient.GetTableReference(TableName);
                 try
                 {
                     await Task<TableResult>.Factory.FromAsync(
-                        tableReference.BeginExecute,
-                        tableReference.EndExecute,
+                        tableRef.BeginExecute,
+                        tableRef.EndExecute,
                         TableOperation.Insert(entity),
                         null);
                 }
@@ -823,8 +821,8 @@
                     // SaveChangesOptions.None,

                     await Task<TableResult>.Factory.FromAsync(
-                        tableReference.BeginExecute,
-                        tableReference.EndExecute,
+                        tableRef.BeginExecute,
+                        tableRef.EndExecute,
                         TableOperation.Delete(entity),
                         null);
                 }


parsing phar files - includes phar entries

needs to update phar parser to recognize File/Directory entries properly

--- src/Peachpie.CodeAnalysis/Utilities/AstUtils.cs
+++ src/Peachpie.CodeAnalysis/Utilities/AstUtils.cs
@@ -167,7 +167,7 @@
         public static bool IsCompileEntry(this Devsense.PHP.Phar.Entry entry)
         {
             // TODO: what entries will be compiled?
-            if (!entry.IsFile)
+            if (entry.IsDirectory)
             {
                 return false;
             }
@@ -175,6 +175,11 @@
             if (entry.Name.EndsWith(".php"))
             {
                 return true;
+            }
+
+            if (string.IsNullOrEmpty(entry.Code))
+            {
+                return false;
             }

             var ext = System.IO.Path.GetExtension(entry.Name);


1462: field refactor

1462: field refactor

--- src/PixelFarm/BackEnd.Tesselate/MaxFirstList.cs
+++ src/PixelFarm/BackEnd.Tesselate/MaxFirstList.cs
@@ -30,68 +30,64 @@
     class MaxFirstList<T>
       where T : IComparable<T>
     {
-        List<RefItem<T>> innerList = new List<RefItem<T>>();
-        bool isSorted = false;
+        List<RefItem<T>> _innerList = new List<RefItem<T>>();
+        bool _isSorted = false;
         public MaxFirstList()
         {
         }
-        public bool IsEmpty
-        {
-            get
-            {
-                return innerList.Count == 0;
-            }
-        }
+        //
+        public bool IsEmpty => _innerList.Count == 0;
+        //
         static int MaxFirstSort(RefItem<T> t1, RefItem<T> t2)
         {
             return t2.Data.CompareTo(t1.Data);
         }
         void SortData()
         {
-            innerList.Sort(MaxFirstSort);
-            for (int i = innerList.Count - 1; i >= 0; --i)
+            _innerList.Sort(MaxFirstSort);
+            for (int i = _innerList.Count - 1; i >= 0; --i)
             {
-                innerList[i].NodeNumber = i;
+                _innerList[i].NodeNumber = i;
             }
-            isSorted = true;
+            _isSorted = true;
         }
         public T DeleteMin()
         {
             //find min and delete
-            if (!isSorted)
+            if (!_isSorted)
             {
                 SortData();
             }
-            int last = innerList.Count - 1;
-            var tmp = innerList[last];
-            innerList.RemoveAt(last);
+            int last = _innerList.Count - 1;
+            var tmp = _innerList[last];
+            _innerList.RemoveAt(last);
             return tmp.Data;
         }
         public T FindMin()
         {
-            if (!isSorted)
+            if (!_isSorted)
             {
                 SortData();
             }
-            return innerList[innerList.Count - 1].Data;
+            return _innerList[_innerList.Count - 1].Data;
         }
         public void Add(out RefItem<T> refItem, T data)
         {
             RefItem<T> item = new RefItem<T>(data);
-            innerList.Add(item);
-            isSorted = false;
+            _innerList.Add(item);
+            _isSorted = false;
             refItem = item;
         }
         public void Add(T data)
         {
             RefItem<T> item = new RefItem<T>(data);
-            innerList.Add(item);
-            isSorted = false;
+            _innerList.Add(item);
+            _isSorted = false;
         }
         int BinSearch(RefItem<T> refItem, int begin, int end)
         {
             int pos = begin + ((end - begin) / 2);
-            RefItem<T> sample = innerList[pos];
+            RefItem<T> sample = _innerList[pos];
             if (refItem == sample)
             {
             }
@@ -125,24 +121,24 @@
         {
             //delete specfic node

-            if (isSorted)
+            if (_isSorted)
             {
                 //use binary search to find node
                 //1. find middle point
                 int removeAt = refItem.NodeNumber;
-                for (int i = innerList.Count - 1; i > removeAt; --i)
+                for (int i = _innerList.Count - 1; i > removeAt; --i)
                 {
-                    innerList[i].NodeNumber = i - 1;
+                    _innerList[i].NodeNumber = i - 1;
                 }
-                innerList.RemoveAt(removeAt);
+                _innerList.RemoveAt(removeAt);
             }
             else
             {
-                for (int i = innerList.Count - 1; i >= 0; --i)
+                for (int i = _innerList.Count - 1; i >= 0; --i)
                 {
-                    if (innerList[i] == refItem)
+                    if (_innerList[i] == refItem)
                     {
-                        this.innerList.RemoveAt(i);
+                        this._innerList.RemoveAt(i);
                         break;
                     }
                 }


Remove temporary directory when done

Remove temporary directory when done

--- src/Platinum.Database/DbConfigScriptProvider.cs
+++ src/Platinum.Database/DbConfigScriptProvider.cs
@@ -132,7 +132,7 @@
              */
             try
             {
-                // Directory.Delete( tmp, true );
+                Directory.Delete( tmp, true );
             }
             catch ( Exception ex )
             {


Add BitChoiceOption component Documentation Comments (#561)

--- src/Client/Web/Bit.Client.Web.BlazorUI/Components/Inputs/BitChoiceOption.razor.cs
+++ src/Client/Web/Bit.Client.Web.BlazorUI/Components/Inputs/BitChoiceOption.razor.cs
@@ -10,12 +10,24 @@
     {
         private bool isChecked;

+        /// <summary>
+        /// ChoiceOption content, It can be a text
+        /// </summary>
         [Parameter] public string? Text { get; set; }

+        /// <summary>
+        /// This value is used to group each ChoiceGroupOption into the same logical ChoiceGroup
+        /// </summary>
         [Parameter] public string? Name { get; set; }

+        /// <summary>
+        /// Value of selected ChoiceOption
+        /// </summary>
         [Parameter] public string? Value { get; set; }

+        /// <summary>
+        /// Whether or not the option is checked
+        /// </summary>
         [Parameter]
         public bool IsChecked
         {
@@ -27,8 +39,14 @@
             }
         }

+        /// <summary>
+        /// Callback for when the ChoiceOption clicked
+        /// </summary>
         [Parameter] public EventCallback<MouseEventArgs> OnClick { get; set; }

+        /// <summary>
+        /// Callback for when the option has been changed
+        /// </summary>
         [Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }

         [CascadingParameter] protected BitChoiceGroup? ChoiceGroup { get; set; }


Add another test.

Add another test.

--- src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs
+++ src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs
@@ -84,7 +84,7 @@
             var destinationDocumentText = @"class Class1 { }";

             await TestMoveTypeToNewFileAsync(
-                code, codeAfterMove, expectedDocumentName,
+                code, codeAfterMove, expectedDocumentName,
                 destinationDocumentText, destinationDocumentContainers: ImmutableArray.Create("A", "B"));
         }

@@ -115,7 +115,7 @@
         [WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsMoveType)]
         public async Task MoveTypeWithNoContainerNamespace()
         {
-            var code =
+            var code =
 @"[||]class Class1 { }
 class Class2 { }";
             var codeAfterMove = @"class Class2 { }";
@@ -143,7 +143,7 @@
 class Class2 { }";

             var expectedDocumentName = "Class1.cs";
-            var destinationDocumentText =
+            var destinationDocumentText =
 @"class Class1 { }";

             await TestMoveTypeToNewFileAsync(code, codeAfterMove, expectedDocumentName, destinationDocumentText);
@@ -968,8 +968,8 @@

 }
 #endif";
-var codeAfterMove =
-@"using System;
+            var codeAfterMove =
+            @"using System;

 namespace N
 {
@@ -996,5 +996,63 @@
             await TestMoveTypeToNewFileAsync(
                 code, codeAfterMove, expectedDocumentName, destinationDocumentText, ignoreTrivia: false);
         }
+
+        [WorkItem(17930, "https://github.com/dotnet/roslyn/issues/17930")]
+        [WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsMoveType)]
+        public async Task MoveTypeWithDirectives2()
+        {
+            var code =
+@"using System;
+
+namespace N
+{
+    class Program
+    {
+        static void Main()
+        {
+        }
+
+#if true
+        public class [||]Inner
+        {
+
+        }
+#endif
+    }
+}";
+            var codeAfterMove =
+            @"using System;
+
+namespace N
+{
+    partial class Program
+    {
+        static void Main()
+        {
+        }
+
+#if true
+#endif
+    }
+}";
+
+            var expectedDocumentName = "Inner.cs";
+            var destinationDocumentText =
+@"namespace N
+{
+    partial class Program
+    {
+#if true
+        public class Inner
+        {
+
+        }
+#endif
+    }
+}";
+
+            await TestMoveTypeToNewFileAsync(
+                code, codeAfterMove, expectedDocumentName, destinationDocumentText, ignoreTrivia: false);
+        }
     }
 }


Put the dark theme colors into code to make it easy to switch between the two.

--- src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs
+++ src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs
@@ -1,4 +1,6 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
+
+// #define dark_theme

 using System.ComponentModel.Composition;
 using System.Diagnostics.CodeAnalysis;
@@ -344,6 +346,24 @@
         #endregion

         #region Regex - Comment
+
+
+#if dark_theme
+        private static readonly Color s_regexTextColor = Color.FromRgb(0xd6, 0x9d, 0x85);
+        private static readonly Color s_regexOtherEscapeColor = Color.FromRgb(0xff, 0xd6, 0x8f);
+        private static readonly Color s_regexGroupingAndAlternationColor = Color.FromRgb(0x05, 0xc3, 0xba);
+        private static readonly Color s_characterClassColor = Color.FromRgb(0x00, 0x8a, 0xff);
+        private static readonly Color s_regexAnchorAndQuantifierColor = Color.FromRgb(0xd7, 0x45, 0x8c);
+        private static readonly Color s_regexCommentColor = Color.FromRgb(87, 166, 74);
+#else
+        private static readonly Color s_regexTextColor = Color.FromRgb(0x80, 0x00, 0x00);
+        private static readonly Color s_regexOtherEscapeColor = Color.FromRgb(0x9e, 0x5b, 0x71);
+        private static readonly Color s_regexGroupingAndAlternationColor = Color.FromRgb(0x05, 0xc3, 0xba);
+        private static readonly Color s_characterClassColor = Color.FromRgb(0x00, 0x73, 0xff);
+        private static readonly Color s_regexAnchorAndQuantifierColor = Color.FromRgb(0xff, 0x00, 0xc1);
+        private static readonly Color s_regexCommentColor = Color.FromRgb(0, 128, 0);
+#endif
+
         [Export(typeof(EditorFormatDefinition))]
         [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexComment)]
         [Name(ClassificationTypeNames.RegexComment)]
@@ -356,7 +376,7 @@
             private RegexCommentFormatDefinition()
             {
                 this.DisplayName = EditorFeaturesWpfResources.Regex_Comment;
-                this.ForegroundColor = Color.FromRgb(0, 128, 0);
+                this.ForegroundColor = s_regexCommentColor;
             }
         }

@@ -372,13 +392,9 @@
             private RegexCharacterClassFormatDefinition()
             {
                 this.DisplayName = EditorFeaturesWpfResources.Regex_Character_class;
-                this.ForegroundColor = Color.FromRgb(0x00, 0x73, 0xff);
-            }
-        }
-
-        private static readonly Color s_regexAnchorAndQuantifierColor = Color.FromRgb(0xff, 0x00, 0xc1);
-        private static readonly Color s_regexGroupingAndAlternationColor = Color.FromRgb(0x05, 0xc3, 0xba);
-        private static readonly Color s_regexTextColor = Color.FromRgb(0x80, 0x00, 0x00);
+                this.ForegroundColor = s_characterClassColor;
+            }
+        }

         [Export(typeof(EditorFormatDefinition))]
         [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexAnchor)]
@@ -489,7 +505,7 @@
             private RegexOtherEscapeFormatDefinition()
             {
                 this.DisplayName = EditorFeaturesWpfResources.Regex_OtherEscape;
-                this.ForegroundColor = Color.FromRgb(0x9e, 0x5b, 0x71);
+                this.ForegroundColor = s_regexOtherEscapeColor;
             }
         }
 #endregion


Delete AddReflectionFieldMapEntryDependencies (#5157)

This is unused. Should have deleted this in #5146.

--- src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ReflectionFieldMapNode.cs
+++ src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ReflectionFieldMapNode.cs
@@ -44,47 +44,6 @@
         public override bool StaticDependenciesAreComputed => true;

         protected override string GetName(NodeFactory factory) => this.GetMangledName(factory.NameMangler);
-
-        /// <summary>
-        /// Helper method to compute the dependencies that would be needed for reflection field lookup.
-        /// </summary>
-        public static void AddReflectionFieldMapEntryDependencies(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
-        {
-            if (!factory.MetadataManager.SupportsReflection)
-                return;
-
-            // TODO: https://github.com/dotnet/corert/issues/3224
-            // Reflection static field bases handling is here because in the current reflection model we reflection-enable
-            // all fields of types that are compiled. Ideally the list of reflection enabled fields should be known before
-            // we even start the compilation process (with the static bases being compilation roots like any other).
-            if (type is MetadataType && !type.IsCanonicalSubtype(CanonicalFormKind.Any))
-            {
-                MetadataType metadataType = (MetadataType)type;
-
-                // For instantiated types, we write the static fields offsets directly into the table, and we do not reference the gc/non-gc statics nodes
-                if (!type.HasInstantiation)
-                {
-                    if (metadataType.GCStaticFieldSize.AsInt > 0)
-                    {
-                        dependencies.Add(factory.TypeGCStaticsSymbol(metadataType), "GC statics for ReflectionFieldMap entry");
-                    }
-
-                    if (metadataType.NonGCStaticFieldSize.AsInt > 0)
-                    {
-                        dependencies.Add(factory.TypeNonGCStaticsSymbol(metadataType), "Non-GC statics for ReflectionFieldMap entry");
-                    }
-                }
-
-                if (metadataType.ThreadStaticFieldSize.AsInt > 0)
-                {
-                    if (factory.Target.Abi == TargetAbi.ProjectN)
-                    {
-                        dependencies.Add(((UtcNodeFactory)factory).TypeThreadStaticsOffsetSymbol(metadataType), "Thread statics for ReflectionFieldMap entry");
-                    }
-                    // TODO: TLS for CoreRT
-                }
-            }
-        }

         public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
         {


Fix 'Join_same_collection_force_alias_uniquefication' test

--- src/InfoCarrier.Core.EFCore/Client/Query/Internal/InfoCarrierQueryModelVisitor.cs
+++ src/InfoCarrier.Core.EFCore/Client/Query/Internal/InfoCarrierQueryModelVisitor.cs
@@ -166,6 +166,7 @@
             // We need to replace EFC's TransparentIdentifiers with regular anonymous types,
             // otherwise Remote.Linq's serializaion would fail.
             // Additionally we determine and use 'firstParamDelegateType' in ExpressionIsQueryable case.
+            // Also CallCreateTransparentIdentifierLambda ensures uniqueness of TransparentIdentifier lambda parameters.
             var fromExpression
                 = this.CompileAdditionalFromClauseExpression(fromClause, queryModel);

@@ -195,9 +196,8 @@
                     miSelectMany,
                     this.Expression,
                     Expression.Lambda(firstParamDelegateType, fromExpression, this.CurrentParameter),
-                    Expression.Lambda(
-                        CallCreateTransparentIdentifier(
-                            transparentIdentifierType, this.CurrentParameter, innerItemParameter),
+                    CallCreateTransparentIdentifierLambda(
+                        transparentIdentifierType,
                         this.CurrentParameter,
                         innerItemParameter));

@@ -229,6 +229,7 @@
             // https://github.com/aspnet/EntityFramework/blob/1.0.0/src/Microsoft.EntityFrameworkCore/Query/EntityQueryModelVisitor.cs#L765
             // We need to replace EFC's TransparentIdentifiers with regular anonymous types,
             // otherwise Remote.Linq's serializaion would fail.
+            // Also CallCreateTransparentIdentifierLambda ensures uniqueness of TransparentIdentifier lambda parameters.
             var outerKeySelectorExpression
                 = this.ReplaceClauseReferences(joinClause.OuterKeySelector, joinClause);

@@ -264,11 +265,8 @@
                     innerSequenceExpression,
                     Expression.Lambda(outerKeySelectorExpression, this.CurrentParameter),
                     Expression.Lambda(innerKeySelectorExpression, innerItemParameter),
-                    Expression.Lambda(
-                        CallCreateTransparentIdentifier(
-                            transparentIdentifierType,
-                            this.CurrentParameter,
-                            innerItemParameter),
+                    CallCreateTransparentIdentifierLambda(
+                        transparentIdentifierType,
                         this.CurrentParameter,
                         innerItemParameter));

@@ -281,6 +279,7 @@
             // https://github.com/aspnet/EntityFramework/blob/1.0.0/src/Microsoft.EntityFrameworkCore/Query/EntityQueryModelVisitor.cs#L838
             // We need to replace EFC's TransparentIdentifiers with regular anonymous types,
             // otherwise Remote.Linq's serializaion would fail.
+            // Also CallCreateTransparentIdentifierLambda ensures uniqueness of TransparentIdentifier lambda parameters.
             var outerKeySelectorExpression
                 = this.ReplaceClauseReferences(groupJoinClause.JoinClause.OuterKeySelector, groupJoinClause);

@@ -326,15 +325,31 @@
                     innerSequenceExpression,
                     Expression.Lambda(outerKeySelectorExpression, this.CurrentParameter),
                     Expression.Lambda(innerKeySelectorExpression, innerItemParameter),
-                    Expression.Lambda(
-                        CallCreateTransparentIdentifier(
-                            transparentIdentifierType,
-                            this.CurrentParameter,
-                            innerItemsParameter),
+                    CallCreateTransparentIdentifierLambda(
+                        transparentIdentifierType,
                         this.CurrentParameter,
                         innerItemsParameter));

             this.IntroduceTransparentScope(groupJoinClause, queryModel, index, transparentIdentifierType);
+        }
+
+        private static LambdaExpression CallCreateTransparentIdentifierLambda(
+            Type transparentIdentifierType,
+            ParameterExpression outerParameter,
+            ParameterExpression innerParameter)
+        {
+            var uniqueInnerParameter =
+                innerParameter.Name == outerParameter.Name
+                    ? Expression.Parameter(innerParameter.Type, innerParameter.Name + @"_")
+                    : innerParameter;
+
+            return Expression.Lambda(
+                CallCreateTransparentIdentifier(
+                    transparentIdentifierType,
+                    outerParameter,
+                    uniqueInnerParameter),
+                outerParameter,
+                uniqueInnerParameter);
         }

         protected override void IncludeNavigations(


fix: fix XmlCommentsRequestBodyFilter uri not unescaped

--- src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs
+++ src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs
@@ -51,8 +51,8 @@
             foreach (var mediaType in requestBody.Content.Values)
             {
                 var exampleAsJson = (mediaType.Schema?.ResolveType(context.SchemaRepository) == "string")
-                    ? $"\"{exampleNode.InnerXml}\""
-                    : exampleNode.InnerXml;
+                    ? $"\"{exampleNode.ToString()}\""
+                    : exampleNode.ToString();

                 mediaType.Example = OpenApiAnyFactory.CreateFromJson(exampleAsJson);
             }


DocumentOutline should use EditorModel.

DocumentOutline should use EditorModel.

--- src/Codex.Web.Mvc/Views/DocumentOutline/DocumentOutline.cshtml
+++ src/Codex.Web.Mvc/Views/DocumentOutline/DocumentOutline.cshtml
@@ -1,4 +1,4 @@
-@model string
+@model EditorModel

 @if (Model == null)
 {


Extended the possible usage of test pattern attributes to fields; so that [Pending] or [Ignore] may be applied to contract verifiers too.

--- src/Gallio/Gallio/Framework/Pattern/PatternAttributeTargets.cs
+++ src/Gallio/Gallio/Framework/Pattern/PatternAttributeTargets.cs
@@ -27,7 +27,7 @@
         /// <summary>
         /// Valid attribute targets for tests.
         /// </summary>
-        public const AttributeTargets Test = TestAssembly | TestType | TestMethod;
+        public const AttributeTargets Test = TestAssembly | TestType | TestMethod | TestContract;

         /// <summary>
         /// Valid attribute targets for test assemblies.
@@ -69,5 +69,10 @@
         /// Valid attribute targets for contribution methods.
         /// </summary>
         public const AttributeTargets ContributionMethod = AttributeTargets.Method;
+
+        /// <summary>
+        /// Valid attribute targets for test contracts.
+        /// </summary>
+        public const AttributeTargets TestContract = AttributeTargets.Field;
     }
 }


Hide the read name console output

Hide the read name console output

--- src/HL7.Fhir.FluentPath.Tests/Experimentation/NavigatorPOCO.cs
+++ src/HL7.Fhir.FluentPath.Tests/Experimentation/NavigatorPOCO.cs
@@ -82,7 +82,7 @@
                 if (_current != null)
                 {
 #if DEBUG
-                    Console.WriteLine("Read Name: {0} (value = {1})", _current.Name, _current.ActualValue);
+//                    Console.WriteLine("Read Name: {0} (value = {1})", _current.Name, _current.ActualValue);
 #endif
                     return _current.Name;
                 }


Change algorithm to store and map Excel data: using OrdererDictionary for indexing

--- LogFilterApplication/LogFilterApplication/SIDDefinition.cs
+++ LogFilterApplication/LogFilterApplication/SIDDefinition.cs
@@ -2,20 +2,23 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
+using System.Linq;
 using System.Runtime.InteropServices;
 using System.Windows.Forms;
 using Excel = Microsoft.Office.Interop.Excel;
+using System.Collections.Specialized;

 namespace LogFilterApplication
 {
     public class SIDDefinition
     {
-        private Dictionary<string, string> AvailableSIDs = new Dictionary<string, string>();
+        private List<KeyValuePair<string, string>> AvailableSIDs = new List<KeyValuePair<string, string>>();
+        private OrderedDictionary SID_Mapping_Description = new OrderedDictionary();

         /// <summary>
-        /// Method to get AvailableSIDs
+        /// Method SID_Mapping_Description to get AvailableSIDs
         /// </summary>
-        public Dictionary<string, string> GetAvailableSIDs
+        public List<KeyValuePair<string, string>> GetAvailableSIDs
         {
             get
             {
@@ -24,6 +27,21 @@
             set
             {
                 this.AvailableSIDs = value;
+            }
+        }
+
+        /// <summary>
+        /// Method GetSIDMappedDescription to get SID_Mapping_Description
+        /// </summary>
+        public OrderedDictionary GetSIDMappedDescription
+        {
+            get
+            {
+                return this.SID_Mapping_Description;
+            }
+            set
+            {
+                this.SID_Mapping_Description = value;
             }
         }

@@ -46,9 +64,10 @@
             int rowCount = xlRange.Rows.Count;
             int colCount = xlRange.Columns.Count;

+            int nrPos = 0;
             int abbrPos = 0;
+            int descPos = 0;
             int sidPos = 0;
-            int nrPos = 0;

             int rowIndex = 1;

@@ -60,34 +79,42 @@
                 {
                     for (j = 1; j <= colCount; j++)
                     {
-                        if (xlRange.Cells[i, j].Value2 == "Abkürzung")
+                        if (xlRange.Cells[i, j].Value2 != null)
                         {
-                            abbrPos = j;    // Detect position index of column "Abkürzung"
-                        }
-                        if (xlRange.Cells[i, j].Value2 == "SID")
-                        {
-                            sidPos = j;     // Detect position index of column "SID"
-                            rowIndex = i + 1; // Detect position index of row
-                        }
-                        if (xlRange.Cells[i, j].Value2 == "Nr.:")
-                        {
-                            nrPos = j;    // Detect position index of column "Nr.:"
-                            int rowStartData = i + 1;
-                            for (i = rowStartData; i < rowCount; i++)
+                            if (xlRange.Cells[i, j].Value2.Contains("Abkürzung"))
                             {
-                                if (xlRange.Cells[i, nrPos].Value2 == dataRowLength)
+                                abbrPos = j;    // Detect position index of column "Abkürzung"
+                            }
+                            if (xlRange.Cells[i, j].Value2.Contains("Beschreibung"))
+                            {
+                                descPos = j;    // Detect position index of column "Abkürzung"
+                            }
+                            if (xlRange.Cells[i, j].Value2.Contains("SID"))
+                            {
+                                sidPos = j;     // Detect position index of column "SID"
+                                rowIndex = i + 1; // Detect position index of row
+                            }
+                            if (xlRange.Cells[i, j].Value2.Contains("Nr"))
+                            {
+                                nrPos = j;    // Detect position index of column "Nr.:"
+                                int rowStartData = i + 1;
+                                for (i = rowStartData; i < rowCount; i++)
                                 {
-                                    rowCount = i;
-                                    i = rowStartData - 1;
-                                    break; // end loop here
+                                    if (xlRange.Cells[i, nrPos].Value2 == dataRowLength)
+                                    {
+                                        rowCount = i;
+                                        i = rowStartData - 1;
+                                        break; // end loop here
+                                    }
                                 }
                             }
                         }
-                        if (abbrPos > 0 && sidPos > 0 && nrPos > 0)
-                            break; // end loop when these values has been found
+
+                        if (abbrPos > 0 && sidPos > 0 && nrPos > 0 && descPos > 0)
+                            break; // end loop column when these values has been found
                     }
-                    if (abbrPos > 0 && sidPos > 0 && nrPos > 0)
-                        break; // end loop when these values has been found
+                    if (abbrPos > 0 && sidPos > 0 && nrPos > 0 && descPos > 0)
+                        break; // end loop row when these values has been found
                 }
             }
             catch (Exception ex)
@@ -96,14 +123,31 @@
                     MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
             }

-            // Abkürzung is column abbrPos, SID is column sidPos
-            // Store data to dictionary
+        // Abkürzung is column abbrPos, SID is column sidPos
+        // Store data to KeyValuePair
+        // Available SIDs is categorized as "White color" cells in Excel data file
+        // For more information about ColorIndex property of Excel cell, read here:
+        // https://msdn.microsoft.com/en-us/library/cc296089%28v=office.12%29.aspx?f=255&MSPPError=-2147217396#xlDiscoveringColorIndex_ColorIndexProperty
             try
             {
                 for (i = rowIndex; i < rowCount; i++)
                 {
-                    if (xlRange.Cells[i, sidPos].Value2 != null && xlRange.Cells[i, abbrPos].Value2 != null)
-                        AvailableSIDs.Add(xlRange.Cells[i, sidPos].Value2.ToString(), xlRange.Cells[i, abbrPos].Value2.ToString());
+                    if (xlRange.Cells[i, sidPos].Value2 != null && xlRange.Cells[i, abbrPos].Value2 != null && xlRange.Cells[i, descPos].Value2 != null &&
+                        xlRange.Cells[i, sidPos].Interior.ColorIndex == 2 && xlRange.Cells[i, abbrPos].Interior.ColorIndex == 2)
+                    {
+                        //AvailableSIDs.Add(xlRange.Cells[i, sidPos].Value2.ToString(), xlRange.Cells[i, abbrPos].Value2.ToString());
+                        AvailableSIDs.Add(new KeyValuePair<string, string>(xlRange.Cells[i, sidPos].Value2.ToString(), xlRange.Cells[i, abbrPos].Value2.ToString()));
+                    }
+                }
+
+                j = 0;
+                for (i = rowIndex; i < rowCount; i++)
+                {
+                    if (xlRange.Cells[i, descPos].Value2 != null && xlRange.Cells[i, descPos].Interior.ColorIndex == 2)
+                    {
+                        SID_Mapping_Description.Add(AvailableSIDs[j], xlRange.Cells[i, descPos].Value2.ToString());
+                        j++;
+                    }
                 }
             }
             catch (Exception ex)
@@ -140,5 +184,10 @@
                     MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
             }
         }
+
+        private void Mapping()
+        {
+
+        }
     }
 }


Fixing a typo

Fixing a typo

--- src/SLANG/src/SequenceLexer{TSequence,T1,T2}.cs
+++ src/SLANG/src/SequenceLexer{TSequence,T1,T2}.cs
@@ -2,7 +2,7 @@
 {
     using System;

-    /// Provides the base class for lexers whose lexer rule has is a sequence of two elements.
+    /// Provides the base class for lexers whose lexer rule is a sequence of two elements.
     /// <typeparam name="TSequence">The type of the lexer rule.</typeparam>
     /// <typeparam name="T1">The type of the first element in the sequence.</typeparam>
     /// <typeparam name="T2">The type of the second element in the sequence.</typeparam>


Fix categories for custom ui nodes.

Fix categories for custom ui nodes.

--- src/SampleLibraryUI/Examples/CustomNodeModel.cs
+++ src/SampleLibraryUI/Examples/CustomNodeModel.cs
@@ -40,7 +40,7 @@
     // node will be organized in the library. You can
     // specify your own category or use one of the
     // built-ins provided in BuiltInNodeCategories.
-    [NodeCategory("Sample Nodes")]
+    [NodeCategory("SampleLibraryUI.Examples")]

     // The description will display in the tooltip
     // and in the help window for the node.


Added ToSafeDictionary Ext method on IEnumerable, cause the default LINQ is stupidly fragile and only on List?

--- src/ServiceStack.Common/EnumerableExtensions.cs
+++ src/ServiceStack.Common/EnumerableExtensions.cs
@@ -88,7 +88,20 @@
 				yield return batch.ToArray();
 				batch.Clear();
 			}
-		}
+		}

+	    public static Dictionary<TKey, T> ToSafeDictionary<T, TKey>(this IEnumerable<T> list, Func<T, TKey> expr)
+        {
+            var map = new Dictionary<TKey, T>();
+            if (list != null)
+            {
+                foreach (var item in list)
+                {
+                    map[expr(item)] = item;
+                }
+            }
+            return map;
+        }
+
 	}
 }