Code formatting

Code formatting

--- Source/RuntimeBusinessLogic/Projects/VisualStudioImporter.cs
+++ Source/RuntimeBusinessLogic/Projects/VisualStudioImporter.cs
@@ -1,15 +1,15 @@
 namespace ZetaResourceEditor.RuntimeBusinessLogic.Projects
 {
+    using FileGroups;
+    using FileInformations;
+    using Language;
+    using ProjectFolders;
     using System;
     using System.Collections.Generic;
     using System.ComponentModel;
     using System.Linq;
     using System.Text.RegularExpressions;
     using System.Xml;
-    using FileGroups;
-    using FileInformations;
-    using Language;
-    using ProjectFolders;
     using ZetaLongPaths;

     /// <summary>
@@ -100,10 +100,10 @@
         }

         // ADDED: adds resources from file Info lists.
-        // I have changed a method doAutomaticallyAddResourceFiles to fill file groups.
-        // You can use same method if you call this method from there.
-        // ATTENTION: LanguageCodeDetection was modified a bit to support variable amount
-        // of point in base name. New method GetBaseName(IInheritedSettings settings, string fileName)
+        // I have changed a method doAutomaticallyAddResourceFiles to fill file groups.
+        // You can use same method if you call this method from there.
+        // ATTENTION: LanguageCodeDetection was modified a bit to support variable amount
+        // of point in base name. New method GetBaseName(IInheritedSettings settings, string fileName)
         // was added to get same base name FileGroup gets.
         public void DoAutomaticallyAddResourceFilesFromList(
             BackgroundWorker backgroundWorker,
@@ -185,27 +185,21 @@
             }
             else
             {
-                if (string.Compare(@"Properties", filePath.Directory.Name, StringComparison.OrdinalIgnoreCase) == 0)
+                if (filePath.Directory.Name.EqualsNoCase(@"Properties"))
                 {
                     return true;
                 }
                 else
                 {
-                    // If a "*.Designer.*" companion file exists, assume it
+                    // If a "*.Designer.*" companion file exists, assume it
                     // is a Windows Forms resource file and do NOT add the file
                     // since it can be translated directly from within VS.NET.

                     if (Project.IgnoreWindowsFormsResourcesWithDesignerFiles)
                     {
-                        var baseFileName =
-                            LanguageCodeDetection.GetBaseName(
-                                Project,
-                                filePath.Name);
-                        //filePath.Name.Substring(0, filePath.Name.IndexOf('.'));
-
-                        var files =
-                            filePath.Directory.GetFiles(
-                                $@"{baseFileName}.Designer.*");
+                        var baseFileName = LanguageCodeDetection.GetBaseName(Project, filePath.Name);
+
+                        var files = filePath.Directory.GetFiles($@"{baseFileName}.Designer.*");

                         return files.Length <= 0;
                     }
@@ -264,8 +258,8 @@
                     }
                     var projectType = g.Value;

-                    //compare with known project types.
-                    // Currently only CS Projects are supported.
+                    //compare with known project types.
+                    // Currently only CS Projects are supported.
                     // But other types like VB can be simply added.
                     if (!Array.Exists(supportedProjectTypes, a => a == projectType))
                     {
@@ -279,7 +273,7 @@
                     //add all files from project
                     //we can add each using separate sub folder
                     var projectName = m.Groups[@"projectName"].Value;
-                    //look in subfolders only
+                    //look in subfolders only
                     var subFolders = Project.ProjectFolders;
                     if (parentProjectFolder != null)
                     {


AverageGrossSalarySeeder - add 201601 data


PR Feedback: code cleanup

PR Feedback: code cleanup

Use extension method for a case and move some code between different
registered actions.

--- src/System.Runtime.Analyzers/Core/CallGCSuppressFinalizeCorrectly.cs
+++ src/System.Runtime.Analyzers/Core/CallGCSuppressFinalizeCorrectly.cs
@@ -110,76 +110,72 @@
                 MustNotCall
             }

-            private bool _suppressFinalizeCalled = false;
-
             private readonly Compilation _compilation;
             private readonly IMethodSymbol _containingMethodSymbol;
             private readonly IMethodSymbol _gcSuppressFinalizeMethodSymbol;
-
+            private readonly SuppressFinalizeUsage _expectedUsage;
+
+            private bool _suppressFinalizeCalled = false;
             private SemanticModel _semanticModel;
-            private IInvocationExpression _invocationExpression;

             public SuppressFinalizeAnalyzer(IMethodSymbol methodSymbol, IMethodSymbol gcSuppressFinalizeMethodSymbol, Compilation compilation)
             {
                 this._compilation = compilation;
                 this._containingMethodSymbol = methodSymbol;
                 this._gcSuppressFinalizeMethodSymbol = gcSuppressFinalizeMethodSymbol;
+
+                this._expectedUsage = GetAllowedSuppressFinalizeUsage(_containingMethodSymbol);
             }

             public void Analyze(OperationAnalysisContext analysisContext)
             {
-                _invocationExpression = (IInvocationExpression)analysisContext.Operation;
-                if (_invocationExpression.TargetMethod.OriginalDefinition.Equals(_gcSuppressFinalizeMethodSymbol))
+                var invocationExpression = (IInvocationExpression)analysisContext.Operation;
+                if (invocationExpression.TargetMethod.OriginalDefinition.Equals(_gcSuppressFinalizeMethodSymbol))
                 {
                     _suppressFinalizeCalled = true;
-                    _semanticModel = analysisContext.Compilation.GetSemanticModel(analysisContext.Operation.Syntax.SyntaxTree);
+
+                    if (_semanticModel == null)
+                    {
+                        _semanticModel = analysisContext.Compilation.GetSemanticModel(analysisContext.Operation.Syntax.SyntaxTree);
+                    }
+
+                    // Check for GC.SuppressFinalize outside of IDisposable.Dispose()
+                    if (_expectedUsage == SuppressFinalizeUsage.MustNotCall)
+                    {
+                        analysisContext.ReportDiagnostic(invocationExpression.Syntax.CreateDiagnostic(
+                            OutsideDisposeRule,
+                            _containingMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
+                            _gcSuppressFinalizeMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat)));
+                    }
+
+                    // Checks for GC.SuppressFinalize(this)
+                    if (invocationExpression.ArgumentsInSourceOrder.Count() != 1)
+                    {
+                        return;
+                    }
+
+                    var parameterSymbol = _semanticModel.GetSymbolInfo(invocationExpression.ArgumentsInSourceOrder.Single().Syntax).Symbol as IParameterSymbol;
+                    if (parameterSymbol == null || !parameterSymbol.IsThis)
+                    {
+                        analysisContext.ReportDiagnostic(invocationExpression.Syntax.CreateDiagnostic(
+                            NotPassedThisRule,
+                            _containingMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
+                            _gcSuppressFinalizeMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat)));
+                    }
                 }
             }

             public void OperationBlockEndAction(OperationBlockAnalysisContext context)
             {
-                var expectedUsage = GetAllowedSuppressFinalizeUsage(_containingMethodSymbol);
-
                 // Check for absence of GC.SuppressFinalize
-                if (!_suppressFinalizeCalled && expectedUsage == SuppressFinalizeUsage.MustCall)
+                if (!_suppressFinalizeCalled && _expectedUsage == SuppressFinalizeUsage.MustCall)
                 {
                     var descriptor = _containingMethodSymbol.ContainingType.HasFinalizer() ? NotCalledWithFinalizerRule : NotCalledRule;
                     context.ReportDiagnostic(_containingMethodSymbol.CreateDiagnostic(
                         descriptor,
                         _containingMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
                         _gcSuppressFinalizeMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat)));
-
-                    return;
-                }
-
-                if (_suppressFinalizeCalled)
-                {
-                    // this means the _invocationExpression is the GC.SuppressFinalize call.
-                    // Check for GC.SuppressFinalize outside of IDisposable.Dispose()
-                    if (expectedUsage == SuppressFinalizeUsage.MustNotCall)
-                    {
-                        context.ReportDiagnostic(_invocationExpression.Syntax.CreateDiagnostic(
-                            OutsideDisposeRule,
-                            _containingMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
-                            _gcSuppressFinalizeMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat)));
-                    }
-
-                    // Checks for GC.SuppressFinalize(this)
-                    if (_invocationExpression.ArgumentsInSourceOrder.Count() != 1)
-                    {
-                        return;
-                    }
-
-                    var parameterSymbol = _semanticModel.GetSymbolInfo(_invocationExpression.ArgumentsInSourceOrder.Single().Syntax).Symbol as IParameterSymbol;
-                    if (parameterSymbol == null || !parameterSymbol.IsThis)
-                    {
-                        context.ReportDiagnostic(_invocationExpression.Syntax.CreateDiagnostic(
-                            NotPassedThisRule,
-                            _containingMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
-                            _gcSuppressFinalizeMethodSymbol.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat)));
-                    }
-                }
-
+                }
             }

             private SuppressFinalizeUsage GetAllowedSuppressFinalizeUsage(IMethodSymbol method)
@@ -193,7 +189,7 @@
                     return SuppressFinalizeUsage.CanCall;
                 }

-                if (!IsDisposeMethod(method))
+                if (!method.IsDisposeImplementation(_compilation))
                 {
                     return SuppressFinalizeUsage.MustNotCall;
                 }
@@ -220,31 +216,6 @@
                 // IDisposable.Dispose just to call it.
                 return SuppressFinalizeUsage.MustCall;
             }
-
-            private bool IsDisposeMethod(IMethodSymbol method)
-            {
-                var disposableType = WellKnownTypes.IDisposable(_compilation);
-
-                if (method.Parameters.Length != 0 ||
-                    !method.ReturnsVoid ||
-                    !method.ContainingType.AllInterfaces.Any(i => i.OriginalDefinition.Equals(disposableType)))
-                {
-                    return false;
-                }
-
-                if (method.IsPublic() && method.Name.Equals("Dispose"))
-                {
-                    return true;
-                }
-
-                if (disposableType == null)
-                {
-                    var disposeMethod = disposableType.GetMembers("Dispose").OfType<IMethodSymbol>().SingleOrDefault();
-                    return method.Equals(method.ContainingType.FindImplementationForInterfaceMember(disposeMethod));
-                }
-
-                return false;
-            }
         }
     }
 }


adding another mock method

adding another mock method

adding another mock

--- src/Test/L0/Worker/CodeCoverage/CodeCoverageCommandExtensionTests.cs
+++ src/Test/L0/Worker/CodeCoverage/CodeCoverageCommandExtensionTests.cs
@@ -85,12 +85,12 @@
             command.Properties.Add("summaryfile", "a.xml");
             Assert.Throws<ArgumentException>(() => publishCCCommand.ProcessCommand(_ec.Object, command));
         }
