Use getEvent upto ver 1.3 if supported.

Use getEvent upto ver 1.3 if supported.

--- Project/uwpmm/uwpmm.Shared/CameraControl/StatusObserver.cs
+++ Project/uwpmm/uwpmm.Shared/CameraControl/StatusObserver.cs
@@ -1,286 +1,289 @@
-using Kazyx.RemoteApi;
-using Kazyx.RemoteApi.Camera;
-using Kazyx.Uwpmm.DataModel;
-using Kazyx.Uwpmm.Utility;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Kazyx.Uwpmm.CameraControl
-{
-    public class StatusObserver
-    {
-        public StatusObserver(TargetDevice device)
-        {
-            this.api = device.Api;
-            this.target = device.Status;
-        }
-
-        private readonly DeviceApiHolder api;
-
-        private readonly CameraStatus target;
-
-        private bool _IsProcessing = false;
-        public bool IsProcessing
-        {
-            private set { _IsProcessing = value; }
-            get { return _IsProcessing; }
-        }
-
-        private int failure_count = 0;
-
-        private const int RETRY_LIMIT = 3;
-
-        private const int RETRY_INTERVAL_SEC = 3;
-
-        public event Action EndByError;
-
-        private ApiVersion version = ApiVersion.V1_0;
-
-        public async Task<bool> Start()
-        {
-            DebugUtil.Log("StatusObserver: Start");
-            if (IsProcessing)
-            {
-                DebugUtil.Log("StatusObserver: Already processing");
-                return false;
-            }
-
-            version = api.Capability.IsSupported("getEvent", "1.1") ? ApiVersion.V1_1 : ApiVersion.V1_0;
-
-            failure_count = 0;
-            if (!await Refresh())
-            {
-                DebugUtil.Log("StatusObserver: Failed to start");
-                return false;
-            }
-
-            IsProcessing = true;
-            PollingLoop();
-            return true;
-        }
-
-        public void Stop()
-        {
-            DebugUtil.Log("StatusObserver: Stop");
-            IsProcessing = false;
-        }
-
-        public async Task<bool> Refresh()
-        {
-            DebugUtil.Log("StatusObserver: Refresh");
-            try
-            {
-                await Update(await api.Camera.GetEventAsync(false, version));
-            }
-            catch (RemoteApiException e)
-            {
-                DebugUtil.Log("StatusObserver: Refresh failed - " + e.code);
-                return false;
-            }
-            return true;
-        }
-
-        private async Task Update(Event status)
-        {
-            if (status.AvailableApis != null) { api.Capability.AvailableApis = status.AvailableApis; }
-            target.IsLiveviewAvailable = status.LiveviewAvailable;
-            if (status.ShootModeInfo != null) { target.ShootMode = status.ShootModeInfo; }
-            if (status.ExposureMode != null) { target.ExposureMode = status.ExposureMode; }
-            if (status.ISOSpeedRate != null) { target.ISOSpeedRate = status.ISOSpeedRate; }
-            if (status.ShutterSpeed != null) { target.ShutterSpeed = status.ShutterSpeed; }
-            if (status.FNumber != null) { target.FNumber = status.FNumber; }
-            if (status.ZoomInfo != null) { target.ZoomInfo = status.ZoomInfo; }
-            if (status.PostviewSizeInfo != null) { target.PostviewSize = status.PostviewSizeInfo; }
-            if (status.SelfTimerInfo != null) { target.SelfTimer = status.SelfTimerInfo; }
-            if (status.BeepMode != null) { target.BeepMode = status.BeepMode; }
-            if (status.FlashMode != null) { target.FlashMode = status.FlashMode; }
-            if (status.FocusMode != null) { target.FocusMode = status.FocusMode; }
-            if (status.ViewAngle != null) { target.ViewAngle = status.ViewAngle; }
-            if (status.SteadyMode != null) { target.SteadyMode = status.SteadyMode; }
-            if (status.MovieQuality != null) { target.MovieQuality = status.MovieQuality; }
-            if (status.TouchAFStatus != null) { target.TouchFocusStatus = status.TouchAFStatus; }
-            if (status.ProgramShiftActivated != null) { target.ProgramShiftActivated = status.ProgramShiftActivated.Value; }
-            if (status.PictureUrls != null) { target.PictureUrls = status.PictureUrls; }
-            if (status.LiveviewOrientation != null) { target.LiveviewOrientation = status.LiveviewOrientation; }
-            if (status.EvInfo != null) { target.EvInfo = status.EvInfo; }
-            if (status.CameraStatus != null) { target.Status = status.CameraStatus; }
-
-            if (status.StillImageSize != null)
-            {
-                if (status.StillImageSize.CapabilityChanged)
-                {
-                    try
-                    {
-                        var size = await api.Camera.GetAvailableStillSizeAsync();
-                        size.Candidates.Sort(CompareStillSize);
-                        target.StillImageSize = size;
-                    }
-                    catch (RemoteApiException)
-                    {
-                        DebugUtil.Log("Failed to get still image size capability");
-                    }
-                }
-                else
-                {
-                    target.StillImageSize.Current = status.StillImageSize.Current;
-                    target.StillImageSize = target.StillImageSize;
-                }
-            }
-
-            if (status.WhiteBalance != null)
-            {
-                if (status.WhiteBalance.CapabilityChanged)
-                {
-                    try
-                    {
-                        var wb = await api.Camera.GetAvailableWhiteBalanceAsync();
-                        var candidates = new List<string>();
-                        var tmpCandidates = new Dictionary<string, int[]>();
-                        foreach (var mode in wb.Candidates)
-                        {
-                            candidates.Add(mode.WhiteBalanceMode);
-                            var tmpList = new List<int>();
-                            if (mode.Candidates.Count == 3)
-                            {
-                                for (int i = mode.Candidates[1]; i <= mode.Candidates[0]; i += mode.Candidates[2])
-                                {
-                                    tmpList.Add(i);
-                                }
-                            }
-                            tmpCandidates.Add(mode.WhiteBalanceMode, tmpList.ToArray());
-
-                            var builder = new System.Text.StringBuilder();
-                            foreach (var val in mode.Candidates)
-                            {
-                                builder.Append(val).Append(", ");
-                            }
-                        }
-
-                        target.WhiteBalance = new Capability<string> { Candidates = candidates, Current = wb.Current.Mode };
-                        target.ColorTempertureCandidates = tmpCandidates;
-                        target.ColorTemperture = wb.Current.ColorTemperature;
-                    }
-                    catch (RemoteApiException)
-                    {
-                        DebugUtil.Log("Failed to get white balance capability");
-                    }
-                }
-                else
-                {
-                    if (status.WhiteBalance != null)
-                    {
-                        target.WhiteBalance.Current = status.WhiteBalance.Current.Mode;
-                    }
-                    target.ColorTemperture = status.WhiteBalance.Current.ColorTemperature;
-                }
-            }
-        }
-
-        private async void PollingLoop()
-        {
-            if (!IsProcessing)
-            {
-                return;
-            }
-
-            try
-            {
-                OnSuccess(await api.Camera.GetEventAsync(true, version));
-            }
-            catch (RemoteApiException e)
-            {
-                OnError(e.code);
-            }
-        }
-
-        private async void OnSuccess(Event @event)
-        {
-            failure_count = 0;
-            await Update(@event);
-            PollingLoop();
-        }
-
-        private async void OnError(StatusCode code)
-        {
-            switch (code)
-            {
-                case StatusCode.Timeout:
-                    DebugUtil.Log("GetEvent timeout without any event. Retry for the next event");
-                    PollingLoop();
-                    return;
-                case StatusCode.NotAcceptable:
-                case StatusCode.CameraNotReady:
-                case StatusCode.IllegalState:
-                case StatusCode.ServiceUnavailable:
-                case StatusCode.Any:
-                    if (failure_count++ < RETRY_LIMIT)
-                    {
-                        DebugUtil.Log("GetEvent failed - retry " + failure_count + ", status: " + code);
-                        await Task.Delay(TimeSpan.FromSeconds(RETRY_INTERVAL_SEC));
-                        PollingLoop();
-                        return;
-                    }
-                    break;
-                case StatusCode.DuplicatePolling:
-                    DebugUtil.Log("GetEvent failed duplicate polling");
-                    return;
-                default:
-                    DebugUtil.Log("GetEvent failed with code: " + code);
-                    break;
-            }
-
-            DebugUtil.Log("StatusObserver Error limit");
-
-            if (IsProcessing)
-            {
-                Stop();
-                if (EndByError != null)
-                {
-                    EndByError.Invoke();
-                }
-            }
-        }
-
-        private static int CompareStillSize(StillImageSize x, StillImageSize y)
-        {
-            if (x == null && y == null)
-            {
-                return 0;
-            }
-            if (x == null)
-            {
-                return -1;
-            }
-            if (y == null)
-            {
-                return 1;
-            }
-
-            if (!x.SizeDefinition.EndsWith("M") || !y.SizeDefinition.EndsWith("M"))
-            {
-                var comp = x.SizeDefinition.CompareTo(y.SizeDefinition);
-                if (comp == 0)
-                {
-                    return x.AspectRatio.CompareTo(y.AspectRatio);
-                }
-                else
-                {
-                    return comp;
-                }
-            }
-
-            var xv = (int)double.Parse(x.SizeDefinition.Substring(0, x.SizeDefinition.Length - 1)) * 100;
-            var yv = (int)double.Parse(y.SizeDefinition.Substring(0, y.SizeDefinition.Length - 1)) * 100;
-
-            if (xv == yv)
-            {
-                return x.AspectRatio.CompareTo(y.AspectRatio);
-            }
-            else
-            {
-                return xv < yv ? 1 : -1;
-            }
-        }
-    }
-}
+using Kazyx.RemoteApi;
+using Kazyx.RemoteApi.Camera;
+using Kazyx.Uwpmm.DataModel;
+using Kazyx.Uwpmm.Utility;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Kazyx.Uwpmm.CameraControl
+{
+    public class StatusObserver
+    {
+        public StatusObserver(TargetDevice device)
+        {
+            this.api = device.Api;
+            this.target = device.Status;
+        }
+
+        private readonly DeviceApiHolder api;
+
+        private readonly CameraStatus target;
+
+        private bool _IsProcessing = false;
+        public bool IsProcessing
+        {
+            private set { _IsProcessing = value; }
+            get { return _IsProcessing; }
+        }
+
+        private int failure_count = 0;
+
+        private const int RETRY_LIMIT = 3;
+
+        private const int RETRY_INTERVAL_SEC = 3;
+
+        public event Action EndByError;
+
+        private ApiVersion version = ApiVersion.V1_0;
+
+        public async Task<bool> Start()
+        {
+            DebugUtil.Log("StatusObserver: Start");
+            if (IsProcessing)
+            {
+                DebugUtil.Log("StatusObserver: Already processing");
+                return false;
+            }
+
+            if (api.Capability.IsSupported("getEvent", "1.3")) { version = ApiVersion.V1_3; }
+            else if (api.Capability.IsSupported("getEvent", "1.2")) { version = ApiVersion.V1_2; }
+            else if (api.Capability.IsSupported("getEvent", "1.1")) { version = ApiVersion.V1_1; }
+            else { version = ApiVersion.V1_0; }
+
+            failure_count = 0;
+            if (!await Refresh())
+            {
+                DebugUtil.Log("StatusObserver: Failed to start");
+                return false;
+            }
+
+            IsProcessing = true;
+            PollingLoop();
+            return true;
+        }
+
+        public void Stop()
+        {
+            DebugUtil.Log("StatusObserver: Stop");
+            IsProcessing = false;
+        }
+
+        public async Task<bool> Refresh()
+        {
+            DebugUtil.Log("StatusObserver: Refresh");
+            try
+            {
+                await Update(await api.Camera.GetEventAsync(false, version));
+            }
+            catch (RemoteApiException e)
+            {
+                DebugUtil.Log("StatusObserver: Refresh failed - " + e.code);
+                return false;
+            }
+            return true;
+        }
+
+        private async Task Update(Event status)
+        {
+            if (status.AvailableApis != null) { api.Capability.AvailableApis = status.AvailableApis; }
+            target.IsLiveviewAvailable = status.LiveviewAvailable;
+            if (status.ShootModeInfo != null) { target.ShootMode = status.ShootModeInfo; }
+            if (status.ExposureMode != null) { target.ExposureMode = status.ExposureMode; }
+            if (status.ISOSpeedRate != null) { target.ISOSpeedRate = status.ISOSpeedRate; }
+            if (status.ShutterSpeed != null) { target.ShutterSpeed = status.ShutterSpeed; }
+            if (status.FNumber != null) { target.FNumber = status.FNumber; }
+            if (status.ZoomInfo != null) { target.ZoomInfo = status.ZoomInfo; }
+            if (status.PostviewSizeInfo != null) { target.PostviewSize = status.PostviewSizeInfo; }
+            if (status.SelfTimerInfo != null) { target.SelfTimer = status.SelfTimerInfo; }
+            if (status.BeepMode != null) { target.BeepMode = status.BeepMode; }
+            if (status.FlashMode != null) { target.FlashMode = status.FlashMode; }
+            if (status.FocusMode != null) { target.FocusMode = status.FocusMode; }
+            if (status.ViewAngle != null) { target.ViewAngle = status.ViewAngle; }
+            if (status.SteadyMode != null) { target.SteadyMode = status.SteadyMode; }
+            if (status.MovieQuality != null) { target.MovieQuality = status.MovieQuality; }
+            if (status.TouchAFStatus != null) { target.TouchFocusStatus = status.TouchAFStatus; }
+            if (status.ProgramShiftActivated != null) { target.ProgramShiftActivated = status.ProgramShiftActivated.Value; }
+            if (status.PictureUrls != null) { target.PictureUrls = status.PictureUrls; }
+            if (status.LiveviewOrientation != null) { target.LiveviewOrientation = status.LiveviewOrientation; }
+            if (status.EvInfo != null) { target.EvInfo = status.EvInfo; }
+            if (status.CameraStatus != null) { target.Status = status.CameraStatus; }
+
+            if (status.StillImageSize != null)
+            {
+                if (status.StillImageSize.CapabilityChanged)
+                {
+                    try
+                    {
+                        var size = await api.Camera.GetAvailableStillSizeAsync();
+                        size.Candidates.Sort(CompareStillSize);
+                        target.StillImageSize = size;
+                    }
+                    catch (RemoteApiException)
+                    {
+                        DebugUtil.Log("Failed to get still image size capability");
+                    }
+                }
+                else
+                {
+                    target.StillImageSize.Current = status.StillImageSize.Current;
+                    target.StillImageSize = target.StillImageSize;
+                }
+            }
+
+            if (status.WhiteBalance != null)
+            {
+                if (status.WhiteBalance.CapabilityChanged)
+                {
+                    try
+                    {
+                        var wb = await api.Camera.GetAvailableWhiteBalanceAsync();
+                        var candidates = new List<string>();
+                        var tmpCandidates = new Dictionary<string, int[]>();
+                        foreach (var mode in wb.Candidates)
+                        {
+                            candidates.Add(mode.WhiteBalanceMode);
+                            var tmpList = new List<int>();
+                            if (mode.Candidates.Count == 3)
+                            {
+                                for (int i = mode.Candidates[1]; i <= mode.Candidates[0]; i += mode.Candidates[2])
+                                {
+                                    tmpList.Add(i);
+                                }
+                            }
+                            tmpCandidates.Add(mode.WhiteBalanceMode, tmpList.ToArray());
+
+                            var builder = new System.Text.StringBuilder();
+                            foreach (var val in mode.Candidates)
+                            {
+                                builder.Append(val).Append(", ");
+                            }
+                        }
+
+                        target.WhiteBalance = new Capability<string> { Candidates = candidates, Current = wb.Current.Mode };
+                        target.ColorTempertureCandidates = tmpCandidates;
+                        target.ColorTemperture = wb.Current.ColorTemperature;
+                    }
+                    catch (RemoteApiException)
+                    {
+                        DebugUtil.Log("Failed to get white balance capability");
+                    }
+                }
+                else
+                {
+                    if (status.WhiteBalance != null)
+                    {
+                        target.WhiteBalance.Current = status.WhiteBalance.Current.Mode;
+                    }
+                    target.ColorTemperture = status.WhiteBalance.Current.ColorTemperature;
+                }
+            }
+        }
+
+        private async void PollingLoop()
+        {
+            if (!IsProcessing)
+            {
+                return;
+            }
+
+            try
+            {
+                OnSuccess(await api.Camera.GetEventAsync(true, version));
+            }
+            catch (RemoteApiException e)
+            {
+                OnError(e.code);
+            }
+        }
+
+        private async void OnSuccess(Event @event)
+        {
+            failure_count = 0;
+            await Update(@event);
+            PollingLoop();
+        }
+
+        private async void OnError(StatusCode code)
+        {
+            switch (code)
+            {
+                case StatusCode.Timeout:
+                    DebugUtil.Log("GetEvent timeout without any event. Retry for the next event");
+                    PollingLoop();
+                    return;
+                case StatusCode.NotAcceptable:
+                case StatusCode.CameraNotReady:
+                case StatusCode.IllegalState:
+                case StatusCode.ServiceUnavailable:
+                case StatusCode.Any:
+                    if (failure_count++ < RETRY_LIMIT)
+                    {
+                        DebugUtil.Log("GetEvent failed - retry " + failure_count + ", status: " + code);
+                        await Task.Delay(TimeSpan.FromSeconds(RETRY_INTERVAL_SEC));
+                        PollingLoop();
+                        return;
+                    }
+                    break;
+                case StatusCode.DuplicatePolling:
+                    DebugUtil.Log("GetEvent failed duplicate polling");
+                    return;
+                default:
+                    DebugUtil.Log("GetEvent failed with code: " + code);
+                    break;
+            }
+
+            DebugUtil.Log("StatusObserver Error limit");
+
+            if (IsProcessing)
+            {
+                Stop();
+                if (EndByError != null)
+                {
+                    EndByError.Invoke();
+                }
+            }
+        }
+
+        private static int CompareStillSize(StillImageSize x, StillImageSize y)
+        {
+            if (x == null && y == null)
+            {
+                return 0;
+            }
+            if (x == null)
+            {
+                return -1;
+            }
+            if (y == null)
+            {
+                return 1;
+            }
+
+            if (!x.SizeDefinition.EndsWith("M") || !y.SizeDefinition.EndsWith("M"))
+            {
+                var comp = x.SizeDefinition.CompareTo(y.SizeDefinition);
+                if (comp == 0)
+                {
+                    return x.AspectRatio.CompareTo(y.AspectRatio);
+                }
+                else
+                {
+                    return comp;
+                }
+            }
+
+            var xv = (int)double.Parse(x.SizeDefinition.Substring(0, x.SizeDefinition.Length - 1)) * 100;
+            var yv = (int)double.Parse(y.SizeDefinition.Substring(0, y.SizeDefinition.Length - 1)) * 100;
+
+            if (xv == yv)
+            {
+                return x.AspectRatio.CompareTo(y.AspectRatio);
+            }
+            else
+            {
+                return xv < yv ? 1 : -1;
+            }
+        }
+    }
+}


