add it to the list if it currently wont fit

--- RelhaxModpack/RelhaxModpack/Utilities/CommonUtils.cs
+++ RelhaxModpack/RelhaxModpack/Utilities/CommonUtils.cs
@@ -1023,7 +1023,11 @@
             try
             {
                 var converter = TypeDescriptor.GetConverter(typeToSet);
-                list[index] = converter.ConvertFrom(valueToSet);
+                object convertedObject = converter.ConvertFrom(valueToSet);
+                if (index < list.Count)
+                    list[index] = convertedObject;
+                else
+                    list.Add(convertedObject);
                 return true;
             }
             catch (Exception ex)


fixing incompatability with appharboror or any other environment with a load balancer that forwards requests to a different port

--- RequestReduce/Utilities/RelativeToAbsoluteUtility.cs
+++ RequestReduce/Utilities/RelativeToAbsoluteUtility.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Web;

 namespace RequestReduce.Utilities
 {
@@ -6,6 +7,12 @@
     {
         public static string ToAbsolute(Uri baseUrl, string relativeUrl)
         {
+            var context = HttpContext.Current;
+            if (context != null)
+            {
+                if (context.Request.Headers["X-Forwarded-For"] != null && !baseUrl.IsDefaultPort)
+                    baseUrl = new System.UriBuilder(baseUrl.Scheme, baseUrl.Host) { Path = baseUrl.PathAndQuery }.Uri;
+            }
             return IsAbsolute(relativeUrl) ? relativeUrl : new Uri(baseUrl, relativeUrl).AbsoluteUri;
         }


投稿者コメントでコメント本文が無いものがあるとクラッシュする不具合を修正 fix #112

--- SRNicoNico/Models/NicoNicoWrapper/NicoNicoComment.cs
+++ SRNicoNico/Models/NicoNicoWrapper/NicoNicoComment.cs
@@ -307,7 +307,7 @@
                                             Number = (int)chat.no,
                                             Vpos = (int)chat.vpos,
                                             PostedAt = (long)chat.date,
-                                            Content = chat.content,
+                                            Content = chat.content() ? chat.content: "",
                                             Mail = chat.mail() ? chat.mail : ""
                                         };
                                         item.Mail = new string(item.Mail.Select(n => (ConvMap.ContainsKey(n) ? ConvMap[n] : n)).ToArray());


RecentsDictionary.Clean

RecentsDictionary.Clean

--- Signum.Utilities/DataStructures/RecentsDictionary.cs
+++ Signum.Utilities/DataStructures/RecentsDictionary.cs
@@ -211,6 +211,13 @@
         {
             return this.GetEnumerator();
         }
+
+        public void Clean()
+        {
+            this.orderList.Clear();
+            this.linkToKey.Clear();
+            this.keyToLink.Clear();
+        }
     }

     //public class Program


SearchControl_GetContextMenuItems fix

SearchControl_GetContextMenuItems fix

--- Signum.Windows.Extensions/Processes/ProcessClient.cs
+++ Signum.Windows.Extensions/Processes/ProcessClient.cs
@@ -83,7 +83,7 @@
                               CanExecute = OperationDN.NotDefinedFor(g.Key, types.Except(g.Select(a => a.t))),
                           }
                           where os == null ? oi.Lite == true && oi.OperationType != OperationType.ConstructorFrom :
-                              os.ContextualFromMany.IsVisible == null ? (oi.Lite == true && os.IsVisible == null && oi.OperationType != OperationType.ConstructorFrom && (os.Click == null || os.ContextualFromMany != null)) :
+                              os.ContextualFromMany.IsVisible == null ? (oi.Lite == true && os.IsVisible == null && oi.OperationType != OperationType.ConstructorFrom && (os.Click == null || os.ContextualFromMany.Click != null)) :
                               os.ContextualFromMany.IsVisible(coc)
                           select coc).ToList();


Refs #1436 - bewaren van bivakaangifte synct naar Kipadmin

--- Solution/Chiro.Gap.Services/UitstappenService.svc.cs
+++ Solution/Chiro.Gap.Services/UitstappenService.svc.cs
@@ -28,6 +28,7 @@
 using Chiro.Gap.ServiceContracts;
 using Chiro.Gap.ServiceContracts.DataContracts;
 using Chiro.Gap.Services.Properties;
+using Chiro.Gap.SyncInterfaces;
 using Chiro.Gap.WorkerInterfaces;

 namespace Chiro.Gap.Services
@@ -54,7 +55,13 @@
         private readonly IUitstappenManager _uitstappenMgr;
         private readonly IAdressenManager _adressenMgr;