-
-        [Fact]
-        [Trait("Level", "L0")]
+
+        [Fact]
+        [Trait("Level", "L0")]
         public void Publish_CoberturaNewIndexFile()
         {
-            SetupMocks();
+            SetupMocks2();
             var reportDirectory = Path.Combine(Path.GetTempPath(), "reportDirectory");
             var coberturaXml = Path.Combine(reportDirectory, "coberturaValid.xml");

@@ -100,11 +100,11 @@
                 File.WriteAllText(coberturaXml, CodeCoverageTestConstants.ValidCoberturaXml);
                 File.WriteAllText((Path.Combine(reportDirectory, "index.html")), string.Empty);
                 File.WriteAllText((Path.Combine(reportDirectory, "frame-summary.html")), string.Empty);
-
+
                 var publishCCCommand = new CodeCoverageCommandExtension();
                 publishCCCommand.Initialize(_hc);
                 var command = new Command("codecoverage", "publish");
-                command.Properties.Add("codecoveragetool", "mockCCTool");
+                command.Properties.Add("codecoveragetool", "cobertura");
                 command.Properties.Add("summaryfile", coberturaXml);
                 command.Properties.Add("reportdirectory", reportDirectory);
                 publishCCCommand.ProcessCommand(_ec.Object, command);
@@ -113,14 +113,14 @@
                 _mockCodeCoveragePublisher.Verify(x => x.PublishCodeCoverageSummaryAsync(It.IsAny<IEnumerable<CodeCoverageStatistics>>(), It.IsAny<string>(), It.IsAny<CancellationToken>()));
                 _mockCodeCoveragePublisher.Verify(x => x.PublishCodeCoverageFilesAsync(It.IsAny<IAsyncCommandContext>(), It.IsAny<Guid>(), It.IsAny<long>(),
                   It.IsAny<List<Tuple<string, string>>>(), It.Is<bool>(browsable => browsable == true), It.IsAny<CancellationToken>()));
-         //       Assert.True(File.Exists(Path.Combine(reportDirectory, "frame-summary.html")));
+                //       Assert.True(File.Exists(Path.Combine(reportDirectory, "frame-summary.html")));
                 Assert.True(File.Exists(Path.Combine(reportDirectory, "indexnew.html")));
-
+
             }
             finally
-            {
+            {
                 Directory.Delete(reportDirectory, true);
-            }
+            }
         }

         [Fact]
@@ -464,5 +464,62 @@
                 }
             });
         }
+        private void SetupMocks2([CallerMemberName] string name = "")
+        {
+            _hc = new TestHostContext(this, name);
+            _codeCoverageStatistics = new List<CodeCoverageStatistics> { new CodeCoverageStatistics { Label = "label", Covered = 10, Total = 10, Position = 1 } };
+            _mocksummaryReader = new Mock<ICodeCoverageSummaryReader>();
+            _mocksummaryReader.Setup(x => x.Name).Returns("cobertura");
+            _mocksummaryReader.Setup(x => x.GetCodeCoverageSummary(It.IsAny<IExecutionContext>(), It.IsAny<string>()))
+                .Returns(_codeCoverageStatistics);
+            _hc.SetSingleton(_mocksummaryReader.Object);
+
+            _mockCodeCoverageEnabler = new Mock<ICodeCoverageEnabler>();
+            _mockCodeCoverageEnabler.Setup(x => x.Name).Returns("cobertura_mockBuildTool");
+            _mockCodeCoverageEnabler.Setup(x => x.EnableCodeCoverage(It.IsAny<IExecutionContext>(), It.IsAny<CodeCoverageEnablerInputs>()));
+            _hc.SetSingleton(_mockCodeCoverageEnabler.Object);
+
+            _mockExtensionManager = new Mock<IExtensionManager>();
+            _mockExtensionManager.Setup(x => x.GetExtensions<ICodeCoverageSummaryReader>()).Returns(new List<ICodeCoverageSummaryReader> { _mocksummaryReader.Object });
+            _mockExtensionManager.Setup(x => x.GetExtensions<ICodeCoverageEnabler>()).Returns(new List<ICodeCoverageEnabler> { _mockCodeCoverageEnabler.Object });
+            _hc.SetSingleton(_mockExtensionManager.Object);
+
+            _mockCodeCoveragePublisher = new Mock<ICodeCoveragePublisher>();
+            _hc.SetSingleton(_mockCodeCoveragePublisher.Object);
+
+            _mockCommandContext = new Mock<IAsyncCommandContext>();
+            _hc.EnqueueInstance(_mockCommandContext.Object);
+
+            var endpointAuthorization = new EndpointAuthorization()
+            {
+                Scheme = EndpointAuthorizationSchemes.OAuth
+            };
+            List<string> warnings;
+            _variables = new Variables(_hc, new Dictionary<string, string>(), new List<MaskHint>(), out warnings);
+            _variables.Set("build.buildId", "1");
+            _variables.Set("build.containerId", "1");
+            _variables.Set("system.teamProjectId", "46075F24-A6B9-447E-BEF0-E1D5592D9E39");
+            _variables.Set("system.hostType", "build");
+            endpointAuthorization.Parameters[EndpointAuthorizationParameters.AccessToken] = "accesstoken";
+
+            _ec = new Mock<IExecutionContext>();
+            _ec.Setup(x => x.Endpoints).Returns(new List<ServiceEndpoint> { new ServiceEndpoint { Url = new Uri("http://dummyurl"), Name = ServiceEndpoints.SystemVssConnection, Authorization = endpointAuthorization } });
+            _ec.Setup(x => x.Variables).Returns(_variables);
+            var asyncCommands = new List<IAsyncCommandContext>();
+            _ec.Setup(x => x.AsyncCommands).Returns(asyncCommands);
+            _ec.Setup(x => x.AddIssue(It.IsAny<Issue>()))
+            .Callback<Issue>
+            ((issue) =>
+            {
+                if (issue.Type == IssueType.Warning)
+                {
+                    _warnings.Add(issue.Message);
+                }
+                else if (issue.Type == IssueType.Error)
+                {
+                    _errors.Add(issue.Message);
+                }
+            });
+        }
     }
 }


Update to transformation pattern

Update to transformation pattern

--- src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs
+++ src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs
@@ -1630,21 +1630,18 @@
             if (!solutionChanges.HasChange)
                 return;

-            // Clear out mutable state not associated with the solution snapshot (for example, which documents are
-            // currently open).
-            foreach (var documentId in solutionChanges.DocumentIdsRemoved)
-                this.ClearDocumentData(documentId);
-
-            var (oldSolution, newSolution) = SetCurrentSolutionEx(solutionChanges.Solution);
-
-            // This method returns the task that could be used to wait for the workspace changed event; we don't want
-            // to do that.
-            _ = RaiseWorkspaceChangedEventAsync(
+            this.SetCurrentSolution(
+                _ => solutionChanges.Solution,
                 solutionChanges.WorkspaceChangeKind,
-                oldSolution,
-                newSolution,
                 solutionChanges.WorkspaceChangeProjectId,
-                solutionChanges.WorkspaceChangeDocumentId);
+                solutionChanges.WorkspaceChangeDocumentId,
+                onBeforeUpdate: (_, _) =>
+                {
+                    // Clear out mutable state not associated with the solution snapshot (for example, which documents are
+                    // currently open).
+                    foreach (var documentId in solutionChanges.DocumentIdsRemoved)
+                        this.ClearDocumentData(documentId);
+                });
         }

         private readonly Dictionary<ProjectId, ProjectReferenceInformation> _projectReferenceInfoMap = new();


Push retry outside of catch to avoid async rewrite bug

--- src/Workspaces/Core/Portable/Workspace/Solution/TextDocumentState.cs
+++ src/Workspaces/Core/Portable/Workspace/Solution/TextDocumentState.cs
@@ -97,41 +97,45 @@
         protected static async Task<TextAndVersion> LoadTextAsync(TextLoader loader, DocumentId documentId, SolutionServices services, bool reportInvalidDataException, CancellationToken cancellationToken)
         {
             int retries = 0;
-        retry:
-
-            try
-            {
-                using (ExceptionHelpers.SuppressFailFast())
-                {
-                    var result = await loader.LoadTextAndVersionAsync(services.Workspace, documentId, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
-                    return result;
-                }
-            }
-            catch (OperationCanceledException)
-            {
-                // if load text is failed due to a cancellation, make sure we propagate it out to the caller
-                throw;
-            }
-            catch (IOException e)
-            {
-                if (++retries <= MaxRetries)
-                {
-                    await Task.Delay(RetryDelay).ConfigureAwait(false);
-                    goto retry;
-                }
-
-                services.Workspace.OnWorkspaceFailed(new DocumentDiagnostic(WorkspaceDiagnosticKind.Failure, e.Message, documentId));
-                return TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, documentId.GetDebuggerDisplay());
-            }
-            catch (InvalidDataException e)
-            {
-                // TODO: Adjust this behavior in the future if we add support for non-text additional files
-                if (reportInvalidDataException)
-                {
-                    services.Workspace.OnWorkspaceFailed(new DocumentDiagnostic(WorkspaceDiagnosticKind.Failure, e.Message, documentId));
-                }
-
-                return TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, documentId.GetDebuggerDisplay());
+
+            while (true)
+            {
+                try
+                {
+                    using (ExceptionHelpers.SuppressFailFast())
+                    {
+                        var result = await loader.LoadTextAndVersionAsync(services.Workspace, documentId, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
+                        return result;
+                    }
+                }
+                catch (OperationCanceledException)
+                {
+                    // if load text is failed due to a cancellation, make sure we propagate it out to the caller
+                    throw;
+                }
+                catch (IOException e)
+                {
+                    if (++retries > MaxRetries)
+                    {
+                        services.Workspace.OnWorkspaceFailed(new DocumentDiagnostic(WorkspaceDiagnosticKind.Failure, e.Message, documentId));
+                        return TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, documentId.GetDebuggerDisplay());
+                    }
+
+                    // fall out to try again
+                }
+                catch (InvalidDataException e)
+                {
+                    // TODO: Adjust this behavior in the future if we add support for non-text additional files
+                    if (reportInvalidDataException)
+                    {
+                        services.Workspace.OnWorkspaceFailed(new DocumentDiagnostic(WorkspaceDiagnosticKind.Failure, e.Message, documentId));
+                    }
+
+                    return TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, documentId.GetDebuggerDisplay());
+                }
+
+                // try again after a delay
+                await Task.Delay(RetryDelay).ConfigureAwait(false);
             }
         }


Node hover update finished

Node hover update finished

--- Scripts/Editor/NodeEditorGUI.cs
+++ Scripts/Editor/NodeEditorGUI.cs
@@ -153,6 +153,8 @@

         Vector2 mousePos = Event.current.mousePosition;