更新cake打包 Signed-off-by: virtual <1185513330@qq.com>

更新cake打包
Signed-off-by: virtual <89ab707496410b11c2fba8f5ec0112cf133af8fd@qq.com>

--- build/parameters.cake
+++ build/parameters.cake
@@ -12,6 +12,7 @@
     public bool IsRunningOnUnix { get; private set; }
     public bool IsRunningOnWindows { get; private set; }
     public bool IsRunningOnTravisCI { get; private set; }
+    public bool IsRunningOnAppVeyor { get; private set; }
     public bool IsPullRequest { get; private set; }
     public bool IsMasterBranch { get; private set; }
     public bool IsDevelopBranch { get; private set; }
@@ -38,7 +39,7 @@
     {
         get
         {
-            return !IsLocalBuild && !IsPullRequest && IsMasterBranch && IsTagged;
+            return !IsLocalBuild && !IsPullRequest && IsTagged && (IsRunningOnTravisCI || (IsRunningOnAppVeyor && IsMasterBranch));
         }
     }

@@ -46,7 +47,7 @@
     {
         get
         {
-            return !IsLocalBuild && !IsPullRequest && IsMasterBranch && IsTagged;
+            return !IsLocalBuild && !IsPullRequest && IsTagged && (IsRunningOnTravisCI || (IsRunningOnAppVeyor && IsMasterBranch));
         }
     }

@@ -81,7 +82,7 @@
             Paths.Directories.NugetRoot,
             Version.VersionWithSuffix(),
             PackageIds,
-            new string[] {  });
+            new string[] { });
     }

     public static BuildParameters GetParameters(ICakeContext context)
@@ -94,14 +95,6 @@
         var target = context.Argument("target", "Default");
         var buildSystem = context.BuildSystem();

-        context.Information($"Cake BuildParameters:-------------begin--------------");
-        context.Information($"IsLocalBuild:{buildSystem.IsLocalBuild}");
-        context.Information($"IsRunningOnUnix:{context.IsRunningOnUnix()}");
-        context.Information($"IsRunningOnTravisCI:{buildSystem.TravisCI.IsRunningOnTravisCI}");
-        context.Information($"PullRequest:{buildSystem.TravisCI.Environment.Repository.PullRequest}");
-        context.Information($"Branch:{buildSystem.TravisCI.Environment.Build.Branch}");
-        context.Information($"Tag:{buildSystem.TravisCI.Environment.Build.Tag}");
-        context.Information($"Cake BuildParameters:---------------end---------------");
         var parameters = new BuildParameters
         {
             Target = target,
@@ -110,12 +103,13 @@
             IsRunningOnUnix = context.IsRunningOnUnix(),
             IsRunningOnWindows = context.IsRunningOnWindows(),
             IsRunningOnTravisCI = buildSystem.TravisCI.IsRunningOnTravisCI,
-            IsPullRequest = StringComparer.OrdinalIgnoreCase.Equals("true", buildSystem.TravisCI.Environment.Repository.PullRequest),
-            IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.TravisCI.Environment.Build.Branch),
-            IsDevelopBranch = (StringComparer.OrdinalIgnoreCase.Equals("develop", buildSystem.TravisCI.Environment.Build.Branch) || StringComparer.OrdinalIgnoreCase.Equals("dev", buildSystem.TravisCI.Environment.Build.Branch)),
+            IsRunningOnAppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor,
+            IsPullRequest = IsThePullRequest(buildSystem),
+            IsMasterBranch = IsTheMasterBranch(buildSystem),
+            IsDevelopBranch = IsTheDevelopBranch(buildSystem),
             IsTagged = IsBuildTagged(buildSystem),
-            GitHub = null,//BuildCredentials.GetGitHubCredentials(context),
-            Coveralls = null,//CoverallsCredentials.GetCoverallsCredentials(context),
+            GitHub = null, //BuildCredentials.GetGitHubCredentials(context),
+            Coveralls = null, //CoverallsCredentials.GetCoverallsCredentials(context),
             ReleaseNotes = null, //context.ParseReleaseNotes("./README.md"),
             IsPublishBuild = IsPublishing(target),
             IsReleaseBuild = IsReleasing(target),