-                private readonly GavChecker _gav;
+        // Sync
+
+        private readonly IBivakSync _bivakSync;
+
+        // rariteit
+
+        private readonly GavChecker _gav;

         /// <summary>
         /// Constructor, verantwoordelijk voor dependency injection
@@ -63,10 +70,12 @@
         /// <param name="autorisatieManager">Businesslogica m.b.t. autorisatie</param>
         /// <param name="uitstappenManager">Businesslogica m.b.t. uitstappen</param>
         /// <param name="adressenManager">Businesslogica m.b.t. adressen</param>
+        /// <param name="bivakSync"></param>
         public UitstappenService(IRepositoryProvider repositoryProvider,
                                  IAutorisatieManager autorisatieManager,
                                  IUitstappenManager uitstappenManager,
-                                 IAdressenManager adressenManager)
+                                 IAdressenManager adressenManager,
+                                 IBivakSync bivakSync)
         {
             _groepsWerkJaarRepo = repositoryProvider.RepositoryGet<GroepsWerkJaar>();
             _groepenRepo = repositoryProvider.RepositoryGet<Groep>();
@@ -82,6 +91,8 @@
             _uitstappenMgr = uitstappenManager;
             _adressenMgr = adressenManager;

+            _bivakSync = bivakSync;
+
             _gav = new GavChecker(_autorisatieMgr);
         }

@@ -276,6 +287,7 @@
             // Anders maken we een nieuwe.

             Uitstap uitstap;
+            bool wasBivak = false;

             var groepsWerkJaar = _groepsWerkJaarRepo.Select()
                                                     .Where(gwj => gwj.Groep.ID == groepId)
@@ -299,12 +311,30 @@
                 uitstap = (from u in groepsWerkJaar.Uitstap
                            where u.ID == info.ID
                            select u).First();
+                wasBivak = uitstap.IsBivak;

                 // overschrijf met gegevens uit 'info'
                 Mapper.Map(info, uitstap);
             }

-            _groepsWerkJaarRepo.SaveChanges();
+#if KIPDORP
+            using (var tx = new TransactionScope())
+            {
+#endif
+                if (uitstap.IsBivak)
+                {
+                    _bivakSync.Bewaren(uitstap);
+                }
+                else if (wasBivak)
+                {
+                    _bivakSync.Verwijderen(uitstap.ID);
+                }
+
+                _groepsWerkJaarRepo.SaveChanges();
+#if KIPDORP
+                tx.Complete();
+            }
+#endif
             return uitstap.ID;
         }


Workaround for buggy SkiaSharp native lib loading

--- Source/AlphaTab.CSharp/Platform/CSharp/SkiaCanvas.cs
+++ Source/AlphaTab.CSharp/Platform/CSharp/SkiaCanvas.cs
@@ -15,10 +15,15 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.
  */
+
+using System;
+using System.IO;
 using System.Reflection;
+using System.Runtime.InteropServices;
 using AlphaTab.Platform.Model;
 using AlphaTab.Rendering;
 using AlphaTab.Rendering.Glyphs;
+using AlphaTab.Util;
 using SkiaSharp;

 namespace AlphaTab.Platform.CSharp
@@ -28,8 +33,44 @@
         private static readonly SKTypeface MusicFont;
         private static readonly int MusicFontSize = 34;