+        hoveredPort = null;
+        hoveredNode = null;

         foreach (Node node in graph.nodes) {
             if (node == null) return;
@@ -191,8 +193,7 @@

             //Check if we are hovering any of this nodes ports
             //Check input ports
-            for (int i = 0; i < node.InputCount; i++)
-            {
+            for (int i = 0; i < node.InputCount; i++) {
                 NodePort port = node.inputs[i];
                 //Check if port rect is available
                 if (!portConnectionPoints.ContainsKey(port)) continue;
@@ -200,8 +201,7 @@
                 if (r.Contains(mousePos)) hoveredPort = port;
             }
             //Check all output ports
-            for (int i = 0; i < node.OutputCount; i++)
-            {
+            for (int i = 0; i < node.OutputCount; i++) {
                 NodePort port = node.outputs[i];
                 //Check if port rect is available
                 if (!portConnectionPoints.ContainsKey(port)) continue;


(TFS CS 6923)

(TFS CS 6923)

--- Signum.Web/Facades/Navigator.cs
+++ Signum.Web/Facades/Navigator.cs
@@ -99,17 +99,17 @@
             return Manager.View(controller, entity, partialViewName, admin);
         }

-        public static PartialViewResult NormalControl(ControllerBase controller, IdentifiableEntity entity)
+        public static PartialViewResult NormalControl(ControllerBase controller, IRootEntity entity)
         {
             return Manager.NormalControl(controller, entity, null, false);
         }

-        public static PartialViewResult NormalControl(ControllerBase controller, IdentifiableEntity entity, bool admin)
+        public static PartialViewResult NormalControl(ControllerBase controller, IRootEntity entity, bool admin)
         {
             return Manager.NormalControl(controller, entity, null, admin);
         }

-        public static PartialViewResult NormalControl(ControllerBase controller, IdentifiableEntity entity, string partialViewName)
+        public static PartialViewResult NormalControl(ControllerBase controller, IRootEntity entity, string partialViewName)
         {
             return Manager.NormalControl(controller, entity, partialViewName, false);
         }


Mac: Allow setting cursor for any control

--- Source/Eto.Mac/Forms/MacView.cs
+++ Source/Eto.Mac/Forms/MacView.cs
@@ -504,10 +504,32 @@
 			}
 		}

+		static readonly IntPtr selResetCursorRects = Selector.GetHandle("resetCursorRects");
+
+		static void TriggerResetCursorRects(IntPtr sender, IntPtr sel)
+		{
+			var obj = Runtime.GetNSObject(sender);
+			var handler = GetHandler(obj) as IMacViewHandler;
+			if (handler != null)
+			{
+				var cursor = handler.Cursor;
+				if (cursor != null)
+				{
+					handler.EventControl.AddCursorRect(new NSRect(NSPoint.Empty, handler.EventControl.Frame.Size), cursor.ControlObject as NSCursor);
+				}
+			}
+		}
+
 		public virtual Cursor Cursor
 		{
 			get { return cursor; }
-			set { cursor = value; }
+			set {
+				if (cursor != value)
+				{
+					cursor = value;
+					AddMethod(selResetCursorRects, new Action<IntPtr, IntPtr>(TriggerResetCursorRects), "v@:");
+				}
+			}
 		}

 		public string ToolTip


Improve settings tab text to not say dll

--- ACTPlugin.cs
+++ ACTPlugin.cs
@@ -53,6 +53,7 @@
             browserWindow.Clickable = !settingsTab.WindowIgnoresMouseEvents();
             browserWindow.Show();

+            pluginScreenSpace.Text = "Cactbot";
             pluginScreenSpace.Controls.Add(settingsTab);

             Application.ApplicationExit += OnACTShutdown;


add filter to multi-select behavior (probably also should add to other select behaviors?)

--- behaviors/MouseMultiSelectBehavior.cs
+++ behaviors/MouseMultiSelectBehavior.cs
@@ -16,6 +16,12 @@
         /// If this is true, PivotSO objects are selected first, even if they are "behind" other objects.
         /// </summary>
         public bool SelectPivotsFirst = true;
+
+        /// <summary>
+        /// set this to filter out objects
+        /// </summary>
+        public Func<SceneObject, bool> SelectionFilterF = null;
+

         public MouseMultiSelectBehavior(FContext scene)
         {
@@ -81,8 +87,8 @@
         protected bool FindSORayIntersection(Ray3f ray, out SORayHit hit)
         {
             return (SelectPivotsFirst) ?
-                scene.Scene.FindSORayIntersection_PivotPriority(ray, out hit) :
-                scene.Scene.FindSORayIntersection(ray, out hit);
+                scene.Scene.FindSORayIntersection_PivotPriority(ray, out hit, SelectionFilterF) :
+                scene.Scene.FindSORayIntersection(ray, out hit, SelectionFilterF);
         }
     }
 }


Change 2

Change 2

--- SubFolderTest/TestGit/Program.cs
+++ SubFolderTest/TestGit/Program.cs
@@ -5,15 +5,24 @@
 using System.Threading.Tasks;
 using Urho;
 using Urho.Gui;
+using Urho.Resources;
 using Urho.Shapes;

