[Debugger.UnitTests] Unit tests for bug 52333 (#1848)

--- MonoDevelop.Debugger.Tests/EvaluationTests.cs
+++ MonoDevelop.Debugger.Tests/EvaluationTests.cs
@@ -1048,6 +1048,10 @@
 			if (soft != null && soft.ProtocolVersion < new Version (2, 31))
 				Assert.Ignore ("A newer version of the Mono runtime is required.");

+			val = Eval ("(int)19.7");
+			Assert.AreEqual ("19", val.Value);
+			Assert.AreEqual ("int", val.TypeName);
+
 			val = Eval ("(byte)n");
 			Assert.AreEqual ("32", val.Value);
 			Assert.AreEqual ("byte", val.TypeName);


- fixed bug with KeyNotFoundException when resolving identity file with SshConfigSessionFactory

--- GitSharp.Core/Transport/SshConfigSessionFactory.cs
+++ GitSharp.Core/Transport/SshConfigSessionFactory.cs
@@ -131,8 +131,8 @@
                 return def;

             string identityKey = identityFile.FullName;
-            JSch jsch = _byIdentityFile[identityKey];
-            if (jsch == null)
+            JSch jsch;
+            if(!_byIdentityFile.TryGetValue(identityKey, out jsch))
             {
                 jsch = new JSch();
                 jsch.setHostKeyRepository(def.getHostKeyRepository());


more updates

more updates

--- src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs
+++ src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs
@@ -55,10 +55,6 @@
             }

             await snw.RegisterStatusNotifierItemAsync(sysTraySrvName);
-
-            tx.Ready();
-
-            await yx.ActivateAsync(1, 1);
         }
     }

@@ -83,9 +79,19 @@
             ObjectPath = new ObjectPath($"/StatusNotifierItem");
             props = new StatusNotifierItemProperties();

+            var dummyicons = new[] { (1, 1, new byte[8 * 4]), (1, 1, new byte[8 * 4]), };
+
+
+
             props.Title = "Avalonia Test Tray";
+            props.IconPixmap = dummyicons;
             props.Id = ID;
-//
+            props.IconName = "Avalonia";
+            props.ToolTip = ("Avalonia Test Tooltip", dummyicons, "Avalonia Test Tooltip Message", "And another one");
+
+
+
+ //
             //
             // public string Category { get; set; } = default;
             //
@@ -98,6 +104,7 @@
             // public int WindowId { get; set; } = default;
         }

+

         // static class StatusNotifierItemExtensions
         // {
@@ -148,7 +155,7 @@

         public async Task SecondaryActivateAsync(int X, int Y)
         {
-            throw new NotImplementedException();
+            //throw new NotImplementedException();
         }

         public async Task ScrollAsync(int Delta, string Orientation)
@@ -193,11 +200,21 @@
             return Disposable.Create(() => NewStatusAsync -= handler);
         }

+        public async Task<object> GetAsync(string prop)
+        {
+            return default;
+        }
+
         public Action<string> NewStatusAsync { get; set; }

         public async Task<StatusNotifierItemProperties> GetAllAsync()
         {
             return props;
+        }
+
+        public async Task SetAsync(string prop, object val)
+        {
+            throw new NotImplementedException();
         }

         public async Task<IDisposable> WatchPropertiesAsync(Action<PropertyChanges> handler)
@@ -335,7 +352,9 @@
         Task<IDisposable> WatchNewOverlayIconAsync(Action handler, Action<Exception> onError = null);
         Task<IDisposable> WatchNewToolTipAsync(Action handler, Action<Exception> onError = null);
         Task<IDisposable> WatchNewStatusAsync(Action<string> handler, Action<Exception> onError = null);
+        Task<object> GetAsync(string prop);
         Task<StatusNotifierItemProperties> GetAllAsync();
+        Task SetAsync(string prop, object val);
         Task<IDisposable> WatchPropertiesAsync(Action<PropertyChanges> handler);
     }


hide questionbox at the end. Should suffice for now. Closes #1

--- QuizPresentator/Program.cs
+++ QuizPresentator/Program.cs
@@ -132,6 +132,7 @@
 							questionBox.Update(quiz);
 							if (quiz.Ended) {
 								state = State.END;
+								questionBox.Hide();
 							} else
 								state = State.WAIT_FOR_ANSWER;
 						}


Fix a possible race condition with session global _rezMultupleAttachmentsData

It's used outside the lock; it might be getting cleared during async
processing by another packet.

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -8177,7 +8177,8 @@
                 }
                 #endregion

-                bool haveAllObjects = false;
+                // Use a copy of the
+                List<RezMultipleAttachmentsFromInvPacket.ObjectDataBlock> attachmentsData = null;
                 lock (_rezMultupleAttachmentsData)
                 {
                     if (rez.HeaderData.CompoundMsgID != _rezMutipleAttachmentsTransactionId)
@@ -8190,13 +8191,14 @@
                     _rezMultupleAttachmentsData.AddRange(rez.ObjectData);
                     if (rez.HeaderData.TotalObjects == _rezMultupleAttachmentsData.Count)
                     {
-                        haveAllObjects = true;
+                        // we have them all, ready to send off. Create a local copy use outside the lock.
+                        attachmentsData = new List<RezMultipleAttachmentsFromInvPacket.ObjectDataBlock>(_rezMultupleAttachmentsData);
                     }
                 }

-                if (haveAllObjects)
-                {
-                    handlerRezMultipleAttachments(this, rez.HeaderData, _rezMultupleAttachmentsData.ToArray());
+                if (attachmentsData != null)    // we have them all, ready to send off
+                {
+                    handlerRezMultipleAttachments(this, rez.HeaderData, attachmentsData.ToArray());
                 }
             }


[Debugger] I dun goofd

[Debugger] I dun goofd

--- MonoDevelop.Debugger.Tests/EvaluationTests.cs
+++ MonoDevelop.Debugger.Tests/EvaluationTests.cs
@@ -304,8 +304,17 @@
 			Assert.AreEqual ("string", val.TypeName);

 			// FIXME: failing on CorDebugger