@@ -126,9 +120,35 @@
             TestProjects = context.GetDirectories("./test/*"),
             ProjectFiles = context.GetFiles("./src/*/*.csproj"),
             TestProjectFiles = context.GetFiles("./test/DotCommon.Test/*.csproj"),
-            PackageIds=Util.GetPackageIds(context,context.GetFiles("./src/*/*.csproj"))
+            PackageIds = Util.GetPackageIds(context, context.GetFiles("./src/*/*.csproj"))
         };
+        context.Information($"Cake BuildParameters:-------------begin--------------");
+        context.Information($"IsLocalBuild:{parameters.IsLocalBuild}");
+        context.Information($"IsRunningOnUnix:{parameters.IsRunningOnUnix}");
+        context.Information($"IsRunningOnTravisCI:{parameters.IsRunningOnTravisCI}");
+        context.Information($"IsRunningOnAppVeyor:{parameters.IsRunningOnAppVeyor}");
+        context.Information($"IsPullRequest:{parameters.IsPullRequest}");
+        context.Information($"IsMasterBranch:{parameters.IsMasterBranch}");
+        context.Information($"IsTagged:{parameters.IsTagged}");
+        context.Information($"ShouldPublish:{parameters.ShouldPublish}");
+        context.Information($"ShouldPublishToNuGet:{parameters.ShouldPublishToNuGet}");
+        context.Information($"Cake BuildParameters:---------------end---------------");
         return parameters;
+    }
+
+    private static bool IsThePullRequest(BuildSystem buildSystem)
+    {
+        return (buildSystem.TravisCI.IsRunningOnTravisCI && StringComparer.OrdinalIgnoreCase.Equals("true", buildSystem.TravisCI.Environment.Repository.PullRequest)) || (buildSystem.AppVeyor.IsRunningOnAppVeyor && buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest);
+    }
+
+    private static bool IsTheMasterBranch(BuildSystem buildSystem)
+    {
+        return (buildSystem.TravisCI.IsRunningOnTravisCI && StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.TravisCI.Environment.Build.Branch)) || (buildSystem.AppVeyor.IsRunningOnAppVeyor && StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch));
+    }
+
+    private static bool IsTheDevelopBranch(BuildSystem buildSystem)
+    {
+        return (buildSystem.TravisCI.IsRunningOnTravisCI && (StringComparer.OrdinalIgnoreCase.Equals("develop", buildSystem.TravisCI.Environment.Build.Branch) || StringComparer.OrdinalIgnoreCase.Equals("dev", buildSystem.TravisCI.Environment.Build.Branch))) || (buildSystem.AppVeyor.IsRunningOnAppVeyor && (StringComparer.OrdinalIgnoreCase.Equals("develop", buildSystem.AppVeyor.Environment.Repository.Branch) || StringComparer.OrdinalIgnoreCase.Equals("dev", buildSystem.AppVeyor.Environment.Repository.Branch)));
     }

     private static bool IsBuildTagged(BuildSystem buildSystem)


Updated version number and pushed to nuget to ensure less dependencies were included in the package.

--- ReturnNull.MvcTools/Properties/AssemblyInfo.cs
+++ ReturnNull.MvcTools/Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0")]
+[assembly: AssemblyVersion("1.0.0.1")]
+[assembly: AssemblyFileVersion("1.0.0.1")]
+[assembly: AssemblyInformationalVersion("1.0.1")]


Removing redundant tests

Removing redundant tests

--- SeleniumExtension.Tests/Elements/TableTests.cs
+++ SeleniumExtension.Tests/Elements/TableTests.cs
@@ -90,16 +90,8 @@
         #region table with header

         [TestCase(1, 1, "ID")]
-        [TestCase(1, 2, "1")]
-        [TestCase(1, 3, "2")]
-        [TestCase(1, 4, "3")]
-        [TestCase(1, 5, "4")]
         [TestCase(1, 6, "5")]
         [TestCase(2, 1, "Subject ID")]
-        [TestCase(2, 2, "1001")]
-        [TestCase(2, 3, "1003")]
-        [TestCase(2, 4, "1002")]
-        [TestCase(2, 5, "1008")]
         [TestCase(2, 6, "1007")]
         public void GetCellByIndexWithHeaderRow(int column, int row, string cell)
         {
@@ -109,16 +101,8 @@
         }

         [TestCase(1, "ID", "ID", 1)]
-        [TestCase(1, "1", "1", 1)]
-        [TestCase(1, "2", "2", 1)]
-        [TestCase(1, "3", "3", 1)]
-        [TestCase(1, "4", "4", 1)]
         [TestCase(1, "5", "5", 1)]
         [TestCase(2, "ID", "Subject ID", 2)]
-        [TestCase(2, "1", "1001", 2)]
-        [TestCase(2, "2", "1003", 2)]
-        [TestCase(2, "3", "1002", 2)]
-        [TestCase(2, "4", "1008", 2)]
         [TestCase(2, "5", "1007", 2)]
         public void GetCellColumnIndexRowlabelWithHeaderRow(int column, string row, string cell, int rowIndex)
         {
@@ -128,16 +112,8 @@
         }

         [TestCase("ID", 1, "ID")]
-        [TestCase("ID", 2, "1")]
-        [TestCase("ID", 3, "2")]
-        [TestCase("ID", 4, "3")]
-        [TestCase("ID", 5, "4")]
         [TestCase("ID", 6, "5")]
         [TestCase("Subject ID", 1, "Subject ID")]
-        [TestCase("Subject ID", 2, "1001")]
-        [TestCase("Subject ID", 3, "1003")]
-        [TestCase("Subject ID", 4, "1002")]
-        [TestCase("Subject ID", 5, "1008")]
         [TestCase("Subject ID", 6, "1007")]
         public void GetCellColumnLabelRowIndexWithheaderRow(string column, int row, string cell, int columnIndex = 1)
         {
@@ -147,16 +123,8 @@
         }

         [TestCase("ID", "ID", "ID")]
-        [TestCase("ID", "1", "1")]
-        [TestCase("ID", "2", "2")]
-        [TestCase("ID", "3", "3")]
-        [TestCase("ID", "4", "4")]
         [TestCase("ID", "5", "5")]
         [TestCase("Subject ID", "Subject ID", "Subject ID")]
-        [TestCase("Subject ID", "1001", "1001")]
-        [TestCase("Subject ID", "1003", "1003")]
-        [TestCase("Subject ID", "1002", "1002")]
-        [TestCase("Subject ID", "1008", "1008")]
         [TestCase("Subject ID", "1007", "1007")]
         public void GetCellColumnLabelRowLabelWithHeaderRow(string column, string row, string cell)
         {
@@ -170,16 +138,8 @@
         #region table without header row

         [TestCase(1, 1, "ID")]
-        [TestCase(1, 2, "1")]
-        [TestCase(1, 3, "2")]
-        [TestCase(1, 4, "3")]
-        [TestCase(1, 5, "4")]
         [TestCase(1, 6, "5")]
         [TestCase(2, 1, "Subject ID")]
-        [TestCase(2, 2, "1001")]
-        [TestCase(2, 3, "1003")]
-        [TestCase(2, 4, "1002")]
-        [TestCase(2, 5, "1008")]
         [TestCase(2, 6, "1007")]
         public void GetCellByIndexWithOutHeaderRow(int column, int row, string cell)
         {
@@ -189,16 +149,8 @@
         }

         [TestCase(1, "ID", "ID")]
-        [TestCase(1, "1", "1")]
-        [TestCase(1, "2", "2")]
-        [TestCase(1, "3", "3")]
-        [TestCase(1, "4", "4")]
         [TestCase(1, "5", "5")]
         [TestCase(2, "ID", "Subject ID")]
-        [TestCase(2, "1", "1001")]
-        [TestCase(2, "2", "1003")]
-        [TestCase(2, "3", "1002")]
-        [TestCase(2, "4", "1008")]
         [TestCase(2, "5", "1007")]
         public void GetCellColumnIndexRowlabelWithOutheaderRow(int column, string row, string cell)
         {
@@ -208,16 +160,8 @@
         }

         [TestCase("ID", 1, "ID")]
-        [TestCase("ID", 2, "1")]
-        [TestCase("ID", 3, "2")]
-        [TestCase("ID", 4, "3")]
-        [TestCase("ID", 5, "4")]
         [TestCase("ID", 6, "5")]
         [TestCase("Subject ID", 1, "Subject ID")]
-        [TestCase("Subject ID", 2, "1001")]
-        [TestCase("Subject ID", 3, "1003")]
-        [TestCase("Subject ID", 4, "1002")]
-        [TestCase("Subject ID", 5, "1008")]
         [TestCase("Subject ID", 6, "1007")]
         public void GetCellColumnLabelRowIndexWithOutheaderRow(string column, int row, string cell)
         {
@@ -227,16 +171,8 @@
         }

         [TestCase("ID", "ID", "ID")]
-        [TestCase("ID", "1", "1")]
-        [TestCase("ID", "2", "2")]
-        [TestCase("ID", "3", "3")]
-        [TestCase("ID", "4", "4")]
         [TestCase("ID", "5", "5")]
         [TestCase("Subject ID", "Subject ID", "Subject ID")]
-        [TestCase("Subject ID", "1001", "1001")]
-        [TestCase("Subject ID", "1003", "1003")]
-        [TestCase("Subject ID", "1002", "1002")]
-        [TestCase("Subject ID", "1008", "1008")]
         [TestCase("Subject ID", "1007", "1007")]
         public void GetCellColumnLabelRowLabelWithOutHeaderRow(string column, string row, string cell)
         {


buildinfo link to console

buildinfo link to console

--- ArtifactoryBuild.cs
+++ ArtifactoryBuild.cs
@@ -1,5 +1,6 @@
 using JFrog.Artifactory.Model;
 using JFrog.Artifactory.Utils;
+using Microsoft.Build.BuildEngine;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 using System;
@@ -16,10 +17,11 @@
         [Required]
         public ITaskItem[] projRefList { get; set; }

-        public string BuildPath { get; set; }
+        public string OutputPath { get; set; }
         public string BaseAddress { get; set; }
         public string OutputType { get; set; }
-
+        public string AssemblyName { get; set; }
+        public string BaseOutputPath { get; set; }

         public string BuildUNCPath { get; set; }
         public string BuildURI { get; set; }
@@ -39,7 +41,7 @@
         private readonly Sha1Reference sha1;
         private readonly MD5CheckSum md5;

-        private const string defaultBuildName = "Not specified***********";
+        private const string defaultBuildName = "Not specified";
         private const string defaultbuildNumber = "1.0";
         /// <summary>
         /// initiate sha1,md5, _buildInfoModel
@@ -54,11 +56,6 @@
             };
         }

-        /// <summary>
-        /// this function is called by the msbuild post event.
-        /// it will iterate over the dllList and projRefList defined in the csporj file.
-        /// </summary>
-        /// <returns></returns>
         public override bool Execute()
         {
             try
@@ -100,7 +97,10 @@
                 //upload json file to artifactory
                 Log.LogMessageFromText("Uploading build info to Artifactory...", MessageImportance.High);
                 UploadBuildInfo.UploadBuildInfoJson(jsonString, string.Format(Url + "/api/build", ServerName), User, Password);
-                Log.LogMessageFromText("Artifactory Post-Build task succeeded", MessageImportance.High);
+
+                Log.LogMessageFromText("Build successfully deployed. Browse it in Artifactory under " + string.Format(Url + "/webapp/builds", ServerName) +
+                    "/" + _buildInfoModel.name + "/" + _buildInfoModel.version + "/" + _buildInfoModel.started + "/" , MessageImportance.High);
+
                 return true;
             }
             catch (Exception ex)