-namespace TestGit
+namespace TestGit
 {
-    class Program
+    class Program : SimpleApplication
     {
+        Program(ApplicationOptions options = null) :base(options) { }
         static void Main(string[] args)
         {
+            var app = new Program(new ApplicationOptions("Data")
+            {
+                TouchEmulation = true,
+                WindowedMode = true
+            });
+            app.Run();
         }
+

         public void MyNoReturnMethod()
         {


remove log

remove log

--- TCC.Core/Parsing/PacketRouter.cs
+++ TCC.Core/Parsing/PacketRouter.cs
@@ -106,7 +106,6 @@
             //if (p.SkillId % 10 != 0) return;
             //if (p.SkillId / 1000 == 260)
             //{
-            Log.CW($"[DECREASE_COOLTIME_SKILL] {p.SkillId} duration = {p.Cooldown}ms");
             //    if (p.SkillId % 10 == 0)
             //    {
             //        SkillManager.ChangeSkillCooldown(p.SkillId, p.Cooldown);


Cleanup DefaultSettings.

Cleanup DefaultSettings.

--- source/Nuke.Common/DefaultSettings.cs
+++ source/Nuke.Common/DefaultSettings.cs
@@ -1,3 +1,7 @@
+// Copyright Matthias Koch 2017.
+// Distributed under the MIT License.
+// https://github.com/matkoch/Nuke/blob/master/LICENSE
+
 using System;
 using System.IO;
 using System.Linq;
@@ -13,89 +17,90 @@
 using Nuke.Core.Execution;
 using Nuke.Core.Tooling;

-[assembly: IconClass (typeof (DefaultSettings), "equalizer")]
+[assembly: IconClass(typeof(DefaultSettings), "equalizer")]

 namespace Nuke.Common
 {
     /// <summary>
-    /// Provides a variety of best-practice settings.
+    /// Provides a variety of best-practice settings. For more details we recommend to check the actual source code.
     /// </summary>
     [PublicAPI]
     public class DefaultSettings
     {
-        public static MSBuildSettings MSBuildRestore => new MSBuildSettings ()
-                .SetWorkingDirectory (Build.Instance.SolutionDirectory)
-                .SetSolutionFile (Build.Instance.SolutionFile)
-                .SetTargets ("Restore");
+        public static MSBuildSettings MSBuildRestore => new MSBuildSettings()
+                .SetWorkingDirectory(Build.Instance.SolutionDirectory)
+                .SetSolutionFile(Build.Instance.SolutionFile)
+                .SetTargets("Restore");

-        public static MSBuildSettings MSBuildCompile => new MSBuildSettings ()
-                .SetWorkingDirectory (Build.Instance.SolutionDirectory)
-                .SetSolutionFile (Build.Instance.SolutionFile)
-                .SetTargets ("Rebuild")
-                .SetConfiguration (Build.Instance.Configuration)
-                .SetMaxCpuCount (Environment.ProcessorCount);
+        public static MSBuildSettings MSBuildCompile => new MSBuildSettings()
+                .SetWorkingDirectory(Build.Instance.SolutionDirectory)
+                .SetSolutionFile(Build.Instance.SolutionFile)
+                .SetTargets("Rebuild")
+                .SetConfiguration(Build.Instance.Configuration)
+                .SetMaxCpuCount(Environment.ProcessorCount);

-        public static MSBuildSettings MSBuildCompileWithAssemblyInfo => MSBuildSettingsExtensions.SetProperty (MSBuildCompile, "AssemblyVersion", GitHubBuild.Instance.GitVersion.AssemblySemVer)
-                .SetProperty ("FileVersion", GitHubBuild.Instance.GitVersion.AssemblySemVer)
-                .SetProperty ("InformationalVersion", GitHubBuild.Instance.GitVersion.InformationalVersion);
+        public static MSBuildSettings MSBuildCompileWithAssemblyInfo => MSBuildCompile
+                .SetProperty("AssemblyVersion", GitHubBuild.Instance.GitVersion.AssemblySemVer)
+                .SetProperty("FileVersion", GitHubBuild.Instance.GitVersion.AssemblySemVer)
+                .SetProperty("InformationalVersion", GitHubBuild.Instance.GitVersion.InformationalVersion);

-        public static MSBuildSettings MSBuildPack => new MSBuildSettings ()
-                .SetWorkingDirectory (Build.Instance.SolutionDirectory)
-                .SetSolutionFile (Build.Instance.SolutionFile)
-                .SetTargets ("Restore", "Pack")
-                .SetConfiguration (Build.Instance.Configuration)
-                .SetProperty ("PackageOutputPath", Build.Instance.OutputDirectory)
-                .SetProperty ("IncludeSymbols", "True")
-                .SetProperty ("PackageVersion", GitHubBuild.Instance.GitVersion.NuGetVersionV2);
+        public static MSBuildSettings MSBuildPack => new MSBuildSettings()
+                .SetWorkingDirectory(Build.Instance.SolutionDirectory)
+                .SetSolutionFile(Build.Instance.SolutionFile)
+                .SetTargets("Restore", "Pack")
+                .SetConfiguration(Build.Instance.Configuration)
+                .SetProperty("PackageOutputPath", Build.Instance.OutputDirectory)
+                .SetProperty("IncludeSymbols", "True")
+                .SetProperty("PackageVersion", GitHubBuild.Instance.GitVersion.NuGetVersionV2);

-        public static GitVersionSettings GitVersion => new GitVersionSettings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"));
+        public static GitVersionSettings GitVersion => new GitVersionSettings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"));

-        public static NuGetPackSettings NuGetPack => new NuGetPackSettings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetOutputDirectory (Build.Instance.OutputDirectory)
-                .SetConfiguration (Build.Instance.Configuration)
-                .SetVersion (GitHubBuild.Instance.GitVersion?.NuGetVersionV2);
+        public static NuGetPackSettings NuGetPack => new NuGetPackSettings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetOutputDirectory(Build.Instance.OutputDirectory)
+                .SetConfiguration(Build.Instance.Configuration)
+                .SetVersion(GitHubBuild.Instance.GitVersion?.NuGetVersionV2);

-        public static NuGetRestoreSettings NuGetRestore => new NuGetRestoreSettings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"));
+        public static NuGetRestoreSettings NuGetRestore => new NuGetRestoreSettings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"));

-        public static InspectCodeSettings InspectCode => new InspectCodeSettings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetTargetPath (Build.Instance.SolutionFile)
-                .SetOutput (Path.Combine (Build.Instance.OutputDirectory, "inspectCode.xml"));
+        public static InspectCodeSettings InspectCode => new InspectCodeSettings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetTargetPath(Build.Instance.SolutionFile)
+                .SetOutput(Path.Combine(Build.Instance.OutputDirectory, "inspectCode.xml"));

-        public static OpenCoverSettings OpenCover => new OpenCoverSettings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetRegistration (RegistrationType.User)
-                .SetTargetExitCodeOffset (targetExitCodeOffset: 0)
-                .SetFilters (
+        public static OpenCoverSettings OpenCover => new OpenCoverSettings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetRegistration(RegistrationType.User)
+                .SetTargetExitCodeOffset(targetExitCodeOffset: 0)
+                .SetFilters(
                     "+[*]*",
                     "-[xunit.*]*",
                     "-[NUnit.*]*",
                     "-[FluentAssertions.*]*",
                     "-[Machine.Specifications.*]*")
-                .SetExcludeByAttributes (
+                .SetExcludeByAttributes(
                     "*.Explicit*",
                     "*.Ignore*",
                     "*. *")
-                .SetExcludeByFile (
+                .SetExcludeByFile(
                     "*/*.Generated.cs",
                     "*/*.Designer.cs",
                     "*/*.g.cs",
                     "*/*.g.i.cs");

-        public static GitLink2Settings GitLink2 => new GitLink2Settings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetSolutionDirectory (Build.Instance.SolutionDirectory.NotNull ("Build.Instance.SolutionDirectory != null"))
-                .SetConfiguration (Build.Instance.Configuration)
-                .SetBranchName (GitHubBuild.Instance.GitVersion.NotNull ("GitHubBuild.Instance.GitVersion != null").BranchName)
-                .SetRepositoryUrl (GitHubBuild.Instance.GitRepositoryUrl.NotNull ("GitHubBuild.Instance.GitRepositoryUrl != null").SvnUrl);
+        public static GitLink2Settings GitLink2 => new GitLink2Settings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetSolutionDirectory(Build.Instance.SolutionDirectory.NotNull("Build.Instance.SolutionDirectory != null"))
+                .SetConfiguration(Build.Instance.Configuration)
+                .SetBranchName(GitHubBuild.Instance.GitVersion.NotNull("GitHubBuild.Instance.GitVersion != null").BranchName)
+                .SetRepositoryUrl(GitHubBuild.Instance.GitRepositoryUrl.NotNull("GitHubBuild.Instance.GitRepositoryUrl != null").SvnUrl);

-        public static GitLink3Settings GitLink3 => new GitLink3Settings ()
-                .SetWorkingDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetBaseDirectory (Build.Instance.RootDirectory.NotNull ("Build.Instance.RootDirectory != null"))
-                .SetRepositoryUrl (GitHubBuild.Instance.GitRepositoryUrl.NotNull ("GitHubBuild.Instance.GitRepositoryUrl != null").SvnUrl);
+        public static GitLink3Settings GitLink3 => new GitLink3Settings()
+                .SetWorkingDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetBaseDirectory(Build.Instance.RootDirectory.NotNull("Build.Instance.RootDirectory != null"))
+                .SetRepositoryUrl(GitHubBuild.Instance.GitRepositoryUrl.NotNull("GitHubBuild.Instance.GitRepositoryUrl != null").SvnUrl);
     }
-}+}


#3786 - removed two Cluster must cancel join prematurely specs (#3803)

--- src/core/Akka.Cluster.Tests/ClusterSpec.cs
+++ src/core/Akka.Cluster.Tests/ClusterSpec.cs
@@ -116,7 +116,6 @@
             ExpectMsg<ClusterEvent.CurrentClusterState>();
         }

-        // this should be the last test step, since the cluster is shutdown
         [Fact]
         public void A_cluster_must_publish_member_removed_when_shutdown()
         {
@@ -199,11 +198,6 @@
             Cluster.Get(sys2).LeaveAsync().IsCompleted.Should().BeTrue();
         }

-        //#if CORECLR
-        //        [Fact(Skip = "Fails on .NET Core")]
-        //#else
-        //        [Fact(Skip = "Fails flakily on .NET 4.5")]
-        //#endif
         [Fact]
         public void A_cluster_must_return_completed_LeaveAsync_task_if_member_already_removed()
         {
@@ -340,29 +334,6 @@
         }

         [Fact]
-        public void A_cluster_must_be_able_to_prematurelly_cancel_JoinAsync()
-        {
-            var timeout = TimeSpan.FromSeconds(10);
-
-            try
-            {
-                var cancel = new CancellationTokenSource();
-                cancel.Cancel(true);
-                var task = _cluster.JoinAsync(_selfAddress, cancel.Token);
-
-                Assert.Throws<AggregateException>(() => task.Wait(timeout))
-                    .Flatten()
-                    .InnerException.Should().BeOfType<TaskCanceledException>();
-
-                task.IsCanceled.Should().BeTrue();
-            }
-            finally
-            {
-                _cluster.Shutdown();
-            }
-        }
-
-        [Fact]
         public void A_cluster_JoinAsync_must_fail_if_could_not_connect_to_cluster()
         {
             var timeout = TimeSpan.FromSeconds(10);
@@ -435,28 +406,6 @@
                     ExpectMsg<ClusterEvent.MemberRemoved>();
                 }).Wait(timeout);

-            }
-            finally
-            {
-                _cluster.Shutdown();
-            }
-        }
-
-        [Fact]
-        public void A_cluster_must_be_able_to_prematurelly_cancel_join_async_seed_nodes()
-        {
-            var timeout = TimeSpan.FromSeconds(10);
-
-            try
-            {
-                var cancel = new CancellationToken(true);
-                var task = _cluster.JoinSeedNodesAsync(new[] { _selfAddress }, cancel);
-
-                Assert.Throws<AggregateException>(() => task.Wait(timeout))
-                    .Flatten()
-                    .InnerException.Should().BeOfType<TaskCanceledException>();
-
-                task.IsCanceled.Should().BeTrue();
             }
             finally
             {


optimized MultiFormatReader if more than one barcode of the same type is read

git-svn-id: 98f681d7a2907ee2a41df434552134740bcc8829@73536 81fbe566-5dc4-48c1-bdea-7421811ca204

--- Source/lib/MultiFormatReader.cs
+++ Source/lib/MultiFormatReader.cs
@@ -15,6 +15,7 @@
 */

 using System.Collections.Generic;
+
 using ZXing.Aztec;
 using ZXing.Datamatrix;
 using ZXing.Maxicode;
@@ -103,7 +104,6 @@

             var tryHarder = value != null && value.ContainsKey(DecodeHintType.TRY_HARDER);
             var formats = value == null || !value.ContainsKey(DecodeHintType.POSSIBLE_FORMATS) ? null : (IList<BarcodeFormat>)value[DecodeHintType.POSSIBLE_FORMATS];
-            readers = new List<Reader>();

             if (formats != null)
             {
@@ -120,6 +120,8 @@
                   formats.Contains(BarcodeFormat.RSS_14) ||
                   formats.Contains(BarcodeFormat.RSS_EXPANDED);

+               readers = new List<Reader>();
+
                // Put 1D readers upfront in "normal" mode
                if (addOneDReader && !tryHarder)
                {
@@ -152,8 +154,11 @@
                }
             }

-            if (readers.Count == 0)
-            {
+            if (readers == null ||
+                readers.Count == 0)
+            {
+               readers = readers ?? new List<Reader>();
+
                if (!tryHarder)
                {
                   readers.Add(new MultiFormatOneDReader(value));
@@ -170,7 +175,6 @@
                }
             }
          }
-
       }

       public void reset()
@@ -188,11 +192,26 @@
       {
          if (readers != null)
          {
-            foreach (var reader in readers)
-            {
+            var rpCallback = hints.ContainsKey(DecodeHintType.NEED_RESULT_POINT_CALLBACK)
+                                ? (ResultPointCallback) hints[DecodeHintType.NEED_RESULT_POINT_CALLBACK]
+                                : null;
+
+            for (var index = 0; index < readers.Count; index++)
+            {
+               var reader = readers[index];
                var result = reader.decode(image, hints);
                if (result != null)
+               {
+                  // found a barcode, pushing the successful reader up front
+                  // I assume that the same type of barcode is read multiple times
+                  // so the reordering of the readers list should speed up the next reading
+                  // a little bit
+                  readers.RemoveAt(index);
+                  readers.Insert(0, reader);
                   return result;
+               }
+               if (rpCallback != null)
+                  rpCallback(null);
             }
          }


Delete FF14PluginHelper.cs

Delete FF14PluginHelper.cs

--- src/ACT.TPMonitor/FF14PluginHelper.cs
+++ src/ACT.TPMonitor/FF14PluginHelper.cs
@@ -1,223 +0,0 @@
-namespace ACT.TTSYukkuri
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-
-    using Advanced_Combat_Tracker;
-
-    public static class FF14PluginHelper
-    {
-        private static object lockObject = new object();
-        private static object plugin;
-
-        public static void Initialize()
-        {
-            lock (lockObject)
-            {
-                if (plugin != null)
-                {
-                    return;
-                }
-
-                if (ActGlobals.oFormActMain.Visible)
-                {
-                    foreach (var item in ActGlobals.oFormActMain.ActPlugins)
-                    {
-                        if (item.pluginFile.Name.ToUpper() == "FFXIV_ACT_Plugin.dll".ToUpper() &&
-                            item.lblPluginStatus.Text.ToUpper() == "FFXIV Plugin Started.".ToUpper())
-                        {
-                            plugin = item.pluginObj;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        public static Process GetFFXIVProcess
-        {
-            get
-            {
-                try
-                {
-                    Initialize();
-
-                    FieldInfo fi = plugin.GetType().GetField("_Memory", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
-                    var memory = fi.GetValue(plugin);
-                    if (memory == null) return null;
-
-                    fi = memory.GetType().GetField("_config", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
-                    var config = fi.GetValue(memory);
-                    if (config == null) return null;
-
-                    fi = config.GetType().GetField("Process", BindingFlags.GetField | BindingFlags.Public | BindingFlags.Instance);
-                    var process = fi.GetValue(config);
-                    if (process == null) return null;
-
-                    return (Process)process;
-                }
-                catch
-                {
-                    return null;
-                }
-            }
-        }
-
-        private static object GetScanCombatants()
-        {
-            Initialize();
-
-            FieldInfo fi = plugin.GetType().GetField("_Memory", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
-            var memory = fi.GetValue(plugin);
-            if (memory == null) return null;
-
-            fi = memory.GetType().GetField("_config", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
-            var config = fi.GetValue(memory);
-            if (config == null) return null;
-
-            fi = config.GetType().GetField("ScanCombatants", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
-            var scanCombatants = fi.GetValue(config);
-            if (scanCombatants == null) return null;
-
-            return scanCombatants;
-        }
-
-        public static List<Combatant> GetCombatantList()
-        {
-            Initialize();
-
-            var result = new List<Combatant>();
-            try
-            {
-                var scanCombatants = GetScanCombatants();
-                if (scanCombatants == null) return null;
-
-                var item = scanCombatants.GetType().InvokeMember("GetCombatantList", BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, scanCombatants, null);
-                FieldInfo fi = item.GetType().GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
-
-                Type[] nestedType = item.GetType().GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public);
-                object tmp = fi.GetValue(item);
-                if (tmp.GetType().IsArray)
-                {
-                    foreach (object temp in (Array)tmp)
-                    {
-                        if (temp == null) break;
-
-                        var combatant = new Combatant();
-
-                        var getValue = new Func<object, string, object>(
-                            (obj, fieldName) =>
-                            {
-                                var fi1 = obj.GetType().GetField(fieldName, BindingFlags.Public | BindingFlags.Instance);
-                                return fi1.GetValue(obj);
-                            });
-
-                        combatant.ID = (uint)getValue(temp, "ID");
-                        combatant.Name = (string)getValue(temp, "Name");
-                        combatant.type = (byte)getValue(temp, "type");
-                        combatant.Level = (int)getValue(temp, "Level");
-
-                        combatant.CurrentHP = (int)getValue(temp, "CurrentHP");
-                        combatant.MaxHP = (int)getValue(temp, "MaxHP");
-
-                        combatant.CurrentMP = (int)getValue(temp, "CurrentMP");
-                        combatant.MaxMP = (int)getValue(temp, "MaxMP");
-
-                        combatant.CurrentTP = (int)getValue(temp, "CurrentTP"); ;
-
-                        result.Add(combatant);
-                    }
-                }
-            }
-            catch
-            {
-            }
-
-            return result;
-        }
-
-        public static List<uint> GetCurrentPartyList(
-            out int partyCount)
-        {
-            Initialize();
-
-            var partyList = new List<uint>();
-            partyCount = 0;
-
-            var scanCombatants = GetScanCombatants();
-            if (scanCombatants == null)
-            {
-                return partyList;
-            }
-
-            var args = new object[]
-            {
-                partyCount
-            };
-
-            var modifiers1 = new ParameterModifier(1);
-            modifiers1[0] = true;
-            var modifiers = new ParameterModifier[]
-            {
-                modifiers1
-            };
-
-            var items = scanCombatants.GetType().InvokeMember(
-                "GetCurrentPartyList",
-                BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod,
-                null,
-                scanCombatants,
-                args,
-                modifiers,
-                CultureInfo.CurrentCulture,
-                null);
-
-            partyCount = (int)args[0];
-
-            FieldInfo fi;
-
-            var getValue = new Func<object, string, object>(
-                (obj, fieldName) =>
-                {
-                    fi = obj.GetType().GetField(fieldName, BindingFlags.Public | BindingFlags.Instance);
-                    return fi.GetValue(obj);
-                });
-
-            fi = items.GetType().GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
-            var itemsInner = fi.GetValue(items);
-
-            if (itemsInner.GetType().IsArray)
-            {
-                foreach (var item in (Array)itemsInner)
-                {
-                    if (item == null)
-                    {
-                        break;
-                    }
-
-                    partyList.Add((uint)item);
-                }
-            }
-
-            return partyList;
-        }
-    }
-    public class Combatant
-    {
-        public uint ID;
-        public uint OwnerID;
-        public int Order;
-        public byte type;
-        public int Job;
-        public int Level;
-        public string Name;
-        public int CurrentHP;
-        public int MaxHP;
-        public int CurrentMP;
-        public int MaxMP;
-        public int CurrentTP;
-    }
-}


Added TransmogItemAppearanceModId to Appearance

Added a missing TransmogItemAppearanceModId property to Appearance.

--- src/ArgentSquire/Models/Appearance.cs
+++ src/ArgentSquire/Models/Appearance.cs
@@ -24,5 +24,11 @@
         /// </summary>
         [JsonProperty("itemAppearanceModId")]
         public int ItemAppearanceModId { get; set; }
+
+        /// <summary>
+        /// Gets or sets the transmog item appearance ID.
+        /// </summary>
+        [JsonProperty("transmogItemAppearanceModId")]
+        public int TransmogItemAppearanceModId { get; set; }
     }
 }


cosmetic

cosmetic

--- src/AutoMapper/Internal/MemberPath.cs
+++ src/AutoMapper/Internal/MemberPath.cs
@@ -8,13 +8,12 @@
 {
     using Execution;
     [EditorBrowsable(EditorBrowsableState.Never)]
-    public struct MemberPath : IEquatable<MemberPath>
+    public readonly struct MemberPath : IEquatable<MemberPath>
     {
         public static readonly MemberPath Empty = new MemberPath(Array.Empty<MemberInfo>());
         public readonly MemberInfo[] Members;
-        public MemberPath(Stack<Member> members) : this(members.ToMemberInfos())
-        {
-        }
+
+        public MemberPath(Stack<Member> members) : this(members.ToMemberInfos()){}

         public MemberPath(MemberInfo[] members) => Members = members;

@@ -26,11 +25,7 @@

         public bool Equals(MemberPath other) => Members.SequenceEqual(other.Members);

-        public override bool Equals(object obj)
-        {
-            if(obj is null) return false;
-            return obj is MemberPath path && Equals(path);
-        }
+        public override bool Equals(object obj) => obj is MemberPath path && Equals(path);

         public override int GetHashCode()
         {
@@ -42,8 +37,7 @@
             return hashCode.ToHashCode();
         }

-        public override string ToString()
-            => string.Join(".", Members.Select(mi => mi.Name));
+        public override string ToString() => string.Join(".", Members.Select(mi => mi.Name));

         public static bool operator==(in MemberPath left, in MemberPath right) => left.Equals(right);

@@ -65,6 +59,6 @@
             return true;
         }

-        public MemberPath Concat(IEnumerable<MemberInfo> memberInfos) => new MemberPath(Members.Concat(memberInfos).ToArray());
+        public MemberPath Concat(IEnumerable<MemberInfo> memberInfos) => new(Members.Concat(memberInfos).ToArray());
     }
 }


Backout changeset 6a4b7065a5b7980e2f458acf4a04fc5856a4862e

--- src/BloomTests/Chorus/MergingTests.cs
+++ src/BloomTests/Chorus/MergingTests.cs
@@ -12,7 +12,7 @@
 {
 	public class BookMergingTests
 	{
-		[Test]
+		[Test, Ignore("not yet")]
 		public void CreateOrLocate_FolderHasAccentedLetter_FindsIt()
 		{
 			using (var setup = new RepositorySetup("Abé Books"))
@@ -21,7 +21,7 @@
 			}
 		}

-		[Test]
+		[Test, Ignore("not yet")]
 		public void CreateOrLocate_FolderHasAccentedLetter2_FindsIt()
 		{
 			using (var testRoot = new TemporaryFolder("bloom sr test"))


Fix error

Fix error

--- src/Core2D.ViewModels/Data/Context.cs
+++ src/Core2D.ViewModels/Data/Context.cs
@@ -31,11 +31,6 @@
             set => Update(ref _record, value);
         }

-        /// <summary>
-        /// Initializes a new instance of the <see cref="Context"/> class.
-        /// </summary>
-        public Context() : base() => ;
-
         /// <inheritdoc/>
         public override object Copy(IDictionary<object, object> shared)
         {


Update timetable.cs

Update timetable.cs

Transformed c1 to a bidimensional array (now named buttons).

--- timetable.cs
+++ timetable.cs
@@ -1,26 +1,49 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.UI;
-
-public class timetable : MonoBehaviour {
-
-    public GameObject popUp;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class timetable : MonoBehaviour
+{
+
+    public GameObject popUp;
     public GameObject inputField;
     public GameObject inputFieldtB;
     public GameObject inputFieldcB;
+    public int weekDays;
+    public int slots;
+
     protected bool isTasking;
-    protected string c1; //Need 49 copies
-
+    protected string[][] buttons; //Need 49 copies (7 days x 7 slots)

+    /*
+     * Initialize the buttons bidimensional array given weekDays and slots
+     */
+    protected void initializeButtons()
+    {
+        for(int day = 0; day < weekDays; day++)
+        {
+            for (int slot = 0; slot < slots; slot++)
+            {
+                buttons[day,slot] = "";
+            }
+
+        }
+    }
     // Use this for initialization
-    void Start() {
-
+    void Start()
+    {
+        weekDays = 7; //7 days a week
+        slots = 7; //7 slots per day
+        buttons = new string[weekDays,slots]; // Makes a bidimensional array of 7x7
+
+        initializeButtons();
     }

     // Update is called once per frame
-    void Update() {
+    void Update()
+    {
         if (isTasking == true)
         {
             GameObject.FindWithTag("gap").GetComponent<Image>().color = new Color(1f, 1f, 1f, 0.5f);
@@ -29,8 +52,8 @@
         {
             GameObject.FindWithTag("gap").GetComponent<Image>().color = new Color(1f, 1f, 1f, 0f);
         }
-    }
-
+    }
+
     public void addTask(int i)
     {
         if (i == 1)
@@ -60,7 +83,7 @@
         {

         }
-    }
+    }
     public void editTask(int i)
     {
         if (isTasking == true)
@@ -75,5 +98,5 @@
             }
         }

-    }
-}
+    }
+}


Set baseline benchmark

Set baseline benchmark

--- osu.Framework.Benchmarks/BenchmarkFontLoading.cs
+++ osu.Framework.Benchmarks/BenchmarkFontLoading.cs
@@ -34,7 +34,7 @@
                 runFor(store);
         }

-        [Benchmark]
+        [Benchmark(Baseline = true)]
         public void BenchmarkRawCaching()
         {
             using (var temp = new TemporaryNativeStorage("fontstore-test" + Guid.NewGuid(), createIfEmpty: true))


Add visual test for switching tabs

Add visual test for switching tabs

--- osu.Framework.Tests/Visual/TestCaseTabControl.cs
+++ osu.Framework.Tests/Visual/TestCaseTabControl.cs
@@ -11,6 +11,7 @@
 using osu.Framework.Graphics.Sprites;
 using osu.Framework.Graphics.UserInterface;
 using osu.Framework.Testing;
+using osu.Framework.Input;
 using OpenTK;
 using OpenTK.Graphics;

@@ -33,15 +34,27 @@

             StyledTabControl pinnedAndAutoSort = new StyledTabControl
             {
-                Position = new Vector2(500, 50),
+                Position = new Vector2(200, 150),
                 Size = new Vector2(200, 30),
                 AutoSort = true
             };
             items.GetRange(0, 7).AsEnumerable().ForEach(item => pinnedAndAutoSort.AddItem(item.Value));
             pinnedAndAutoSort.PinItem(TestEnum.Test5);

+            StyledTabControl switchingTabControl;
+            PlatformActionContainer platformActionContainer = new PlatformActionContainer
+            {
+                Child = switchingTabControl = new StyledTabControl
+                {
+                    Position = new Vector2(200, 250),
+                    Size = new Vector2(200, 30),
+                }
+            };
+            items.AsEnumerable().ForEach(item => switchingTabControl.AddItem(item.Value));
+
             Add(simpleTabcontrol);
             Add(pinnedAndAutoSort);
+            Add(platformActionContainer);

             var nextTest = new Func<TestEnum>(() => items.AsEnumerable()
                                                          .Select(item => item.Value)
@@ -80,6 +93,19 @@
             {
                 if (pinned.Count > 0) pinnedAndAutoSort.UnpinItem(pinned.Pop());
             });
+
+            AddStep("Set first tab", () => switchingTabControl.Current.Value = switchingTabControl.VisibleItems.First());
+            AddStep("Switch forward", () => platformActionContainer.TriggerPressed(new PlatformAction(PlatformActionType.DocumentNext)));
+            AddAssert("Ensure second tab", () => switchingTabControl.Current.Value == switchingTabControl.VisibleItems.ElementAt(1));
+
+            AddStep("Switch backward", () => platformActionContainer.TriggerPressed(new PlatformAction(PlatformActionType.DocumentPrevious)));
+            AddAssert("Ensure first Tab", () => switchingTabControl.Current.Value == switchingTabControl.VisibleItems.First());
+
+            AddStep("Switch backward", () => platformActionContainer.TriggerPressed(new PlatformAction(PlatformActionType.DocumentPrevious)));
+            AddAssert("Ensure last tab", () => switchingTabControl.Current.Value == switchingTabControl.VisibleItems.Last());
+
+            AddStep("Switch forward", () => platformActionContainer.TriggerPressed(new PlatformAction(PlatformActionType.DocumentNext)));
+            AddAssert("Ensure first tab", () => switchingTabControl.Current.Value == switchingTabControl.VisibleItems.First());
         }

         private class StyledTabControl : TabControl<TestEnum>


Fix failing large offset test

Fix failing large offset test

If we are going to continue to let the underlying clock process frames,
there needs to be a bit of lenience to allow the backwards seek on
resume (to play back over the freq ramp period).

The test is meant to be ensuring we don't skip the full offset amount,
so div10 seems pretty safe.

--- osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
+++ osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
@@ -66,7 +66,7 @@
                 Player.OnUpdate += _ =>
                 {
                     double currentTime = Player.GameplayClockContainer.CurrentTime;
-                    alwaysGoingForward &= currentTime >= lastTime;
+                    alwaysGoingForward &= currentTime >= lastTime - 500;
                     lastTime = currentTime;
                 };
             });
@@ -77,7 +77,7 @@

             resumeAndConfirm();

-            AddAssert("time didn't go backwards", () => alwaysGoingForward);
+            AddAssert("time didn't go too far backwards", () => alwaysGoingForward);

             AddStep("reset offset", () => LocalConfig.SetValue(OsuSetting.AudioOffset, 0.0));
         }


Fix appearance of sheared button borders after click

The border would previously get brighter after click, but then dim
instantly when the flash layer has fully faded out. The underlying issue
there is https://github.com/ppy/osu-framework/issues/5191, but
`ShearedButton` was placing the flashing layer incorrectly anyway, as
the intent was that it should also apply to the border.

--- osu.Game/Graphics/UserInterface/ShearedButton.cs
+++ osu.Game/Graphics/UserInterface/ShearedButton.cs
@@ -5,6 +5,7 @@
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Input.Events;
 using osu.Framework.Localisation;
@@ -68,6 +69,7 @@
         private Colour4? lighterColour;
         private Colour4? textColour;

+        private readonly Container backgroundLayer;
         private readonly Box flashLayer;

         /// <summary>
@@ -85,24 +87,35 @@
             Height = 50;
             Padding = new MarginPadding { Horizontal = shear * 50 };

-            Content.CornerRadius = 7;
+            const float corner_radius = 7;
+
+            Content.CornerRadius = corner_radius;
             Content.Shear = new Vector2(shear, 0);
             Content.Masking = true;
-            Content.BorderThickness = 2;
             Content.Anchor = Content.Origin = Anchor.Centre;

             Children = new Drawable[]
             {
-                background = new Box
+                backgroundLayer = new Container
                 {
-                    RelativeSizeAxes = Axes.Both
-                },
-                text = new OsuSpriteText
-                {
-                    Anchor = Anchor.Centre,
-                    Origin = Anchor.Centre,
-                    Font = OsuFont.TorusAlternate.With(size: 17),
-                    Shear = new Vector2(-shear, 0)
+                    RelativeSizeAxes = Axes.Both,
+                    CornerRadius = corner_radius,
+                    Masking = true,
+                    BorderThickness = 2,
+                    Children = new Drawable[]
+                    {
+                        background = new Box
+                        {
+                            RelativeSizeAxes = Axes.Both
+                        },
+                        text = new OsuSpriteText
+                        {
+                            Anchor = Anchor.Centre,
+                            Origin = Anchor.Centre,
+                            Font = OsuFont.TorusAlternate.With(size: 17),
+                            Shear = new Vector2(-shear, 0)
+                        },
+                    }
                 },
                 flashLayer = new Box
                 {
@@ -186,7 +199,7 @@
             }

             background.FadeColour(colourDark, 150, Easing.OutQuint);
-            Content.TransformTo(nameof(BorderColour), ColourInfo.GradientVertical(colourDark, colourLight), 150, Easing.OutQuint);
+            backgroundLayer.TransformTo(nameof(BorderColour), ColourInfo.GradientVertical(colourDark, colourLight), 150, Easing.OutQuint);

             if (!Enabled.Value)
                 colourText = colourText.Opacity(0.6f);


Add explanation about try-catch logic in `SkinComponentToolbox`

--- osu.Game/Skinning/Editor/SkinComponentToolbox.cs
+++ osu.Game/Skinning/Editor/SkinComponentToolbox.cs
@@ -8,6 +8,7 @@
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Input.Events;
+using osu.Framework.Logging;
 using osu.Game.Graphics;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
@@ -74,8 +75,14 @@
                     RequestPlacement = t => RequestPlacement?.Invoke(t)
                 });
             }
-            catch
+            catch (DependencyNotRegisteredException)
             {
+                // This loading code relies on try-catching any dependency injection errors to know which components are valid for the current target screen.
+                // If a screen can't provide the required dependencies, a skinnable component should not be displayed in the list.
+            }
+            catch (Exception e)
+            {
+                Logger.Error(e, $"Skin component {type} could not be loaded in the editor component list due to an error");
             }
         }


Add pagenum query param for Integrated middleware. See #942

--- core/Piranha.AspNetCore/IntegratedMiddleware.cs
+++ core/Piranha.AspNetCore/IntegratedMiddleware.cs
@@ -291,6 +291,8 @@
                                     var pageNum = Convert.ToInt32(segments[n]);
                                     query.Append("&page=");
                                     query.Append(pageNum);
+                                    query.Append("&pagenum=");
+                                    query.Append(pageNum);
                                 }
                                 catch
                                 {


In the revision log view, each row contains two links with the revision number.
I made those links a little bit more explicit:
 * the link in the '''Rev''' column now shows a hint ''Browse revision x''
 * the link in the '''Chgset''' column is now displayed enclosed in `[...]`
   and shows a hint ''View changeset [x]''

git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@2199 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/log.cs
+++ templates/log.cs
@@ -107,10 +107,12 @@

      <?cs var:log.changes[item.rev].date ?>

-      <a href="<?cs var:item.browser_href ?>"><?cs var:item.rev ?>
+      <a href="<?cs var:item.browser_href ?>"
+         title="Browse at revision <?cs var:item.rev ?>"><?cs var:item.rev ?>

-      <a href="<?cs var:item.changeset_href ?>"><?cs var:item.rev ?>
+      <a href="<?cs var:item.changeset_href ?>"
+         title="View changeset [<?cs var:item.rev ?>]">[<?cs var:item.rev ?>]

      <?cs var:log.changes[item.rev].author ?>
      <?cs var:log.changes[item.rev].message ?>


JimEvans: Check elements' internal IDs for equality before making RPC call to determine IWebElement equality in .NET.

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@15255 07704840-8298-11de-bf8c-fd130f914ac9

--- dotnet/src/WebDriver/Remote/RemoteWebElement.cs
+++ dotnet/src/WebDriver/Remote/RemoteWebElement.cs
@@ -741,6 +741,14 @@
                 return false;
             }

+            if (this.elementId == otherAsElement.Id)
+            {
+                // For drivers that implement ID equality, we can check for equal IDs
+                // here, and expect them to be equal. There is a potential danger here
+                // where two different elements are assigned the same ID.
+                return true;
+            }
+
             Dictionary<string, object> parameters = new Dictionary<string, object>();
             parameters.Add("id", this.elementId);
             parameters.Add("other", otherAsElement.Id);


Adding ignore reason for HTML5 test for Edge in .NET

--- dotnet/test/common/HTML5/LocationContextTest.cs
+++ dotnet/test/common/HTML5/LocationContextTest.cs
@@ -6,7 +6,7 @@
     public class LocationContextTest : DriverTestFixture
     {
         [Test]
-        [IgnoreBrowser(Browser.Edge)]
+        [IgnoreBrowser(Browser.Edge, "Driver incorrectly reports location capability")]
         [IgnoreBrowser(Browser.Firefox, "Firefox driver incorrectly reports capability of geolocation.")]
         [IgnoreBrowser(Browser.Chrome, "Chrome driver does not support setting altitude value.")]
         public void ShouldSetAndGetLocation()


Removed Server.Broadcast()

Removed Server.Broadcast()


-Tests

-Tests

--- Src/Newtonsoft.Json.Glimpse.Tests/GlimpseTraceWriterTests.cs
+++ Src/Newtonsoft.Json.Glimpse.Tests/GlimpseTraceWriterTests.cs
@@ -64,6 +64,10 @@
       Assert.AreEqual(null, messages[1].Type);
       Assert.AreEqual(TimeSpan.FromSeconds(1), messages[1].Duration);
       Assert.AreEqual("More random text", messages[1].Message);
+
+      IList<JsonTimelineMessage> timelineMessages = broker.Messages.OfType<JsonTimelineMessage>().ToList();
+      Assert.AreEqual(1, timelineMessages.Count);
+      Assert.AreEqual("Unknown", timelineMessages[0].EventName);
     }

     [Test]
@@ -113,6 +117,10 @@
   2,
   3
 ]", messages[2].JsonText);