+        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+        private static extern IntPtr LoadLibrary(string libname);
+
         static SkiaCanvas()
         {
+            // https://github.com/mono/SkiaSharp/issues/713
+            // https://github.com/mono/SkiaSharp/issues/572
+            // manually load skia lib
+            switch (System.Environment.OSVersion.Platform)
+            {
+                case PlatformID.MacOSX:
+                case PlatformID.Unix:
+                    // I think unix platforms should be fine, to be tested
+                    break;
+                default:
+                    string libSkiaSharpPath = Path.GetDirectoryName(typeof(SkiaCanvas).Assembly.Location);
+                    if (IntPtr.Size == 4)
+                    {
+                        libSkiaSharpPath = Path.Combine(libSkiaSharpPath, "x86", "libSkiaSharp.dll");
+                    }
+                    else
+                    {
+                        libSkiaSharpPath = Path.Combine(libSkiaSharpPath, "x64", "libSkiaSharp.dll");
+                    }
+                    Logger.Debug("Skia", "Loading native lib from '" + libSkiaSharpPath + "'");
+                    var lib = LoadLibrary(libSkiaSharpPath);
+                    if (lib == IntPtr.Zero)
+                    {
+                        Logger.Warning("Skia", "Loading native lib from '" + libSkiaSharpPath + "' failed");
+                    }
+                    else
+                    {
+                        Logger.Debug("Skia", "Loading native lib from '" + libSkiaSharpPath + "' successful");
+                    }
+                    break;
+            }
+
+            // attempt to load correct skia native lib
             var type = typeof(SkiaCanvas).GetTypeInfo();
             var bravura = type.Assembly.GetManifestResourceStream(type.Namespace + ".Bravura.ttf");
             {


Added support for pre-declaring a type of data to be handled by builders.

--- Source/Core/Core/ExecutionHandling/ContextBuilder.cs
+++ Source/Core/Core/ExecutionHandling/ContextBuilder.cs
@@ -4,81 +4,93 @@

 namespace LeanTest.Core.ExecutionHandling
 {
-    /// <summary>
-    /// Encapsulates the IoC container and builds the data and execution context for a test, including 'state' and 'mocks'.
-    /// </summary>
-    public class ContextBuilder
-    {
-        private readonly IIocContainer _container;
-        private readonly IBuilder[] _builders;
-        internal IDataStore DataStore { get; }
+	/// <summary>
+	/// Encapsulates the IoC container and builds the data and execution context for a test, including 'state' and 'mocks'.
+	/// </summary>
+	public class ContextBuilder
+	{
+		private readonly IIocContainer _container;
+		private readonly IBuilder[] _builders;
+		internal IDataStore DataStore { get; }

-        /// <summary>
-        /// Initialize internal fields, including data store and builders (for e.g. 'mocks' and 'state') .
-        /// </summary>
-        /// <param name="container"></param>
-        /// <param name="builderFactories"></param>
-        internal ContextBuilder(IIocContainer container, params Func<IIocContainer, IDataStore, IBuilder>[] builderFactories)
-        {
-            _container = container ?? throw new ArgumentNullException(nameof(container));
+		/// <summary>
+		/// Initialize internal fields, including data store and builders (for e.g. 'mocks' and 'state') .
+		/// </summary>
+		/// <param name="container"></param>
+		/// <param name="builderFactories"></param>
+		internal ContextBuilder(IIocContainer container, params Func<IIocContainer, IDataStore, IBuilder>[] builderFactories)
+		{
+			_container = container ?? throw new ArgumentNullException(nameof(container));

-            DataStore = new DataStore();
-            _builders = builderFactories?.Select(builderFactory => builderFactory(_container, DataStore)).ToArray() ?? throw new ArgumentNullException(nameof(builderFactories));
-        }
+			DataStore = new DataStore();
+			_builders = builderFactories?.Select(builderFactory => builderFactory(_container, DataStore)).ToArray() ?? throw new ArgumentNullException(nameof(builderFactories));
+		}

-        /// <summary>
-        /// Get an instance of type <c>T</c> from the IoC container.
-        /// </summary>
-        public T GetInstance<T>() where T : class
-        {
-            return _container.TryResolve<T>();
-        }
+		/// <summary>
+		/// Get an instance of type <c>T</c> from the IoC container.
+		/// </summary>
+		public T GetInstance<T>() where T : class
+		{
+			return _container.TryResolve<T>();
+		}

-        /// <summary>
-        /// Declare data of type <c>T</c> to be stored, then used to fill in builders (e.g. 'mocks' and 'state') during <c>Build</c>.
-        /// </summary>
-        public ContextBuilder WithData<T>(T data)
-        {
-            DataStore.WithData(data);
-            foreach (IBuilder builder in _builders)
-                builder.WithBuilderForData<T>();
+		/// <summary>
+		/// Declare data of type <c>T</c> to be stored, then used to fill in builders (e.g. 'mocks' and 'state') during <c>Build</c>.
+		/// </summary>
+		public ContextBuilder WithData<T>(T data)
+		{
+			DataStore.WithData(data);
+			foreach (IBuilder builder in _builders)
+				builder.WithBuilderForData<T>();

-            return this;
-        }
+			return this;
+		}

-        /// <summary>
-        /// Declare an enumeration of data of type <c>T</c> to be stored, then used to fill builders (e.g. 'mocks' and 'state') during <c>Build</c>.
-        /// </summary>
-        public ContextBuilder WithEnumerableData<T>(IEnumerable<T> ts)
-        {
-            DataStore.WithEnumerable(ts);
-            foreach (IBuilder builder in _builders)
-                builder.WithBuilderForData<T>();
+		/// <summary>
+		/// Pre-declare the intent to handle data of type <c>T</c>. The effect will be to have <c>PreBuild</c>, <c>Build</c> and <c>PostBuild</c> run for builders that
+		/// support data of type <c>T</c>, even for tests which do not declare data of type <c>T</c>.
+		/// </summary>
+		public ContextBuilder WithData<T>()
+		{
+			foreach (IBuilder builder in _builders)
+				builder.WithBuilderForData<T>();

-            return this;
-        }
+			return this;
+		}

-        /// <summary>
-        /// Clear all declared data from the data store.
-        /// </summary>
-        /// <returns></returns>
-        public ContextBuilder WithClearDataStore()
-        {
-            DataStore.TypedData.Clear();
+		/// <summary>
+		/// Declare an enumeration of data of type <c>T</c> to be stored, then used to fill builders (e.g. 'mocks' and 'state') during <c>Build</c>.
+		/// </summary>
+		public ContextBuilder WithEnumerableData<T>(IEnumerable<T> ts)
+		{
+			DataStore.WithEnumerable(ts);
+			foreach (IBuilder builder in _builders)
+				builder.WithBuilderForData<T>();

-            return this;
-        }
+			return this;
+		}

-        /// <summary>
-        /// Use the declared data to build builders (e.g. 'mocks' and 'state').
-        /// </summary>
-        /// <returns></returns>
-        public ContextBuilder Build()
-        {
-            foreach (IBuilder builder in _builders)
-                builder.Build();
+		/// <summary>
+		/// Clear all declared data from the data store.
+		/// </summary>
+		/// <returns></returns>
+		public ContextBuilder WithClearDataStore()
+		{
+			DataStore.TypedData.Clear();

-            return this;
-        }
-    }
+			return this;
+		}
+
+		/// <summary>
+		/// Use the declared data to build builders (e.g. 'mocks' and 'state').
+		/// </summary>
+		/// <returns></returns>
+		public ContextBuilder Build()
+		{
+			foreach (IBuilder builder in _builders)
+				builder.Build();
+
+			return this;
+		}
+	}
 }


Tweak unit test tree to collapse single nodes

--- Source/Eto.Test/Eto.Test/Sections/UnitTestSection.cs
+++ Source/Eto.Test/Eto.Test/Sections/UnitTestSection.cs
@@ -366,13 +366,7 @@
 		void PopulateTree(string filter = null)
 		{
 			var testSuites = GetTestSuites().Select(suite => ToTree(suite.Assembly, suite, filter)).Where(r => r != null).ToList();
-			TreeItem treeData;
-			if (testSuites.Count > 1)
-			{
-				treeData = new TreeItem();
-				treeData.Children.AddRange(testSuites);
-			}
-			else treeData = testSuites.FirstOrDefault();
+			var treeData = new TreeItem(testSuites);
 			Application.Instance.AsyncInvoke(() => tree.DataStore = treeData);
 		}

@@ -392,6 +386,19 @@
 					if (treeItem != null)
 						item.Children.Add(treeItem);
 				}
+				while (item.Children.Count == 1)
+				{
+					// collapse test nodes
+					var child = item.Children[0] as TreeItem;
+					if (child.Children.Count == 0)
+						break;
+					if (!child.Text.StartsWith(item.Text, StringComparison.Ordinal))
+						item.Text += "." + child.Text;
+					else
+						item.Text = child.Text;
+					item.Children.Clear();
+					item.Children.AddRange(child.Children);
+				}
 				if (item.Children.Count == 0)
 					return null;
 			}


Add implementation for users module custom list comments request.

--- Source/Lib/TraktApiSharp/Modules/TraktUsersModule.cs
+++ Source/Lib/TraktApiSharp/Modules/TraktUsersModule.cs
@@ -14,6 +14,7 @@
     using Objects.Post.Users.Responses;
     using Requests;
     using Requests.WithOAuth.Users;
+    using Requests.WithoutOAuth.Users;
     using System;
     using System.Linq;
     using System.Threading.Tasks;
@@ -258,6 +259,19 @@
             });
         }

+        public async Task<TraktPaginationListResult<TraktComment>> GetListCommentsAsync(string username, string listId,
+                                                                                TraktCommentSortOrder? sorting = null,
+                                                                                int? page = null, int? limit = null)
+        {
+            return await QueryAsync(new TraktUserListCommentsRequest(Client)
+            {
+                Username = username,
+                Id = listId,
+                Sorting = sorting,
+                PaginationOptions = new TraktPaginationOptions(page, limit)
+            });
+        }
+
         public async Task LikeListAsync(string username, string listId)
         {
             await QueryAsync(new TraktUserListLikeRequest(Client)