@@ -147,7 +147,7 @@
                 var projectParser = new CSProjParser(Environment.CurrentDirectory + "..\\" + task.ItemSpec);
                 var projectRef = projectParser.Parse();
                 if (projectRef == null) continue;
-                module = new Module(projectRef.AssemblyName)
+                module = new Module(ProjectName)
                 {
                     Dependencies = projectRef.LstProjectMetadata
                         .Select(x => new {reference = GetRefrenceDetails(x.EvaluatedValue), hint = x.EvaluatedValue})
@@ -223,7 +223,7 @@
             }
             catch(Exception ex)
             {
-                //TODO handle this exption - do not hide
+                Log.LogMessageFromText("Exception: " + ex.Message, MessageImportance.High);
             }

             return null;
@@ -234,7 +234,7 @@
         /// </summary>
         /// <param name="path"></param>
         /// <returns></returns>
-        private static string FindNupkg(string path)
+        private string FindNupkg(string path)
         {
             try
             {
@@ -245,7 +245,7 @@
             }
             catch (Exception ex)
             {
-                //TODO handle this exption - do not hide
+                Log.LogMessageFromText("Exception: " + ex.Message, MessageImportance.High);
                 return null;
             }


If there is no 'data' key, that's fine.

If there is no 'data' key, that's fine.

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -467,7 +467,7 @@
             string callbackId = json["callbackId"] as string;
             string status = json["status"] as string;
             string creativeId = json.ContainsKey("creativeId") ? json["creativeId"] as string : null;
-            string data = json["data"] is string ? json["data"] as string : Json.Serialize(json["data"]);
+            string data = json.ContainsKey("data") ? (json["data"] is string ? json["data"] as string : Json.Serialize(json["data"])) : null;
             TeakNotification.WebGLCallback(callbackId, status, data, creativeId);
         }
         catch(Exception e)


should be <int>

should be <int>

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -94,7 +94,7 @@
             return NotificationState.Enabled;
 #elif UNITY_ANDROID
             AndroidJavaClass teak = new AndroidJavaClass("io.teak.sdk.Teak");
-            return (NotificationState) teak.CallStatic<bool>("getNotificationStatus");
+            return (NotificationState) teak.CallStatic<int>("getNotificationStatus");
 #elif UNITY_IPHONE
             return (NotificationState) TeakGetNotificationState();
 #endif


Updating increment event to ulong

Updating increment event to ulong

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -204,9 +204,9 @@
     /// <param name="objectTypeId">The type of object that is being posted, e.g. 'quest'.</param>
     /// <param name="objectInstanceId">The specific instance of the object, e.g. 'gather-quest-1'</param>
     /// <param name="count">The amount by which to increment</param>
-    public void IncrementEvent(string actionId, string objectTypeId, string objectInstanceId, uint count) {
-#if UNITY_EDITOR
-        Debug.Log("[Teak] IncrementEvent(): " + actionId + " - " + objectTypeId + " - " + objectInstanceId);
+    public void IncrementEvent(string actionId, string objectTypeId, string objectInstanceId, ulong count) {
+#if UNITY_EDITOR
+        Debug.Log("[Teak] IncrementEvent(): " + actionId + " - " + objectTypeId + " - " + objectInstanceId + " - " + count);
 #elif UNITY_ANDROID
         AndroidJavaClass teak = new AndroidJavaClass("io.teak.sdk.Teak");
         teak.CallStatic("incrementEvent", actionId, objectTypeId, objectInstanceId, count);
@@ -413,7 +413,7 @@
     private static extern void TeakTrackEvent(string actionId, string objectTypeId, string objectInstanceId);

     [DllImport ("__Internal")]
-    private static extern void TeakIncrementEvent(string actionId, string objectTypeId, string objectInstanceId, uint count);
+    private static extern void TeakIncrementEvent(string actionId, string objectTypeId, string objectInstanceId, ulong count);

     [DllImport ("__Internal")]
     private static extern void TeakUnityRegisterRoute(string route, string name, string description);


Edit GetGraphicData method

Edit GetGraphicData method

Edit GetGraphicData method

--- QueueDataGraphic/QueueDataGraphic/CSharpFiles/DataQueue.cs
+++ QueueDataGraphic/QueueDataGraphic/CSharpFiles/DataQueue.cs
@@ -86,9 +86,10 @@
 			RemovingOverload();                                                 //	call RemovingOverload method, 呼叫RemovingOverload方法
 		}                                                                       //	AddData method end, 結束AddData方法

-		public Queue<object> GetGraphicData()                                   //	GraphicData method, GraphicData方法
-		{                                                                       //	GraphicData method start, 進入GraphicData方法
+		public Queue<object> GetGraphicData()                                   //	GetGraphicData method, GetGraphicData方法
+		{                                                                       //	GetGraphicData method start, 進入GetGraphicData方法

-		}
+		}                                                                       //	GetGraphicData method end, 結束GetGraphicData方法
+
 	}                                                                           //	DataQueue class end, 結束DataQueue類別
 }                                                                               //	namespace end, 結束命名空間


Fix for when an ArgumentException is raised.

--- Magick.NET/Core/Helpers/Throw.cs
+++ Magick.NET/Core/Helpers/Throw.cs
@@ -59,7 +59,15 @@
           path = path.Substring(1);
       }