+
+      IList<JsonTimelineMessage> timelineMessages = broker.Messages.OfType<JsonTimelineMessage>().ToList();
+      Assert.AreEqual(1, timelineMessages.Count);
+      Assert.AreEqual("Serialize - Int32", timelineMessages[0].EventName);
     }

     [Test]
@@ -162,6 +170,10 @@
   2,
   3
 ]", messages[2].JsonText);
+
+      IList<JsonTimelineMessage> timelineMessages = broker.Messages.OfType<JsonTimelineMessage>().ToList();
+      Assert.AreEqual(1, timelineMessages.Count);
+      Assert.AreEqual("Deserialize - Int32", timelineMessages[0].EventName);
     }
   }
 }


Quick fix for #5163

Quick fix for #5163

+ Player can no longer weld themselves inside or wrench a closet whiles inside
+ Added a catch for when the player doesn't exist (needed for resist/breakout)
+ Removed some TODOs + minor cleanup


Fixed for radial randomly losing references ( hopefully fixes the last issue of staging ) (#8013)

* This should prevent it

* Update


up test

up test

--- Terradue.Tep.Test/Wpsjob.Test.cs
+++ Terradue.Tep.Test/Wpsjob.Test.cs
@@ -24,8 +24,6 @@
                 Console.Error.WriteLine(e.Message);
                 throw;
             }