-			if (Session is Mono.Debugging.Soft.SoftDebuggerSession) {
+			if (Session is SoftDebuggerSession) {
 				val = Eval ("true.ToString()");
+				if (!AllowTargetInvokes) {
+					var options = Session.Options.EvaluationOptions.Clone ();
+					options.AllowTargetInvoke = true;
+
+					Assert.IsTrue (val.IsNotSupported);
+					val.Refresh (options);
+					val = val.Sync ();
+				}
+
 				Assert.AreEqual ("\"True\"", val.Value);
 				Assert.AreEqual ("string", val.TypeName);
 			}


Fixed patcher/launcher crypto

Fixed patcher/launcher crypto

--- src/Booma.Proxy.Client.Launcher/MainWindow.xaml.cs
+++ src/Booma.Proxy.Client.Launcher/MainWindow.xaml.cs
@@ -35,8 +35,8 @@
 		{
 			ContainerBuilder builder = new ContainerBuilder();

-			PatchEncryptionLazyWithoutKeyDecorator encrypt = new PatchEncryptionLazyWithoutKeyDecorator();
-			PatchEncryptionLazyWithoutKeyDecorator decrypt = new PatchEncryptionLazyWithoutKeyDecorator();
+			EncryptionLazyWithoutKeyDecorator<uint> encrypt = new EncryptionLazyWithoutKeyDecorator<uint>(val => new PatchServerCryptoProvider(PatchEncryptionKeyFactory.Create(val)));
+			EncryptionLazyWithoutKeyDecorator<uint> decrypt = new EncryptionLazyWithoutKeyDecorator<uint>(val => new PatchServerCryptoProvider(PatchEncryptionKeyFactory.Create(val)));
 			IFullCryptoInitializationService<uint> intializers = new SeperateAggregateCryptoInitializationService<uint>(encrypt, decrypt);

 			builder.RegisterInstance(intializers)


Removed comment

Removed comment

--- HeroesMatchTracker.Data/Properties/AssemblyInfo.cs
+++ HeroesMatchTracker.Data/Properties/AssemblyInfo.cs
@@ -21,6 +21,5 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("038bea71-201f-4c56-9edd-152fed4d9b41")]

-// [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0")]
 [assembly: AssemblyFileVersion("1.0.0")]


Delete AppUser.cs

Delete AppUser.cs

--- IdentityDemo_EmailConfirmation/Identity/AppUser.cs
+++ IdentityDemo_EmailConfirmation/Identity/AppUser.cs
@@ -1,15 +0,0 @@
-using Microsoft.AspNet.Identity.EntityFramework;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-
-namespace IdentityDemo.Identity
-{
-    public class AppUser : IdentityUser
-    {
-        public string FirstName { get; set; }
-        public string LastName { get; set; }
-        public bool AccountEnabled { get; set; }
-    }
-}


Removed test "hello" literal

Removed test "hello" literal

--- KBVault.Web/Views/Home/Themes/Default/Index.cshtml
+++ KBVault.Web/Views/Home/Themes/Default/Index.cshtml
@@ -26,8 +26,7 @@
          var KB_SearchUrl = "@Url.Action("Ajax", "Search")";
     </script>
 </head>
-<body>
-    hello
+<body>
     <header class="jumbotron subhead" id="overview">
         <div class="container">
             <h1>


reverst change on code update for websocketwrapper class

--- src/Couchbase.Lite.Shared/Sync/WebSocketWrapper.cs
+++ src/Couchbase.Lite.Shared/Sync/WebSocketWrapper.cs
@@ -375,7 +375,7 @@
             cts.CancelAfter(IdleTimeout);
             if (NetworkStream == null) {
                 Log.To.Sync.E(Tag, "Socket reported ready, but no network stream available!");
-                DidClose(C4WebSocketCustomCloseCode.WebSocketCloseUserPermanent, "Unexpected error in client logic");
+                DidClose(C4WebSocketCloseCode.WebSocketCloseAbnormal, "Unexpected error in client logic");
                 return;
             }

@@ -630,7 +630,7 @@
                 var baseStream = _client?.GetStream();
                 if (baseStream == null) {
                     Log.To.Sync.W(Tag, "Failed to get network stream (already closed?).  Aborting start...");
-                    DidClose(C4WebSocketCustomCloseCode.WebSocketCloseUserPermanent, "Unexpected error in client logic");
+                    DidClose(C4WebSocketCloseCode.WebSocketCloseAbnormal, "Unexpected error in client logic");
                     return;
                 }


tiny code reformat

tiny code reformat

--- src/DbLocalizationProvider/Cache/CacheEventArgs.cs
+++ src/DbLocalizationProvider/Cache/CacheEventArgs.cs
@@ -20,11 +20,13 @@

 using System;

-namespace DbLocalizationProvider.Cache {
+namespace DbLocalizationProvider.Cache
+{
     [Serializable]
     public class CacheEventArgs
     {
-        public static readonly CacheEventArgs Empty = new CacheEventArgs(CacheOperation.None, string.Empty, string.Empty);
+        public static readonly CacheEventArgs Empty =
+            new CacheEventArgs(CacheOperation.None, string.Empty, string.Empty);

         public CacheEventArgs(CacheOperation operation, string cacheKey, string resourceKey)
         {


Add Site Debug Only, closes #18 Add Site button now only appears in DEBUG builds of the mod.

--- KSPRemoteLaunch/KSPRemoteLaunch/RemoteLaunchGUI.cs
+++ KSPRemoteLaunch/KSPRemoteLaunch/RemoteLaunchGUI.cs
@@ -90,7 +90,7 @@

             GUILayout.Label("Result: " + result, labelSty, GUILayout.ExpandWidth(true));
-
+#if DEBUG
             if (GUILayout.Button("Add & Set Launch Site", buttonSty, GUILayout.ExpandWidth(true)))
             {
                 try
@@ -125,7 +125,7 @@
                 }

             }
-
+#endif
             descText = GUILayout.TextArea(descText, textSty, GUILayout.ExpandHeight(true));


Fix logic error in Composition Param handling. #230

--- LCIAToolAPI/CalRecycleLCA.Services/ParamService.cs
+++ LCIAToolAPI/CalRecycleLCA.Services/ParamService.cs
@@ -49,7 +49,7 @@
             else if (isvalid(p.LCIAMethodID))
                 p.ParamTypeID = 10;
             else if (isvalid(p.FlowPropertyID))
-                if (_repository.GetCompositionId((int)p.FlowID, (int)p.FlowPropertyID) != null)
+                if (isvalid(_repository.GetCompositionId((int)p.FlowID, (int)p.FlowPropertyID)))
                     p.ParamTypeID = 5; // this is an internal indicator- ParamTypeID==5 should never appear in the wild
                 else
                     p.ParamTypeID = 4;


Fixed UserSettings Issue

Fixed UserSettings Issue

--- src/Foundation/Facets/code/Facades/UserSettings.cs
+++ src/Foundation/Facets/code/Facades/UserSettings.cs
@@ -37,9 +37,19 @@
                 var settings = Tracker.Current.Contact.GetFacet<IUserSettings>(FacetNames.UserSettings);
                 if (settings != null)
                 {
+                    if (!settings.Entries.Keys.Contains(area))
+                    {
+                        return string.Empty;
+                    }
+
                     var areaSettings = settings.Entries[area];
                     if (areaSettings != null)
                     {
+                        if (!areaSettings.Entries.Keys.Contains(key))
+                        {
+                            return string.Empty;
+                        }
+
                         var setting = areaSettings.Entries[key];
                         if (setting != null)
                         {


Avoid logging during assembly resolve event

Assembly resolving should be as quick and side effect free as possible.
It's best to avoid triggering assembly loads or writing to disk during assembly resolves.
This change delays writing to the log until the package is being disposed.

--- src/GitHub.VisualStudio/AssemblyResolverPackage.cs
+++ src/GitHub.VisualStudio/AssemblyResolverPackage.cs
@@ -7,6 +7,7 @@
 using System.Runtime.InteropServices;
 using Microsoft.VisualStudio;
 using Microsoft.VisualStudio.Shell;
+using NLog;

 namespace GitHub.VisualStudio
 {
@@ -19,25 +20,34 @@
     {
         // list of assemblies that should be considered when resolving
         IEnumerable<ProvideDependentAssemblyAttribute> dependentAssemblies;
+        string packageFolder;

-        string packageFolder;
+        IDictionary<string, Assembly> resolvingAssemblies;
+        IDictionary<string, Exception> resolvingExceptions;

         public AssemblyResolverPackage()
         {
             var asm = Assembly.GetExecutingAssembly();
             packageFolder = Path.GetDirectoryName(asm.Location);
             dependentAssemblies = asm.GetCustomAttributes<ProvideDependentAssemblyAttribute>();
-
+            resolvingAssemblies = new Dictionary<string, Assembly>();
+            resolvingExceptions = new Dictionary<string, Exception>();
             AppDomain.CurrentDomain.AssemblyResolve += ResolveAssemblyFromPackageFolder;
         }

         protected override void Dispose(bool disposing)
         {
             AppDomain.CurrentDomain.AssemblyResolve -= ResolveAssemblyFromPackageFolder;
+
+            if (resolvingAssemblies.Count > 0 || resolvingExceptions.Count > 0)
+            {
+                // Avoid loading logging assembly unless there is something to log.
+                WriteToLog();
+            }
+
             base.Dispose(disposing);
         }

-        [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")]
         Assembly ResolveAssemblyFromPackageFolder(object sender, ResolveEventArgs e)
         {
             Assembly resolvedAssembly = null;
@@ -50,24 +60,31 @@
                     resolvedAssembly = ResolveDependentAssembly(dependentAssembly, packageFolder, resolveAssemblyName);
                     if (resolvedAssembly != null)
                     {
-                        VsOutputLogger.WriteLine($"Resolved '{e.Name}' to '{resolvedAssembly.Location}'.");
+                        resolvingAssemblies[e.Name] = resolvedAssembly;
                         break;
                     }
                 }
             }
             catch (Exception ex)
             {
-                var log = string.Format(CultureInfo.CurrentCulture,
-                    "Error occurred loading {0} from {1}.{2}{3}{4}",
-                    e.Name,
-                    Assembly.GetExecutingAssembly().Location,
-                    Environment.NewLine,
-                    ex,
-                    Environment.NewLine);
-                VsOutputLogger.Write(log);
+                resolvingExceptions[e.Name] = ex;
             }

             return resolvedAssembly;
+        }
+
+        void WriteToLog()
+        {
+            var log = LogManager.GetCurrentClassLogger();
+            foreach (var resolvedAssembly in resolvingAssemblies)
+            {
+                log.Info(CultureInfo.InvariantCulture, "Resolved '{0}' to '{1}'.", resolvedAssembly.Key, resolvedAssembly.Value.Location);
+            }
+
+            foreach (var resolvingException in resolvingExceptions)
+            {
+                log.Error(CultureInfo.InvariantCulture, "Error occurred loading '{0}' from '{1}'.\n{2}", resolvingException.Key, packageFolder, resolvingException.Value);
+            }
         }

         [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods")]


Use interface when casting.

Use interface when casting.

--- PlantUmlStudio/Controls/BindableTextEditor.Config.cs
+++ PlantUmlStudio/Controls/BindableTextEditor.Config.cs
@@ -126,7 +126,7 @@

         private static PropertyChangedCallback CreateCallback<TValue>(Action<TextEditorOptions, TValue> update)
         {
-            return (dependencyObject, e) => update(((BindableTextEditor)dependencyObject).Options, (TValue)e.NewValue);
+            return (dependencyObject, e) => update(((ITextEditorComponent)dependencyObject).Options, (TValue)e.NewValue);
         }

         protected override void OnOptionChanged(PropertyChangedEventArgs e)


Damage conversion/gain does not apply to skill DoT

--- PoESkillTree.Computation.Data/GeneralStatMatchers.cs
+++ PoESkillTree.Computation.Data/GeneralStatMatchers.cs
@@ -50,15 +50,18 @@
                 { "chance to deal double damage", Damage.ChanceToDouble },
                 {
                     "({DamageTypeMatchers}) damage (gained |added )?as (extra )?({DamageTypeMatchers}) damage",
-                    References[0].AsDamageType.Damage.GainAs(References[1].AsDamageType.Damage)
+                    References[0].AsDamageType.Damage.WithHitsAndAilments
+                        .GainAs(References[1].AsDamageType.Damage.WithHitsAndAilments)
                 },
                 {
                     "({DamageTypeMatchers}) damage as extra damage of a random element",
-                    Reference.AsDamageType.Damage.GainAs(RandomElement.Damage)
+                    Reference.AsDamageType.Damage.WithHitsAndAilments
+                        .GainAs(RandomElement.Damage.WithHitsAndAilments)
                 },
                 {
                     "({DamageTypeMatchers}) damage converted to ({DamageTypeMatchers}) damage",
-                    References[0].AsDamageType.Damage.ConvertTo(References[1].AsDamageType.Damage)
+                    References[0].AsDamageType.Damage.WithHitsAndAilments
+                        .ConvertTo(References[1].AsDamageType.Damage.WithHitsAndAilments)
                 },
                 { "({DamageTypeMatchers}) damage taken", Reference.AsDamageType.Damage.Taken },
                 { "take ({DamageTypeMatchers}) damage", Reference.AsDamageType.Damage.Taken },


Fix documentation typo (#9740)

Fix documentation typo (#9740)

--- src/Http/Http.Abstractions/src/Routing/Endpoint.cs
+++ src/Http/Http.Abstractions/src/Routing/Endpoint.cs
@@ -4,7 +4,7 @@
 namespace Microsoft.AspNetCore.Http
 {
     /// <summary>
-    /// Respresents a logical endpoint in an application.
+    /// Represents a logical endpoint in an application.
     /// </summary>
     public class Endpoint
     {


more async in caching nancy module

more async in caching nancy module

--- src/LiGet/Cache/Proxy/CachingProxyV3NancyModule.cs
+++ src/LiGet/Cache/Proxy/CachingProxyV3NancyModule.cs
@@ -34,7 +34,7 @@

             this.OnError.AddItemToEndOfPipeline(HandleError);

-            base.Get<Response>("/{path*}", args =>
+            base.Get<Response>("/{path*}", async args =>
             {
                 string myV3Url = this.GetServiceUrl().AbsoluteUri;
                 Dictionary<string, string> replacements = replacementsProvider.GetReplacements(myV3Url);
@@ -45,7 +45,7 @@
                 };
                 request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                 _log.DebugFormat("Proxying {0} to {1}", this.Request.Url, request.RequestUri);
-                var originalResponse = client.SendAsync(request).Result;
+                var originalResponse = await client.SendAsync(request);
                 return new Response()
                 {
                     StatusCode = (Nancy.HttpStatusCode)(int)originalResponse.StatusCode,
@@ -68,7 +68,7 @@
                 };
             });

-            base.Get<Response>("/v3/registration3/{package}/index.json", args =>
+            base.Get<Response>("/v3/registration3/{package}/index.json", async args =>
             {
                 string package = args.package;
                 byte[] bytes = this.metadataCache.TryGet(package);
@@ -105,7 +105,7 @@
                 request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                 _log.DebugFormat("Cache miss. Proxying {0} to {1}", Request.Url, request.RequestUri);
                 var timestamp = DateTimeOffset.UtcNow;
-                var originalResponse = client.SendAsync(request).Result;
+                var originalResponse = await client.SendAsync(request);
                 return new Response()
                 {
                     StatusCode = (Nancy.HttpStatusCode)(int)originalResponse.StatusCode,
@@ -135,7 +135,7 @@
                 };
             });

-            base.Get<Response>("/{path*}", args =>
+            base.Get<Response>("/{path*}", async args =>
             {
                 string myV3Url = this.GetServiceUrl().AbsoluteUri;
                 Dictionary<string, string> replacements = replacementsProvider.GetReplacements(myV3Url);
@@ -146,7 +146,7 @@
                 };
                 request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                 _log.DebugFormat("Proxying {0} to {1}", this.Request.Url, request.RequestUri);
-                var originalResponse = client.SendAsync(request).Result;
+                var originalResponse = await client.SendAsync(request);
                 return new Response()
                 {
                     StatusCode = (Nancy.HttpStatusCode)(int)originalResponse.StatusCode,
@@ -169,7 +169,7 @@
                 };
             });

-            base.Get<Response>("/v3-flatcontainer/{package}/{version}/{filename}", args =>
+            base.Get<Response>("/v3-flatcontainer/{package}/{version}/{filename}", async args =>
             {
                 string package = args.package;
                 string version = args.version;
@@ -188,7 +188,7 @@
                     };
                     request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/octet-stream"));
                     _log.DebugFormat("Cache miss. Proxying {0} to {1}", this.Request.Url, request.RequestUri);
-                    var originalResponse = client.SendAsync(request).Result;
+                    var originalResponse = await client.SendAsync(request);
                     return new DisposingResponse(originalResponse)
                     {
                         ContentType = originalResponse.Content.Headers.ContentType.MediaType,


change exception throwing to log errors, added a null check for getting the custom attribute in case it's not in the xml file

--- RelhaxModpack/RelhaxModpack/Utilities/CommonUtils.cs
+++ RelhaxModpack/RelhaxModpack/Utilities/CommonUtils.cs
@@ -1093,11 +1093,28 @@
                 //if we're doing custom typing, then get the type based on the attribute name
                 if (customTyping)
                 {
-                    string typeResult = listElement.Attribute(customTypeAttributeName).Value;
+                    XAttribute typeResultAttribute = listElement.Attribute(customTypeAttributeName);
+                    if (typeResultAttribute == null)
+                    {
+                        Logging.Error("The custom attribute {0} was missing from the xml element", customTypeAttributeName);
+                        errorOccured = true;
+                        continue;
+                    }
+
+                    string typeResult = typeResultAttribute.Value;
                     if (string.IsNullOrEmpty(typeResult))
-                        throw new BadMemeException("typeResult is null or empty - invalid attribute name");
+                    {
+                        Logging.Error("typeResult is null or empty - invalid attribute name", customTypeAttributeName);
+                        errorOccured = true;
+                        continue;
+                    }
+
                     if (!typeMapper.ContainsKey(typeResult))
-                        throw new BadMemeException(string.Format("typeResult {0} does not exist in dictionary", typeResult));
+                    {
+                        Logging.Error("typeResult {0} does not exist in dictionary", typeResult);
+                        errorOccured = true;
+                        continue;
+                    }
                     listObjectType = typeMapper[typeResult];
                 }


Lucene.Net.Core.Codecs.BlockTreeTermsWriter.FieldMetaData refactor: Changed public fields into properties

--- src/Lucene.Net.Core/Codecs/BlockTreeTermsWriter.cs
+++ src/Lucene.Net.Core/Codecs/BlockTreeTermsWriter.cs
@@ -239,27 +239,27 @@

         private class FieldMetaData
         {
-            public readonly FieldInfo fieldInfo;
-            public readonly BytesRef rootCode;
-            public readonly long numTerms;
-            public readonly long indexStartFP;
-            public readonly long sumTotalTermFreq;
-            public readonly long sumDocFreq;
-            public readonly int docCount;
-            internal readonly int longsSize;
+            public FieldInfo FieldInfo { get; private set; }
+            public BytesRef RootCode { get; private set; }
+            public long NumTerms { get; private set; }
+            public long IndexStartFP { get; private set; }
+            public long SumTotalTermFreq { get; private set; }
+            public long SumDocFreq { get; private set; }
+            public int DocCount { get; private set; }
+            internal int LongsSize { get; private set; }

             public FieldMetaData(FieldInfo fieldInfo, BytesRef rootCode, long numTerms, long indexStartFP, long sumTotalTermFreq, long sumDocFreq, int docCount, int longsSize)
             {
                 Debug.Assert(numTerms > 0);
-                this.fieldInfo = fieldInfo;
+                this.FieldInfo = fieldInfo;
                 Debug.Assert(rootCode != null, "field=" + fieldInfo.Name + " numTerms=" + numTerms);
-                this.rootCode = rootCode;
-                this.indexStartFP = indexStartFP;
-                this.numTerms = numTerms;
-                this.sumTotalTermFreq = sumTotalTermFreq;
-                this.sumDocFreq = sumDocFreq;
-                this.docCount = docCount;
-                this.longsSize = longsSize;
+                this.RootCode = rootCode;
+                this.IndexStartFP = indexStartFP;
+                this.NumTerms = numTerms;
+                this.SumTotalTermFreq = sumTotalTermFreq;
+                this.SumDocFreq = sumDocFreq;
+                this.DocCount = docCount;
+                this.LongsSize = longsSize;
             }
         }

@@ -1204,18 +1204,18 @@
                 foreach (FieldMetaData field in fields)
                 {
                     //System.out.println("  field " + field.fieldInfo.name + " " + field.numTerms + " terms");
-                    @out.WriteVInt(field.fieldInfo.Number);
-                    @out.WriteVLong(field.numTerms);
-                    @out.WriteVInt(field.rootCode.Length);
-                    @out.WriteBytes(field.rootCode.Bytes, field.rootCode.Offset, field.rootCode.Length);
-                    if (field.fieldInfo.IndexOptions != IndexOptions.DOCS_ONLY)
-                    {
-                        @out.WriteVLong(field.sumTotalTermFreq);
-                    }
-                    @out.WriteVLong(field.sumDocFreq);
-                    @out.WriteVInt(field.docCount);
-                    @out.WriteVInt(field.longsSize);
-                    indexOut.WriteVLong(field.indexStartFP);
+                    @out.WriteVInt(field.FieldInfo.Number);
+                    @out.WriteVLong(field.NumTerms);
+                    @out.WriteVInt(field.RootCode.Length);
+                    @out.WriteBytes(field.RootCode.Bytes, field.RootCode.Offset, field.RootCode.Length);
+                    if (field.FieldInfo.IndexOptions != IndexOptions.DOCS_ONLY)
+                    {
+                        @out.WriteVLong(field.SumTotalTermFreq);
+                    }
+                    @out.WriteVLong(field.SumDocFreq);
+                    @out.WriteVInt(field.DocCount);
+                    @out.WriteVInt(field.LongsSize);
+                    indexOut.WriteVLong(field.IndexStartFP);
                 }
                 WriteTrailer(@out, dirStart);
                 CodecUtil.WriteFooter(@out);


Improve efficiency of int command parsing by removing CF workaround and selecting validation message only after failure

--- src/NUnitFramework/nunitlite/CommandLineOptions.cs
+++ src/NUnitFramework/nunitlite/CommandLineOptions.cs
@@ -290,27 +290,17 @@

         protected int RequiredInt(string val, string option)
         {
+            int result;
+            if (int.TryParse(val, out result)) return result;
+
+            ErrorMessages.Add(string.IsNullOrEmpty(val)
+                ? "Missing required value for option '" + option + "'."
+                : "An int value was expected for option '{0}' but a value of '{1}' was used");
+
             // We have to return something even though the value will
             // be ignored if an error is reported. The -1 value seems
             // like a safe bet in case it isn't ignored due to a bug.
-            int result = -1;
-
-            if (string.IsNullOrEmpty(val))
-                ErrorMessages.Add("Missing required value for option '" + option + "'.");
-            else
-            {
-                // NOTE: Don't replace this with TryParse or you'll break the CF build!
-                try
-                {
-                    result = int.Parse(val);
-                }
-                catch (Exception)
-                {
-                    ErrorMessages.Add("An int value was expected for option '{0}' but a value of '{1}' was used");
-                }
-            }
-
-            return result;
+            return -1;
         }

         private string ExpandToFullPath(string path)


Fix typo in NullValue property (thanks @lukapor)

--- src/Nest/Mapping/AttributeBased/StringAttribute.cs
+++ src/Nest/Mapping/AttributeBased/StringAttribute.cs
@@ -26,7 +26,7 @@
 		public bool IncludeInAll { get { return Self.IncludeInAll.GetValueOrDefault(); } set { Self.IncludeInAll = value; } }
 		public FieldIndexOption Index { get { return Self.Index.GetValueOrDefault(); } set { Self.Index = value; } }
 		public IndexOptions IndexOptions { get { return Self.IndexOptions.GetValueOrDefault(); } set { Self.IndexOptions = value; } }
-		public string NullValue { get { return Self.Analyzer; } set { Self.Analyzer = value; } }
+		public string NullValue { get { return Self.NullValue; } set { Self.NullValue = value; } }
 		public int PositionOffsetGap { get { return Self.PositionOffsetGap.GetValueOrDefault(); } set { Self.PositionOffsetGap = value; } }
 		public string SearchAnalyzer { get { return Self.SearchAnalyzer; } set { Self.SearchAnalyzer = value; } }
 		public TermVectorOption TermVector { get { return Self.TermVector.GetValueOrDefault(); } set { Self.TermVector = value; } }


PP9-9225 cleanup tests

PP9-9225 cleanup tests

--- src/Picturepark.SDK.V1.Tests/Clients/ShareTests.cs
+++ src/Picturepark.SDK.V1.Tests/Clients/ShareTests.cs
@@ -402,7 +402,16 @@
         public async Task ShouldContainDynamicOutputsBasic()
         {
             var (formatIdOriginal, formatIdPreview, shareContents) = await PrepareDynamicOutputFormatTest();
-            var shareCreateResult = await CreateShare(new ShareBasicCreateRequest()
+
+            var shareFullCreateResult = await CreateShare(new ShareBasicCreateRequest()
+            {
+                Contents = shareContents,
+                OutputAccess = OutputAccess.Full,
+                Name = formatIdOriginal + "-share",
+                LanguageCode = "en"
+            }).ConfigureAwait(false);
+
+            var sharePreviewCreateResult = await CreateShare(new ShareBasicCreateRequest()
             {
                 Contents = shareContents,
                 OutputAccess = OutputAccess.Preview,
@@ -410,11 +419,7 @@
                 LanguageCode = "en"
             }).ConfigureAwait(false);

-            var share = await _client.Share.GetAsync(shareCreateResult.ShareId).ConfigureAwait(false);
-
-            var shareOutputs = share.ContentSelections.Single().Outputs;
-            shareOutputs.Should().Contain(o => o.OutputFormatId == formatIdPreview);
-            shareOutputs.Should().NotContain(o => o.OutputFormatId == formatIdOriginal);
+            await AssertSharesContainCorrectOutputs(shareFullCreateResult.ShareId, sharePreviewCreateResult.ShareId, formatIdOriginal, formatIdPreview);
         }

         [Fact]
@@ -422,18 +427,38 @@
         public async Task ShouldContainDynamicOutputsEmbed()
         {
             var (formatIdOriginal, formatIdPreview, shareContents) = await PrepareDynamicOutputFormatTest();
-            var shareCreateResult = await CreateShare(new ShareEmbedCreateRequest()
+
+            var shareFullCreateResult = await CreateShare(new ShareEmbedCreateRequest()
+            {
+                Contents = shareContents,
+                OutputAccess = OutputAccess.Full,
+                Name = formatIdOriginal + "-share"
+            }).ConfigureAwait(false);
+
+            var sharePreviewCreateResult = await CreateShare(new ShareEmbedCreateRequest()
             {
                 Contents = shareContents,
                 OutputAccess = OutputAccess.Preview,
                 Name = formatIdPreview + "-share"
             }).ConfigureAwait(false);

-            var share = await _client.Share.GetAsync(shareCreateResult.ShareId).ConfigureAwait(false);
-
-            var shareOutputs = share.ContentSelections.Single().Outputs;
-            shareOutputs.Should().Contain(o => o.OutputFormatId == formatIdPreview);
-            shareOutputs.Should().NotContain(o => o.OutputFormatId == formatIdOriginal);
+            await AssertSharesContainCorrectOutputs(shareFullCreateResult.ShareId, sharePreviewCreateResult.ShareId, formatIdOriginal, formatIdPreview);
+        }
+
+        private async Task AssertSharesContainCorrectOutputs(
+            string shareFullId,
+            string sharePreviewId,
+            string formatIdOriginal,
+            string formatIdPreview)
+        {
+            var shareFull = await _client.Share.GetAsync(shareFullId).ConfigureAwait(false);
+            var sharePreview = await _client.Share.GetAsync(sharePreviewId).ConfigureAwait(false);
+
+            shareFull.ContentSelections.Single().Outputs.Should().Contain(o => o.OutputFormatId == formatIdPreview);
+            shareFull.ContentSelections.Single().Outputs.Should().Contain(o => o.OutputFormatId == formatIdOriginal);
+
+            sharePreview.ContentSelections.Single().Outputs.Should().Contain(o => o.OutputFormatId == formatIdPreview);
+            sharePreview.ContentSelections.Single().Outputs.Should().NotContain(o => o.OutputFormatId == formatIdOriginal);
         }

         private async Task<(string outputFormatIdOriginal, string outputFormatIdPreview, ICollection<ShareContent> shareContent)> PrepareDynamicOutputFormatTest([CallerMemberName] string testName = null)


2210.1

--- src/PixelFarm/PixelFarm.Painter/0_Base/ForNet20.cs
+++ src/PixelFarm/PixelFarm.Painter/0_Base/ForNet20.cs
@@ -6,6 +6,7 @@
     //public delegate R Func<T, R>(T t1);
     //public delegate R Func<T1, T2, R>(T1 t1, T2 t2);
     //public delegate R Func<T1, T2, T3, R>(T1 t1, T2 t2, T3 t3);
+#if !NETSTANDARD
     public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
     public delegate void Action<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3);
     public delegate void Action<in T1, in T2, in T3, in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
@@ -14,7 +15,7 @@
     public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
     public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);

-#if !NETSTANDARD
+
     public delegate TResult Func<out TResult>();
     public delegate TResult Func<in T, out TResult>(T arg);
     public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);


Switch to w3c log file timestamp format (#626)

--- src/PowerShellEditorServices/Utility/FileLogger.cs
+++ src/PowerShellEditorServices/Utility/FileLogger.cs
@@ -82,7 +82,7 @@
                 // Print the timestamp and log level
                 this.textWriter.WriteLine(
                     "{0} [{1}] - Method \"{2}\" at line {3} of {4}\r\n",
-                    DateTime.Now,
+                    DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     logLevel.ToString().ToUpper(),
                     callerName,
                     callerLineNumber,


fix: header for test file

fix: header for test file

--- Main/Source/NMemory.Test/TableCollectionFixture.cs
+++ Main/Source/NMemory.Test/TableCollectionFixture.cs
@@ -1,14 +1,36 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using NMemory.Indexes;
-using NMemory.Tables;
-using NMemory.Test.Environment.Data;
+// -----------------------------------------------------------------------------------
+// <copyright file="TableCollectionFixture.cs" company="NMemory Team">
+//     Copyright (C) 2012-2015 NMemory Team
+//
+//     Permission is hereby granted, free of charge, to any person obtaining a copy
+//     of this software and associated documentation files (the "Software"), to deal
+//     in the Software without restriction, including without limitation the rights
+//     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//     copies of the Software, and to permit persons to whom the Software is
+//     furnished to do so, subject to the following conditions:
+//
+//     The above copyright notice and this permission notice shall be included in
+//     all copies or substantial portions of the Software.
+//
+//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//     THE SOFTWARE.
+// </copyright>
+// -----------------------------------------------------------------------------------
+

 namespace NMemory.Test
 {
+    using System.Linq;
+    using Microsoft.VisualStudio.TestTools.UnitTesting;
+    using NMemory.Indexes;
+    using NMemory.Tables;
+    using NMemory.Test.Environment.Data;
+
     [TestClass]
     public class TableCollectionFixture
     {
@@ -29,6 +51,5 @@

             Assert.IsTrue(object.ReferenceEquals(rel1, rel));
         }
-
     }
 }


Skip DownloadFileAttribute_ToStream test failing on CI with TLS handshake errors

--- MegaApiClient.Tests/DownloadUploadAuthenticated.cs
+++ MegaApiClient.Tests/DownloadUploadAuthenticated.cs
@@ -100,7 +100,7 @@
       }
     }

-    [Theory]
+    [Theory(Skip = "SSL Handshake failed on CI")]
     [InlineData(FileAttributeType.Thumbnail, "Data/SampleFile_thumbnail.jpg")]
     [InlineData(FileAttributeType.Preview, "Data/SampleFile_preview.jpg")]
     public void DownloadFileAttribute_ToStream_Succeeds(FileAttributeType fileAttributeType, string expectedFileContent)


ランキングの説明文のHtml特殊文字をデコードしてなかった

ランキングの説明文のHtml特殊文字をデコードしてなかった

--- SRNicoNico/Models/NicoNicoWrapper/NicoNicoRanking.cs
+++ SRNicoNico/Models/NicoNicoWrapper/NicoNicoRanking.cs
@@ -3,6 +3,7 @@
 using SRNicoNico.Models.NicoNicoViewer;
 using System;
 using System.Threading.Tasks;
+using System.Web;

 namespace SRNicoNico.Models.NicoNicoWrapper {
     public class NicoNicoRanking : NotificationObject {
@@ -165,14 +166,13 @@
                     item.ContentUrl = "https://www.nicovideo.jp/" + content.SelectSingleNode("p/a").Attributes["href"].Value;
                     item.Title = content.SelectSingleNode("p/a").InnerText;

-                    item.Description = content.SelectSingleNode("div[@class='wrap']/p[@class='itemDescription ranking']").InnerText;
+                    item.Description = HttpUtility.HtmlDecode(content.SelectSingleNode("div[@class='wrap']/p[@class='itemDescription ranking']").InnerText);

                     var itemdata = content.SelectSingleNode("div[@class='itemData']/ul");

                     item.ViewCount = itemdata.SelectSingleNode("li[@class='count view']/span").InnerText;
                     item.CommentCount = itemdata.SelectSingleNode("li[@class='count comment']/span").InnerText;
                     item.MylistCount = itemdata.SelectSingleNode("li[@class='count mylist']/span").InnerText;
-

                     NicoNicoUtil.ApplyLocalHistory(item);


Fixed logic with 3 BP level site groupings

--- Sdl.Web.Templating/Templates/PublishConfiguration.cs
+++ Sdl.Web.Templating/Templates/PublishConfiguration.cs
@@ -8,6 +8,7 @@
 using Tridion.ContentManager.ContentManagement.Fields;
 using Tridion.ContentManager.Templating;
 using Tridion.ContentManager.Templating.Assembly;
+using System.Linq;

 namespace Sdl.Web.Tridion.Templates
 {
@@ -151,11 +152,11 @@
             return additionalData;
         }

-        private Publication GetMasterPublication(Publication contextPublication, ref string siteId)
-        {
-            siteId = GetSiteIdFromPublication(contextPublication) ?? siteId;
+        private Publication GetMasterPublication(Publication contextPublication)
+        {
+            var siteId = GetSiteIdFromPublication(contextPublication);
             List<Publication> validParents = new List<Publication>();
-            if (siteId != null)
+            if (siteId != null && siteId!="multisite-master")
             {
                 foreach (var item in contextPublication.Parents)
                 {
@@ -170,7 +171,7 @@
             {
                 Logger.Error(String.Format("Publication {0} has more than one parent with the same (or empty) siteId {1}. Cannot determine site grouping, so picking the first parent: {2}.", contextPublication.Title, siteId, validParents[0].Title));
             }
-            return validParents.Count==0 ? contextPublication : GetMasterPublication(validParents[0], ref siteId);
+            return validParents.Count==0 ? contextPublication : GetMasterPublication(validParents[0]);
         }

         private bool IsCandidateMaster(Publication pub, string childId)
@@ -185,8 +186,8 @@

         private List<string> LoadSitePublications(Publication contextPublication)
         {
-            string siteId = null;
-            var master = GetMasterPublication(contextPublication, ref siteId);
+            string siteId = GetSiteIdFromPublication(contextPublication);
+            var master = GetMasterPublication(contextPublication);
             Logger.Debug(String.Format("Master publication is : {0}, siteId is {1}", master.Title, siteId));
             List<string> pubIds = new List<string> { master.Id.ItemId.ToString() };
             if (siteId!=null)
@@ -209,10 +210,6 @@
                 {
                     Logger.Debug(String.Format("Found valid descendent {0} with site ID {1} ", child.Title, childSiteId));
                     pubIds.Add(child.Id.ItemId.ToString());
-                    if (child.HasChildren)
-                    {
-                        pubIds.AddRange(GetChildPublicationIds(child, siteId));
-                    }
                 }
                 else
                 {


field is readonly

field is readonly

--- src/Pustota.Maven/Actions/DumpClassifiersAction.cs
+++ src/Pustota.Maven/Actions/DumpClassifiersAction.cs
@@ -6,7 +6,7 @@
 {
 	public class DumpClassifiersAction
 	{
-		private IProjectsRepository _projects;
+		private readonly IProjectsRepository _projects;

 		public DumpClassifiersAction(IProjectsRepository projects)
 		{


Nobody needs no

Nobody needs no

ViewBag.message

--- ShortenerApp/Shortener/Controllers/HomeController.cs
+++ ShortenerApp/Shortener/Controllers/HomeController.cs
@@ -15,8 +15,6 @@

         public ActionResult About()
         {
-            ViewBag.Message = "Your application description page.";
-
             return View();
         }
     }


fix when dynamic type has custom inheritance for TreeEntity

--- Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
+++ Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
@@ -206,6 +206,7 @@
         public string TypeName { get; private set; }
         public DynamicBaseType BaseType { get; private set; }
         public DynamicTypeDefinition Def { get; private set; }
+        public bool IsTreeEntity { get; private set; }

         public DynamicTypeCodeGenerator(string @namespace, string typeName, DynamicBaseType baseType, DynamicTypeDefinition def, HashSet<string> usings)
         {
@@ -214,6 +215,7 @@
             this.TypeName = typeName;
             this.BaseType = baseType;
             this.Def = def;
+            this.IsTreeEntity = def != null && def.CustomInheritance != null && def.CustomInheritance.Code.Contains("TreeEntity");
         }

         public string GetFileCode()
@@ -287,6 +289,9 @@

         public string GetEntityOperation()
         {
+            if (this.IsTreeEntity)
+                return null;
+
             if (this.Def.OperationCreate == null &&
                  this.Def.OperationSave == null &&
                  this.Def.OperationDelete == null)
@@ -588,6 +593,7 @@
         public string TypeName { get; private set; }
         public DynamicBaseType BaseType { get; private set; }
         public DynamicTypeDefinition Def { get; private set; }
+        public bool IsTreeEntity { get; private set; }

         public Dictionary<string, string> AlreadyTranslated { get; set; }
         public Dictionary<string, Tuple<string, string>> Formatted { get; set; }
@@ -599,6 +605,7 @@
             this.TypeName = typeName;
             this.BaseType = baseType;
             this.Def = def;
+            this.IsTreeEntity = def != null && def.CustomInheritance != null && def.CustomInheritance.Code.Contains("TreeEntity");
         }

         public string GetFileCode()
@@ -621,7 +628,6 @@
                     sb.AppendLine($"        " + item + ",");
                 sb.AppendLine($"    }}");
             }
-

             sb.AppendLine($"    public static class {this.TypeName}Logic");
             sb.AppendLine($"    {{");
@@ -633,8 +639,14 @@
             if (this.BaseType == DynamicBaseType.Entity)
             {
                 sb.AppendLine(GetInclude().Indent(16));
-
-                if (complexFields != null)
+            }
+
+            if (this.Def.CustomStartCode != null)
+                sb.AppendLine(this.Def.CustomStartCode.Code.Indent(16));
+
+            if (this.BaseType == DynamicBaseType.Entity)
+            {
+                if (complexFields.HasItems())
                     sb.AppendLine(RegisterComplexQuery(complexFields).Indent(16));

                 var complexOperations = RegisterComplexOperations();
@@ -642,9 +654,6 @@
                     sb.AppendLine(complexOperations.Indent(16));
             }

-            if (this.Def.CustomStartCode != null)
-                sb.AppendLine(this.Def.CustomStartCode.Code.Indent(16));
-
             sb.AppendLine($"            }}");
             sb.AppendLine($"        }}");

@@ -662,11 +671,14 @@
             StringBuilder sb = new StringBuilder();
             sb.AppendLine($"var fi = sb.Include<{this.TypeName}Entity>()");

-            if (this.Def.OperationSave != null && string.IsNullOrWhiteSpace(this.Def.OperationSave.Execute.Trim()))
-                sb.AppendLine($"    .WithSave({this.TypeName}Operation.Save)");
-
-            if (this.Def.OperationDelete != null && string.IsNullOrWhiteSpace(this.Def.OperationDelete.Delete.Trim()))
-                sb.AppendLine($"    .WithDelete({this.TypeName}Operation.Delete)");
+            if (!this.IsTreeEntity)
+            {
+                if (this.Def.OperationSave != null && string.IsNullOrWhiteSpace(this.Def.OperationSave.Execute.Trim()))
+                    sb.AppendLine($"    .WithSave({this.TypeName}Operation.Save)");
+
+                if (this.Def.OperationDelete != null && string.IsNullOrWhiteSpace(this.Def.OperationDelete.Delete.Trim()))
+                    sb.AppendLine($"    .WithDelete({this.TypeName}Operation.Delete)");
+            }

             var mcui = this.Def.MultiColumnUniqueIndex;
             if (mcui != null)
@@ -741,10 +753,20 @@
             if (!string.IsNullOrWhiteSpace(operationConstruct))
             {
                 sb.AppendLine();
-                sb.AppendLine("new Graph<{0}Entity>.Construct({0}Operation.Create)".FormatWith(this.TypeName));
-                sb.AppendLine("{");
-                sb.AppendLine("    Construct = (args) => {\r\n" + operationConstruct.Indent(8) + "\r\n}");
-                sb.AppendLine("}.Register();");
+
+                if (this.IsTreeEntity)
+                {
+                    sb.AppendLine("Graph<{0}Entity>.Construct.Untyped(TreeOperation.CreateRoot).Do(g => ".FormatWith(this.TypeName));
+                    sb.AppendLine("    g.Construct = (args) => {\r\n" + operationConstruct.Indent(8) + "\r\n}");
+                    sb.AppendLine(").Register(replace: true);");
+                }
+                else
+                {
+                    sb.AppendLine("new Graph<{0}Entity>.Construct({0}Operation.Create)".FormatWith(this.TypeName));
+                    sb.AppendLine("{");
+                    sb.AppendLine("    Construct = (args) => {\r\n" + operationConstruct.Indent(8) + "\r\n}");
+                    sb.AppendLine("}.Register();");
+                }
             }

             var operationExecute = this.Def.OperationSave?.Execute.Trim();
@@ -752,7 +774,7 @@
             if (!string.IsNullOrWhiteSpace(operationExecute) || !string.IsNullOrWhiteSpace(operationCanExecute))
             {
                 sb.AppendLine();
-                sb.AppendLine("new Graph<{0}Entity>.Execute({0}Operation.Save)".FormatWith(this.TypeName));
+                sb.AppendLine("new Graph<{0}Entity>.Execute({1}Operation.Save)".FormatWith(this.TypeName, (this.IsTreeEntity ? "Tree" : this.TypeName)));
                 sb.AppendLine("{");

                 if (!string.IsNullOrWhiteSpace(operationCanExecute))
@@ -761,7 +783,7 @@
                 sb.AppendLine("    AllowsNew = true,");
                 sb.AppendLine("    Lite = false,");
                 sb.AppendLine("    Execute = (e, args) => {\r\n" + operationExecute?.Indent(8) + "\r\n}");
-                sb.AppendLine("}.Register();");
+                sb.AppendLine("}." + (this.IsTreeEntity ? "Register(replace: true)" : "Register()") + ";");
             }

             var operationDelete = this.Def.OperationDelete?.Delete.Trim();
@@ -769,14 +791,14 @@
             if (!string.IsNullOrWhiteSpace(operationDelete) || !string.IsNullOrEmpty(operationCanDelete))
             {
                 sb.AppendLine();
-                sb.AppendLine("new Graph<{0}Entity>.Delete({0}Operation.Delete)".FormatWith(this.TypeName));
+                sb.AppendLine("new Graph<{0}Entity>.Delete({1}Operation.Delete)".FormatWith(this.TypeName, (this.IsTreeEntity ? "Tree" : this.TypeName)));
                 sb.AppendLine("{");

                 if (!string.IsNullOrWhiteSpace(operationCanDelete))
                     sb.AppendLine($"    CanDelete = e => {operationCanDelete},");

                 sb.AppendLine("    Delete = (e, args) => {\r\n" + (operationDelete.DefaultText("e.Delete();")).Indent(8) + "\r\n}");
-                sb.AppendLine("}.Register();");
+                sb.AppendLine("}." + (this.IsTreeEntity ? "Register(replace: true)" : "Register()") + ";");
             }

             return sb.ToString();


NWebDAV: Allow external access to the typed converters.

--- NWebDav/NWebDav.Server/Props/DavTypedProperties.cs
+++ NWebDav/NWebDav.Server/Props/DavTypedProperties.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Data;
 using System.Globalization;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
@@ -197,7 +196,7 @@
             }
         }

-        private static IConverter TypeConverter { get; } = new Rfc1123DateConverter();
+        public static IConverter TypeConverter { get; } = new Rfc1123DateConverter();

         /// <summary>
         /// Converter to map RFC1123 dates to/from a <see cref="DateTime"/>.
@@ -241,7 +240,7 @@
             }
         }

-        private static IConverter TypeConverter { get; } = new Iso8601DateConverter();
+        public static IConverter TypeConverter { get; } = new Iso8601DateConverter();

         /// <summary>
         /// Converter to map ISO 8601 dates to/from a <see cref="DateTime"/>.
@@ -264,7 +263,7 @@
             public Boolean FromXml(IHttpContext httpContext, object value) => int.Parse(value.ToString()) != 0;
         }

-        private static IConverter TypeConverter { get; } = new BooleanConverter();
+        public static IConverter TypeConverter { get; } = new BooleanConverter();

         /// <summary>
         /// Converter to map an XML boolean to/from a <see cref="bool"/>.
@@ -287,7 +286,7 @@
             public string FromXml(IHttpContext httpContext, object value) => value.ToString();
         }

-        private static IConverter TypeConverter { get; } = new StringConverter();
+        public static IConverter TypeConverter { get; } = new StringConverter();

         /// <summary>
         /// Converter to map an XML string to/from a <see cref="string"/>.
@@ -310,7 +309,7 @@
             public Int32 FromXml(IHttpContext httpContext, object value) => int.Parse(value.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture);
         }

-        private static IConverter TypeConverter { get; } = new Int32Converter();
+        public static IConverter TypeConverter { get; } = new Int32Converter();

         /// <summary>
         /// Converter to map an XML number to/from a <see cref="int"/>.
@@ -333,7 +332,7 @@
             public Int64 FromXml(IHttpContext httpContext, object value) => int.Parse(value.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture);
         }

-        private static IConverter TypeConverter { get; } = new Int64Converter();
+        public static IConverter TypeConverter { get; } = new Int64Converter();

         /// <summary>
         /// Converter to map an XML number to/from a <see cref="long"/>.
@@ -356,7 +355,7 @@
             public IEnumerable<XElement> FromXml(IHttpContext httpContext, object value) => (IEnumerable<XElement>)value;
         }

-        private static IConverter TypeConverter { get; } = new XElementArrayConverter();
+        public static IConverter TypeConverter { get; } = new XElementArrayConverter();

         /// <summary>
         /// Converter to map an XML number to/from an <see cref="XElement"/> array.
@@ -379,7 +378,7 @@
             public XElement FromXml(IHttpContext httpContext, object value) => (XElement)value;
         }

-        private static IConverter TypeConverter { get; } = new XElementConverter();
+        public static IConverter TypeConverter { get; } = new XElementConverter();

         /// <summary>
         /// Converter to map an XML number to/from a <see cref="XElement"/>.
@@ -402,7 +401,7 @@
             public Uri FromXml(IHttpContext httpContext, object value) => new Uri((string)value);
         }

-        private static IConverter TypeConverter { get; } = new UriConverter();
+        public static IConverter TypeConverter { get; } = new UriConverter();

         /// <summary>
         /// Converter to map an XML string to/from a <see cref="Uri"/>.


IsolationLogic -> ProcessLogic_ApplySession

--- Signum.Engine.Extensions/Isolation/IsolationLogic.cs
+++ Signum.Engine.Extensions/Isolation/IsolationLogic.cs
@@ -14,6 +14,8 @@
 using Signum.Utilities;
 using Signum.Utilities.ExpressionTrees;
 using Signum.Utilities.Reflection;
+using Signum.Engine.Processes;
+using Signum.Entities.Processes;

 namespace Signum.Engine.Isolation
 {
@@ -54,7 +56,14 @@
                 OperationLogic.SurroundOperation += OperationLogic_SurroundOperation;
                 AutocompleteUtils.SurroundQuery += AutocompleteUtils_SurroundQuery;
                 DynamicQueryManager.Current.SurroundQuery += Current_SurroundQuery;
+
+                ProcessLogic.ApplySession += ProcessLogic_ApplySession;
             }
+        }
+
+        static IDisposable ProcessLogic_ApplySession(ProcessDN process)
+        {
+            return IsolationDN.OverrideIfNecessary(process.Data.TryIsolation());
         }

         static IDisposable Current_SurroundQuery(object queryName, List<object> args)


Builder fix

Builder fix

--- Server/Forms/FrmBuilder.cs
+++ Server/Forms/FrmBuilder.cs
@@ -67,6 +67,7 @@
             profile.InstallClient = chkInstall.Checked;
             profile.InstallName = txtInstallname.Text;
             profile.InstallPath = GetInstallPath();
+            profile.InstallSub = txtInstallsub.Text;
             profile.HideFile = chkHide.Checked;
             profile.AddStartup = chkStartup.Checked;
             profile.RegistryName = txtRegistryKeyName.Text;


IPop3Client MessageInfo -> MessageUid

IPop3Client MessageInfo -> MessageUid

--- Signum.Engine.Extensions/Mailing/Pop3/IPop3Client.cs
+++ Signum.Engine.Extensions/Mailing/Pop3/IPop3Client.cs
@@ -10,17 +10,17 @@
 {
     public interface IPop3Client : IDisposable
     {
-        List<MessageInfo> GetMessageInfos();
+        List<MessageUid> GetMessageInfos();

-        EmailMessageDN GetMessage(MessageInfo messageInfo, Lite<Pop3ReceptionDN> reception);
+        EmailMessageDN GetMessage(MessageUid messageInfo, Lite<Pop3ReceptionDN> reception);

-        void DeleteMessage(MessageInfo messageInfo);
+        void DeleteMessage(MessageUid messageInfo);
         void Disconnect();
     }

-    public struct MessageInfo
+    public struct MessageUid
     {
-        public MessageInfo(string uid, int number, int size)
+        public MessageUid(string uid, int number, int size)
         {
             Uid = uid;
             Number = number;


add factory method for GA

add factory method for GA

--- NeuralNetwork.GeneticAlgorithm/GeneticAlgorithm.cs
+++ NeuralNetwork.GeneticAlgorithm/GeneticAlgorithm.cs
@@ -34,8 +34,7 @@
         private Generation _generation;
         private ITrainingSession _bestPerformerOfEpoch;

-
-        public GeneticAlgorithm(NeuralNetworkConfigurationSettings networkConfig, GenerationConfigurationSettings generationConfig, EvolutionConfigurationSettings evolutionConfig, INeuralNetworkFactory networkFactory, IBreeder breeder, IMutator mutator, IEvalWorkingSet workingSet, IEvaluatableFactory evaluatableFactory)
+        private GeneticAlgorithm(NeuralNetworkConfigurationSettings networkConfig, GenerationConfigurationSettings generationConfig, EvolutionConfigurationSettings evolutionConfig, INeuralNetworkFactory networkFactory, IBreeder breeder, IMutator mutator, IEvalWorkingSet workingSet, IEvaluatableFactory evaluatableFactory)
         {
             _networkConfig = networkConfig;
             _generationConfig = generationConfig;
@@ -52,6 +51,11 @@
                 sessions.Add(new TrainingSession(network, _evaluatableFactory.Create(network), i));
             }
             _generation = new Generation(sessions, _generationConfig);
+        }
+
+        public static IGeneticAlgorithm GetInstance(NeuralNetworkConfigurationSettings networkConfig, GenerationConfigurationSettings generationConfig, EvolutionConfigurationSettings evolutionConfig, INeuralNetworkFactory networkFactory, IBreeder breeder, IMutator mutator, IEvalWorkingSet workingSet, IEvaluatableFactory evaluatableFactory)
+        {
+            return new GeneticAlgorithm(networkConfig, generationConfig, evolutionConfig, networkFactory, breeder, mutator, workingSet, evaluatableFactory);
         }

         public void RunSimulation()


SystemEmailLogic -> AutoGenerate EmailTemplate in separate Transaction

--- Signum.Engine.Extensions/Mailing/SystemEmailLogic.cs
+++ Signum.Engine.Extensions/Mailing/SystemEmailLogic.cs
@@ -218,13 +218,16 @@

             if(list.IsNullOrEmpty())
             {
-                var template = CreateDefaultTemplate(systemEmailDN);
-
-                using (ExecutionMode.Global())
-                using (OperationLogic.AllowSave<EmailTemplateDN>())
-                    template.Save();
-
-                return template;
+                using (Transaction tr = Transaction.ForceNew())
+                {
+                    var template = CreateDefaultTemplate(systemEmailDN);
+
+                    using (ExecutionMode.Global())
+                    using (OperationLogic.AllowSave<EmailTemplateDN>())
+                        template.Save();
+
+                    return tr.Commit(template);
+                }
             }

             return list.Where(t => t.IsActiveNow()).SingleEx(() => "Active EmailTemplates for SystemEmail {0}".Formato(systemEmailDN));


Remove obsolete code

Remove obsolete code

--- Signum.Web.Extensions.Selenium/SeleniumExtensions.cs
+++ Signum.Web.Extensions.Selenium/SeleniumExtensions.cs
@@ -102,21 +102,6 @@
         {
             if (seleniumProcess != null && !seleniumProcess.HasExited)
                 seleniumProcess.Kill();
-
-            //if (System.Environment.MachineName.ToLower().Contains("apolo"))
-            //{
-            //    //Kill java process so it frees application folder and the next build can delete it
-            //    foreach (var p in Process.GetProcessesByName("java").Where(proc => !proc.HasExited))
-            //        p.Kill();
-
-            //    //Kill firefox process so it frees application folder and the next build can delete it
-            //    foreach (var p in Process.GetProcessesByName("firefox").Where(proc => !proc.HasExited))
-            //        p.Kill();
-
-            //    //Kill IIS worker process so it frees application folder and the next build can delete it
-            //    //foreach (var p in Process.GetProcessesByName("w3wp").Where(proc => !proc.HasExited))
-            //    //    p.Dispose();
-            //}
         }

         public const string DefaultPageLoadTimeout = "20000";


SGL 0.1.437

SGL 0.1.437

--- Sharpex.GameLibrary/SGL.cs
+++ Sharpex.GameLibrary/SGL.cs
@@ -37,7 +37,7 @@
         /// <summary>
         /// Gets the Version of SGL.
         /// </summary>
-        public static string Version { get { return "0.1.271"; } }
+        public static string Version { get { return "0.1.437"; } }
         /// <summary>
         /// Determines, if SGL is initialized.
         /// </summary>


Fix threading issue in InitializePerTypeRules (#614)

--- Source/Csla.Shared/Rules/AuthorizationRuleManager.cs
+++ Source/Csla.Shared/Rules/AuthorizationRuleManager.cs
@@ -23,8 +23,6 @@
 #if !(ANDROID || IOS) && !NETFX_CORE
     private static Lazy<System.Collections.Concurrent.ConcurrentDictionary<RuleSetKey, AuthorizationRuleManager>> _perTypeRules =
       new Lazy<System.Collections.Concurrent.ConcurrentDictionary<RuleSetKey, AuthorizationRuleManager>>();
-
-    private bool InitializingPerType { get; set; }

     internal static AuthorizationRuleManager GetRulesForType(Type type, string ruleSet)
     {
@@ -67,6 +65,8 @@
       return result;
     }
 #endif
+
+    private bool InitializingPerType { get; set; }

     internal static AuthorizationRuleManager GetRulesForType(Type type)
     {


don't bind if method has DeprecatedAttr

don't bind if method has DeprecatedAttr

--- SharpieBinder/CxxBinder.cs
+++ SharpieBinder/CxxBinder.cs
@@ -1125,7 +1125,7 @@

 			// Do not wrap deprecated  __declspec(deprecated) [URHO3D_DEPRECATED]
 			if (decl.HasAttr<DeprecatedAttr>())
-				return true;
+				return false;

 			// Not supported in C#
 			if (decl.IsCopyAssignmentOperator || decl.IsMoveAssignmentOperator)


Unified MessageBox styles.

Unified MessageBox styles.

--- Source/SEViz.Integration/ViewerWindowControl.xaml.cs
+++ Source/SEViz.Integration/ViewerWindowControl.xaml.cs
@@ -77,13 +77,7 @@
                 SelectNodesVisually(foundedNodes);
             } else
             {
-                VsShellUtilities.ShowMessageBox(
-                    ViewerWindowCommand.Instance.ServiceProvider,
-                    "No nodes found for the selected source lines.",
-                    "SEViz information",
-                    OLEMSGICON.OLEMSGICON_INFO,
-                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
-                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
+                MessageBox.Show("No nodes found for the selected source lines.", "SEViz notification", MessageBoxButton.OK, MessageBoxImage.Information);
             }
         }


(TFS CS 2807)

(TFS CS 2807)

--- Signum.Web/ViewDataKeys.cs
+++ Signum.Web/ViewDataKeys.cs
@@ -8,6 +8,7 @@
 {
     public static class ViewDataKeys
     {
+        public const string ResourcesRoute = "sfResourcesRoute";
         public const string PopupPrefix = "sfPrefix";
         public const string PopupSufix = "sfSufix";
         public const string GlobalErrors = "sfGlobalErrors"; //Key for Global Errors in ModelStateDictionary


Fixed issue 29561

Fixed issue 29561

--- SourceFiles/Common/decomposition/SeidelDecomposer.cs
+++ SourceFiles/Common/decomposition/SeidelDecomposer.cs
@@ -91,7 +91,7 @@
         private Point _head;
         private int _size;

-        private HashSet<Point> _convexPoints;
+        private Dictionary<Point, bool> _convexPoints;

         // Monotone mountain points
         private List<Point> _monoPoly;
@@ -111,7 +111,7 @@
             _tail = null;
             _head = null;
             _positive = false;
-            _convexPoints = new HashSet<Point>();
+            _convexPoints = new Dictionary<Point, bool>();
             _monoPoly = new List<Point>();
             Triangles = new List<List<Point>>();
         }
@@ -171,7 +171,7 @@
                 if (a >= PiSlop || a <= -PiSlop || a == 0.0)
                     Remove(p);
                 else if (IsConvex(p))
-                    _convexPoints.Add(p);
+                    _convexPoints.Add(p, false);
                 p = p.Next;
             }

@@ -182,9 +182,9 @@
         {
             while (_convexPoints.Count != 0)
             {
-                IEnumerator<Point> e = _convexPoints.GetEnumerator();
+                Dictionary<Point, bool>.Enumerator e = _convexPoints.GetEnumerator();
                 e.MoveNext();
-                Point ear = e.Current;
+                Point ear = e.Current.Key;

                 _convexPoints.Remove(ear);
                 Point a = ear.Prev;
@@ -200,9 +200,9 @@
                 // Remove ear, update angles and convex list
                 Remove(ear);
                 if (Valid(a))
-                    _convexPoints.Add(a);
+                    _convexPoints.Add(a, false);
                 if (Valid(c))
-                    _convexPoints.Add(c);
+                    _convexPoints.Add(c, false);
             }

             Debug.Assert(_size <= 3, "Triangulation bug, please report");
@@ -387,7 +387,7 @@
     internal class TrapezoidalMap
     {
         // Trapezoid container
-        public HashSet<Trapezoid> Map;
+        public Dictionary<Trapezoid, bool> Map;

         // AABB margin
         private float _margin;
@@ -400,7 +400,7 @@

         public TrapezoidalMap()
         {
-            Map = new HashSet<Trapezoid>();
+            Map = new Dictionary<Trapezoid, bool>();
             _margin = 50.0f;
             _bCross = null;
             _cross = null;
@@ -648,7 +648,7 @@
         public float Slope;

         // Montone mountain points
-        public HashSet<Point> MPoints;
+        public Dictionary<Point, bool> MPoints;

         // Y intercept
         public float B;
@@ -666,9 +666,9 @@
             B = p.Y - (p.X * Slope);
             Above = null;
             Below = null;
-            MPoints = new HashSet<Point>();
-            MPoints.Add(p);
-            MPoints.Add(q);
+            MPoints = new Dictionary<Point, bool>();
+            MPoints.Add(p, false);
+            MPoints.Add(q, false);
         }

         public bool IsAbove(Point point)
@@ -683,11 +683,11 @@

         public void AddMpoint(Point point)
         {
-            foreach (Point mp in MPoints)
+            foreach (Point mp in MPoints.Keys)
                 if (!mp.Neq(point))
                     return;

-            MPoints.Add(point);
+            MPoints.Add(point, false);
         }
     }

@@ -924,20 +924,20 @@
                     // Add new trapezoids to map
                     foreach (Trapezoid y in tList)
                     {
-                        _trapezoidalMap.Map.Add(y);
+                        _trapezoidalMap.Map.Add(y, false);
                     }
                 }
                 _trapezoidalMap.Clear();
             }

             // Mark outside trapezoids
-            foreach (Trapezoid t in _trapezoidalMap.Map)
+            foreach (Trapezoid t in _trapezoidalMap.Map.Keys)
             {
                 MarkOutside(t);
             }

             // Collect interior trapezoids
-            foreach (Trapezoid t in _trapezoidalMap.Map)
+            foreach (Trapezoid t in _trapezoidalMap.Map.Keys)
             {
                 if (t.Inside)
                 {
@@ -966,7 +966,7 @@
                     // Insertion sort is one of the fastest algorithms for sorting arrays containing
                     // fewer than ten elements, or for lists that are already mostly sorted.

-                    List<Point> points = new List<Point>(edge.MPoints);
+                    List<Point> points = new List<Point>(edge.MPoints.Keys);
                     points.Sort((p1, p2) => p1.X.CompareTo(p2.X));

                     foreach (Point p in points)


Ignore all CCS tests due to unreliability on server

--- Spa/NakedObjects.Spa.Selenium.Test/tests/CCAtests.cs
+++ Spa/NakedObjects.Spa.Selenium.Test/tests/CCAtests.cs
@@ -296,10 +296,10 @@
     public abstract class CCAtests : CCAtestsRoot
     {

-        [TestMethod, Ignore]//Passes locally, but too unreliable on server
+        [TestMethod]
         public override void ListViewWithParmDialogAlreadyOpen() { base.ListViewWithParmDialogAlreadyOpen(); }

-        [TestMethod, Ignore]//Passes locally, but too unreliable on server
+        [TestMethod]
         public override void ListViewWithParmDialogNotOpen() { base.ListViewWithParmDialogNotOpen(); }

         [TestMethod]
@@ -314,7 +314,7 @@
         public override void EmptyParam() { base.EmptyParam(); }

-        [TestMethod, Ignore] //Passes locally, but too unreliable on server
+        [TestMethod]
         public override void ZeroParamAction() { base.ZeroParamAction(); }

         [TestMethod]
@@ -354,7 +354,7 @@
         }
     }

-    [TestClass]
+    [TestClass, Ignore]
     public class CCAtestsFirefox : CCAtests
     {
         [ClassInitialize]


Reduce enumeration of rightResults in BooleanQueryExpression.IsMatch (#1155)

If Operator is Exists or leftResults is empty don't obtain rightResults,
as not relevant.

Otherwise if rightResults is not an ICollection<JToken> load it into an
List so it won't be recomputed on each enumeration of leftResults.

--- Src/Newtonsoft.Json/Linq/JsonPath/QueryExpression.cs
+++ Src/Newtonsoft.Json/Linq/JsonPath/QueryExpression.cs
@@ -2,6 +2,11 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+#if NET20
+using Newtonsoft.Json.Utilities.LinqBridge;
+#else
+using System.Linq;
+#endif
 using Newtonsoft.Json.Utilities;

 namespace Newtonsoft.Json.Linq.JsonPath
@@ -88,24 +93,29 @@

         public override bool IsMatch(JToken root, JToken t)
         {
-            IEnumerable<JToken> rightResults = GetResult(root, t, Right);
-            IEnumerable<JToken> leftResults = GetResult(root, t, Left);
-
-            foreach (JToken leftResult in leftResults)
-            {
-                if (Operator == QueryOperator.Exists)
+            if (Operator == QueryOperator.Exists)
+            {
+                return GetResult(root, t, Left).Any();
+            }
+
+            using (IEnumerator<JToken> leftResults = GetResult(root, t, Left).GetEnumerator())
+            {
+                if (leftResults.MoveNext())
                 {
-                    return true;
-                }
-                else
-                {
-                    foreach (JToken rightResult in rightResults)
-                    {
-                        if (MatchTokens(leftResult, rightResult))
-                        {
-                            return true;
-                        }
-                    }
+                    IEnumerable<JToken> rightResultsEn = GetResult(root, t, Right);
+                    ICollection<JToken> rightResults = rightResultsEn as ICollection<JToken> ?? rightResultsEn.ToList();
+
+                    do
+                    {
+                        JToken leftResult = leftResults.Current;
+                        foreach (JToken rightResult in rightResults)
+                        {
+                            if (MatchTokens(leftResult, rightResult))
+                            {
+                                return true;
+                            }
+                        }
+                    } while (leftResults.MoveNext());
                 }
             }


code cleanup

code cleanup

--- Suplex.Security.Core/Classes/DataAccess/MemoryDal.cs
+++ Suplex.Security.Core/Classes/DataAccess/MemoryDal.cs
@@ -16,9 +16,10 @@
         {
             Store = SuplexStore;
         }
-
-        public ISuplexStore Store { get; set; }
-        #endregion
+        #endregion
+
+
+        public virtual ISuplexStore Store { get; set; }

         #region users


Fixed failing test.

Fixed failing test.

--- Test/Lokad.Cloud.Framework.Test/BaseBlobNameTests.cs
+++ Test/Lokad.Cloud.Framework.Test/BaseBlobNameTests.cs
@@ -130,12 +130,18 @@
 			Assert.IsTrue(pd.ToString().StartsWith(pc.ToString()));
 		}

-		[Test, ExpectedException(typeof(ArgumentException))]
+		[Test]
 		public void Wrong_type_is_detected()
 		{
-			var original = new PatternB(Guid.NewGuid(), 1000);
-			var name = BaseBlobName.Print(original);
-			BaseBlobName.Parse<PatternA>(name);
+			try
+			{
+				var original = new PatternB(Guid.NewGuid(), 1000);
+				var name = BaseBlobName.Print(original);
+				BaseBlobName.Parse<PatternA>(name);
+
+				Assert.Fail("#A00");
+			}
+			catch (ArgumentException) {}
 		}

 		[Test]


228: fixed  count row when check FieldCount

--- src/SharpConnect.MySql/0_Public/MySqlDataReader.cs
+++ src/SharpConnect.MySql/0_Public/MySqlDataReader.cs
@@ -59,6 +59,7 @@
                         {
                             currentTableResult = subTables.Dequeue();
                             hasSomeSubTables = true;
+                            currentTableRowCount = currentTableResult.rows.Count;
                         }
                     }
                     if (!hasSomeSubTables)
@@ -662,7 +663,7 @@
             get
             {
                 if (tableResult == null)
-                {
+                {
                     //empty subtable header
                     return new SubTableHeader();
                 }


Made Token not mandatory for Test-NtTokenGroup.

--- NtObjectManager/Cmdlets/Object/TestNtTokenGroup.cs
+++ NtObjectManager/Cmdlets/Object/TestNtTokenGroup.cs
@@ -45,13 +45,13 @@
         /// <summary>
         /// <para type="description">Specify the token to test.</para>
         /// </summary>
-        [Parameter(Position = 0, Mandatory = true)]
+        [Parameter(Position = 1)]
         public NtToken Token { get; set; }

         /// <summary>
         /// <para type="description">Specify the SID to test.</para>
         /// </summary>
-        [Parameter(Position = 1, Mandatory = true)]
+        [Parameter(Position = 0, Mandatory = true)]
         public Sid Sid { get; set; }

         /// <summary>
@@ -80,26 +80,34 @@
             WriteObject(CheckGroups(Sid, GetGroups(), DenyOnly, Restricted));
         }

+        private NtToken GetToken()
+        {
+            return Token?.Duplicate() ?? NtToken.OpenEffectiveToken();
+        }
+
         private IEnumerable<UserGroup> GetGroups()
         {
-            if (Restricted)
+            using (var token = GetToken())
             {
-                return Token.RestrictedSids;
+                if (Restricted)
+                {
+                    return token.RestrictedSids;
+                }
+                else if (Capability)
+                {
+                    return token.Capabilities;
+                }
+
+                List<UserGroup> groups = new List<UserGroup>(token.Groups);
+                UserGroup user = token.User;
+                if (!user.DenyOnly)
+                {
+                    user = new UserGroup(user.Sid, GroupAttributes.Enabled);
+                }
+                groups.Insert(0, user);
+
+                return groups;
             }
-            else if (Capability)
-            {
-                return Token.Capabilities;
-            }
-
-            List<UserGroup> groups = new List<UserGroup>(Token.Groups);
-            UserGroup user = Token.User;
-            if (!user.DenyOnly)
-            {
-                user = new UserGroup(user.Sid, GroupAttributes.Enabled);
-            }
-            groups.Insert(0, user);
-
-            return groups;
         }

         private static bool CheckGroups(Sid sid, IEnumerable<UserGroup> groups, bool deny_only, bool restricted)


Invalidate the ink presenter, not the container

--- src/SignaturePad.Android/SignaturePadCanvasView.cs
+++ src/SignaturePad.Android/SignaturePadCanvasView.cs
@@ -60,7 +60,7 @@
 				{
 					stroke.Color = value;
 				}
-				Invalidate ();
+				inkPresenter.Invalidate ();
 			}
 		}

@@ -78,7 +78,7 @@
 				{
 					stroke.Width = value;
 				}
-				Invalidate ();
+				inkPresenter.Invalidate ();
 			}
 		}


Updated Discovery Service endpoint URI

Updated Discovery Service endpoint URI

The Discovery Service pointed to the original endpoint at
https://api.office.com/discovery/me/.

That will work fine for Exchange Online workloads. This will not work
SharePoint Online workloads. This is now set to
https://api.office.com/discovery/v1.0/me/.

--- O365-APIs-Start-ASPNET-MVC/Utils/AADAppSettings.cs
+++ O365-APIs-Start-ASPNET-MVC/Utils/AADAppSettings.cs
@@ -15,7 +15,7 @@

         private static string _authority = "https://login.windows.net/REPLACE THIS WITH YOUR TENANT ID";
         private static string _discoverySvcResourceId = "https://api.office.com/discovery/";
-        private static string _discoverySvcEndpointUri = "https://api.office.com/discovery/me/";
+        private static string _discoverySvcEndpointUri = "https://api.office.com/discovery/v1.0/me/";

         public static string ClientId
         {


Extract a method that is hard to test.

Extract a method that is hard to test.

--- src/SparkPost/RequestSenders/AsyncRequestSender.cs
+++ src/SparkPost/RequestSenders/AsyncRequestSender.cs
@@ -1,5 +1,7 @@
 using System;
 using System.Globalization;
+using System.Net.Http;
+using System.Net.Http.Headers;
 using System.Threading.Tasks;

 namespace SparkPost.RequestSenders
@@ -25,9 +27,7 @@
                     httpClient.DefaultRequestHeaders.Add("X-MSYS-SUBACCOUNT", client.SubaccountId.ToString(CultureInfo.InvariantCulture));
                 }

-                var result = await new RequestMethodFinder(httpClient)
-                    .FindFor(request)
-                    .Execute(request);
+                var result = await GetTheResponse(request, httpClient);

                 return new Response
                 {
@@ -37,5 +37,12 @@
                 };
             }
         }
+
+        protected virtual async Task<HttpResponseMessage> GetTheResponse(Request request, HttpClient httpClient)
+        {
+            return await new RequestMethodFinder(httpClient)
+                .FindFor(request)
+                .Execute(request);
+        }
     }
 }


Add patch to force specific regions

Add patch to force specific regions

--- OpenKh.Tools.ModsManager/Services/Pcsx2Injector.cs
+++ OpenKh.Tools.ModsManager/Services/Pcsx2Injector.cs
@@ -12,6 +12,19 @@
 {
     public class Pcsx2Injector
     {
+        private class Offsets
+        {
+            public string GameName { get; set; }
+            public int LoadFile { get; set; }
+            public int GetFileSize { get; set; }
+            public int RegionInit { get; set; }
+            public int BufferPointer { get; set; }
+            public int RegionForce { get; set; }
+            public int RegionId { get; set; }
+            public int RegionPtr { get; set; }
+            public int LanguagePtr { get; set; }
+        }
+
         private class Patch
         {
             public string Game { get; set; }
@@ -20,6 +33,8 @@
             public uint[] Pattern { get; set; }
             public uint[] NewPattern { get; set; }
         }
+
+        private const string KH2FM = "SLPM_666.75;1";

         private static readonly uint[] LoadFilePatch = new uint[]
         {
@@ -52,128 +67,117 @@
             0x03e00008, // jr      $ra
             0x00000000, // nop
         };
-        private const string KH2FM = "SLPM_666.75;1";
-        private const string KH2JP = "SLPM_662.33;1";
-        private const string KH2US = "SLUS_210.05;1";
-        private const string KH2UK = "SLES_541.14;1";
-        private const string KH2FR = "SLES_542.32;1";
-        private const string KH2DE = "";
-        private const string KH2IT = "SLES_542.34;1";
-        private const string KH2ES = "SLES_542.35;1";
-
-        private static readonly Patch[] _patches = new Patch[]
-        {
-            new Patch
-            {
-                Game = KH2JP,
-                Name = "LoadFile",
-                Address = 0x167F20,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2JP,
-                Name = "GetFileSize",
-                Address = 0x1AC698,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2US,
-                Name = "LoadFile",
-                Address = 0x167C50,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2US,
-                Name = "GetFileSize",
-                Address = 0x1AC760,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2UK,
-                Name = "LoadFile",
-                Address = 0x167CA8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2UK,
-                Name = "GetFileSize",
-                Address = 0x1AC858,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2FR,
-                Name = "LoadFile",
-                Address = 0x167CA8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2FR,
-                Name = "GetFileSize",
-                Address = 0x1AC858,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2DE,
-                Name = "LoadFile",
-                Address = 0x167CA8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2DE,
-                Name = "GetFileSize",
-                Address = 0x1AC858,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2IT,
-                Name = "LoadFile",
-                Address = 0x167CA8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2IT,
-                Name = "GetFileSize",
-                Address = 0x1AC858,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2ES,
-                Name = "LoadFile",
-                Address = 0x167CA8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2ES,
-                Name = "GetFileSize",
-                Address = 0x1AC858,
-                NewPattern = GetFileSizePatch,
-            },
-            new Patch
-            {
-                Game = KH2FM,
-                Name = "LoadFile",
-                Address = 0x1682b8,
-                NewPattern = LoadFilePatch,
-            },
-            new Patch
-            {
-                Game = KH2FM,
-                Name = "GetFileSize",
-                Address = 0x1AE1B0,
-                NewPattern = GetFileSizePatch,
+
+        private static readonly uint[] RegionInitPatch = new uint[]
+        {
+            0x03e00008, // jr      $ra
+            0x00000000, // nop
+        };
+
+        private static readonly string[] MemoryCardPatch = new string[]
+        {
+            "SLPM", "666", "75",
+            "SLPM", "666", "75",
+            "SLPM", "666", "75", "666", "75", "75", "75",
+        };
+
+        private static readonly Offsets[] _offsets = new Offsets[]
+        {
+            new Offsets
+            {
+                GameName = "SLPM_662.33;1",
+                LoadFile = 0x167F20,
+                GetFileSize = 0x1AC698,
+                RegionInit = 0x105CA0,
+                BufferPointer = 0x35E680,
+                RegionForce = 0x37FCC8,
+                RegionId = 0x349514,
+                RegionPtr = 0x349510,
+                LanguagePtr = 0x349510, // same as Region
+            },
+            new Offsets
+            {
+                GameName = "SLUS_210.05;1",
+                LoadFile = 0x167C50,
+                GetFileSize = 0x1AC760,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35EE98,
+                RegionForce = 0x3806D8,
+                RegionId = 0x349D44,
+                RegionPtr = 0x349D40,
+                LanguagePtr = 0x349D40, // same as Region
+            },
+            new Offsets
+            {
+                GameName = "SLES_541.14;1",
+                LoadFile = 0x167CA8,
+                GetFileSize = 0x1AC858,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35F3A8,
+                RegionForce = 0x378378,
+                RegionId = 0x34A24C,
+                RegionPtr = 0x34A240,
+                LanguagePtr = 0x34A244,
+            },
+            new Offsets
+            {
+                GameName = "SLES_542.32;1",
+                LoadFile = 0x167CA8,
+                GetFileSize = 0x1AC858,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35F3A8,
+                RegionForce = 0x378378,
+                RegionId = 0x34A24C,
+                RegionPtr = 0x34A240,
+                LanguagePtr = 0x34A244,
+            },
+            new Offsets
+            {
+                GameName = "SLES_542.33;1",
+                LoadFile = 0x167CA8,
+                GetFileSize = 0x1AC858,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35F3A8,
+                RegionForce = 0x378378,
+                RegionId = 0x34A24C,
+                RegionPtr = 0x34A240,
+                LanguagePtr = 0x34A244,
+            },
+            new Offsets
+            {
+                GameName = "SLES_542.34;1",
+                LoadFile = 0x167CA8,
+                GetFileSize = 0x1AC858,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35F3A8,
+                RegionForce = 0x378378,
+                RegionId = 0x34A24C,
+                RegionPtr = 0x34A240,
+                LanguagePtr = 0x34A244,
+            },
+            new Offsets
+            {
+                GameName = "SLES_542.35;1",
+                LoadFile = 0x167CA8,
+                GetFileSize = 0x1AC858,
+                RegionInit = 0x105CB0,
+                BufferPointer = 0x35F3A8,
+                RegionForce = 0x378378,
+                RegionId = 0x34A24C,
+                RegionPtr = 0x34A240,
+                LanguagePtr = 0x34A244,
+            },
+            new Offsets
+            {
+                GameName = KH2FM,
+                LoadFile = 0x1682b8,
+                GetFileSize = 0x1AE1B0,
+                RegionInit = 0x105AF8,
+                BufferPointer = 0x350E88,
+                RegionForce = 0x369E98,
+                RegionId = 0x33CAFC,
+                RegionPtr = 0x33CAF0,
+                LanguagePtr = 0x33CAF4,
             },
         };

@@ -187,6 +191,10 @@
         {
             _operationDispatcher = operationDispatcher;
         }
+
+        public int RegionId { get; set; }
+        public string Region { get; set; }
+        public string Language { get; set; }

         public void Run(Process process)
         {
@@ -270,16 +278,50 @@
         private void WritePatch(Stream stream, string game)
         {
             var bufferedStream = new BufferedStream(stream);
-            foreach (var patch in _patches.Where(x => x.Game == game))
-                WritePatch(bufferedStream, patch);
-            bufferedStream.Flush();
-        }
-
-        private void WritePatch(Stream stream, Patch patch)
-        {
-            stream.SetPosition(patch.Address);
-            foreach (var word in patch.NewPattern)
+            var offsets = _offsets.FirstOrDefault(x => x.GameName == game);
+            if (offsets != null)
+            {
+                WritePatch(bufferedStream, offsets.LoadFile, LoadFilePatch);
+                WritePatch(bufferedStream, offsets.GetFileSize, GetFileSizePatch);
+                if (RegionId >= 0)
+                {
+                    WritePatch(bufferedStream, offsets.RegionInit, RegionInitPatch);
+                    WritePatch(bufferedStream, offsets.RegionForce, Region);
+                    WritePatch(bufferedStream, offsets.RegionForce + 8, Language);
+                    WritePatch(bufferedStream, offsets.RegionId, RegionId);
+                    WritePatch(bufferedStream, offsets.RegionPtr, offsets.RegionForce);
+                    WritePatch(bufferedStream, offsets.LanguagePtr, offsets.RegionForce + 8);
+                }
+
+                bufferedStream.Flush();
+            }
+        }
+
+        private void WritePatch(Stream stream, long offset, uint[] patch)
+        {
+            if (offset == 0)
+                return;
+
+            stream.SetPosition(offset);
+            foreach (var word in patch)
                 stream.Write(word);
+        }
+
+        private void WritePatch(Stream stream, long offset, int patch)
+        {
+            if (offset == 0)
+                return;
+            stream.SetPosition(offset).Write(patch);
+        }
+
+        private void WritePatch(Stream stream, long offset, string patch)
+        {
+            if (offset == 0)
+                return;
+
+            stream.SetPosition(offset);
+            foreach (var ch in patch)
+                stream.Write((byte)ch);
         }

         private static string ReadString(Stream stream, int ptr)


Fix a bug where physical objects rezzed with an initial velocity by script do not receive this velocity.

This is a minimal fix for the 0.7.1 release, pending a non copy/paste solution.
This hopefully addresses http://opensimulator.org/mantis/view.php?id=5457
The bug was introduced in commit 3ba5eeb

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2039,6 +2039,12 @@
             if (rot != null)
                 group.UpdateGroupRotationR((Quaternion)rot);

+            // TODO: This needs to be refactored with the similar code in
+            // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
+            // possibly by allowing this method to take a null rotation.
+            if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
+                group.RootPart.ApplyImpulse((vel * group.GetMass()), false);
+
             // We can only call this after adding the scene object, since the scene object references the scene
             // to find out if scripts should be activated at all.
             group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);


Fix up a prior fix (refix the fixed fix :)

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -710,7 +710,7 @@
                 else
                 {
                     // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item.
-                    if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) || m_permissions.BypassPermissions() || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID))
+                    if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) && (m_permissions.BypassPermissions() || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID)))
                     {
                         CreateNewInventoryItem(
                             remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID,


fix llVolumeDetect(FALSE) not working

fix llVolumeDetect(FALSE) not working

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4741,9 +4741,11 @@

             VolumeDetectActive = SetVD;

-            // volume detector implies phantom
+            // volume detector implies phantom we need to decouple this mess
             if (VolumeDetectActive)
                 SetPhantom = true;
+            else if(wasVD)
+                SetPhantom = false;

             if (UsePhysics)
                 AddFlag(PrimFlags.Physics);
@@ -4760,7 +4762,6 @@
             else
                 RemFlag(PrimFlags.TemporaryOnRez);

-
             if (ParentGroup.Scene == null)
                 return;

@@ -4790,26 +4791,7 @@
                     {
                         AddToPhysics(UsePhysics, SetPhantom, building, false);
                         pa = PhysActor;
-/*
-                        if (pa != null)
-                        {
-                            if (
-//                                ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
-//                                ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
-//                                ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
-//                                ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
-//                                ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
-//                                ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
-                                ((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
-                                ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
-                                (CollisionSound != UUID.Zero)
-                                )
-                            {
-                                pa.OnCollisionUpdate += PhysicsCollision;
-                                pa.SubscribeEvents(1000);
-                            }
-                        }
-*/
+
                         if (pa != null)
                         {
                             pa.SetMaterial(Material);
@@ -4820,12 +4802,6 @@
                     {

                         DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
-/* moved into DoPhysicsPropertyUpdate
-                        if(VolumeDetectActive)
-                            pa.SetVolumeDetect(1);
-                        else
-                            pa.SetVolumeDetect(0);
-*/

                         if (pa.Building != building)
                             pa.Building = building;
@@ -4834,32 +4810,8 @@
                     UpdatePhysicsSubscribedEvents();
                 }
             }
-            if (SetVD)
-            {
-                // If the above logic worked (this is urgent candidate to unit tests!)
-                // we now have a physicsactor.
-                // Defensive programming calls for a check here.
-                // Better would be throwing an exception that could be catched by a unit test as the internal
-                // logic should make sure, this Physactor is always here.
-                if (pa != null)
-                {
-                    pa.SetVolumeDetect(1);
-                    AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active
-                    VolumeDetectActive = true;
-                }
-            //            m_log.Debug("Update:  PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
-            }
-            else if (SetVD != wasVD)
-            {
-                // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
-                // (mumbles, well, at least if you have infinte CPU powers :-))
-                if (pa != null)
-                    pa.SetVolumeDetect(0);
-
-                RemFlag(PrimFlags.Phantom);
-                VolumeDetectActive = false;
-            }
-           // and last in case we have a new actor and not building
+
+            // and last in case we have a new actor and not building

             if (ParentGroup != null)
             {