-      path = Path.GetFullPath(path);
+      try
+      {
+        path = Path.GetFullPath(path);
+      }
+      catch (ArgumentException)
+      {
+        return;
+      }
+
       if (path.EndsWith("]", StringComparison.OrdinalIgnoreCase))
       {
         int endIndex = path.IndexOf("[", StringComparison.OrdinalIgnoreCase);


Move logging to be done after null check

--- Manager/Manager/JobRepository.cs
+++ Manager/Manager/JobRepository.cs
@@ -104,7 +104,7 @@
 		{
 			try
 			{
-				managerLogger.Info("ssigning jobs to node");
+				managerLogger.Info("Assigning jobs to node");
 				List<Uri> allAliveWorkerNodesUri;
 				using (var sqlConnection = new SqlConnection(_connectionString))
 				{
@@ -372,13 +372,12 @@
 					{
 						sqlConnection.OpenWithRetry(_retryPolicy);
 						var jobQueueItem = _jobRepositoryCommandExecuter.AcquireJobQueueItem(sqlConnection);
-						managerLogger.Info("acquired job with id  " + jobQueueItem.JobId + " for node " +  availableNode.ToString() );
 						if (jobQueueItem == null)
 						{
 							sqlConnection.Close();
 							return;
 						}
-
+						managerLogger.Info("acquired job with id  " + jobQueueItem.JobId + " for node " + availableNode);
 						var builderHelper = new NodeUriBuilderHelper(availableNode);
 						var urijob = builderHelper.GetJobTemplateUri();
 						managerLogger.Info("posting the job to the node");


update test

update test

--- Soomla/Assets/Examples/MuffinRush/BasicTest.cs
+++ Soomla/Assets/Examples/MuffinRush/BasicTest.cs
@@ -1093,7 +1093,7 @@
 //
 //			WorldCompletionGate lvl1CompletionGate =
 //				new WorldCompletionGate(worldGateId, lvl1Id);
-//			lvl2.addGate(lvl1CompletionGate);
+//			lvl2.Gates.Gates.Add(lvl1CompletionGate);
 //
 //			worlds.Add(lvl1);
 //			worlds.Add(lvl2);


Fixed a bug with the log builder which was causing sign in issue.

--- Source/Core/Extensions/LogBuilderExtensions.cs
+++ Source/Core/Extensions/LogBuilderExtensions.cs
@@ -17,6 +17,9 @@
         /// <param name="builder">The log builder object.</param>
         /// <param name="tags">The tags to be added to the event.</param>
         public static ILogBuilder Tag(this ILogBuilder builder, params string[] tags) {
+            if (builder.LogData.Properties == null)
+                builder.LogData.Properties = new Dictionary<string, object>();
+
             var tagList = new List<string>();
             if (builder.LogData.Properties.ContainsKey(Tags) && builder.LogData.Properties[Tags] is List<string>)
                 tagList = builder.LogData.Properties[Tags] as List<string>;
@@ -86,17 +89,17 @@
             contextData[SubmissionMethod] = submissionMethod;
         }

-        private static IDictionary<string, object> GetContextData(this ILogBuilder logBuilder) {
-            if (logBuilder.LogData.Properties == null)
-                logBuilder.LogData.Properties = new Dictionary<string, object>();
+        private static IDictionary<string, object> GetContextData(this ILogBuilder builder) {
+            if (builder.LogData.Properties == null)
+                builder.LogData.Properties = new Dictionary<string, object>();

             IDictionary<string, object> contextData = new Dictionary<string, object>();
-            if (!logBuilder.LogData.Properties.ContainsKey(ContextData))
-                logBuilder.LogData.Properties[ContextData] = contextData;
+            if (!builder.LogData.Properties.ContainsKey(ContextData))
+                builder.LogData.Properties[ContextData] = contextData;

-            if (logBuilder.LogData.Properties.ContainsKey(ContextData)
-                && logBuilder.LogData.Properties[ContextData] is IDictionary<string, object>)
-                contextData = (IDictionary<string, object>)logBuilder.LogData.Properties[ContextData];
+            if (builder.LogData.Properties.ContainsKey(ContextData)
+                && builder.LogData.Properties[ContextData] is IDictionary<string, object>)
+                contextData = (IDictionary<string, object>)builder.LogData.Properties[ContextData];

             return contextData;
         }


Small fixes on Color

Small fixes on Color

--- Source/Core/LightClaw.Engine/Graphics/Color.cs
+++ Source/Core/LightClaw.Engine/Graphics/Color.cs
@@ -1186,7 +1186,12 @@
         /// <returns>A color.</returns>
         public static Color FromBgra(int color)
         {
-            return new Color((byte)((color >> 16) & 255), (byte)((color >> 8) & 255), (byte)(color & 255), (byte)((color >> 24) & 255));
+            return new Color(
+                (byte)((color >> 16) & byte.MaxValue),
+                (byte)((color >> 8) & byte.MaxValue),
+                (byte)(color & byte.MaxValue),
+                (byte)((color >> 24) & byte.MaxValue)
+            );
         }

         /// <summary>
@@ -1407,7 +1412,7 @@

 #endif

-        public enum FormatOrder
+        public enum FormatOrder : byte
         {
             Rgba,


Show a message when there was no Dropbox API key.

--- RudeFox.FrontEnd/ApplicationManagement/SingletonManager.cs
+++ RudeFox.FrontEnd/ApplicationManagement/SingletonManager.cs
@@ -9,6 +9,7 @@
 using RudeFox.Services;
 using NLog.Targets;
 using RudeFox.Updater;
+using RudeFox.Enums;

 namespace RudeFox.ApplicationManagement
 {
@@ -41,14 +42,15 @@
         {
 #if !DEBUG
             if (string.IsNullOrWhiteSpace(Keys.DROPBOX_API_KEY))
-                throw new NullReferenceException("Bad Dropbox API key.");
+                DialogService.Instance.GetMessageDialog("API key not found", "Could not find Dropbox API key.", "Ok").ShowDialog();
+            else
+            {
+                UpdateManager.Initialize(Keys.DROPBOX_API_KEY);
+                Task.Run(() => App.Instance.UpdateAfter(5));
+            }

             // register sentry as NLog target
             Target.Register<Nlog.SentryTarget>("Sentry");
-
-            // check for updates
-            UpdateManager.Initialize(Keys.DROPBOX_API_KEY);
-            Task.Run(() => App.Instance.UpdateAfter(5));
 #endif
         }
     }


fix regression Chart button copy filters

--- Signum.Web.Extensions/Chart/Controllers/ChartController.cs
+++ Signum.Web.Extensions/Chart/Controllers/ChartController.cs
@@ -26,20 +26,21 @@
     public class ChartController : Controller
     {
         #region chart
-        public ActionResult Index(string webQueryName)
+        public ActionResult Index(FindOptions findOptions)
         {
             ChartPermission.ViewCharting.Authorize();

-            object queryName = Navigator.ResolveQueryName(webQueryName);
-
-            if (!Navigator.IsFindable(queryName))
-                throw new UnauthorizedAccessException(ChartMessage.Chart_Query0IsNotAllowed.NiceToString().Formato(queryName));
-
-            QueryDescription queryDescription = DynamicQueryManager.Current.QueryDescription(queryName);
-
-            var request = new ChartRequest(queryName)
+            if (!Navigator.IsFindable(findOptions.QueryName))
+                throw new UnauthorizedAccessException(ChartMessage.Chart_Query0IsNotAllowed.NiceToString().Formato(findOptions.QueryName));
+
+            QueryDescription queryDescription = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);
+
+            Navigator.SetTokens(findOptions.FilterOptions, queryDescription, false);
+
+            var request = new ChartRequest(findOptions.QueryName)
             {
                 ChartScript = ChartScriptLogic.Scripts.Value.Values.FirstEx(() => "No ChartScript loaded in the database"),
+                Filters = findOptions.FilterOptions.Select(fo => fo.ToFilter()).ToList()
             };

             return OpenChartRequest(request, null);


Update PlyReader.cs

Update PlyReader.cs

--- Source/HelixToolkit.Wpf/Importers/PlyReader.cs
+++ Source/HelixToolkit.Wpf/Importers/PlyReader.cs
@@ -13,8 +13,8 @@
     /// <summary>
     /// Polygon File Format Reader.
     /// </summary>
-    /// <see cref="https://www.cc.gatech.edu/projects/large_models/ply.html"/>
-    /// <see cref="http://graphics.stanford.edu/data/3Dscanrep/"/>
+    /// cref="https://www.cc.gatech.edu/projects/large_models/ply.html"
+    /// cref="http://graphics.stanford.edu/data/3Dscanrep/"
     /// <remarks>
     /// This reader only reads ascii ply formats.
     /// This was initially meant to read models exported by Blender 3D Software <see cref=""/>.


CSharp: ImGui.IsWindowHovered default parameter value.

--- Source/Urho3D/CSharp/ThirdParty/ImGui/ImGui.cs
+++ Source/Urho3D/CSharp/ThirdParty/ImGui/ImGui.cs
@@ -763,7 +763,7 @@
             return ImGuiNative.igIsWindowFocused(flags);
         }

-        public static bool IsWindowHovered(HoveredFlags flags)
+        public static bool IsWindowHovered(HoveredFlags flags=HoveredFlags.Default)
         {
             return ImGuiNative.igIsWindowHovered(flags);
         }


BUG: Handle jlid from product on box when releasing

Signed-off-by: Sanhueza Oscar <7e8dccf00c0068966ebc93651d5c9d9814b26a3e@jotautomation.com>

--- BoxTestCSharp/Program.cs
+++ BoxTestCSharp/Program.cs
@@ -123,8 +123,8 @@
                 {
                     result_post = HandleBoxCmd("get_state", false, boxip, 1);
                     dynamic jss = new JavaScriptSerializer();
-                    dynamic BoxStateObject = jss.Deserialize<BoxStateObject>(result_post);
-                    result_post = HandleBoxCmd("release", true, BoxStateObject.products(0).jlid, boxip, 1);
+                    dynamic BoxState = jss.Deserialize<object>(result_post);
+                    result_post = HandleBoxCmd("release", true, BoxState["products"][0]["jlid"], boxip, 1);
                 }

                 Console.WriteLine(result_post);


SA1203: Constant fields should appear before non-constant fields

--- Src/FluentAssertions/Events/EventAssertions.cs
+++ Src/FluentAssertions/Events/EventAssertions.cs
@@ -14,8 +14,9 @@
     /// </summary>
     public class EventAssertions<T> : ReferenceTypeAssertions<T, EventAssertions<T>>
     {
+        private const string PropertyChangedEventName = "PropertyChanged";
+
         private readonly IMonitor<T> monitor;
-        private const string PropertyChangedEventName = "PropertyChanged";

         protected internal EventAssertions(IMonitor<T> monitor)
             : base(monitor.Subject)


Add test coverage for bundled version props

--- test/dotnet-new.Tests/GivenThatIWantANewApp.cs
+++ test/dotnet-new.Tests/GivenThatIWantANewApp.cs
@@ -7,6 +7,7 @@
 using System.Xml.Linq;
 using FluentAssertions;
 using Microsoft.DotNet.Tools.Test.Utilities;
+using Microsoft.Extensions.DependencyModel;
 using Xunit;

 namespace Microsoft.DotNet.New.Tests
@@ -70,36 +71,85 @@
                 .Should().Pass();
         }

-        [Fact]
-        public void NewClassLibRestoresCorrectNetStandardLibraryVersion()
+        [Theory]
+        [InlineData("console", "RuntimeFrameworkVersion", "Microsoft.NETCore.App")]
+        [InlineData("classlib", "NetStandardImplicitPackageVersion", "NETStandard.Library")]
+        public void NewProjectRestoresCorrectPackageVersion(string type, string propertyName, string packageName)
         {
-            var rootPath = TestAssets.CreateTestDirectory().FullName;
+            // These will fail when templates stop including explicit version.
+            // Collapse back to one method and remove the explicit version handling when that happens.
+            NewProjectRestoresCorrectPackageVersion(type, propertyName, packageName, deleteExplicitVersion: true);
+            NewProjectRestoresCorrectPackageVersion(type, propertyName, packageName, deleteExplicitVersion: false);
+        }
+
+        private void NewProjectRestoresCorrectPackageVersion(string type, string propertyName, string packageName, bool deleteExplicitVersion)
+        {
+            var rootPath = TestAssets.CreateTestDirectory(identifier: $"_{type}_{deleteExplicitVersion}").FullName;
             var packagesDirectory = Path.Combine(rootPath, "packages");
-            var projectName = "Library";
-            var projectFileName = $"{projectName}.csproj";
+            var projectName = "Project";
+            var expectedVersion = GetFrameworkPackageVersion();

             new NewCommand()
                 .WithWorkingDirectory(rootPath)
-                .Execute($"classlib --name {projectName} -o .")
+                .Execute($"{type} --name {projectName} -o .")
                 .Should().Pass();
+
+            ValidateAndRemoveExplicitVersion();

             new RestoreCommand()
                 .WithWorkingDirectory(rootPath)
                 .Execute($"--packages {packagesDirectory}")
                 .Should().Pass();

-            var expectedVersion = XDocument.Load(Path.Combine(rootPath, projectFileName))
-                .Elements("Project")
-                .Elements("PropertyGroup")
-                .Elements("NetStandardImplicitPackageVersion")
-                .FirstOrDefault()
-                ?.Value;
-
-            expectedVersion.Should().NotBeNullOrEmpty("Could not find NetStandardImplicitPackageVersion property in a new classlib.");
-
-            new DirectoryInfo(Path.Combine(packagesDirectory, "netstandard.library"))
+            new DirectoryInfo(Path.Combine(packagesDirectory, packageName))
                 .Should().Exist()
                 .And.HaveDirectory(expectedVersion);
+
+            string GetFrameworkPackageVersion()
+            {
+                var dotnetDir = new FileInfo(DotnetUnderTest.FullName).Directory;
+                var sharedFxDir = dotnetDir
+                    .GetDirectory("shared", "Microsoft.NETCore.App")
+                    .EnumerateDirectories()
+                    .Single(d => d.Name.StartsWith("2.0.0"));
+
+                if (packageName == "Microsoft.NETCore.App")
+                {
+                    return sharedFxDir.Name;
+                }
+
+                var depsFile = Path.Combine(sharedFxDir.FullName, "Microsoft.NETCore.App.deps.json");
+                using (var stream = File.OpenRead(depsFile))
+                using (var reader = new DependencyContextJsonReader())
+                {
+                    var context = reader.Read(stream);
+                    var dependency = context
+                        .RuntimeLibraries
+                        .Single(library => library.Name.Equals(packageName, StringComparison.OrdinalIgnoreCase));
+
+                    return dependency.Version;
+                }
+            }
+
+            // Remove when templates stop putting an explicit version
+            void ValidateAndRemoveExplicitVersion()
+            {
+                var projectFileName = $"{projectName}.csproj";
+                var projectPath = Path.Combine(rootPath, projectFileName);
+                var projectDocument = XDocument.Load(projectPath);
+                var explicitVersionNode = projectDocument
+                   .Elements("Project")
+                   .Elements("PropertyGroup")
+                   .Elements(propertyName)
+                   .SingleOrDefault();
+
+                explicitVersionNode.Should().NotBeNull();
+                if (deleteExplicitVersion)
+                {
+                    explicitVersionNode.Remove();
+                    projectDocument.Save(projectPath);
+                }
+            }
         }
     }
 }


Annotate [CanBeNull] Packer parameters

Annotate [CanBeNull] Packer parameters


Incremented version.

Incremented version.

--- src/Abp/AbpConsts.cs
+++ src/Abp/AbpConsts.cs
@@ -8,6 +8,6 @@
         /// <summary>
         /// Current version of the ABP.
         /// </summary>
-        public const string CurrentVersion = "0.3.2.8";
+        public const string CurrentVersion = "0.3.2.9";
     }
 }


Fix signed vs unsigned int errors in a test

--- Test/WindowsRuntime/File/FileReadStreamTest.cs
+++ Test/WindowsRuntime/File/FileReadStreamTest.cs
@@ -181,7 +181,7 @@

 #if NETCORE
             int actualReadSize = await fileStream.ReadAsync(testBuffer, 0, (int) readSize);
-            Assert.AreEqual(expectedReadCount, actualReadSize);
+            Assert.AreEqual((int)expectedReadCount, actualReadSize);
 #else
             IBuffer testBufferAsIBuffer = testBuffer.AsBuffer();
             await fileStream.ReadAsync(testBufferAsIBuffer, readSize, InputStreamOptions.None);
@@ -205,57 +205,57 @@
         {
             int attempts = 1;
             ulong position = 0;
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
             attempts++;
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 512, 512);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position = (ulong)(bufferToCompare.Length - 128);
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 128);
             attempts++;
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position = 4096;
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
             attempts++;
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += 4096;
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
-            position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
+            position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
+            Assert.AreEqual((long)position, fileStream.Position);
             position -= 4096;
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 128, 128);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position = (ulong)(streamReadSize + 4096 - 512);
             fileStream.Seek(position);
 #if NETCORE
             //don't know why adding these two line will pass, but this this the same as the desktop test
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 512);
 #endif
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
             attempts++;
-            Assert.AreEqual(position, fileStream.Position);
-            position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
+            position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 1024);
+            Assert.AreEqual((long)position, fileStream.Position);
             position -= 1024;
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 2048, 2048);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position = (ulong)(bufferToCompare.Length - 128);
             fileStream.Seek(position);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             position += await FileReadStreamSeekAndCompareAsync(fileStream, bufferToCompare, position, 1024, 128);