-
-            context.ConsoleDebug = true;

         }

@@ -112,7 +110,6 @@
             wpsjob.RemoteIdentifier = Guid.NewGuid().ToString();
             wpsjob.Identifier = Guid.NewGuid().ToString();
             wpsjob.OwnerId = owner.Id;
-            wpsjob.UserId = owner.Id;
             wpsjob.WpsId = wps.Provider.Identifier;
             wpsjob.ProcessId = wps.Identifier;
             wpsjob.CreatedTime = DateTime.UtcNow;
@@ -256,7 +253,7 @@
                 jobList.Load();
                 items = jobList.GetItemsAsList();
                 Assert.AreEqual(NBJOBS_USR1_RESTRICTED_OWNED, items.Count);
-                Assert.AreEqual("restricted-job-usr1", items [0].Name);
+                Assert.AreEqual("restricted-job-usr1-2", items [0].Name);

                 //Test Visibility PRIVATE
                 jobList = new EntityList<WpsJob>(context);
@@ -314,25 +311,23 @@

             try {
                 EntityList<WpsJob> jobList = new EntityList<WpsJob>(context);
-                //jobList.UserId = usr1.Id;
                 jobList.SetFilter("OwnerId", usr1.Id.ToString());
                 jobList.Load();
                 var items = jobList.GetItemsAsList();
                 Assert.AreEqual(NBJOBS_USR1_OWNED, items.Count);

                 jobList = new EntityList<WpsJob>(context);
-                //jobList.UserId = usr2.Id;
                 jobList.SetFilter("OwnerId", usr2.Id.ToString());
                 jobList.Load();
                 items = jobList.GetItemsAsList();
                 Assert.AreEqual(NBJOBS_USR1_OWNED_USR2, items.Count);

                 jobList = new EntityList<WpsJob>(context);
-                //jobList.UserId = usr3.Id;
                 jobList.SetFilter("OwnerId", usr3.Id.ToString());
                 jobList.Load();
                 items = jobList.GetItemsAsList();
                 Assert.AreEqual(NBJOBS_USR1_OWNED_USR3, items.Count);
+
             } catch (Exception e) {
                 Assert.Fail(e.Message);
             } finally {


Add the Min and the Max range in DateTimeValidationRule.

--- WinUX.Common/Data/Validation/Rules/DateTimeValidationRule.cs
+++ WinUX.Common/Data/Validation/Rules/DateTimeValidationRule.cs
@@ -7,6 +7,26 @@
     /// </summary>
     public class DateTimeValidationRule : ValidationRule
     {
+        /// <summary>
+        ///  Gets or sets the minimum of <see cref="DateTime"/>.
+        ///  The default value is DateTime.MinValue
+        /// </summary>
+        public DateTime MinDateTime
+        {
+            set;
+            get;
+        } = DateTime.MinValue;
+
+        /// <summary>
+        /// Gets or sets the maximum of <see cref="DateTime"/>.
+        /// The default value is DateTime.MaxValue
+        /// </summary>
+        public DateTime MaxDateTime
+        {
+            set;
+            get;
+        } = DateTime.MaxValue;
+
         /// <summary>
         /// Validates the specified object is a <see cref="DateTime"/>.
         /// </summary>
@@ -27,7 +47,11 @@
             }

             DateTime temp;
-            return DateTime.TryParse(val, out temp);
+            if (DateTime.TryParse(val, out temp))
+            {
+                return temp >= MinDateTime && temp <= MaxDateTime;
+            }
+            return false;
         }
     }
 }


Add set nickname / game commands

Add set nickname / game commands

--- WycademyV2/src/WycademyV2/Commands/Modules/SettingsModule.cs
+++ WycademyV2/src/WycademyV2/Commands/Modules/SettingsModule.cs
@@ -65,5 +65,30 @@
                 }
             }
         }
+
+        [Group("set")]
+        public class SetGroup : ModuleBase
+        {
+            [Command("nick")]
+            [Summary("Set the nickname of the bot for the current server.")]
+            [RequireOwner]
+            [RequireUnlocked]
+            [RequireContext(ContextType.Guild)]
+            public async Task SetNickname([Remainder] string name)
+            {
+                var botUser = await Context.Guild.GetCurrentUserAsync();
+
+                await botUser.ModifyAsync(x => x.Nickname = name == "DEFAULT" ? null : name);
+            }
+
+            [Command("game")]
+            [Summary("Sets the current game to show the bot as playing.")]
+            [RequireOwner]
+            [RequireUnlocked]
+            public async Task SetGame([Remainder] string game)
+            {
+                await (Context.Client as DiscordSocketClient).SetGame(game);
+            }
+        }
     }
 }


make padding of AtomicLong optional when compiling as performance seems to be double without padding.

--- Src/Metrics/Utils/AtomicLong.cs
+++ Src/Metrics/Utils/AtomicLong.cs
@@ -1,21 +1,24 @@
-
+#if PADDED_ATOMIC_LONG
 using System.Runtime.InteropServices;
+#endif
 using System.Threading;
 namespace Metrics.Utils
 {
     ///
-    /// Atomic long. Padded to avoid false sharing.
-    ///
+    /// Atomic long.
     /// TBD: implement optimizations behind LongAdder from
     /// metrics-core
     ///
-    [StructLayout(LayoutKind.Explicit, Size = 64)]
+#if PADDED_ATOMIC_LONG
+    [StructLayout(LayoutKind.Explicit, Size = 64 * 2)]
+#endif
     public struct AtomicLong
     {
+
+#if PADDED_ATOMIC_LONG
         [FieldOffset(64)]
+#endif
         private long value;
-
-        //public AtomicLong() : this(0L) { }

         public AtomicLong(long value)
         {


Modified widget model class to generate proper json instead of typed C# json

--- src/DataCat.Core/Model/WidgetModel.cs
+++ src/DataCat.Core/Model/WidgetModel.cs
@@ -34,9 +34,9 @@
             {
                 FilterId = this.FilterId,
                 CollectionName = this.CollectionName,
-                Config = this.Config.ToBsonDocument(),
+                Config = BsonDocument.Parse(this.Config.ToString()),
                 ConnectionId = this.ConnectionId,
-                DataMap = this.Config.ToBsonDocument(),
+                DataMap = BsonDocument.Parse(this.DataMap.ToString()),
                 Type = this.Type,
                 User = userId
             };


Add ReadTest.SqlInjectionAttack(), a sanity check to ensure that we properly
escape parameters to avoid SQL injection attacks.

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1159 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Test/Providers/ReadTest.cs
+++ src/DbLinq/Test/Providers/ReadTest.cs
@@ -1070,5 +1070,12 @@

         #endregion

+        [Test]
+        public void SqlInjectionAttack()
+        {
+            var db = CreateDB();
+            var q = db.Customers.Where(c => c.ContactName == "'; DROP TABLE DoesNotExist; --");
+            Assert.AreEqual(0, q.Count());
+        }
     }
 }


[*] Fixed error & improved code

[*] Fixed error & improved code

--- source/Indy.IL2CPU.IL.X86/Bge.cs
+++ source/Indy.IL2CPU.IL.X86/Bge.cs
@@ -21,24 +21,14 @@
 			string BaseLabel = CurInstructionLabel + "__";
 			string LabelTrue = BaseLabel + "True";
 			string LabelFalse = BaseLabel + "False";
-#warning Code checking: strange code seems to be generated. Read the following comments:
 			//JumpAlways right after JumpIfGreaterOrEquals to the same label
 			//my offer is:
-			//new CPUx86.Pop(CPUx86.Registers.EAX);
-			//new CPUx86.Pop(CPUx86.Registers.EBX);
-			//new CPUx86.Compare(CPUx86.Registers.EAX, CPUx86.Registers.EBX);
-			//new CPUx86.JumpIfLess(LabelFalse);
-			//new CPU.JumpAlways(TargetLabel);
-			//new CPU.Label(LabelFalse);
 			new CPUx86.Pop(CPUx86.Registers.EAX);
-			new CPUx86.Compare(CPUx86.Registers.EAX, CPUx86.Registers.AtESP);
-			new CPUx86.JumpIfGreaterOrEquals(LabelTrue);
-			new CPUx86.JumpAlways(LabelTrue);
-			new CPU.Label(LabelTrue);
-			new CPUx86.Add(CPUx86.Registers.ESP, "4");
-			new CPUx86.JumpAlways(TargetLabel);
+			new CPUx86.Pop(CPUx86.Registers.EBX);
+			new CPUx86.Compare(CPUx86.Registers.EAX, CPUx86.Registers.EBX);
+			new CPUx86.JumpIfLess(LabelFalse);
+			new CPU.JumpAlways(TargetLabel);
 			new CPU.Label(LabelFalse);
-			new CPUx86.Add(CPUx86.Registers.ESP, "4");
 		}

 		private void DoAssemble64Bit() {


Avoid "Input string was not in a correct format." exception when endpoint was giving a response body which could not be parsed by string.Format. No callers were using the "args" overloads anyway.

--- source/Loggly/LogglyException.cs
+++ source/Loggly/LogglyException.cs
@@ -25,16 +25,14 @@
         #endregion

         #region Static Methods
-        public static void Throw(string format, params object[] args)
+        public static void Throw(string message)
         {
-            string message = string.Format(format, args);
             var exception = new LogglyException(message);
             Throw(exception);
         }

-        public static void Throw(Exception innerException, string format, params object[] args)
+        public static void Throw(Exception innerException, string message)
         {
-            string message = string.Format(format, args);
             var exception = new LogglyException(message, innerException);
             Throw(exception);
         }


Update ZoomControl.cs

Update ZoomControl.cs

--- src/Draw2D.ZoomControl/ZoomControl.cs
+++ src/Draw2D.ZoomControl/ZoomControl.cs
@@ -34,6 +34,8 @@
         private bool _isCaptured;
         private InputModifiers _capturedInputModifiers;
         private IPointer _capturedPointer;
+        private Matrix _currentMatrix;
+        private Point _panPosition;

         public static readonly DirectProperty<ZoomControl, IZoomServiceState> ZoomServiceStateProperty =
            AvaloniaProperty.RegisterDirect<ZoomControl, IZoomServiceState>(nameof(ZoomServiceState), o => o.ZoomServiceState, (o, v) => o.ZoomServiceState = v);
@@ -61,10 +63,6 @@
             get { return _drawTarget; }
             set { SetAndRaise(DrawTargetProperty, ref _drawTarget, value); }
         }
-
-        private Matrix CurrentMatrix { get; set; }
-
-        private Point PanPosition { get; set; }

         public Action Capture { get; set; }

@@ -83,11 +81,6 @@
             _isCaptured = false;
             _capturedInputModifiers = InputModifiers.None;
             _capturedPointer = null;
-
-            PointerWheelChanged += (sender, e) => HandlePointerWheelChanged(e);
-            PointerPressed += (sender, e) => HandlePointerPressed(e);
-            PointerReleased += (sender, e) => HandlePointerReleased(e);
-            PointerMoved += (sender, e) => HandlePointerMoved(e);
         }

         private void GetOffset(out double dx, out double dy, out double zx, out double zy)
@@ -126,15 +119,6 @@
                 }
             }
             _pointers[e.Pointer] = (e.Pointer, e.GetPosition(this), e.InputModifiers);
-        }
-
-        private void HandlePointerWheelChanged(PointerWheelEventArgs e)
-        {
-            if (_zoomServiceState != null)
-            {
-                var zpoint = AdjustZoomPoint(e.GetPosition(this));
-                Wheel(e.Delta.Y, zpoint.X, zpoint.Y);
-            }
         }

         private void GetPointerPressedType(PointerPressedEventArgs e, out bool isLeft)
@@ -211,6 +195,15 @@
 #endif
         }

+        private void HandlePointerWheelChanged(PointerWheelEventArgs e)
+        {
+            if (_zoomServiceState != null)
+            {
+                var zpoint = AdjustZoomPoint(e.GetPosition(this));
+                Wheel(e.Delta.Y, zpoint.X, zpoint.Y);
+            }
+        }
+
         private void HandlePointerPressed(PointerPressedEventArgs e)
         {
             UpdatePointer(e);
@@ -366,7 +359,7 @@

         private void UpdateCurrentMatrix()
         {
-            CurrentMatrix = new Matrix(
+            _currentMatrix = new Matrix(
                 _zoomServiceState.ZoomX,
                 0,
                 0,
@@ -377,10 +370,10 @@

         private void UpdateZoomServiceState()
         {
-            _zoomServiceState.ZoomX = CurrentMatrix.M11;
-            _zoomServiceState.ZoomY = CurrentMatrix.M22;
-            _zoomServiceState.OffsetX = CurrentMatrix.M31;
-            _zoomServiceState.OffsetY = CurrentMatrix.M32;
+            _zoomServiceState.ZoomX = _currentMatrix.M11;
+            _zoomServiceState.ZoomY = _currentMatrix.M22;
+            _zoomServiceState.OffsetX = _currentMatrix.M31;
+            _zoomServiceState.OffsetY = _currentMatrix.M32;
         }

         public void ZoomTo(double zoom, double x, double y)
@@ -388,7 +381,7 @@
             if (_zoomServiceState != null && _inputTarget != null)
             {
                 UpdateCurrentMatrix();
-                CurrentMatrix = new Matrix(zoom, 0, 0, zoom, x - (zoom * x), y - (zoom * y)) * CurrentMatrix;
+                _currentMatrix = new Matrix(zoom, 0, 0, zoom, x - (zoom * x), y - (zoom * y)) * _currentMatrix;
                 UpdateZoomServiceState();
             }
         }
@@ -405,7 +398,7 @@
         {
             if (_zoomServiceState != null && _inputTarget != null)
             {
-                PanPosition = new Point(x, y);
+                _panPosition = new Point(x, y);
             }
         }

@@ -413,12 +406,12 @@
         {
             if (_zoomServiceState != null && _inputTarget != null)
             {
-                double dx = x - PanPosition.X;
-                double dy = y - PanPosition.Y;
+                double dx = x - _panPosition.X;
+                double dy = y - _panPosition.Y;
                 Point delta = new Point(dx, dy);
-                PanPosition = new Point(x, y);
+                _panPosition = new Point(x, y);
                 UpdateCurrentMatrix();
-                CurrentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, delta.X, delta.Y) * CurrentMatrix;
+                _currentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, delta.X, delta.Y) * _currentMatrix;
                 UpdateZoomServiceState();
             }
         }
@@ -427,7 +420,7 @@
         {
             if (_zoomServiceState != null && _inputTarget != null)
             {
-                CurrentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
+                _currentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
                 UpdateZoomServiceState();
             }
         }
@@ -438,7 +431,7 @@
             {
                 double ox = (panelWidth - elementWidth) / 2;
                 double oy = (panelHeight - elementHeight) / 2;
-                CurrentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, ox, oy);
+                _currentMatrix = new Matrix(1.0, 0.0, 0.0, 1.0, ox, oy);
                 UpdateZoomServiceState();
             }
         }
@@ -451,7 +444,7 @@
                 double zy = panelHeight / elementHeight;
                 double ox = (panelWidth - elementWidth * zx) / 2;
                 double oy = (panelHeight - elementHeight * zy) / 2;
-                CurrentMatrix = new Matrix(zx, 0.0, 0.0, zy, ox, oy);
+                _currentMatrix = new Matrix(zx, 0.0, 0.0, zy, ox, oy);
                 UpdateZoomServiceState();
             }
         }
@@ -465,7 +458,7 @@
                 double zoom = Math.Min(zx, zy);
                 double ox = (panelWidth - elementWidth * zoom) / 2;
                 double oy = (panelHeight - elementHeight * zoom) / 2;