-            Assert.AreEqual(position, fileStream.Position);
+            Assert.AreEqual((long)position, fileStream.Position);
             return attempts;
         }


Before this mess ups again, fix truncated userid + cookie

--- SparklrWP_EOC/MainPage.xaml.cs
+++ SparklrWP_EOC/MainPage.xaml.cs
@@ -43,7 +43,7 @@
                 else
                 {
                     log("Login failed, Error: " + le.Error.Message);
-                    Sparklr.Login("EaterOfCorpses", "pass", (lea) =>
+                    Sparklr.Login("EaterOfCorpses", "500Please", (lea) =>
                     {
                         if (lea.IsSuccessful)
                         {


Helper client (should) support authenticated requests

--- Stockfighter/Helpers/Client.cs
+++ Stockfighter/Helpers/Client.cs
@@ -10,10 +10,24 @@
     {
         private const string baseUrl = "https://api.stockfighter.io/ob/api/";
         private HttpClient client = new HttpClient();
+        private string apiKey;
+
+        public Client() { }
+        public Client(string apiKey)
+        {
+            this.apiKey = apiKey;
+        }

         public async Task<T> Get<T>(string url)
         {
-            var response = await client.GetAsync(Combine(baseUrl, url)).ConfigureAwait(false);
+            var request = new HttpRequestMessage(HttpMethod.Get, Combine(baseUrl, url));
+
+            if (!string.IsNullOrWhiteSpace(apiKey))
+            {
+                request.Headers.Add("X-Starfighter-Authorization", apiKey);
+            }
+
+            var response = await client.SendAsync(request).ConfigureAwait(false);

             response.EnsureSuccessStatusCode();


Forgot to match z, also the size of the StringBuilder

Added in this commit

--- Tests/System/Threading/SemaphoreSlimTestsEx.cs
+++ Tests/System/Threading/SemaphoreSlimTestsEx.cs
@@ -63,13 +63,13 @@
             // maxTask a
             // 1 x
             // chunks of at most maxCount b, separated by chunks of c
-            var sb = new StringBuilder();
+            var sb = new StringBuilder(log.Capacity);
             foreach (var entry in log)
             {
                 sb.Append(entry);
             }
             var str = sb.ToString();
-            var regex = string.Format("a{{{0}}}x(b{{0,{1}}}c+)+", maxTasks, maxCount);
+            var regex = string.Format("a{{{0}}}x(b{{0,{1}}}c+)+z", maxTasks, maxCount);
             Assert.IsTrue((new Regex(regex)).IsMatch(str));
             // The results of release increase *per chunk of c*.
             var last = -1;


Fixed movement borders

Fixed movement borders

--- TheGiraffeGame/TheGiraffeGame/StartingPoint.cs
+++ TheGiraffeGame/TheGiraffeGame/StartingPoint.cs
@@ -17,7 +17,7 @@
             switch (keyinfo.Key)
             {
                 case ConsoleKey.UpArrow:
-                    if (GiraffesHeadVar.Col < columns - 1)
+                    if (GiraffesHeadVar.Col > 0)
                     {
                         Screen[GiraffesHeadVar.Col, GiraffesHeadVar.Row] = emptySpace;
                         Screen[GiraffesHeadVar.Col - 1, GiraffesHeadVar.Row] = giraffeHeadChar;
@@ -26,7 +26,7 @@
                     break;

                 case ConsoleKey.DownArrow:
-                    if (GiraffesHeadVar.Col > 0)
+                    if (GiraffesHeadVar.Col < columns - 1)
                     {
                         Screen[GiraffesHeadVar.Col, GiraffesHeadVar.Row] = emptySpace;
                         Screen[GiraffesHeadVar.Col + 1, GiraffesHeadVar.Row] = giraffeHeadChar;
@@ -44,7 +44,7 @@
             char particleChar = '#';

             Random numGenerator = new Random();
-            int particleY = numGenerator.Next(0, columns - 2);
+            int particleY = numGenerator.Next(0, columns);
             int particleX = screen.GetLength(1);

             for (int col = 0; col < columns; col++)


more links

more links

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@gmail.com>

--- Terradue.Tep/Terradue/Tep/Controller/Community/GroupTep.cs
+++ Terradue.Tep/Terradue/Tep/Controller/Community/GroupTep.cs
@@ -42,34 +42,34 @@
 As described previously, the portal authorisation mechanism allows a great flexibility for managing users and groups and their permissions with the items in the system.
 In order to enable all the requirements specific to the TEP, the \ref TepCommunity uses the \ref Security components as the following:

-- \ref User is an \ref UserTep registered via the \ref Authentication mechanism integrated in the portal (e.g. EO-SSO)
-- \ref Group is a \ref GroupTep regrouping a set of \ref UserTep put together for organisational purpose. For instance, all Terradue staff users are grouped in the Terradue Group.
-- Domain is named "Thematic Group" and englobes all users, groups and objects having a thematic scope in common. For instance,
+- \ref Terradue.Portal.User is an \ref Terradue.Tep.UserTep registered via the \ref Authentication mechanism integrated in the portal (e.g. EO-SSO)
+- \ref Terradue.Portal.Group is a \ref Terradue.Tep.GroupTep regrouping a set of \ref Terradue.Tep.UserTep put together for organisational purpose. For instance, all Terradue staff users are grouped in the Terradue Group.
+- \ref Terradue.Portal.Domain is named "Thematic Group" and englobes all users, groups and objects having a thematic scope in common. For instance,
 there could be a "Volcanoes" thematic group that would have expert users in volcanoes monitoring, the data collections used for monitoring them (e.g. Sentinel-2 and 3),
 the features related to this domain (e.g. latest most important eruptions) and the all the processing services relative to volcanoes.
-- The inital roles are defined as \ref RoleTep.
+- The inital roles are defined as \ref Terradue.Tep.RoleTep.

 Objects identified and used in TEP are
-- \ref Series called "Data \ref Collection"
-- \ref DataPackage
-- \ref Service also called processing services and mainly implemented as \ref WpsProcessOffering
-- Job reprenting an instance of a processing service execution
-- \ref CloudProvider providing with \ref CloudAppliance
-- \ref ThematicApplication that combines at user level the previous objects.
-- \ref Activity that records all the operations executed from the portal
+- \ref Terradue.Portal.Series called "Data \ref Collection"
+- \ref Terradue.Tep.DataPackage
+- \ref Terradue.Portal.Service also called processing services and mainly implemented as \ref Terradue.Portal.WpsProcessOffering
+- Job representing an instance of a processing service execution
+- \ref Terradue.Cloud.CloudProvider providing with \ref Terradue.Cloud.CloudAppliance
+- \ref Terradue.Tep.ThematicApplication that combines at user level the previous objects.
+- \ref Terradue.Portal.Activity that records all the operations executed from the portal

 #### Additional privilege and permissions for TEP ####

 Specific privileges and permissions are implemented for TEP in order to control a precise operation on the platform.
 The specific operations are described in the folowing table.

-Object Type        | Operation Name        | Description
------------------- | --------------------- | ----------------------------------------------------------------------------------------
-\ref Collection    | Can Search In         | Allows to search for dataset in the collection
-\ref Collection    | Can Download          | Allows to download the raw dataset in the collection directly on user desktop
-\ref Collection    | Can Process           | Allows to use the data inside processing service or for processing purpose
-\ref CloudProvider | Can Request Sandbox   | Allows to request for a Developer Cloud Sandbox via the related \ref Cloud Provider
-\ref CloudProvider | Can Provision Cluster | Allows to provision a Cluster via the related \ref Cloud Provider
+Object Type                       | Operation Name        | Description
+--------------------------------- | --------------------- | ----------------------------------------------------------------------------------------
+\ref Terradue.Tep.Collection      | Can Search In         | Allows to search for dataset in the collection
+\ref Terradue.Tep.Collection      | Can Download          | Allows to download the raw dataset in the collection directly on user desktop
+\ref Terradue.Tep.Collection      | Can Process           | Allows to use the data inside processing service or for processing purpose
+\ref Terradue.Cloud.CloudProvider | Can Request Sandbox   | Allows to request for a Developer Cloud Sandbox via the related \ref Cloud Provider
+\ref Terradue.Cloud.CloudProvider | Can Provision Cluster | Allows to provision a Cluster via the related \ref Cloud Provider

 @}


fix timer disposing error

fix timer disposing error

--- ThinkingHome.NooLite/ThinkingHome.NooLite/MTRFXXAdapter.cs
+++ ThinkingHome.NooLite/ThinkingHome.NooLite/MTRFXXAdapter.cs
@@ -45,8 +45,8 @@

         public void Dispose()
         {
+            timer.Dispose();
             device.Dispose();
-            timer.Dispose();
         }

         #endregion


Added extra test after bug report

Added extra test after bug report

--- tests/NLog.UnitTests/Fluent/LogBuilderTests.cs
+++ tests/NLog.UnitTests/Fluent/LogBuilderTests.cs
@@ -426,6 +426,19 @@
             Assert.Equal(d, logEventInfo.TimeStamp);
         }

+        [Fact]
+        public void LogBuilder_exception_only()
+        {
+            var ex = new Exception("Exception message1");
+
+            _logger.Error()
+            .Exception(ex)
+            .Write();
+
+            var expectedEvent = new LogEventInfo(LogLevel.Error, "logger1", null) { Exception = ex };
+            AssertLastLogEventTarget(expectedEvent);
+        }
+
         ///<remarks>
         /// func because 1 logbuilder creates 1 message
         ///


fix the bug in IDA*

fix the bug in IDA*


Apply review

Apply review

--- osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs
+++ osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs
@@ -49,7 +49,6 @@
                     RelativeSizeAxes = Axes.X,
                     AutoSizeAxes = Axes.Y
                 },
-
                 new SettingsCheckbox
                 {
                     LabelText = "Letterboxing",
@@ -83,13 +82,14 @@
             };

             var resolutions = getResolutions();
+
             if (resolutions.Count > 1)
             {
                 resolutionSettingsContainer.Child = resolutionDropdown = new SettingsDropdown<Size>
                 {
                     LabelText = "Resolution",
                     ShowsDefaultIndicator = false,
-                    Items = getResolutions(),
+                    Items = resolutions,
                     Bindable = sizeFullscreen
                 };


Complete BatchMap refactoring

Complete BatchMap refactoring

--- BatchMap/Program.cs
+++ BatchMap/Program.cs
@@ -158,69 +158,68 @@
                 var mapID = new MapPathToIDConverter().ConvertFromPathToID(inFiles[mapIndex]);

                 mapFileLoadActions.LoadMapFileByName(inFiles[mapIndex]);
-                var mapFile = _mapFileProvider.MapFiles[mapID];
+                var mapFile = _mapFileProvider.MapFiles[mapID].AsEditableMap();

                 var changesMade = false;

-                //for (int i = mapFile.TileRows.Count - 1; i >= 0; --i)
-                //{
-                //    var tr = mapFile.TileRows[i];
-                //    for (int j = tr.EntityItems.Count - 1; j >= 0; --j)
-                //    {
-                //        var tt = tr.EntityItems[j];
-                //        if (tt.X > mapFile.Properties.Width || tr.Y > mapFile.Properties.Height)
-                //        {
-                //            Console.WriteLine("[MAP {3}] Tile {0}x{1} ({2}) is out of map bounds. Removing.",
-                //                tt.X, tr.Y, Enum.GetName(typeof(TileSpec), tt.Value), mapID);
-                //            mapFile.RemoveTileAt(tr.Y, tt.X);
-                //            changesMade = true;
-                //        }
-                //    }
-                //}
-
-                //for (int i = mapFile.WarpRows.Count - 1; i >= 0; --i)
-                //{
-                //    var tr = mapFile.WarpRows[i];
-                //    for (int j = tr.EntityItems.Count - 1; j >= 0; --j)
-                //    {
-                //        var tt = tr.EntityItems[j];
-                //        if (tt.X > mapFile.Properties.Width || tr.Y > mapFile.Properties.Height)
-                //        {
-                //            Console.WriteLine("[MAP {2}] Warp {0}x{1} is out of map bounds. Removing.", tt.X, tr.Y, mapID);
-                //            mapFile.RemoveWarpAt(tr.Y, tt.X);
-                //            changesMade = true;
-                //        }
-                //    }
-                //}
-
-                for(int i = mapFile.NPCSpawns.Count - 1; i >= 0; --i)
-                {
-                    var npc = mapFile.NPCSpawns[i];
-                    var npcRec = _pubProvider.ENFFile[npc.ID];
-                    if (npc.ID > _pubProvider.ENFFile.Data.Count || npcRec == null)
-                    {
-                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} uses non-existent NPC #{3}. Removing.", mapID, npc.X, npc.Y, npc.ID);
-                        //EMF.NPCSpawns.RemoveAt(i); //todo: way to modify NPCs
+                for (int i = mapFile.TileRows.Count - 1; i >= 0; --i)
+                {
+                    var tr = mapFile.TileRows[i];
+                    for (int j = tr.EntityItems.Count - 1; j >= 0; --j)
+                    {
+                        var tt = tr.EntityItems[j];
+                        if (tt.X > mapFile.Properties.Width || tr.Y > mapFile.Properties.Height)
+                        {
+                            Console.WriteLine("[MAP {0}] Tile {1}x{2} ({3}) is out of map bounds. Removing.",
+                                              mapID, tt.X, tr.Y, Enum.GetName(typeof(TileSpec), tt.Value));
+                            mapFile.RemoveTileAt(tr.Y, tt.X);
+                            changesMade = true;
+                        }
+                    }
+                }
+
+                for (int i = mapFile.WarpRows.Count - 1; i >= 0; --i)
+                {
+                    var tr = mapFile.WarpRows[i];
+                    for (int j = tr.EntityItems.Count - 1; j >= 0; --j)
+                    {
+                        var tt = tr.EntityItems[j];
+                        if (tt.X > mapFile.Properties.Width || tr.Y > mapFile.Properties.Height)
+                        {
+                            Console.WriteLine("[MAP {0}] Warp {1}x{2} is out of map bounds. Removing.", mapID, tt.X, tr.Y);
+                            mapFile.RemoveWarpAt(tr.Y, tt.X);
+                            changesMade = true;
+                        }
+                    }
+                }
+
+                foreach(var npcSpawn in mapFile.NPCSpawns)
+                {
+                    var npcRec = _pubProvider.ENFFile[npcSpawn.ID];
+                    if (npcSpawn.ID > _pubProvider.ENFFile.Data.Count || npcRec == null)
+                    {
+                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} uses non-existent NPC #{3}. Removing.", mapID, npcSpawn.X, npcSpawn.Y, npcSpawn.ID);
+                        mapFile.RemoveNPCSpawn(npcSpawn);
                         changesMade = true;
                         continue;
                     }

-                    if (npc.X > mapFile.Properties.Width || npc.Y > mapFile.Properties.Height)
-                    {
-                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} ({3}) is out of map bounds. Removing.", mapID, npc.X, npc.Y, npcRec.Name);
-                        //EMF.NPCSpawns.RemoveAt(i); //todo: way to modify NPCs
+                    if (npcSpawn.X > mapFile.Properties.Width || npcSpawn.Y > mapFile.Properties.Height)
+                    {
+                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} ({3}) is out of map bounds. Removing.", mapID, npcSpawn.X, npcSpawn.Y, npcRec.Name);
+                        mapFile.RemoveNPCSpawn(npcSpawn);
                         changesMade = true;
                         continue;
                     }

-                    if (!TileIsValidNPCSpawnPoint(mapFile, npc.X, npc.Y))
-                    {
-                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} ({3}) is invalid...", mapID, npc.X, npc.Y, npcRec.Name);
+                    if (!TileIsValidNPCSpawnPoint(mapFile, npcSpawn.X, npcSpawn.Y))
+                    {
+                        Console.WriteLine("[MAP {0}] NPC Spawn {1}x{2} ({3}) is invalid...", mapID, npcSpawn.X, npcSpawn.Y, npcRec.Name);
                         var found = false;
-                        for (int row = npc.Y - 2; row < npc.Y + 2; ++row)
+                        for (int row = npcSpawn.Y - 2; row < npcSpawn.Y + 2; ++row)
                         {
                             if (found) break;
-                            for (int col = npc.X - 2; col < npc.X + 2; ++col)
+                            for (int col = npcSpawn.X - 2; col < npcSpawn.X + 2; ++col)
                             {
                                 if (found) break;
                                 if (TileIsValidNPCSpawnPoint(mapFile, col, row))
@@ -233,31 +232,30 @@

                         if (!found)
                         {
-                            Console.WriteLine("[MAP {0}] NPC couldn't spawn anywhere valid! Removing.");
-                            //EMF.NPCSpawns.RemoveAt(i); //todo: way to modify NPCs
+                            Console.WriteLine("[MAP {0}] NPC couldn't spawn anywhere valid! Removing.", mapID);
+                            mapFile.RemoveNPCSpawn(npcSpawn);
                             changesMade = true;
                         }
                     }
                 }

-                for (int i = mapFile.Chests.Count - 1; i >= 0; --i)
-                {
-                    var chest = mapFile.Chests[i];
-                    var rec = _pubProvider.EIFFile[chest.ItemID];
-                    if (chest.ItemID > _pubProvider.EIFFile.Data.Count || rec == null)
-                    {
-                        Console.WriteLine("[MAP {0}] Chest Spawn {1}x{2} uses non-existent Item #{3}. Removing.", mapID, chest.X, chest.Y, chest.ItemID);
-                        //EMF.Chests.RemoveAt(i); //todo: way to modify Chests
+                foreach(var chestSpawn in mapFile.Chests)
+                {
+                    var rec = _pubProvider.EIFFile[chestSpawn.ItemID];
+                    if (chestSpawn.ItemID > _pubProvider.EIFFile.Data.Count || rec == null)
+                    {
+                        Console.WriteLine("[MAP {0}] Chest Spawn {1}x{2} uses non-existent Item #{3}. Removing.", mapID, chestSpawn.X, chestSpawn.Y, chestSpawn.ItemID);
+                        mapFile.RemoveChestSpawn(chestSpawn);
                         changesMade = true;
                         continue;
                     }

-                    if (chest.X > mapFile.Properties.Width ||
-                        chest.Y > mapFile.Properties.Height ||
-                        mapFile.Tiles[chest.Y, chest.X] != TileSpec.Chest)
-                    {
-                        Console.WriteLine("[MAP {0}] Chest Spawn {1}x{2} points to a non-chest. Removing.", mapID, chest.X, chest.Y);
-                        //EMF.Chests.RemoveAt(i); //todo: way to modify Chests
+                    if (chestSpawn.X > mapFile.Properties.Width ||
+                        chestSpawn.Y > mapFile.Properties.Height ||
+                        mapFile.Tiles[chestSpawn.Y, chestSpawn.X] != TileSpec.Chest)
+                    {
+                        Console.WriteLine("[MAP {0}] Chest Spawn {1}x{2} points to a non-chest. Removing.", mapID, chestSpawn.X, chestSpawn.Y);
+                        mapFile.RemoveChestSpawn(chestSpawn);
                         changesMade = true;
                     }
                 }
@@ -280,7 +278,7 @@
             }
         }

-        private static bool TileIsValidNPCSpawnPoint(IMapFile EMF, int x, int y)
+        private static bool TileIsValidNPCSpawnPoint(IReadOnlyMapFile EMF, int x, int y)
         {
             if (EMF.Warps[y, x] != null)
                 return false;


Green after re-enabling test (should have been the red cycle for last)

--- Bowling/bowling.csx
+++ Bowling/bowling.csx
@@ -63,16 +63,16 @@
 		game.Score().ShouldBe(16);
 	}

-//	public void Roll_10_over_two_frames()
-//	{
-//		game.Roll(0);
-//		game.Roll(5);
-//		game.Roll(5);
-//		game.Roll(3);
-//		RollMany(rolls: 16, pins: 0);
+	public void Roll_10_over_two_frames()
+	{
+		game.Roll(0);
+		game.Roll(5);
+		game.Roll(5);
+		game.Roll(3);
+		RollMany(rolls: 16, pins: 0);

-//		game.Score().ShouldBe(13);
-//	}
+		game.Score().ShouldBe(13);
+	}

 	private void RollMany(int rolls, int pins)
 	{


The null value parameter removed from call of OandaBrokerage c'tor from OandaDownloader class (#5430)

Co-authored-by: rampasto <10d5b80d220fa5b7cdff7ae9f8b279d61d826bb7@outlook.com>

--- ToolBox/OandaDownloader/OandaDataDownloader.cs
+++ ToolBox/OandaDownloader/OandaDataDownloader.cs
@@ -43,8 +43,7 @@
                 null,
                 Environment.Practice,
                 accessToken,
-                accountId,
-                null);
+                accountId);
         }

         /// <summary>


new updates for the next meeting!

new updates for the next meeting!

--- CameraController.cs
+++ CameraController.cs
@@ -4,15 +4,27 @@
 public class CameraController : MonoBehaviour {

 	public GameObject player;
+	public GameObject myo = null;
+	private ThalmicMyo thalmicMyo;
+	private Transform playerTransform;

 	private Vector3 offset;

 	// Use this for initialization
 	void Start () {
+		playerTransform = player.transform;
 		offset = transform.position - player.transform.position;
+		thalmicMyo = myo.GetComponent<ThalmicMyo> ();
+		transform.rotation = new Quaternion (0f, 0f, 0f, 0f);
 	}
-
+
+	void Update() {
+		this.transform.rotation = new Quaternion(thalmicMyo.transform.rotation.x, thalmicMyo.transform.rotation.y,
+			thalmicMyo.transform.rotation.z, thalmicMyo.transform.rotation.w);
+	}
+
 	void LateUpdate () {
+
 		transform.position = player.transform.position + offset;
 	}
 }


Categorized Uwp tests

Categorized Uwp tests

--- Test/UwpTest/UwpWeavingTest.cs
+++ Test/UwpTest/UwpWeavingTest.cs
@@ -22,8 +22,8 @@
         }

         [TestMethod]
-        [TestCategory("Weaving")]
-        public void SimpleAdviceTest()
+        [TestCategory("UWP")]
+        public void SimpleAdviceUwpTest()
         {
             var c = new AdvisedClass();
             var r = c.Add(3, 5);


Remove BlackHole coloring

Remove BlackHole coloring

--- Client/BlackHole.cs
+++ Client/BlackHole.cs
@@ -16,7 +16,6 @@
             type = ObjectType.BlackHole;
             facing = 0f;
             spritename = "map/blackhole";
-            color = Color.Blue;
             bounding = 0f; // no bounding sphere; Update handles gravity pull
         }


Change BlackHole to ignore non-physics objects

--- Client/BlackHole.cs
+++ Client/BlackHole.cs
@@ -31,6 +31,9 @@
                 // black holes don't affect themselves...
                 if (gobj.type == ObjectType.BlackHole) continue;

+                // exclude objects that have no physics
+                if (gobj.layermask == 0 || gobj.bounding <= 0f) continue;
+
                 // objects closer than 140 units are affected by the grav pull
                 if (!(Vector2.DistanceSquared(gobj.position, this.position) < 19600)) continue;


Implement Station deserialization

Implement Station deserialization

--- Client/GameState.cs
+++ Client/GameState.cs
@@ -113,6 +113,9 @@
                         case ObjectType.AIShip:
                             obj = new AIShip(this);
                             break;
+                        case ObjectType.Station:
+                            obj = new SpaceStation(this);
+                            break;
                         case ObjectType.Asteroid:
                             obj = new Asteroid(this);
                             break;


use the actual SkyWriter

use the actual SkyWriter

--- Client/SkyWriter.cs
+++ Client/SkyWriter.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Threading;
 using turtleAPI;
@@ -18,23 +19,23 @@
             // Console.ReadKey();
             //////////////* skyWriter.Add(server[label[0]]);*/
             skyWriter.AddRange(label.Select(l => server[l]));
-
+            Console.WriteLine("STARTING");
             Text = text.ToLower();

-            //SortTurtles();
-            //Fill();
-
-            //t.Add(new Thread(writeLetter));
-            //t.Add(new Thread(writeLetter1));
-            //t.Add(new Thread(writeLetter2));
-            //t.Add(new Thread(writeLetter3));
-            //t.Add(new Thread(writeLetter4));
-
-            t.Add(new Thread(Turner));
-            t.Add(new Thread(Turner));
-            t.Add(new Thread(Turner));
-            t.Add(new Thread(Turner));
-            t.Add(new Thread(Turner));
+            SortTurtles();
+            Fill();
+
+            t.Add(new Thread(writeLetter));
+            t.Add(new Thread(writeLetter1));
+            t.Add(new Thread(writeLetter2));
+            t.Add(new Thread(writeLetter3));
+            t.Add(new Thread(writeLetter4));
+
+            //t.Add(new Thread(Turner));
+            //t.Add(new Thread(Turner));
+            //t.Add(new Thread(Turner));
+            //t.Add(new Thread(Turner));
+            //t.Add(new Thread(Turner));
             t[0].Start(0);
             t[1].Start(1);
             t[2].Start(2);
@@ -77,7 +78,7 @@
             while (!skyWriter[0].down()) { }
         }

-        private void writeLetter()
+        private void writeLetter(object f)
         {
             string[] o;
             foreach (char letter in Text.ToArray())
@@ -100,7 +101,7 @@
                 //        counter = 0;
             }
         }
-        private void writeLetter1()
+        private void writeLetter1(object f)
         {
             string[] o;
             foreach (char letter in Text.ToArray())
@@ -122,7 +123,7 @@
                 //         counter = 0;
             }
         }
-        private void writeLetter2()
+        private void writeLetter2(object f)
         {
             string[] o;
             foreach (char letter in Text.ToArray())
@@ -144,7 +145,7 @@
                 //       counter = 0;
             }
         }
-        private void writeLetter3()
+        private void writeLetter3(object f)
         {
             string[] o;
             foreach (char letter in Text.ToArray())
@@ -166,7 +167,7 @@
                 //        counter = 0;
             }
         }
-        private void writeLetter4()
+        private void writeLetter4(object f)
         {
             string[] o;
             foreach (char letter in Text.ToArray())


# maptool add set attribute func

# maptool add set attribute func

--- Maptool/Maptool/Form/main_map.cs
+++ Maptool/Maptool/Form/main_map.cs
@@ -74,6 +74,12 @@
             int x = (e.X / TileSize) * TileSize;
             int y = (e.Y / TileSize) * TileSize;

+            if(SelectMode == true)
+            {
+                mainForm.updateAttributePanel(e.X / TileSize, e.Y / TileSize);
+                return;
+            }
+
             switch(mainForm.layerType)
             {
                 case LAYER_TYPE.TILE_LAYER:
@@ -83,8 +89,6 @@
                    Graphics g = Graphics.FromImage(flag);
                    g.DrawImage(mainForm.TileSelectWindow.SelectedTile.tile, new Point(x, y));

-                   mainForm.updateAttributePanel(x / TileSize, y / TileSize);
-
                    work_map.Image = flag;
                    mainForm.Minimap_update();
                    refresh();
@@ -92,9 +96,9 @@
                    break;

                 case LAYER_TYPE.ATTRIBUTE_LAYER :
-
-
-                    break;
+                   grid[x / TileSize, y / TileSize].attributeHeight = mainForm.attributeSettingWindow.height;
+                   grid[x / TileSize, y / TileSize].attributeMove = mainForm.attributeSettingWindow.move;
+                   break;

                 case LAYER_TYPE.OBJECT_LAYER :

@@ -102,7 +106,7 @@
                     break;

             }
-
+            mainForm.updateAttributePanel(e.X / TileSize, e.Y / TileSize);
         }
         private void GridCellHighlight(object sender, MouseEventArgs e)
         {
@@ -148,18 +152,16 @@

             if(e.Button == MouseButtons.Left)
             {
-                if(SelectMode == true)
-                {
-                    mainForm.updateAttributePanel(e.X / TileSize, e.Y / TileSize);
-                }else
-                {
-                    cellClick(e);
-                    isDrag = true;
-                }
+                cellClick(e);
+                isDrag = true;
             }else if (e.Button == MouseButtons.Right)
             {
-                this.Cursor = Cursors.Help;
-                SelectMode = true;
+                if(SelectMode == false)
+                    this.Cursor = Cursors.Help;
+                else
+                    this.Cursor = Cursors.Default;
+
+                SelectMode = !SelectMode;
                 return;
             }


Use InterfaceMap to choose best method

Use InterfaceMap to choose best method

--- Miruken/Callback/HandleMethod.cs
+++ Miruken/Callback/HandleMethod.cs
@@ -38,9 +38,6 @@

         public bool InvokeOn(object target, IHandler composer)
         {
-            if (!TargetType.IsInstanceOfType(target))
-                return false;
-
             var targetMethod = MatchMethod(target);
             if (targetMethod == null) return false;

@@ -72,8 +69,18 @@

         private MethodInfo MatchMethod(object target)
         {
-            return target.GetType().GetMethods(Binding)
-                .FirstOrDefault(m => m.Name == _method.Name &&
+            MethodInfo[] candidates = null;
+
+            var targetType = target.GetType();
+            if (TargetType.IsInterface && TargetType.IsInstanceOfType(target))
+            {
+                var mapping = targetType.GetInterfaceMap(TargetType);
+                candidates = mapping.TargetMethods;
+            }
+
+            candidates = candidates ?? targetType.GetMethods(Binding);
+
+            return candidates.FirstOrDefault(m => m.Name == _method.Name &&
                     m.GetParameters().Select(p => p.ParameterType)
                     .SequenceEqual(_parameters));
         }


bugfix

bugfix

--- Shared/AppSettingsBase.cs
+++ Shared/AppSettingsBase.cs
@@ -18,16 +18,18 @@
 		private static XmlSerializer _serializer;
 		private string _fileName;

-		public static T Load<T>(string fileName)
+		public static T Load<T>(string fileName, string rootName = null)
 			where T : AppSettingsBase, new()
 		{
 			T settings;

 			if (File.Exists(fileName))
 			{
-				var rootAttr = new XmlRootAttribute("AppSettings");
 				if (_serializer == null)
 				{
+					if (string.IsNullOrEmpty(rootName))
+						rootName = typeof(T).Name;
+					var rootAttr = new XmlRootAttribute(rootName);
 					_serializer = new XmlSerializer(typeof(T), null, null, rootAttr, "");
 				}
 				using (var rd = new StreamReader(fileName))


restore Signum.Upgrade ignoring Framework

--- Signum.Upgrade/Program.cs
+++ Signum.Upgrade/Program.cs
@@ -21,7 +21,7 @@
         Console.Write("  ApplicationName = "); SafeConsole.WriteLineColor(ConsoleColor.DarkGray, uctx.ApplicationName);

-        UpgradeContext.DefaultIgnoreDirectories = UpgradeContext.DefaultIgnoreDirectories.Where(a => a != "Framework").ToArray();
+        //UpgradeContext.DefaultIgnoreDirectories = UpgradeContext.DefaultIgnoreDirectories.Where(a => a != "Framework").ToArray();

         new CodeUpgradeRunner(autoDiscover: true).Run(uctx);
     }


Removed unwanted namespaces.

Removed unwanted namespaces.

--- WPF/DispatcherConcept/DispatcherConcept/MainWindow.xaml.cs
+++ WPF/DispatcherConcept/DispatcherConcept/MainWindow.xaml.cs
@@ -1,20 +1,7 @@
 using System;
-using System.Collections.Generic;
 using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
 using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
 using System.Windows.Threading;

 namespace DispatcherConcept


Requested vs Available resources: Date Format Corrected for edit form

--- Web/Areas/Logistics/Views/PromisedContribution/Edit.cshtml
+++ Web/Areas/Logistics/Views/PromisedContribution/Edit.cshtml
@@ -6,7 +6,10 @@
 @{
     ViewBag.Title = Translator.Translate("Contributions");
     Layout = "~/Views/Shared/_MainLayout.cshtml";
-
+    var user = (UserIdentity)System.Web.HttpContext.Current.User.Identity;
+    var unitPreference = user.Profile.PreferedWeightMeasurment;
+    var UserUnit = @Translator.Translate(@Html.UserUnitPreference());
+    var unitsfx = " [" + UserUnit + "]";
 }
 @section Toolbar
 {
@@ -27,7 +30,7 @@

              @Html.LabelFor(model => model.ExpectedTimeOfArrival)

-                 @Html.TextBoxFor(model => model.ExpectedTimeOfArrival, new { @class = "cats-datepicker2", @placeholder = "ETA" })
+                <input class = "cats-datepicker2" id="ExpectedTimeOfArrival" name="ExpectedTimeOfArrival" value="@Model.ExpectedTimeOfArrival.ToShortDateString()"/>
                  @Html.ValidationMessageFor(model => model.ExpectedTimeOfArrival)

@@ -58,7 +61,7 @@

-             @Html.LabelFor(model => model.PromisedQuantity)
+             @Html.LabelFor(model => model.PromisedQuantity) @unitsfx

                  @Html.TextBoxFor(model => model.PromisedQuantity, new { @class = "input-xlarge", @placeholder = "Promised Quantity" })
                  @Html.ValidationMessageFor(model => model.PromisedQuantity)
@@ -66,7 +69,7 @@

-             @Html.LabelFor(model => model.DeliveredQuantity)
+             @Html.LabelFor(model => model.DeliveredQuantity) @unitsfx

                  @Html.TextBoxFor(model => model.DeliveredQuantity, new { @class = "input-xlarge", @placeholder = "Delivered Quantity" })
                  @Html.ValidationMessageFor(model => model.DeliveredQuantity)


Herp Derp WebForms

Herp Derp WebForms

--- Website/Areas/Admin/DynamicData/PageTemplates/Edit.aspx.cs
+++ Website/Areas/Admin/DynamicData/PageTemplates/Edit.aspx.cs
@@ -14,13 +14,13 @@
             table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
             DetailsView1.SetMetaTable(table);
             DetailsDataSource.EntityTypeFilter = table.EntityType.Name;
+            DetailsView1.RowsGenerator = new OrderedFieldGenerator(table);
+            Title = table.DisplayName;
+            DetailsDataSource.Include = table.ForeignKeyColumnsNames;
         }

         protected void Page_Load(object sender, EventArgs e)
         {
-            DetailsView1.RowsGenerator = new OrderedFieldGenerator(table);
-            Title = table.DisplayName;
-            DetailsDataSource.Include = table.ForeignKeyColumnsNames;
         }

         protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)