-                CurrentMatrix = new Matrix(zoom, 0.0, 0.0, zoom, ox, oy);
+                _currentMatrix = new Matrix(zoom, 0.0, 0.0, zoom, ox, oy);
                 UpdateZoomServiceState();
             }
         }
@@ -479,7 +472,7 @@
                 double zoom = Math.Max(zx, zy);
                 double ox = (panelWidth - elementWidth * zoom) / 2;
                 double oy = (panelHeight - elementHeight * zoom) / 2;
-                CurrentMatrix = new Matrix(zoom, 0.0, 0.0, zoom, ox, oy);
+                _currentMatrix = new Matrix(zoom, 0.0, 0.0, zoom, ox, oy);
                 UpdateZoomServiceState();
             }
         }
@@ -527,6 +520,31 @@
                 UniformToFill(Bounds.Width, Bounds.Height, _inputTarget.GetWidth(), _inputTarget.GetHeight());
                 Invalidate(redraw);
             }
+        }
+
+
+        protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
+        {
+            base.OnPointerWheelChanged(e);
+            HandlePointerWheelChanged(e);
+        }
+
+        protected override void OnPointerPressed(PointerPressedEventArgs e)
+        {
+            base.OnPointerPressed(e);
+            HandlePointerPressed(e);
+        }
+
+        protected override void OnPointerReleased(PointerReleasedEventArgs e)
+        {
+            base.OnPointerReleased(e);
+            HandlePointerReleased(e);
+        }
+
+        protected override void OnPointerMoved(PointerEventArgs e)
+        {
+            base.OnPointerMoved(e);
+            HandlePointerMoved(e);
         }

         protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)


Updating to version 0.2.1

Updating to version 0.2.1

Need to bump version to be able to publish new nuget package

--- src/DtaSpy/Properties/AssemblyInfo.cs
+++ src/DtaSpy/Properties/AssemblyInfo.cs
@@ -31,7 +31,7 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.2.0.0")]
-[assembly: AssemblyFileVersion("0.2.0.0")]
+[assembly: AssemblyVersion("0.2.1.0")]
+[assembly: AssemblyFileVersion("0.2.1.0")]

 [assembly: InternalsVisibleTo("DtaSpy.Tests")]


dotnet: Sync ShiftSchedulingSat with the Python one

--- examples/dotnet/ShiftSchedulingSat.cs
+++ examples/dotnet/ShiftSchedulingSat.cs
@@ -46,7 +46,7 @@
                                           (3, 0, 5, -2),
                                           // Employee 5 wants a night shift on the second Thursday.
                                           (5, 3, 10, -2),
-                                          // Employee 2 does not want a night shift on the third Friday.
+                                          // Employee 2 does not want a night shift on the first Friday.
                                           (2, 3, 4, 4)
         };

@@ -390,7 +390,7 @@
         // Forbid sequences that are too short.
         foreach (var length in Range(1, hardMin))
         {
-            foreach (var start in Range(works.Length - length - 1))
+            foreach (var start in Range(works.Length - length + 1))
             {
                 model.AddBoolOr(NegatedBoundedSpan(works, start, length));
             }
@@ -402,7 +402,7 @@
         {
             foreach (var length in Range(hardMin, softMin))
             {
-                foreach (var start in Range(works.Length - length - 1))
+                foreach (var start in Range(works.Length - length + 1))
                 {
                     var span = NegatedBoundedSpan(works, start, length).ToList();
                     var name = $": under_span(start={start}, length={length})";
@@ -422,7 +422,7 @@
         {
             foreach (var length in Range(softMax + 1, hardMax + 1))
             {
-                foreach (var start in Range(works.Length - length - 1))
+                foreach (var start in Range(works.Length - length + 1))
                 {
                     var span = NegatedBoundedSpan(works, start, length).ToList();
                     var name = $": over_span(start={start}, length={length})";


Program can be made static

Program can be made static

--- src/FluentMigrator.Console/Program.cs
+++ src/FluentMigrator.Console/Program.cs
@@ -20,7 +20,7 @@

 namespace FluentMigrator.Console
 {
-    class Program
+    static class Program
     {
         static int Main(string[] args)
         {


Make MassMoment.GetCenterOfMass return 0 if mass is 0

Previous I was returning NaN. Technically the center of mass is
undefined when mass is 0, but returning NaN tends to cause cascading
NaNs whereas any non-NaN number would later get cancelled by the zero
mass.

--- Viewer/src/physics/MassMoment.cs
+++ Viewer/src/physics/MassMoment.cs
@@ -65,7 +65,11 @@
 	}

 	public Vector3 GetCenterOfMass() {
-		return massPosition / mass;
+		if (mass == 0) {
+			return Vector3.Zero;
+		} else {
+			return massPosition / mass;
+		}
 	}

 	public float GetMomentOfInertia(Vector3 axisOfRotation, Vector3 centerOfRotation) {


simplified screen shot images

simplified screen shot images

--- WWTMVC5/Views/Learn/Index.cshtml
+++ WWTMVC5/Views/Learn/Index.cshtml
@@ -14,9 +14,7 @@

Alternatively, below please see some annotated screen shots of the WWT Web Client user interface

-

-

 Install WorldWide Telescope on a Windows PC

After downloading WorldWide Telescope, install and launch the program.  Upon first opening the Home screen, you’ll find a dialogue box that tells you how to navigate in the WorldWide Telescope.


Remove duplication

Remove duplication

--- WalletWasabi/Stores/IoManager.cs
+++ WalletWasabi/Stores/IoManager.cs
@@ -175,24 +175,42 @@
 				}
 			}

+			var byteArrayBuilder = new ByteArrayBuilder();
+			foreach (var line in lines)
+			{
+				ContinueBuildHash(byteArrayBuilder, line);
+			}
+
+			var res = await WorkWithHashAsync(byteArrayBuilder, cancellationToken);
+			if (res.same)
+			{
+				return;
+			}
+
+			IoHelpers.EnsureContainingDirectoryExists(NewFilePath);
+
+			await File.WriteAllLinesAsync(NewFilePath, lines, cancellationToken);
+			SafeMoveNewToOriginal();
+			await WriteOutHashAsync(res.hash);
+		}
+
+		private async Task<(bool same, byte[] hash)> WorkWithHashAsync(ByteArrayBuilder byteArrayBuilder, CancellationToken cancellationToken)
+		{
 			byte[] hash = null;
 			try
 			{
-				byte[] bytes;
-				var byteArrayBuilder = new ByteArrayBuilder();
-				foreach (var line in lines)
-				{
-					ContinueBuildHash(byteArrayBuilder, line);
-				}
-
-				bytes = byteArrayBuilder.ToArray();
+				var bytes = byteArrayBuilder.ToArray();
 				hash = HashHelpers.GenerateSha256Hash(bytes);
 				if (File.Exists(DigestFilePath))
 				{
 					var digest = await File.ReadAllBytesAsync(DigestFilePath, cancellationToken);
 					if (ByteHelpers.CompareFastUnsafe(hash, digest))
 					{
-						return;
+						if (File.Exists(NewFilePath))
+						{
+							File.Delete(NewFilePath);
+						}
+						return (true, hash);
 					}
 				}
 			}
@@ -202,11 +220,7 @@
 				Logger.LogInfo<IoManager>(ex);
 			}

-			IoHelpers.EnsureContainingDirectoryExists(NewFilePath);
-
-			await File.WriteAllLinesAsync(NewFilePath, lines, cancellationToken);
-			SafeMoveNewToOriginal();
-			await WriteOutHashAsync(hash);
+			return (false, hash);
 		}

 		private async Task WriteOutHashAsync(byte[] hash)
@@ -237,8 +251,6 @@
 				File.Delete(NewFilePath);
 			}

-			byte[] hash = null;
-			byte[] bytes;
 			var byteArrayBuilder = new ByteArrayBuilder();

 			var linesArray = lines.ToArray();
@@ -289,27 +301,14 @@
 				await sw.FlushAsync();
 			}

-			try
-			{
-				bytes = byteArrayBuilder.ToArray();
-				hash = HashHelpers.GenerateSha256Hash(bytes);
-				if (File.Exists(DigestFilePath))
-				{
-					var digest = await File.ReadAllBytesAsync(DigestFilePath, cancellationToken);
-					if (ByteHelpers.CompareFastUnsafe(hash, digest))
-					{
-						return;
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				Logger.LogWarning<IoManager>("Failed to read digest.");
-				Logger.LogInfo<IoManager>(ex);
+			var res = await WorkWithHashAsync(byteArrayBuilder, cancellationToken);
+			if (res.same)
+			{
+				return;
 			}

 			SafeMoveNewToOriginal();
-			await WriteOutHashAsync(hash);
+			await WriteOutHashAsync(res.hash);
 		}

 		public async Task<string[]> ReadAllLinesAsync(CancellationToken cancellationToken = default)


Go deeper when gathering parameters from functions and procedures

--- Watsonia.Data/DatabaseUpdater.cs
+++ Watsonia.Data/DatabaseUpdater.cs
@@ -363,14 +363,7 @@
 			// Get the parameters from the statement property
 			if (procedure.Statement is SelectStatement select)
 			{
-				GatherMappedParameters(procedure.Parameters, select.Conditions);
-				foreach (var source in select.SourceFields)
-				{
-					if (source is Sql.SelectExpression sourceSelect)
-					{
-						GatherMappedParameters(procedure.Parameters, sourceSelect.Select.Conditions);
-					}
-				}
+				GatherMappedParametersFromSelect(procedure.Parameters, select);
 			}

 			// Add the procedure to the dictionary
@@ -392,27 +385,36 @@
 			// Get the parameters from the statement property
 			if (function.Statement is SelectStatement select)
 			{
-				GatherMappedParameters(function.Parameters, select.Conditions);
-				foreach (var source in select.SourceFields)
-				{
-					if (source is Sql.SelectExpression sourceSelect)
-					{
-						GatherMappedParameters(function.Parameters, sourceSelect.Select.Conditions);
-					}
-				}
+				GatherMappedParametersFromSelect(function.Parameters, select);
 			}

 			// Add the function to the dictionary
 			functionDictionary.Add(function.Name, function);
 		}

-		private void GatherMappedParameters(ICollection<MappedParameter> parameters, ConditionCollection conditions)
+		private void GatherMappedParametersFromSelect(ICollection<MappedParameter> parameters, SelectStatement select)
+		{
+			GatherMappedParametersFromConditionCollection(parameters, select.Conditions);
+			foreach (var source in select.SourceFields)
+			{
+				if (source is Sql.SelectExpression sourceSelect)
+				{
+					GatherMappedParametersFromConditionCollection(parameters, sourceSelect.Select.Conditions);
+				}
+			}
+			foreach (var unionSelect in select.UnionStatements)
+			{
+				GatherMappedParametersFromSelect(parameters, unionSelect);
+			}
+		}
+
+		private void GatherMappedParametersFromConditionCollection(ICollection<MappedParameter> parameters, ConditionCollection conditions)
 		{
 			foreach (var condition in conditions)
 			{
 				if (condition is ConditionCollection)
 				{
-					GatherMappedParameters(parameters, (ConditionCollection)condition);
+					GatherMappedParametersFromConditionCollection(parameters, (ConditionCollection)condition);
 				}
 				else if (condition is Condition)
 				{


Storage bugfix

Storage bugfix

--- server/Storage/GoogleDriveHutelStorageClient.cs
+++ server/Storage/GoogleDriveHutelStorageClient.cs
@@ -93,7 +93,7 @@
             var validFiles = fileList.Items.Where(file => file.Labels.Trashed != true).ToList();
             if (validFiles.Count > 0)
             {
-                return fileList.Items[0].Id;
+                return validFiles[0].Id;
             }
             else
             {