Dispose AmqpConnection

Dispose AmqpConnection

--- csharp/device/Microsoft.Azure.Devices.Client/Transport/AmqpTransportHandler.cs
+++ csharp/device/Microsoft.Azure.Devices.Client/Transport/AmqpTransportHandler.cs
@@ -29,7 +29,7 @@
         int closed;

         public AmqpTransportHandler(IotHubConnectionString connectionString, AmqpTransportSettings transportSettings)
-            :base(transportSettings)
+            : base(transportSettings)
         {
             TransportType transportType = transportSettings.GetTransportType();
             this.deviceId = connectionString.DeviceId;
@@ -44,7 +44,7 @@
                 default:
                     throw new InvalidOperationException("Invalid Transport Type {0}".FormatInvariant(transportType));
             }
-
+
             this.openTimeout = transportSettings.OpenTimeout;
             this.operationTimeout = transportSettings.OperationTimeout;
             this.prefetchCount = transportSettings.PrefetchCount;
@@ -119,6 +119,114 @@

         public override Task CloseAsync()
         {
+            this.Close();
+            return TaskHelpers.CompletedTask;
+        }
+
+        public override async Task SendEventAsync(Message message)
+        {
+            Outcome outcome;
+            using (AmqpMessage amqpMessage = message.ToAmqpMessage())
+            {
+                outcome = await this.SendAmqpMessageAsync(amqpMessage);
+            }
+
+            if (outcome.DescriptorCode != Accepted.Code)
+            {
+                throw AmqpErrorMapper.GetExceptionFromOutcome(outcome);
+            }
+        }
+
+        public override async Task SendEventAsync(IEnumerable<Message> messages)
+        {
+            // List to hold messages in Amqp friendly format
+            var messageList = new List<Data>();
+
+            foreach (Message message in messages)
+            {
+                using (AmqpMessage amqpMessage = message.ToAmqpMessage())
+                {
+                    var data = new Data() { Value = MessageConverter.ReadStream(amqpMessage.ToStream()) };
+                    messageList.Add(data);
+                }
+            }
+
+            Outcome outcome;
+            using (AmqpMessage amqpMessage = AmqpMessage.Create(messageList))
+            {
+                amqpMessage.MessageFormat = AmqpConstants.AmqpBatchedMessageFormat;
+                outcome = await this.SendAmqpMessageAsync(amqpMessage);
+            }
+
+            if (outcome.DescriptorCode != Accepted.Code)
+            {
+                throw AmqpErrorMapper.GetExceptionFromOutcome(outcome);
+            }
+        }
+
+        public override async Task<Message> ReceiveAsync(TimeSpan timeout)
+        {
+            AmqpMessage amqpMessage;
+            try
+            {
+                ReceivingAmqpLink deviceBoundReceivingLink = await this.GetDeviceBoundReceivingLinkAsync();
+                amqpMessage = await deviceBoundReceivingLink.ReceiveMessageAsync(timeout);
+            }
+            catch (Exception exception)
+            {
+                if (exception.IsFatal())
+                {
+                    throw;
+                }
+
+                throw AmqpClientHelper.ToIotHubClientContract(exception);
+            }
+
+            Message message;
+            if (amqpMessage != null)
+            {
+                message = new Message(amqpMessage)
+                {
+                    LockToken = new Guid(amqpMessage.DeliveryTag.Array).ToString()
+                };
+            }
+            else
+            {
+                message = null;
+            }
+
+            return message;
+        }
+
+        public override Task CompleteAsync(string lockToken)
+        {
+            return this.DisposeMessageAsync(lockToken, AmqpConstants.AcceptedOutcome);
+        }
+
+        public override Task AbandonAsync(string lockToken)
+        {
+            return this.DisposeMessageAsync(lockToken, AmqpConstants.ReleasedOutcome);
+        }
+
+        public override Task RejectAsync(string lockToken)
+        {
+            return this.DisposeMessageAsync(lockToken, AmqpConstants.RejectedOutcome);
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            try
+            {
+                this.Close();
+            }
+            finally
+            {
+                base.Dispose(disposing);
+            }
+        }
+
+        void Close()
+        {
             if (Interlocked.CompareExchange(ref this.closed, 1, 0) == 0)
             {
                 GC.SuppressFinalize(this);
@@ -126,117 +234,10 @@
                 this.faultTolerantDeviceBoundReceivingLink.CloseAsync().Fork();
                 this.IotHubConnection.Release(this.deviceId);
             }
-            return TaskHelpers.CompletedTask;
-        }
-
-        public override async Task SendEventAsync(Message message)
-        {
-            Outcome outcome;
-            using (AmqpMessage amqpMessage = message.ToAmqpMessage())
-            {
-                outcome = await this.SendAmqpMessageAsync(amqpMessage);
-            }
-
-            if (outcome.DescriptorCode != Accepted.Code)
-            {
-                throw AmqpErrorMapper.GetExceptionFromOutcome(outcome);
-            }
-        }
-
-        public override async Task SendEventAsync(IEnumerable<Message> messages)
-        {
-            // List to hold messages in Amqp friendly format
-            var messageList = new List<Data>();
-
-            foreach (Message message in messages)
-            {
-                using (AmqpMessage amqpMessage = message.ToAmqpMessage())
-                {
-                    var data = new Data() { Value = MessageConverter.ReadStream(amqpMessage.ToStream()) };
-                    messageList.Add(data);
-                }
-            }
-
-            Outcome outcome;
-            using (AmqpMessage amqpMessage = AmqpMessage.Create(messageList))
-            {
-                amqpMessage.MessageFormat = AmqpConstants.AmqpBatchedMessageFormat;
-                outcome = await this.SendAmqpMessageAsync(amqpMessage);
-            }
-
-            if (outcome.DescriptorCode != Accepted.Code)
-            {
-                throw AmqpErrorMapper.GetExceptionFromOutcome(outcome);
-            }
-        }
-
-        protected override void Dispose(bool disposing)
-        {
-            try
-            {
-                if (disposing)
-                {
-                    this.faultTolerantDeviceBoundReceivingLink?.Dispose();
-                    this.faultTolerantEventSendingLink?.Dispose();
-                }
-            }
-            finally
-            {
-                base.Dispose(disposing);
-            }
-        }
-
-        public override async Task<Message> ReceiveAsync(TimeSpan timeout)
-        {
-            AmqpMessage amqpMessage;
-            try
-            {
-                ReceivingAmqpLink deviceBoundReceivingLink = await this.GetDeviceBoundReceivingLinkAsync();
-                amqpMessage = await deviceBoundReceivingLink.ReceiveMessageAsync(timeout);
-            }
-            catch (Exception exception)
-            {
-                if (exception.IsFatal())
-                {
-                    throw;
-                }
-
-                throw AmqpClientHelper.ToIotHubClientContract(exception);
-            }
-
-            Message message;
-            if (amqpMessage != null)
-            {
-                message = new Message(amqpMessage)
-                {
-                    LockToken = new Guid(amqpMessage.DeliveryTag.Array).ToString()
-                };
-            }
-            else
-            {
-                message = null;
-            }
-
-            return message;
-        }
-
-        public override Task CompleteAsync(string lockToken)
-        {
-            return this.DisposeMessageAsync(lockToken, AmqpConstants.AcceptedOutcome);
-        }
-
-        public override Task AbandonAsync(string lockToken)
-        {
-            return this.DisposeMessageAsync(lockToken, AmqpConstants.ReleasedOutcome);
-        }
-
-        public override Task RejectAsync(string lockToken)
-        {
-            return this.DisposeMessageAsync(lockToken, AmqpConstants.RejectedOutcome);
-        }
-
-       async Task<Outcome> SendAmqpMessageAsync(AmqpMessage amqpMessage)
-       {
+        }
+
+        async Task<Outcome> SendAmqpMessageAsync(AmqpMessage amqpMessage)
+        {
             Outcome outcome;
             try
             {
@@ -254,7 +255,7 @@
             }

             return outcome;
-       }
+        }

         async Task DisposeMessageAsync(string lockToken, Outcome outcome)
         {


Went to 1.3

Went to 1.3

--- CloudWatchAppender/Properties/AssemblyInfo.cs
+++ CloudWatchAppender/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]


Add two more tests.

Add two more tests.

--- WalletWasabi.Tests/UnitTests/Crypto/GroupElementTests.cs
+++ WalletWasabi.Tests/UnitTests/Crypto/GroupElementTests.cs
@@ -411,11 +411,13 @@
 			scalar = EC.N;
 			expected = new GroupElement(EC.G * scalar);
 			Assert.Equal(expected, g * scalar);
+			Assert.Equal(g * Scalar.Zero, g * scalar);

 			// Scalar overflown N+1.
 			scalar = EC.N + Scalar.One;
 			expected = new GroupElement(EC.G * scalar);
 			Assert.Equal(expected, g * scalar);
+			Assert.Equal(g * Scalar.One, g * scalar);

 			// Scalar overflown uint.Max
 			scalar = new Scalar(uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue);


Make sure exception is thrown.

Make sure exception is thrown.

--- WalletWasabi.Tests/UnitTests/Hwi/DefaultResponseTests.cs
+++ WalletWasabi.Tests/UnitTests/Hwi/DefaultResponseTests.cs
@@ -1,6 +1,7 @@
 using NBitcoin;
 using System;
 using System.Collections.Generic;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -146,8 +147,15 @@

 			using (var cts = new CancellationTokenSource(ReasonableRequestTimeout))
 			{
-				var res = await pb.SendCommandAsync("enumerate", true, cts.Token);
-				Assert.NotEmpty(res.response);
+				if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+				{
+					var res = await pb.SendCommandAsync("enumerate", true, cts.Token);
+					Assert.NotEmpty(res.response);
+				}
+				else
+				{
+					await Assert.ThrowsAsync<PlatformNotSupportedException>(async () => await pb.SendCommandAsync("enumerate", true, cts.Token));
+				}
 			}
 		}


updates to DesktopWindowEnumerator

updates to DesktopWindowEnumerator

--- WinVisible/WinVisible/Classes/DesktopWindowEnumerator.cs
+++ WinVisible/WinVisible/Classes/DesktopWindowEnumerator.cs
@@ -29,6 +29,9 @@

         [DllImport("user32.dll")]
         private static extern bool IsWindowVisible(IntPtr hWnd);
+
+        [DllImport("coredll")]
+        public static extern uint GetWindowThreadProcessId(IntPtr hwnd, out uint lpdwProcessId);
         #endregion

         #region Properties


Added missing using on IEnumerator<T>

Added missing using on IEnumerator<T>

--- WmcSoft.Core/Collections/Generic/CollectionExtensions.cs
+++ WmcSoft.Core/Collections/Generic/CollectionExtensions.cs
@@ -205,14 +205,15 @@

             TextInfo textInfo = GetTextInfo(formatProvider);
             var separator = textInfo.ListSeparator;
-            var it = enumerable.GetEnumerator();
-            if (it.MoveNext()) {
-                var sb = new StringBuilder(it.Current.ToString(format, formatProvider));
-                while (it.MoveNext()) {
-                    sb.Append(separator);
-                    sb.Append(it.Current.ToString(format, formatProvider));
-                }
-                return sb.ToString();
+            using (var it = enumerable.GetEnumerator()) {
+                if (it.MoveNext()) {
+                    var sb = new StringBuilder(it.Current.ToString(format, formatProvider));
+                    while (it.MoveNext()) {
+                        sb.Append(separator);
+                        sb.Append(it.Current.ToString(format, formatProvider));
+                    }
+                    return sb.ToString();
+                }
             }
             return "";
         }
@@ -243,9 +244,10 @@

             var output = new TOutput[collection.Count];
             var i = 0;
-            var enumerator = collection.GetEnumerator();
-            while (enumerator.MoveNext()) {
-                output[i++] = convert(enumerator.Current);
+            using (var enumerator = collection.GetEnumerator()) {
+                while (enumerator.MoveNext()) {
+                    output[i++] = convert(enumerator.Current);
+                }
             }
             return output;
         }
@@ -593,7 +595,7 @@
         /// <returns>The sorted enumerable</returns>
         /// <remarks>If the two enumerables are not sorted using the comparer, the result is undefined.</remarks>
         public static IEnumerable<T> Merge<T>(this IEnumerable<T> self, IEnumerable<T> other, IComparer<T> comparer) {
-            using(var enumerator1 = self.GetEnumerator())
+            using (var enumerator1 = self.GetEnumerator())
             using (var enumerator2 = other.GetEnumerator()) {
                 var hasValue1 = enumerator1.MoveNext();
                 var hasValue2 = enumerator2.MoveNext();


Added generic version of ToRanges.

Added generic version of ToRanges.

--- WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
+++ WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
@@ -900,6 +900,28 @@

         #endregion

+        #region ToRange
+
+        public static IEnumerable<Tuple<T, T>> ToRanges<T>(this IEnumerable<T> values, Func<T, T, bool> isSuccessor) {
+            using (var enumerator = values.GetEnumerator()) {
+                if (!enumerator.MoveNext())
+                    yield break;
+                var start = enumerator.Current;
+                var end = start;
+                while (enumerator.MoveNext()) {
+                    if (isSuccessor(end, enumerator.Current)) {
+                        end = enumerator.Current;
+                    } else {
+                        yield return Tuple.Create(start, end);
+                        end = start = enumerator.Current;
+                    }
+                }
+                yield return Tuple.Create(start, end);
+            }
+        }
+
+        #endregion
+
         #region ToString

         static TextInfo GetTextInfo(IFormatProvider formatProvider) {


Use correct tab index

Use correct tab index

--- BuildingThemes/BuildingThemesMod.cs
+++ BuildingThemes/BuildingThemesMod.cs
@@ -211,7 +211,7 @@
             container.autoLayoutDirection = LayoutDirection.Vertical;
             container.autoLayoutPadding.top = 5;

-            container.isVisible = tabstrip.selectedIndex == 3;
+            container.isVisible = tabstrip.selectedIndex == 4;

             foreach (Configuration.Theme theme in Singleton<BuildingThemesManager>.instance.GetAllThemes())
             {


Updated header.

Updated header.

--- PlantUmlEditor/Model/Snippets/ISnippetParser.cs
+++ PlantUmlEditor/Model/Snippets/ISnippetParser.cs
@@ -1,19 +1,19 @@
-//  PlantUML Editor 2
-//  Copyright 2012 Matthew Hamilton - matthamilton@live.com
+//  PlantUML Editor
+//  Copyright 2013 Matthew Hamilton - matthamilton@live.com
 //  Copyright 2010 Omar Al Zabir - http://omaralzabir.com/ (original author)
 //
-//    Licensed under the Apache License, Version 2.0 (the "License");
-//    you may not use this file except in compliance with the License.
-//    You may obtain a copy of the License at
+//  Licensed under the Apache License, Version 2.0 (the "License");
+//  you may not use this file except in compliance with the License.
+//  You may obtain a copy of the License at
 //
-//        http://www.apache.org/licenses/LICENSE-2.0
+//      http://www.apache.org/licenses/LICENSE-2.0
 //
-//    Unless required by applicable law or agreed to in writing, software
-//    distributed under the License is distributed on an "AS IS" BASIS,
-//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//    See the License for the specific language governing permissions and
-//    limitations under the License.
-//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+
 using System.IO;

 namespace PlantUmlEditor.Model.Snippets
@@ -30,4 +30,4 @@
 		/// <returns>A snippet.</returns>
 		CodeSnippet Parse(Stream snippetSource);
 	}
-}+}


Added more data types

Added more data types

--- XESmartTarget.Core/Utils/DataTableLineProtocolAdapter.cs
+++ XESmartTarget.Core/Utils/DataTableLineProtocolAdapter.cs
@@ -58,7 +58,7 @@
                                 {
                                     point = point.Field(dc.ColumnName, Convert.ToSingle(colValue));
                                 }
-                                else if (colValue is long)
+                                else if (colValue is long || colValue is int || colValue is short || colValue is sbyte || colValue is Int16 || colValue is Int32 || colValue is Int64)
                                 {
                                     point = point.Field(dc.ColumnName, Convert.ToInt64(colValue));
                                 }
@@ -66,7 +66,7 @@
                                 {
                                     point = point.Field(dc.ColumnName, Convert.ToString(colValue));
                                 }
-                                else if (colValue is ulong)
+                                else if (colValue is ulong || colValue is uint || colValue is ushort || colValue is byte || colValue is UInt16 || colValue is UInt32 || colValue is UInt64)
                                 {
                                     point = point.Field(dc.ColumnName, Convert.ToUInt64(colValue));
                                 }


Remove commented code and slightly improve XboxStream loop.

--- XboxKeyboardMouse/XboxController/Emulation/XboxStream.cs
+++ XboxKeyboardMouse/XboxController/Emulation/XboxStream.cs
@@ -41,7 +41,6 @@
                     Thread.Sleep(500);

                     IntPtr handle = GetForegroundWindow();
-
                     if (GetWindowText(handle, text, count) > 0)
                     {
                         if (!text.ToString().Equals(XBOXAPP))
@@ -49,19 +48,8 @@
                             ShowAndFreeCursor();
                             started = false;
                             Program.MainForm.StatusWaiting();
-
-                            continue;
                         }
-
-                        /*if (IsFullscreen(handle) == false) {
-                            ShowAndFreeCursor();
-                            started = false;
-                            Program.mainform.StatusWaiting();
-
-                            continue;
-                        }*/
-
-                        if (!started)
+                        else if (!started)
                         {
                             LockAndHideCursor();
                             started = true;


Support for exporting optional classes; prune empty directives.

--- Rant/Vocabulary/RantDictionaryTable.Exporter.cs
+++ Rant/Vocabulary/RantDictionaryTable.Exporter.cs
@@ -38,20 +38,22 @@
         {
             var root = new RantDictionaryTableClassDirective("root");
             // we create the tree of class directives first - then we fill it
-            var classes = entries.Where(x => x.GetClasses().Any()).Select(x => x.GetClasses().ToArray()).ToList();
+            var classes = entries.Where(x => GetClassesForExport(x).Any()).Select(x => GetClassesForExport(x).ToArray()).ToList();
             if (classes.Any())
                 CreateNestedClassDirectives(root, classes);

             // now that we have a tree of class directives, let's populate it
             foreach (var entry in entries)
             {
-                if (!entry.GetClasses().Any())
+                if (!GetClassesForExport(entry).Any())
                 {
                     root.Entries.Add(entry);
                     continue;
                 }
-                root.FindDirectiveForClasses(entry.GetClasses().ToArray())?.Entries.Add(entry);
+                root.FindDirectiveForClasses(GetClassesForExport(entry).ToArray())?.Entries.Add(entry);
             }
+
+            root.Prune();

             root.Render(writer);
         }
@@ -95,6 +97,12 @@
             }
         }

+        // Returns the classes of an object, but optional classes are postfixed with ?
+        public static IEnumerable<string> GetClassesForExport(RantDictionaryEntry entry)
+        {
+            return entry.GetRequiredClasses().Concat(entry.GetOptionalClasses().Select(x => x + "?"));
+        }
+
         private class RantDictionaryTableClassDirective
         {
             public string Name;
@@ -113,6 +121,11 @@
                 }
             }

+            public bool ShouldPrune
+            {
+                get { return this.Entries.Count <= 3; }
+            }
+
             public RantDictionaryTableClassDirective(string name)
             {
                 this.Name = name;
@@ -129,8 +142,21 @@
                     if (tree != null)
                         return tree;
                 }
+                if (!Children.Any()) return this;
                 // all children were null, we're the best we've got I guess
-                return this;
+                return null;
+            }
+
+            public void Prune()
+            {
+                if(this.ShouldPrune)
+                {
+                    Parent.Entries.AddRange(this.Entries);
+                    Parent.Children.Remove(this.Name);
+                }
+                var children = Children.Values.ToList();
+                foreach(var child in children)
+                    child.Prune();
             }

             public void Render(StreamWriter writer, int level = -1)
@@ -156,7 +182,7 @@
                     if (!String.IsNullOrWhiteSpace(entry.Terms[0].Pronunciation))
                         writer.WriteLine(leadingWhitespacer + "  | pron {0}", entry.Terms.Select(t => t.Pronunciation).Aggregate((c, n) => c + "/" + n));

-                    string[] uniqueClasses = entry.GetClasses().Where(x => !Classes.Contains(x)).ToArray();
+                    string[] uniqueClasses = GetClassesForExport(entry).Where(x => !Classes.Contains(x)).ToArray();
                     if (uniqueClasses.Length > 0)
                         writer.WriteLine(leadingWhitespacer + "  | class {0}", uniqueClasses.Aggregate((c, n) => c + " " + n));


added all custom UI brushes

added all custom UI brushes

--- RelhaxWPFConvert/RelhaxWPFConvert/UISettings.cs
+++ RelhaxWPFConvert/RelhaxWPFConvert/UISettings.cs
@@ -5,13 +5,14 @@
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Media;
+using System.Windows;

 namespace RelhaxWPFConvert
 {
     public static class UISettings
     {
         #region Highlighting properties
-        //button (hilight)
+        //button (highlight)
         private static Brush buttonHighlightBrush;
         public static Brush ButtonHighlightBrush
         {
@@ -26,18 +27,228 @@
             }
         }

-        //tabControl (selected and highlight)
+        //tabControl (highlight and selected)
+        private static Brush tabItemHighlightBrush;
+        public static Brush TabItemHighlightBrush
+        {
+            get
+            {
+                return tabItemHighlightBrush;
+            }
+            set
+            {
+                tabItemHighlightBrush = value;
+                OnStaticPropertyChanged(nameof(TabItemHighlightBrush));
+            }
+        }
+
+        private static Brush tabItemSelectedBrush;
+        public static Brush TabItemSelectedBrush
+        {
+            get
+            {
+                return tabItemSelectedBrush;
+            }
+            set
+            {
+                tabItemSelectedBrush = value;
+                OnStaticPropertyChanged(nameof(TabItemSelectedBrush));
+            }
+        }
+
+        //checkbox (highlight and mark)
+        private static Brush checkboxHighlightBrush;
+        public static Brush CheckboxHighlightBrush
+        {
+            get
+            {
+                return checkboxHighlightBrush;
+            }
+            set
+            {
+                checkboxHighlightBrush = value;
+                OnStaticPropertyChanged(nameof(CheckboxHighlightBrush));
+            }
+        }
+
+        private static Brush checkboxCheckmarkBrush;
+        public static Brush CheckboxCheckmarkBrush
+        {
+            get
+            {
+                return checkboxCheckmarkBrush;
+            }
+            set
+            {
+                checkboxCheckmarkBrush = value;
+                OnStaticPropertyChanged(nameof(CheckboxCheckmarkBrush));
+            }
+        }
+
+        //radioButton (highlight and mark)
+        private static Brush radioButtonHighlightBrush;
+        public static Brush RadioButtonHighlightBrush
+        {
+            get
+            {
+                return radioButtonHighlightBrush;
+            }
+            set
+            {
+                radioButtonHighlightBrush = value;
+                OnStaticPropertyChanged(nameof(RadioButtonHighlightBrush));
+            }
+        }
+
+        private static Brush radioButtonCheckmarkBrush;
+        public static Brush RadioButtonCheckmarkBrush
+        {
+            get
+            {
+                return radioButtonCheckmarkBrush;
+            }
+            set
+            {
+                radioButtonCheckmarkBrush = value;
+                OnStaticPropertyChanged(nameof(RadioButtonCheckmarkBrush));
+            }
+        }
+
+        //combobox (highlight, outside color, inside color)
+        private static Brush comboboxOutsideHighlightBrush;
+        public static Brush ComboboxOutsideHighlightBrush
+        {
+            get
+            {
+                return comboboxOutsideHighlightBrush;
+            }
+            set
+            {
+                comboboxOutsideHighlightBrush = value;
+                OnStaticPropertyChanged(nameof(ComboboxOutsideHighlightBrush));
+            }
+        }
+
+        private static Brush comboboxInsideColorBrush;
+        public static Brush ComboboxInsideColorBrush
+        {
+            get
+            {
+                return comboboxInsideColorBrush;
+            }
+            set
+            {
+                comboboxInsideColorBrush = value;
+                OnStaticPropertyChanged(nameof(ComboboxInsideColorBrush));
+            }
+        }
+
+        private static Brush comboboxOutsideColorBrush;
+        public static Brush ComboboxOutsideColorBrush
+        {
+            get
+            {
+                return comboboxOutsideColorBrush;
+            }
+            set
+            {
+                comboboxOutsideColorBrush = value;
+                OnStaticPropertyChanged(nameof(ComboboxOutsideColorBrush));
+            }
+        }
+
         #endregion

         #region Default UI options
         //x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"
         public static Brush DefaultButtonHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 190, 230, 253));

+        /*
+           <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
+            <GradientStop Color="#F0F0F0" Offset="0.0"/>
+            <GradientStop Color="#E5E5E5" Offset="1.0"/>
+           </LinearGradientBrush>
+        */
+        public static Brush DefaultTabItemHighlightBrush = new LinearGradientBrush(new GradientStopCollection()
+        {
+            new GradientStop(Color.FromArgb(255,240,240,240),0),
+            new GradientStop(Color.FromArgb(255,229,229,229),1)
+        })
+        {
+            EndPoint = new Point(0,1),
+            StartPoint = new Point(0,0)
+        };
+
+        //x:Key="TabItem.Selected.Background" Color="#FFFFFF"
+        public static Brush DefaultTabItemSelectedBrush = new SolidColorBrush(Colors.White);
+
+        //x:Key="OptionMark.MouseOver.Background" Color="#FFF3F9FF"
+        public static Brush DefaultCheckboxHighlightBrush = new SolidColorBrush(Color.FromArgb(255,243,249,255));
+
+        //x:Key="OptionMark.MouseOver.Glyph" Color="#FF212121"
+        //x:Key="OptionMark.Pressed.Glyph" Color="#FF212121"
+        //x:Key="OptionMark.Static.Glyph" Color="#FF212121"
+        public static Brush DefaultCheckboxCheckmarkBrush = new SolidColorBrush(Color.FromArgb(255,33,33,33));
+
+        //x:Key="RadioButton.MouseOver.Background" Color="#FFF3F9FF"
+        public static Brush DefaultRadioButtonHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 243, 249, 255));
+
+        //x:Key="RadioButton.MouseOver.Glyph" Color="#FF212121"
+        //x:Key="RadioButton.Pressed.Glyph" Color="#FF212121"
+        //x:Key="RadioButton.Static.Glyph" Color="#FF212121"
+        public static Brush DefaultRadioButtonCheckmarkBrush = new SolidColorBrush(Color.FromArgb(255, 33, 33, 33));
+
+        /*
+          <LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
+            <GradientStop Color="#FFECF4FC" Offset="0.0"/>
+            <GradientStop Color="#FFDCECFC" Offset="1.0"/>
+          </LinearGradientBrush>
+        */
+        public static Brush DefaultComboboxOutsideHighlightBrush = new LinearGradientBrush(new GradientStopCollection()
+        {
+            new GradientStop(Color.FromArgb(255,236,244,252),0),
+            new GradientStop(Color.FromArgb(255,220,236,252),1)
+        })
+        {
+            EndPoint = new Point(0, 1),
+            StartPoint = new Point(0, 0)
+        };
+
+        /*
+          <LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
+            <GradientStop Color="#FFF0F0F0" Offset="0.0"/>
+            <GradientStop Color="#FFE5E5E5" Offset="1.0"/>
+          </LinearGradientBrush>
+        */
+        public static Brush DefaultComboboxOutsideColorBrush = new LinearGradientBrush(new GradientStopCollection()
+        {
+            new GradientStop(Color.FromArgb(255,240,240,240),0),
+            new GradientStop(Color.FromArgb(255,229,229,229),1)
+        })
+        {
+            EndPoint = new Point(0, 1),
+            StartPoint = new Point(0, 0)
+        };
+
+        //<Border x:Name="dropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
+        public static Brush DefaultComboboxInsideColorBrush = SystemColors.WindowBrush;
+
         #endregion

         #region Dark UI options
         public static Brush DarkButtonHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));

+        public static Brush DarkTabItemHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));
+        public static Brush DarkTabItemSelectedBrush = new SolidColorBrush(Colors.White);
+
+        public static Brush DarkCheckboxHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));
+        public static Brush DarkCheckboxCheckmarkBrush = new SolidColorBrush(Colors.White);
+
+        public static Brush DarkRadioButtonHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));
+        public static Brush DarkRadioButtonCheckmarkBrush = new SolidColorBrush(Colors.White);
+
+        public static Brush DarkComboboxOutsideHighlightBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));
+        public static Brush DarkComboboxOutsideColorBrush = new SolidColorBrush(Color.FromArgb(255, 134, 134, 134));
         #endregion


Fixing problems with eager closing when the context menu is used

#439 and #616

--- Fluent.Ribbon/Controls/MenuItem.cs
+++ Fluent.Ribbon/Controls/MenuItem.cs
@@ -1,8 +1,7 @@
-// ReSharper disable once CheckNamespace
+// ReSharper disable once CheckNamespace
 namespace Fluent
 {
     using System;
-    using System.Reflection;
     using System.Windows;
     using System.Windows.Controls;
     using System.Windows.Controls.Primitives;
@@ -22,10 +21,6 @@
     public class MenuItem : System.Windows.Controls.MenuItem, IQuickAccessItemProvider, IRibbonControl, IDropDownControl, IToggleButton
     {
         #region Fields
-
-        //DependencyPropertyKey
-        private static readonly FieldInfo rolePropertyKeyFieldInfo = typeof(System.Windows.Controls.MenuItem).GetField("RolePropertyKey", BindingFlags.Static | BindingFlags.NonPublic);
-        private static readonly DependencyPropertyKey rolePropertyKey = (DependencyPropertyKey)rolePropertyKeyFieldInfo.GetValue(null);

         // Thumb to resize in both directions
         private Thumb resizeBothThumb;
@@ -431,7 +426,8 @@
         {
             base.OnMouseEnter(e);

-            if (this.IsItemsControlMenuBase == false)
+            if (this.IsItemsControlMenuBase == false
+                && this.isContextMenuOpening == false)
             {
                 if (this.HasItems
                     && this.Parent is DropDownButton)
@@ -444,14 +440,10 @@
         /// <inheritdoc />
         protected override void OnMouseLeave(MouseEventArgs e)
         {
-            if (this.isContextMenuOpening)
-            {
-                return;
-            }
-
             base.OnMouseLeave(e);

-            if (this.IsItemsControlMenuBase == false)
+            if (this.IsItemsControlMenuBase == false
+                && this.isContextMenuOpening == false)
             {
                 if (this.HasItems
                     && this.Parent is DropDownButton // prevent too slow close on regular DropDown
@@ -466,7 +458,13 @@
         protected override void OnContextMenuOpening(ContextMenuEventArgs e)
         {
             this.isContextMenuOpening = true;
-            this.IsContextMenuOpened = true;
+
+            // We have to close the sub menu as soon as the context menu gets opened
+            // but only if it should be opened on ourself
+            if (ReferenceEquals(this, e.Source))
+            {
+                this.IsSubmenuOpen = false;
+            }

             base.OnContextMenuOpening(e);
         }
@@ -475,14 +473,8 @@
         protected override void OnContextMenuClosing(ContextMenuEventArgs e)
         {
             this.isContextMenuOpening = false;
-            this.IsContextMenuOpened = false;

             base.OnContextMenuClosing(e);
-
-            if (this.IsMouseOver == false)
-            {
-                this.OnMouseLeave(new MouseEventArgs(Mouse.PrimaryDevice, 0));
-            }
         }

         #endregion Non MenuBase ItemsControl workarounds


Update index.cshtml

Update index.cshtml


Fix Read_LdmlDelimiters test

Fix Read_LdmlDelimiters test

UT depends on LDML Data Mapper update for parsing level 1+2 quote marks.  Revert to prior assertions for now

--- SIL.WritingSystems.Tests/LdmlDataMapperTests.cs
+++ SIL.WritingSystems.Tests/LdmlDataMapperTests.cs
@@ -307,18 +307,10 @@
 			var pp = new PunctuationPattern("pattern1", PunctuationPatternContext.Medial);
 			Assert.That(wsFromLdml.PunctuationPatterns.FirstOrDefault(), Is.EqualTo(pp));
 			Assert.That(wsFromLdml.QuotationParagraphContinueType, Is.EqualTo(QuotationParagraphContinueType.Outermost));
-			// Verify Level 1 normal quotation marks (quotationStart and quotationEnd)
-			var qm1 = new QuotationMark("\"", "\"", null, 1, QuotationMarkingSystemType.Normal);
-			Assert.That(wsFromLdml.QuotationMarks[0], Is.EqualTo(qm1));
-			// Verify Level 2 normal quotation marks (alternateQuotationStart and alternateQuotationEnd)
-			var qm2 = new QuotationMark("{", "}", null, 2, QuotationMarkingSystemType.Normal);
+			var qm1 = new QuotationMark("open1", "close2", "cont3", 3, QuotationMarkingSystemType.Normal);
+			Assert.That(wsFromLdml.QuotationMarks.FirstOrDefault(), Is.EqualTo(qm1));
+			var qm2 = new QuotationMark("", null, null, 1, QuotationMarkingSystemType.Narrative);
 			Assert.That(wsFromLdml.QuotationMarks[1], Is.EqualTo(qm2));
-			// Verify Level 3 normal quotation marks (special: sil:quotation-marks)
-			var qm3 = new QuotationMark("open1", "close2", "cont3", 3, QuotationMarkingSystemType.Normal);
-			Assert.That(wsFromLdml.QuotationMarks[2], Is.EqualTo(qm3));
-			// Verify Level 1 narrative quotation marks (special: sil:quotation-marks)
-			var qm4 = new QuotationMark("", null, null, 1, QuotationMarkingSystemType.Narrative);
-			Assert.That(wsFromLdml.QuotationMarks[3], Is.EqualTo(qm4));
 		}

 #if WS_FIX


Don't require any sources when building a DELETE query.

--- Silk.Data.SQL.ORM/Queries/DeleteQueryBuilder.cs
+++ Silk.Data.SQL.ORM/Queries/DeleteQueryBuilder.cs
@@ -31,9 +31,6 @@
 		public ICollection<ORMQuery> CreateQuery<TView>(EntityModel<TView> model, params TView[] sources)
 			where TView : new()
 		{
-			if (sources == null || sources.Length < 1)
-				throw new ArgumentException("At least one source must be provided.", nameof(sources));
-
 			if (model.PrimaryKeyFields == null ||
 				model.PrimaryKeyFields.Length == 0)
 				throw new InvalidOperationException("A primary key is required.");


URL escaping on generation (User)

URL escaping on generation (User)

--- src/epvpapi/User.cs
+++ src/epvpapi/User.cs
@@ -343,7 +343,11 @@
         /// </summary>
         public string URL
         {
-            get { return "http://www.elitepvpers.com/forum/members/" + ID + "-" + Name.ToLower() + ".html"; }
+            get
+            {
+                string escapedUserName = Regex.Replace(Name, "([^a-zA-Z0-9]+)", "-").ToLower(); // by default, all usernames are escaped in links by vBulletin itself
+                return "http://www.elitepvpers.com/forum/members/" + ID + "-" + escapedUserName + ".html";
+            }
         }

         public User(uint id = 0)


Ajax.Platform: Implement the StandardAjax Platform API

--- Snowflake.StandardAjax/StandardAjax.Platform.cs
+++ Snowflake.StandardAjax/StandardAjax.Platform.cs
@@ -11,27 +11,53 @@
     public partial class StandardAjax
     {
         [AjaxMethod(MethodPrefix = "Platform")]
+        [AjaxMethodParameter(ParameterName = "platform", ParameterType = AjaxMethodParameterType.StringParameter)]
         public IJSResponse GetPreferences(IJSRequest request)
         {
-            return new JSResponse(request, null);
+            IPlatformInfo platform = this.CoreInstance.LoadedPlatforms[request.GetParameter("platform")];
+            return new JSResponse(request, this.CoreInstance.PlatformPreferenceDatabase.GetPreferences(platform));
         }

         [AjaxMethod(MethodPrefix = "Platform")]
+        [AjaxMethodParameter(ParameterName = "platform", ParameterType = AjaxMethodParameterType.StringParameter)]
+        [AjaxMethodParameter(ParameterName = "preference", ParameterType = AjaxMethodParameterType.StringParameter)]
+        [AjaxMethodParameter(ParameterName = "value", ParameterType = AjaxMethodParameterType.StringParameter)]
         public IJSResponse SetPreference(IJSRequest request)
         {
-            return new JSResponse(request, null);
-        }
-
-        [AjaxMethod(MethodPrefix = "Platform")]
-        public IJSResponse SetInputDevice(IJSRequest request)
-        {
-            return new JSResponse(request, null);
+            IPlatformInfo platform = this.CoreInstance.LoadedPlatforms[request.GetParameter("platform")];
+            string preference = request.GetParameter("preference");
+            string value = request.GetParameter("value");
+            switch (preference)
+            {
+                case "emulator":
+                    if (this.CoreInstance.PluginManager.LoadedEmulators.ContainsKey(value))
+                    {
+                        this.CoreInstance.PlatformPreferenceDatabase.SetEmulator(platform, value);
+                        return new JSResponse(request, "Emulator set to " + value, true);
+                    }
+                    else
+                    {
+                        return new JSResponse(request, "Error: Emulator not installed", false);
+                    }
+                case "scraper":
+                    if (this.CoreInstance.PluginManager.LoadedEmulators.ContainsKey(value))
+                    {
+                        this.CoreInstance.PlatformPreferenceDatabase.SetScraper(platform, value);
+                        return new JSResponse(request, "Scraper set to " + value, true);
+                    }
+                    else
+                    {
+                        return new JSResponse(request, "Error: Scraper not installed", false);
+                    }
+                default:
+                    return new JSResponse(request, "Error: unknown preference type", false);
+            }
         }

         [AjaxMethod(MethodPrefix = "Platform")]
         public IJSResponse GetPlatforms(IJSRequest request)
         {
-            return new JSResponse(request, null);
+            return new JSResponse(request, this.CoreInstance.LoadedPlatforms);
         }
     }
 }


clean code

clean code

--- Solution1/DataAccess/Repositories/Repository.cs
+++ Solution1/DataAccess/Repositories/Repository.cs
@@ -10,7 +10,7 @@
     where T : BaseModel
     {
         protected readonly PlatformManagement context;
-
+
         protected Repository(PlatformManagement platformManagement)
         {
             context = platformManagement;


Make sure we don't bother to try and change local bounds if we don't need to.

--- Gui/GUIWidget.cs
+++ Gui/GUIWidget.cs
@@ -1339,9 +1339,12 @@
 			get => LocalBounds.Width;
 			set
 			{
-				RectangleDouble localBounds = LocalBounds;
-				localBounds.Right = localBounds.Left + value;
-				LocalBounds = localBounds;
+				if (value != Width)
+				{
+					RectangleDouble localBounds = LocalBounds;
+					localBounds.Right = localBounds.Left + value;
+					LocalBounds = localBounds;
+				}
 			}
 		}

@@ -1351,9 +1354,12 @@
 			get => LocalBounds.Height;
 			set
 			{
-				RectangleDouble localBounds = LocalBounds;
-				localBounds.Top = localBounds.Bottom + value;
-				LocalBounds = localBounds;
+				if (value != Height)
+				{
+					RectangleDouble localBounds = LocalBounds;
+					localBounds.Top = localBounds.Bottom + value;
+					LocalBounds = localBounds;
+				}
 			}
 		}


* Nelibur.Sword AssemblyInfo.cs assembly description to new name

--- Source/Nelibur.Sword/Properties/AssemblyInfo.cs
+++ Source/Nelibur.Sword/Properties/AssemblyInfo.cs
@@ -7,7 +7,7 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.

-[assembly: AssemblyTitle("Nelibur.Core")]
+[assembly: AssemblyTitle("Nelibur.Sword")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyCulture("")]


Use is instead of GetType

Use is instead of GetType

- Ensures that base types are matched as well

--- Gui/GUIWidget.cs
+++ Gui/GUIWidget.cs
@@ -3072,7 +3072,7 @@
 					yield return childChild;
 				}

-				if(child.GetType() == typeof(T))
+				if(child is T)
 				{
 					yield return (T)child;
 				}


code cleanup + broke startup code out to separate method

--- CollectionViewer/MainWindow.xaml.cs
+++ CollectionViewer/MainWindow.xaml.cs
@@ -1,17 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Xml.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
 using Microsoft.Msagl.Drawing;
 using Microsoft.Msagl.GraphViewerGdi;
 using model;
@@ -53,24 +42,29 @@
             };

             loginwindow.okbtn.Click += (sender, e) => {
-                bool connected = this.TryConnect(this._connector, loginviewmodel, loginwindow);
-                if (connected == true)
-                {
-                    loginwindow.Close();
-                    this._site = loginviewmodel.Site;
-                    this._connector.Query(this._site);
-                    this._devlibrary = this._connector.DeviceCollectionLibrary;
-                    this._userlibrary = this._connector.UserCollectionLibrary;
-                    Graph[] graphs = this.BuildTreeAllCollections(this._connector);
-                    MsaglHelpers.ConfigureGViewer(this.deviceColViewer);
-                    MsaglHelpers.ConfigureGViewer(this.userColViewer);
-                    this.deviceColViewer.Graph = graphs[0];
-                    this.userColViewer.Graph = graphs[1];
-                }
+                if (this.TryConnect(this._connector, loginviewmodel, loginwindow) == true)
+                { this.Startup(loginwindow, loginviewmodel); }
             };
+
+            //loginwindow.pwdbx.Enter

             loginwindow.ShowDialog();

+        }
+
+        private void Startup(LoginWindow loginwindow, LoginViewModel loginviewmodel)
+        {
+            loginwindow.Close();
+            this._site = loginviewmodel.Site;
+            this._connector.Query(this._site);
+            this._devlibrary = this._connector.DeviceCollectionLibrary;
+            this._userlibrary = this._connector.UserCollectionLibrary;
+            Graph[] graphs = this.BuildTreeAllCollections(this._connector);
+            MsaglHelpers.ConfigureGViewer(this.deviceColViewer);
+            MsaglHelpers.ConfigureGViewer(this.userColViewer);
+            this.deviceColViewer.Graph = graphs[0];
+            this.userColViewer.Graph = graphs[1];
+
         }

         private bool TryConnect(SccmConnector connector, LoginViewModel loginviewmodel, LoginWindow loginwindow)


no message

no message

--- Com.AimUI.TagEngine/ParserEngine.cs
+++ Com.AimUI.TagEngine/ParserEngine.cs
@@ -457,7 +457,8 @@
                                     tmpSubTag.tagObj = tagObj;
                                     if (string.IsNullOrEmpty(tmpSubTag.tagName))
                                     {
-                                        tagObj.curTag = "";
+                                        tagObj.curTag = null;
+                                        if (isDynamic) strBuilder.AppendLine(instanceName + ".curTag = null;");
                                         if (IsNullOrWhiteSpace(tmpSubTag.bodyContent) == false)
                                         {
                                             TagContext.SetItem(tagContext, "$__tagid", tagId);
@@ -467,9 +468,9 @@
                                     else
                                     {
                                         tagObj.curTag = tmpSubTag.tagName;
+                                        if (isDynamic) strBuilder.AppendLine(instanceName + ".curTag = @\"" + tmpSubTag.tagName + "\";");
                                         if (tmpSubTag.tagParams != null)
                                         {
-                                            if (isDynamic) strBuilder.AppendLine(instanceName + ".curTag = @\"" + tmpSubTag.tagName + "\";");
                                             ParseTagParams(tagContext, strBuilder, tmpSubTag.tagParams, tagObj, instanceName, tmpSubTag, tagsObj, isDynamic);
                                         }
                                         if (isDynamic)


Moved texture store inline

Moved texture store inline

--- osu.Framework.Templates/templates/template-flappy/FlappyDon.Game/Elements/Pipe.cs
+++ osu.Framework.Templates/templates/template-flappy/FlappyDon.Game/Elements/Pipe.cs
@@ -12,9 +12,6 @@
     /// </summary>
     public class Pipe : Sprite
     {
-        [Resolved]
-        private TextureStore textures { get; set; }
-
         public Pipe()
         {
             Anchor = Anchor.BottomCentre;
@@ -23,7 +20,7 @@
         }

         [BackgroundDependencyLoader]
-        private void load()
+        private void load(TextureStore textures)
         {
             Texture = textures.Get("pipe-green");
         }


Additional test, Lexer get two integers

Additional test, Lexer get two integers

--- Src/ScalaSharp.Core.Tests/Parsing/LexerTests.cs
+++ Src/ScalaSharp.Core.Tests/Parsing/LexerTests.cs
@@ -85,5 +85,25 @@

             Assert.IsNull(lexer.NextToken());
         }
+
+        [TestMethod]
+        public void GetTwoIntegers()
+        {
+            Lexer lexer = new Lexer("123 456");
+
+            var result = lexer.NextToken();
+
+            Assert.IsNotNull(result);
+            Assert.AreEqual("123", result.Value);
+            Assert.AreEqual(TokenType.Integer, result.Type);
+
+            result = lexer.NextToken();
+
+            Assert.IsNotNull(result);
+            Assert.AreEqual("456", result.Value);
+            Assert.AreEqual(TokenType.Integer, result.Type);
+
+            Assert.IsNull(lexer.NextToken());
+        }
     }
 }


missing xmldoc

missing xmldoc

--- Coremero/Coremero/Client/IClient.cs
+++ Coremero/Coremero/Client/IClient.cs
@@ -43,6 +43,9 @@
         /// </summary>
         event EventHandler<Exception> Error;

+        /// <summary>
+        /// An enumerable list of what servers the client is currently connected to.
+        /// </summary>
         IEnumerable<IServer> Servers { get; }
     }
 }


if the mail method cannot create new unique strings it will start appending numbers

--- DataGen/Types/Mail/MailGenerator.cs
+++ DataGen/Types/Mail/MailGenerator.cs
@@ -80,23 +80,26 @@
         /// <returns></returns>
         /// <exception cref="Exception"></exception>
         private string UniqueMail(string name, string secondName) {
-            var resets = 0;
-            while (resets < AttemptLimit)
-                if (_emailDomainsEnumerator.MoveNext()) {
-                    var emailDomain = _emailDomainsEnumerator.Current;
-                    foreach (var separator in Separators) {
-                        var address = BuildString(name, separator.ToString(), secondName, "@", emailDomain);
-                        if (ClearValidateSave(address))
-                            return address;
+            while (true) {
+                var resets = 0;
+                while (resets < AttemptLimit)
+                    if (_emailDomainsEnumerator.MoveNext()) {
+                        var emailDomain = _emailDomainsEnumerator.Current;
+                        foreach (var separator in Separators) {
+                            var address = BuildString(name, separator.ToString(), secondName, "@", emailDomain);
+                            if (ClearValidateSave(address))
+                                return address;
+                        }
                     }
-                }
-                else {
-                    //If this needs to be called more than once.
-                    //It means that every combination with separators and EmailDomains has been iterated.
-                    _emailDomainsEnumerator.Reset();
-                    resets += 1;
-                }
-            throw new Exception("Could not create an unique mail");
+                    else {
+                        //If this needs to be called more than once.
+                        //It means that every combination with separators and EmailDomains has been iterated.
+                        _emailDomainsEnumerator.Reset();
+                        resets += 1;
+                    }
+                // Start adding numbers.
+                secondName = secondName + Randomizer(9);
+            }
         }

         private static string BuildString(params string[] strings) {
@@ -110,15 +113,18 @@
         ///     This method currently can only be called up 1 * ammount of mail suppliers with the same argument. After that it will throw an exception
         /// </summary>
         public string Mail(string name) {
-            if (string.IsNullOrEmpty(name))
-                throw new NullReferenceException($"{nameof(name)} cannot be empty string or null");
-            if (!Unique) return RandomMail(name);
-            foreach (var emailDomain in _emailDomains) {
-                var address = BuildString(name, "@", emailDomain);
-                if (ClearValidateSave(address))
-                    return address;
+            while (true) {
+                if (string.IsNullOrEmpty(name))
+                    throw new NullReferenceException($"{nameof(name)} cannot be empty string or null");
+                if (!Unique) return RandomMail(name);
+                foreach (var emailDomain in _emailDomains) {
+                    var address = BuildString(name, "@", emailDomain);
+                    if (ClearValidateSave(address))
+                        return address;
+                }
+                // Start adding numbers
+                name = name + Randomizer(9);
             }
-            throw new Exception("Could not create an unique mail");
         }
     }
 }


HAhahhaha

HAhahhaha

--- TeamArchMageGame/KiwisMatrix/Main/KiwisDeath.cs
+++ TeamArchMageGame/KiwisMatrix/Main/KiwisDeath.cs
@@ -374,14 +374,16 @@
             }
         }
         // Despawn
-        static int ccc = 0;
+        static int ccc = 3;
         private static void DespawnLeftTree(int spawnWidth, int spawnHeigth)
         {
             if (leftTreeCounter != 0)
             {
                 leftTreeCounter--;
             }
-            ccc = 0;
+            ccc = 3;
+            ccc = (ccc - leftTreeCounter) + 1;
+
             for (int row = leftTreeCounter, i = spawnWidth; row > 0; row--, i++)
             {
                 for (int col = 0, j = spawnHeigth; col < bigBor.GetLength(1); col++, j++)


Re-implemented menu options

Re-implemented menu options

--- suddendeath/Assets/OptionsScreenBehavior.cs
+++ suddendeath/Assets/OptionsScreenBehavior.cs
@@ -64,42 +64,40 @@

 	// Use this for initialization
 	void Start () {
-        /*
+
         // Spinner Handlers
-        spinner.onValueChanged.AddListener(val => { gameOptions.isSpinnerEnabled = val; Debug.Log("") });
-        spinnerCount.onValueChanged.AddListener(val => { gameOptions.spinnerCount = (int)val; Debug.Log("") });
-        spinnerSpeed.onValueChanged.AddListener(val => { gameOptions.spinnerSpeed = (int)val; Debug.Log("") });
+        spinner.onValueChanged.AddListener(val => { gameOptions.isSpinnerEnabled = val; Debug.Log("Spinner Enabled: " + val); });
+        //spinnerCount.onValueChanged.AddListener(val => { gameOptions.spinnerCount = (int)val; Debug.Log("") });
+        //spinnerSpeed.onValueChanged.AddListener(val => { gameOptions.spinnerSpeed = (int)val; Debug.Log("") });

         // Wall Laser (Laser Turret) Handlers
-        wallLaser.onValueChanged.AddListener(val => { gameOptions.isWallLaserEnabled = val; Debug.Log(""));
-        wallLaserCount.onValueChanged.AddListener(val => { gameOptions.wallLaserCount = (int)val; wallLaserCountText.text = "Wall Laser Count: " + (int)val; Debug.Log("") });
-        wallLaserBounceCount.onValueChanged.AddListener(val => { gameOptions.wallLaserBounceCount = (int)val; wallLaserBounceCountText.text = "Laser Bounce Count: " + (int)val; Debug.Log("") });
-        wallLaserShotFrequency.onValueChanged.AddListener(val => { gameOptions.wallLaserShotFrequency = val; wallLaserShotFrequencyText.text = "Wall Laser Shot Freq: " + val; Debug.Log("") });
-        wallLaserChargeTime.onValueChanged.AddListener(val => { gameOptions.wallLaserChargeTime = val; wallLaserChargeTimeText.text = "Wall Laser Charge Time: " + val; Debug.Log("") });
+        wallLaser.onValueChanged.AddListener(val => { gameOptions.isWallLaserEnabled = val; Debug.Log("Wall Turret Enabled: " + val); });
+        //wallLaserCount.onValueChanged.AddListener(val => { gameOptions.wallLaserCount = (int)val; wallLaserCountText.text = "Wall Laser Count: " + (int)val; Debug.Log("") });
+        //wallLaserBounceCount.onValueChanged.AddListener(val => { gameOptions.wallLaserBounceCount = (int)val; wallLaserBounceCountText.text = "Laser Bounce Count: " + (int)val; Debug.Log("") });
+        //wallLaserShotFrequency.onValueChanged.AddListener(val => { gameOptions.wallLaserShotFrequency = val; wallLaserShotFrequencyText.text = "Wall Laser Shot Freq: " + val; Debug.Log("") });
+        //wallLaserChargeTime.onValueChanged.AddListener(val => { gameOptions.wallLaserChargeTime = val; wallLaserChargeTimeText.text = "Wall Laser Charge Time: " + val; Debug.Log("") });

         // Bomb Handlers
-        bomb.onValueChanged.AddListener(val => { gameOptions.isBombEnabled = val; Debug.Log("") });
-        bombFrequency.onValueChanged.AddListener(val => { gameOptions.bombFrequency = val; bombFrequencyText.text = "Bomb Frequency: " + val; Debug.Log("") });
-        bombFallTime.onValueChanged.AddListener(val => { gameOptions.bombFallTime = val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
+        bomb.onValueChanged.AddListener(val => { gameOptions.isBombEnabled = val; Debug.Log("Bomb Enabled: " + val); });
+        //bombFrequency.onValueChanged.AddListener(val => { gameOptions.bombFrequency = val; bombFrequencyText.text = "Bomb Frequency: " + val; Debug.Log("") });
+        //bombFallTime.onValueChanged.AddListener(val => { gameOptions.bombFallTime = val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });

         // Mine Handlers
-        mine.onValueChanged.AddListener(val => { gameOptions.isMineEnabled = val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
-        mineStartsArmed.onValueChanged.AddListener(val => { gameOptions.mineStartsArmed = val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
-        mineTimeToDetonate.onValueChanged.AddListener(val => { gameOptions.mineTimeToDetonate = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
-        maxMines.onValueChanged.AddListener(val => { gameOptions.maxMines = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log(""));
-        mineRespawnFrequency.onValueChanged.AddListener(val => { gameOptions.mineRespawnFrequency = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log("") });
-        mineMaxLifetime.onValueChanged.AddListener(val => { gameOptions.mineMaxLifetime = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log("") });
+        mine.onValueChanged.AddListener(val => { gameOptions.isMineEnabled = val; Debug.Log("Mine Enabled: " + val); });
+        //mineStartsArmed.onValueChanged.AddListener(val => { gameOptions.mineStartsArmed = val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
+        //mineTimeToDetonate.onValueChanged.AddListener(val => { gameOptions.mineTimeToDetonate = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + val; Debug.Log("") });
+        //maxMines.onValueChanged.AddListener(val => { gameOptions.maxMines = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log(""));
+        //mineRespawnFrequency.onValueChanged.AddListener(val => { gameOptions.mineRespawnFrequency = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log("") });
+        //mineMaxLifetime.onValueChanged.AddListener(val => { gameOptions.mineMaxLifetime = (int)val; bombFallTimeText.text = "Bomb Fall Time: " + (int)val; Debug.Log("") });

         // Floor Handlers
-        floor.onValueChanged.AddListener(val => { gameOptions.isFloorEnabled = val; Debug.Log("") });
-        floorCollapseDuration.onValueChanged.AddListener(val => { gameOptions.floorCollapseDuration = (int)val; Debug.Log("") });
-        */
+        floor.onValueChanged.AddListener(val => { gameOptions.isFloorEnabled = val; Debug.Log("Floor Enabled: " + val); });
+        //floorCollapseDuration.onValueChanged.AddListener(val => { gameOptions.floorCollapseDuration = (int)val; Debug.Log("") });
     }

     // Update is called once per frame
     void Update()
     {
-        /*
         for (int player = 1; player < 5; player++)
         {
             if (XCI.GetButtonDown(XboxButton.Back, (XboxController)player))
@@ -107,6 +105,5 @@
                 Globals.Instance.GameManager.DisplayPlayerSetup();
             }
         }
-        */
     }
 }


Default to master git branch

Default to master git branch

--- UnityBuildServer/VersionControl/Git/GitVCS.cs
+++ UnityBuildServer/VersionControl/Git/GitVCS.cs
@@ -89,7 +89,7 @@
                 var cloneOptions = new CloneOptions
                 {
                     CredentialsProvider = credentialsHandler,
-                    BranchName = config.RepositoryBranchName,
+                    BranchName = string.IsNullOrEmpty (config.RepositoryBranchName) ? "master" : config.RepositoryBranchName,
                     Checkout = true,
                     RecurseSubmodules = true
                 };


Make DelayQueue.Dequeue() be reentrant -- seems to be necessary for the NetworkEmulatorTransport, where a PacketSent or PacketReceived event may itself trigger an update somehow!

--- GTBase/Collections.cs
+++ GTBase/Collections.cs
@@ -992,7 +992,7 @@
             bool hasDequeued = false;
             while (first != null && first.delta <= elapsed)
             {
-                dequeued(first.element);
+                T element = first.element;
                 hasDequeued = true;
                 Count--;
                 MaximumDelay -= first.delta;
@@ -1000,6 +1000,7 @@
                 DelayNode scrap = first;
                 first = first.next;
                 nodePool.Return(scrap);
+                dequeued(element);
             }
             if (first != null)
             {
@@ -1010,5 +1011,4 @@
             return hasDequeued;
         }
     }
-
 }


Fixed login indexes not being created or deleted

Logins created during user creation get indexes made but don't when
logins are added to an existing account and therefore the login couldn't
be found when used again, causing a 409 dupe exception when trying to
add the login again.

--- AccidentalFish.AspNet.Identity.Azure/TableUserStore.cs
+++ AccidentalFish.AspNet.Identity.Azure/TableUserStore.cs
@@ -259,18 +259,26 @@
         {
             if (user == null) throw new ArgumentNullException("user");
             if (loginInfo == null) throw new ArgumentNullException("loginInfo");
-            TableUserLogin login = new TableUserLogin(user.Id, loginInfo.LoginProvider, loginInfo.ProviderKey);
-            TableOperation operation = TableOperation.Insert(login);
+
+            var login = new TableUserLogin(user.Id, loginInfo.LoginProvider, loginInfo.ProviderKey);
+            var operation = TableOperation.Insert(login);
             await _loginTable.ExecuteAsync(operation);
+
+            var loginIndexItem = new TableUserLoginProviderKeyIndex(user.Id, login.ProviderKey, login.LoginProvider);
+            await _loginProviderKeyIndexTable.ExecuteAsync(TableOperation.InsertOrReplace(loginIndexItem));
         }

         public async Task RemoveLoginAsync(T user, UserLoginInfo loginInfo)
         {
             if (user == null) throw new ArgumentNullException("user");
             if (loginInfo == null) throw new ArgumentNullException("loginInfo");
-            TableUserLogin login = new TableUserLogin(user.Id, loginInfo.LoginProvider, loginInfo.ProviderKey);
-            TableOperation operation = TableOperation.Delete(login);
-            await  _loginTable.ExecuteAsync(operation);
+            var login = new TableUserLogin(user.Id, loginInfo.LoginProvider, loginInfo.ProviderKey);
+            var operation = TableOperation.Delete(login);
+            await _loginTable.ExecuteAsync(operation);
+
+            var loginIndexItem = new TableUserLoginProviderKeyIndex(user.Id, login.ProviderKey, login.LoginProvider);
+            var indexOperation = TableOperation.Delete(loginIndexItem);
+            await _loginProviderKeyIndexTable.ExecuteAsync(indexOperation);
         }

         public Task<IList<UserLoginInfo>> GetLoginsAsync(T user)


Updated views to be more robust including web 8 views.

--- Alchemy4Tridion.Plugins/GUI/Configuration/Constants.cs
+++ Alchemy4Tridion.Plugins/GUI/Configuration/Constants.cs
@@ -239,8 +239,32 @@
         /// </summary>
         public static class Views
         {
+            public const string ActivityInstanceView = "ActivityInstanceView";
+            public const string BusinessProcessTypeView = "BusinessProcessTypeView";
+            public const string CategoryView = "CategoryView";
+            public const string ComponentView = "ComponentView";
+            public const string ControlRoomView = "ControlRoomView";
+            public const string CustomPageView = "CustomPageView";
+            public const string FolderView = "FolderView";
+            public const string HelpView = "HelpView";
+            public const string KeywordView = "KeywordView";
+            public const string ListFiltersView = "ListFiltersView";
+            public const string MultimediaTypeView = "MultimediaTypeView";
+            public const string PopupsView = "PopupsView";
+            public const string ProcessHistoryView = "ProcessHistoryView";
+            public const string ProcessInstanceView = "ProcessInstanceView";
+            public const string SitesView = "SitesView";
+            public const string SiteWizardView = "SiteWizardView";
+            public const string SplashScreenView = "SplashScreenView";
+            public const string StructureGroupView = "StructureGroupView";
+            public const string TargetGroupView = "TargetGroupView";
+            public const string TargetTypeView = "TargetTypeView";
+            public const string TemplateBuildingBlockView = "TemplateBuildingBlockView";
+            public const string UserAccountsView = "UserAccountsView";
+            public const string VirtualFolderView = "VirtualFolderView";
+            public const string WelcomeView = "WelcomeView";
+            public const string WorkflowActivitiesView = "WorkflowActivitiesView";
             public const string ComponentTemplateView = "ComponentTemplateView";
-            public const string ComponentView = "ComponentView";
             public const string DashboardView = "DashboardView";
             public const string PageTemplateView = "PageTemplateView";
             public const string PageView = "PageView";


Improvised the algorithm.

Improvised the algorithm.

Earlier I was using two seprate loops one each for finding the insertion position and then other one for shifting the elements. Now I've achieved the entire stuff using only one loop.


UsersFolder not used anymore

UsersFolder not used anymore

--- WrapperInstances/FileSystemWrapperInstance.cs
+++ WrapperInstances/FileSystemWrapperInstance.cs
@@ -20,7 +20,6 @@
         {
             var baseDirectory = FileSystem.Current.GetFolderFromPathAsync(AppDomain.CurrentDomain.BaseDirectory).Result;

-            UsersFolder     = baseDirectory.CreateFolderAsync("Users", CreationCollisionOption.OpenIfExists).Result;
             SettingsFolder  = baseDirectory.CreateFolderAsync("Settings", CreationCollisionOption.OpenIfExists).Result;
             LogFolder       = baseDirectory.CreateFolderAsync("Logs", CreationCollisionOption.OpenIfExists).Result;
             CrashLogFolder  = LogFolder.CreateFolderAsync("Crash", CreationCollisionOption.OpenIfExists).Result;


Vesrion 0.102

Vesrion 0.102

--- GitMind/Properties/AssemblyInfo.cs
+++ GitMind/Properties/AssemblyInfo.cs
@@ -50,7 +50,7 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("0.101.*")]
+[assembly: AssemblyVersion("0.102.*")]

 [assembly: InternalsVisibleTo("GitMindTest")]


Accelerate resolution for the AI if it's gonna win on the next move

--- Connect4/Connect4/Minimax/MinimaxAlgorithm.cs
+++ Connect4/Connect4/Minimax/MinimaxAlgorithm.cs
@@ -91,36 +91,47 @@
                     foreach (int column in p_Node.Grid.ColumnNotFull)
                     {
                         GameGrid newGameGrid = p_Node.Grid.CloneGameGrid(p_Node.Grid);
+                        newGameGrid.AddTokenInColumn(column, p_MaximizingPlayer.TokenColor);
+                        Node newNode = new Node(p_MinimizingPlayer, newGameGrid, column, p_Node.Depth + 1);

-                        newGameGrid.AddTokenInColumn(column, p_MaximizingPlayer.TokenColor);
-
-                        Node newNode = new Node(p_MinimizingPlayer, newGameGrid, column, p_Node.Depth + 1);
-                        Node currentNode = Minimax(newNode, p_MaxDepth, p_Alpha, p_Beta, p_MaximizingPlayer, p_MinimizingPlayer);
-
-                        if (currentNode == null)
+                        if (p_Node.Depth == 1)
                         {
-                            nodeWithScoreMax = newNode;
+                            newGameGrid.CalculateGridScore(p_MaximizingPlayer);
+                            if (newGameGrid.FourTokenAligned)
+                            {
+                                nodeWithScoreMax = newNode;
+                                return nodeWithScoreMax;
+                            }
                         }
                         else
                         {
-                            newNode.Grid.Score = currentNode.Grid.Score;
+                            Node currentNode = Minimax(newNode, p_MaxDepth, p_Alpha, p_Beta, p_MaximizingPlayer, p_MinimizingPlayer);

-                            if (nodeWithScoreMax == null)
+                            if (currentNode == null)
                             {
                                 nodeWithScoreMax = newNode;
                             }
                             else
                             {
-                                nodeWithScoreMax = currentNode.Grid.Score > nodeWithScoreMax.Grid.Score ? newNode : nodeWithScoreMax;
+                                newNode.Grid.Score = currentNode.Grid.Score;

-                                if (nodeWithScoreMax.Grid.Score > p_Beta)
+                                if (nodeWithScoreMax == null)
                                 {
-                                    return nodeWithScoreMax;
+                                    nodeWithScoreMax = newNode;
                                 }
-                                p_Alpha = Math.Max(p_Alpha, nodeWithScoreMax.Grid.Score);
-                            }
+                                else
+                                {
+                                    nodeWithScoreMax = currentNode.Grid.Score > nodeWithScoreMax.Grid.Score ? newNode : nodeWithScoreMax;
+
+                                    if (nodeWithScoreMax.Grid.Score > p_Beta)
+                                    {
+                                        return nodeWithScoreMax;
+                                    }
+                                    p_Alpha = Math.Max(p_Alpha, nodeWithScoreMax.Grid.Score);
+                                }

+                            }
                         }
                     }
                     return nodeWithScoreMax;


[corlib] Mono friendly IO errors

[corlib] Mono friendly IO errors

--- mscorlib/system/io/__error.cs
+++ mscorlib/system/io/__error.cs
@@ -19,7 +19,9 @@

 using System;
 using System.Runtime.InteropServices;
+#if !MONO
 using Win32Native = Microsoft.Win32.Win32Native;
+#endif
 using System.Text;
 using System.Globalization;
 using System.Security;
@@ -126,7 +128,7 @@

             return path;
         }
-
+#if !MONO
         [System.Security.SecuritySafeCritical]  // auto-generated
         internal static void WinIOError() {
             int errorCode = Marshal.GetLastWin32Error();
@@ -216,7 +218,7 @@
                 break;
             }
         }
-
+#endif
         internal static void WriteNotSupported() {
             throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream"));
         }
@@ -224,11 +226,12 @@
         internal static void WriterClosed() {
             throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_WriterClosed"));
         }
-
+#if !MONO
         // From WinError.h
         internal const int ERROR_FILE_NOT_FOUND = Win32Native.ERROR_FILE_NOT_FOUND;
         internal const int ERROR_PATH_NOT_FOUND = Win32Native.ERROR_PATH_NOT_FOUND;
         internal const int ERROR_ACCESS_DENIED  = Win32Native.ERROR_ACCESS_DENIED;
         internal const int ERROR_INVALID_PARAMETER = Win32Native.ERROR_INVALID_PARAMETER;
+#endif
     }
 }


improved NULL handling for Contains

improved NULL handling for Contains

--- mstum.utils/CircularBuffer.cs
+++ mstum.utils/CircularBuffer.cs
@@ -140,15 +140,22 @@
         {
             using (var e = GetEnumerator())
             {
+                if (item == null)
+                {
+                    while (e.MoveNext())
+                    {
+                        if (e.Current == null) { return true; }
+                    }
+                    return false;
+                }
+
+                EqualityComparer<T> comparer = EqualityComparer<T>.Default;
                 while (e.MoveNext())
                 {
-                    if (Equals(e.Current, item))
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
+                    if(comparer.Equals(e.Current, item) { return true; }
+                }
+                return false;
+            }
         }

         public void CopyTo(T[] array, int arrayIndex)


Minor cleanup.

Minor cleanup.

--- Gu.Wpf.UiAutomation/Input/Mouse.cs
+++ Gu.Wpf.UiAutomation/Input/Mouse.cs
@@ -245,14 +245,14 @@
         /// Drags the mouse in one step.
         /// </summary>
         /// <param name="mouseButton">The mouse button to use for dragging.</param>
-        /// <param name="from">Starting point of the drag.</param>
-        /// <param name="to">The distance to drag, + for down, - for up.</param>
+        /// <param name="from">Start point of the drag.</param>
+        /// <param name="to">End point for the drga.</param>
         public static void Drag(MouseButton mouseButton, Point from, Point to)
         {
             Position = from;
             using (Hold(mouseButton))
             {
-                var interpolation = Interpolation.Start(POINT.Create(from), POINT.Create(to), MoveSpeed);
+                var interpolation = Interpolation.Start(from, to, MoveSpeed);
                 while (interpolation.TryGetPosition(out var pos))
                 {
                     if (!User32.SetCursorPos(pos.X, pos.Y))


Use byte[] overload in TgzFileProvider.

Use byte[] overload in TgzFileProvider.

--- Gui/ThemeEngines/GraphiteScheme.cs
+++ Gui/ThemeEngines/GraphiteScheme.cs
@@ -18,10 +18,7 @@
         {
             GraphiteScheme retval = new GraphiteScheme();

-            var stream = new System.IO.MemoryStream(Properties.Resources.agate_black_gui);
-            stream.Seek(0, System.IO.SeekOrigin.Begin);
-
-            TgzFileProvider provider = new TgzFileProvider("agate-black-gui", stream);
+            TgzFileProvider provider = new TgzFileProvider("agate-black-gui", Properties.Resources.agate_black_gui);
             retval.SetDefaults(provider);

             return retval;


Make SerializedNestedStrings public

Make SerializedNestedStrings public

--- Assets/Scripts/Localization/SerializedNestedStrings.cs
+++ Assets/Scripts/Localization/SerializedNestedStrings.cs
@@ -7,7 +7,7 @@
 //Serialization uses tabs for group indentation, key=value for string value lines
 //ToString() returns serialized data

-class SerializedNestedStrings
+public class SerializedNestedStrings
 {
     private class StringData
     {


Removed dud code. Hand location accuracy needs improved.

--- kinectApp/kinectApp/kinectApp/Entities/KinectAdapter.cs
+++ kinectApp/kinectApp/kinectApp/Entities/KinectAdapter.cs
@@ -306,101 +306,6 @@
             return point;
         }

-        /*private void ProcessDepthAndBodyIndex(BodyIndexFrameReference bifRef, DepthFrameReference depthRef)
-        {
-            // We'll access the body index data directly to avoid a copy
-            using (BodyIndexFrame bodyIndexFrame = bifRef.AcquireFrame())
-            {
-                using (DepthFrame depthFrame = )
-                int depthWidth = bodyIndexFrame.FrameDescription.Width;
-                int depthHeight = bodyIndexFrame.FrameDescription.Height;
-                using (KinectBuffer bodyIndexData = bodyIndexFrame.LockImageBuffer())
-                {
-                    unsafe
-                    {
-                        byte* bodyIndexDataPointer = (byte*)bodyIndexData.UnderlyingBuffer;
-
-                        int colorMappedToDepthPointCount = this.colorMappedToDepthPoints.Length;
-
-                        fixed (DepthSpacePoint* colorMappedToDepthPointsPointer = this.colorMappedToDepthPoints)
-                        {
-                            // Treat the color data as 4-byte pixels
-                            uint* bitmapPixelsPointer = (uint*)this.bitmap.BackBuffer;
-
-                            // Loop over each row and column of the color image
-                            // Zero out any pixels that don't correspond to a body index
-                            for (int colorIndex = 0; colorIndex < colorMappedToDepthPointCount; ++colorIndex)
-                            {
-                                float colorMappedToDepthX = colorMappedToDepthPointsPointer[colorIndex].X;
-                                float colorMappedToDepthY = colorMappedToDepthPointsPointer[colorIndex].Y;
-
-                                // The sentinel value is -inf, -inf, meaning that no depth pixel corresponds to this color pixel.
-                                if (!float.IsNegativeInfinity(colorMappedToDepthX) &&
-                                    !float.IsNegativeInfinity(colorMappedToDepthY))
-                                {
-                                    // Make sure the depth pixel maps to a valid point in color space
-                                    int depthX = (int)(colorMappedToDepthX + 0.5f);
-                                    int depthY = (int)(colorMappedToDepthY + 0.5f);
-
-                                    // If the point is not valid, there is no body index there.
-                                    if ((depthX >= 0) && (depthX < depthWidth) && (depthY >= 0) && (depthY < depthHeight))
-                                    {
-                                        int depthIndex = (depthY * depthWidth) + depthX;
-
-                                        // If we are tracking a body for the current pixel, do not zero out the pixel
-                                        if (bodyIndexDataPointer[depthIndex] != 0xff)
-                                        {
-                                            continue;
-                                        }
-                                    }
-                                }
-
-                                bitmapPixelsPointer[colorIndex] = 0;
-                            }
-                        }
-
-                        this.bitmap.AddDirtyRect(new Int32Rect(0, 0, this.bitmap.PixelWidth, this.bitmap.PixelHeight));
-                    }
-                }
-            }
-
-            /*using (BodyIndexFrame bodyFrame = aReference.AcquireFrame())
-            {
-                if (bodyFrame != null)
-                {
-                    bodyFrame.CopyFrameDataToArray
-
-                    Color[] color = new Color[kHeight * kWidth];
-
-                    // Go through each pixel and set the bytes correctly
-                    // Remember, each pixel got a Red, Green and Blue
-                    int index = 0;
-                    for (int y = 0; y < kWidth; y++)
-                    {
-                        for (int x = 0; x < kHeight; x++)
-                        {
-                            Color c = new Color(iColourImageBuffer[index + 0], iColourImageBuffer[index + 1], iColourImageBuffer[index + 2], iColourImageBuffer[index + 3]);
-                            color[y * kHeight + x] = c;
-                            index += 4;
-                        }
-                    }
-
-                    if (iGraphicsDevice.IsDisposed) return;
-                    var video = new Texture2D(iGraphicsDevice, kWidth, kHeight);
-
-
-                    video.SetData(color);
-
-
-                    lock (iVideoLock)
-                    {
-                        iRGBVideo = video;
-                    }
-                }
-
-
-        }*/
-
         //Process a change in the availability of Kinect
         private void KSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
         {


fixed memory leak in TestContent

fixed memory leak in TestContent

--- Fluent/FluentTest/TestContent.xaml.cs
+++ Fluent/FluentTest/TestContent.xaml.cs
@@ -31,7 +31,8 @@
         {
             this.InitializeComponent();

-            ScreenTip.HelpPressed += this.OnScreenTipHelpPressed;
+            this.Loaded += this.HandleTestContentLoaded;
+            this.Unloaded += this.HandleTestContentUnloaded;

             //Ribbon.Localization.Culture = new CultureInfo("ru-RU");

@@ -97,6 +98,16 @@
         private void OnScreenTipHelpPressed(object sender, ScreenTipHelpEventArgs e)
         {
             Process.Start((string)e.HelpTopic);
+        }
+
+        private void HandleTestContentLoaded(object sender, RoutedEventArgs e)
+        {
+            ScreenTip.HelpPressed += this.OnScreenTipHelpPressed;
+        }
+
+        private void HandleTestContentUnloaded(object sender, RoutedEventArgs e)
+        {
+            ScreenTip.HelpPressed -= this.OnScreenTipHelpPressed;
         }

         private void OnLauncherButtonClick(object sender, RoutedEventArgs e)


Add methods

Add methods

--- KLibrary4/Linq/Linq/Composition.cs
+++ KLibrary4/Linq/Linq/Composition.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;

 namespace KLibrary.Linq
 {
@@ -80,5 +81,13 @@
                 yield return Tuple.Create(enumerator1.Current, enumerator2.MoveNext() ? enumerator2.Current : default(TSecond));
             }
         }
+
+        public static Dictionary<TKey, TValue> ZipToDictionary<TKey, TValue>(this IEnumerable<TKey> keys, IEnumerable<TValue> values)
+        {
+            if (keys == null) throw new ArgumentNullException(nameof(keys));
+            if (values == null) throw new ArgumentNullException(nameof(values));
+
+            return keys.Zip(values, (k, v) => new { k, v }).ToDictionary(_ => _.k, _ => _.v);
+        }
     }
 }


clear

clear

--- CSharpGL/OpenGLObjects/VertexBuffers/OneIndexBuffer.cs
+++ CSharpGL/OpenGLObjects/VertexBuffers/OneIndexBuffer.cs
@@ -41,28 +41,25 @@
         /// <summary>
         /// 索引数组中有多少个元素。
         /// </summary>
-        public int ElementCount
+        public int GetElementCount()
         {
-            get
+            int result = 0;
+            switch (this.Type)
             {
-                int result = 0;
-                switch (this.Type)
-                {
-                    case IndexElementType.UnsignedByte:
-                        result = base.ByteLength / sizeof(byte);
-                        break;
-                    case IndexElementType.UnsignedShort:
-                        result = base.ByteLength / sizeof(ushort);
-                        break;
-                    case IndexElementType.UnsignedInt:
-                        result = base.ByteLength / sizeof(uint);
-                        break;
-                    default:
-                        throw new NotImplementedException();
-                }
+                case IndexElementType.UnsignedByte:
+                    result = base.ByteLength / sizeof(byte);
+                    break;
+                case IndexElementType.UnsignedShort:
+                    result = base.ByteLength / sizeof(ushort);
+                    break;
+                case IndexElementType.UnsignedInt:
+                    result = base.ByteLength / sizeof(uint);
+                    break;
+                default:
+                    throw new NotImplementedException();
+            }

-                return result;
-            }
+            return result;
         }

         /// <summary>
@@ -99,9 +96,9 @@
             glBindBuffer(OpenGL.GL_ELEMENT_ARRAY_BUFFER, buffers[0]);
             glBufferData(OpenGL.GL_ELEMENT_ARRAY_BUFFER, this.ByteLength, this.Header, (uint)this.Usage);
             glBindBuffer(OpenGL.GL_ELEMENT_ARRAY_BUFFER, 0);
-
+
             OneIndexBufferPtr bufferPtr = new OneIndexBufferPtr(
-                 buffers[0], this.Mode, 0, this.ElementCount, this.Type, this.Length, this.ByteLength);
+                 buffers[0], this.Mode, 0, this.GetElementCount(), this.Type, this.Length, this.ByteLength);

             return bufferPtr;
         }


falf vector is the same with directional light's direction.

--- Demos/CSharpGL.Demos/Renderers/BasicLightsRenderer.cs
+++ Demos/CSharpGL.Demos/Renderers/BasicLightsRenderer.cs
@@ -11,7 +11,7 @@
         public vec3 AmbientLightColor { get; set; }
         public vec3 DirectionalLightDirection { get; set; }
         public vec3 DirectionalLightColor { get; set; }
-        public vec3 HalfVector { get; set; }
+        //public vec3 HalfVector { get; set; }
         public float Shininess { get; set; }
         public float Strength { get; set; }

@@ -38,7 +38,7 @@
             this.AmbientLightColor = new vec3(0.2f);
             this.DirectionalLightDirection = new vec3(1);
             this.DirectionalLightColor = new vec3(1);
-            this.HalfVector = new vec3(1);
+            //this.HalfVector = new vec3(1);
             this.Shininess = 10.0f;
             this.Strength = 1.0f;
         }
@@ -48,7 +48,8 @@
             this.SetUniform("ambientLight", this.AmbientLightColor);
             this.SetUniform("directionalLightColor", this.DirectionalLightColor);
             this.SetUniform("directionalLightDirection", this.DirectionalLightDirection.normalize());
-            this.SetUniform("halfVector", this.HalfVector.normalize());
+            this.SetUniform("halfVector", this.DirectionalLightDirection.normalize());
+            //this.SetUniform("halfVector", this.HalfVector.normalize());
             this.SetUniform("shininess", this.Shininess);
             this.SetUniform("strength", this.Strength);


Support sensitive variables

Support sensitive variables

--- source/Program.cs
+++ source/Program.cs
@@ -87,6 +87,7 @@
             var deploymentProcess = repository.DeploymentProcesses.Get(project.DeploymentProcessId);

             CreateVariable(repository, project, "serverInstance", @".\SQL2012");
+            CreateVariable(repository, project, "password", "Redg@te1", true);

             deploymentProcess.Steps.Add(new DeploymentStepResource
             {
@@ -138,7 +139,7 @@
             repository.DeploymentProcesses.Modify(deploymentProcess);
         }

-        private static void CreateVariable(IOctopusRepository repository, ProjectResource project, string name, string value)
+        private static void CreateVariable(IOctopusRepository repository, ProjectResource project, string name, string value, bool isSensitive = false)
         {
             var vs = repository.VariableSets.Get(project.VariableSetId);

@@ -146,7 +147,7 @@
             if (v != null)
                 v.Value = value;
             else
-                vs.Variables.Add(new VariableResource {Name = name, Value = value});
+                vs.Variables.Add(new VariableResource {Name = name, Value = value, IsSensitive = isSensitive});

             repository.VariableSets.Modify(vs);
         }


Simplify GetServiceCodes code

Simplify GetServiceCodes code

I'm not sure why you are looping and not just using a copy constructor. There are actually several places where the code could be simplified, but this is one obvious one.

--- DotNetShipping/ShippingProviders/FedExBaseProvider.cs
+++ DotNetShipping/ShippingProviders/FedExBaseProvider.cs
@@ -68,15 +68,7 @@
         {
             if (_serviceCodes != null && _serviceCodes.Count > 0)
             {
-                var serviceCodes = new Dictionary<string, string>();
-
-                foreach (var serviceCodeKey in _serviceCodes.Keys)
-                {
-                    var serviceCode = _serviceCodes[serviceCodeKey];
-                    serviceCodes.Add(serviceCodeKey, serviceCode);
-                }
-
-                return serviceCodes;
+                return new Dictionary<string, string>(_serviceCodes);
             }

             return null;


simplified code in JsonSerializerBuilder

--- Code/Light.Serialization.Json/JsonSerializerBuilder.cs
+++ Code/Light.Serialization.Json/JsonSerializerBuilder.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using Light.GuardClauses;
+using Light.GuardClauses.Exceptions;
 using Light.Serialization.Json.BuilderHelpers;
 using Light.Serialization.Json.Caching;
 using Light.Serialization.Json.ComplexTypeDecomposition;
@@ -81,9 +82,7 @@
             characterEscaper.MustNotBeNull(nameof(characterEscaper));

             Pool.SetFieldAndReplaceInPool(ref _characterEscaper, characterEscaper);
-            ConfigureAll<ISetCharacterEscaper>(o => o.CharacterEscaper = characterEscaper);
-
-            return this;
+            return ConfigureAll<ISetCharacterEscaper>(o => o.CharacterEscaper = characterEscaper);
         }

         /// <summary>
@@ -97,9 +96,7 @@
             typeAnalyzer.MustNotBeNull(nameof(typeAnalyzer));

             Pool.SetFieldAndReplaceInPool(ref _typeAnalyzer, typeAnalyzer);
-            ConfigureAll<ISetTypeAnalyzer>(o => o.TypeAnalyzer = typeAnalyzer);
-
-            return this;
+            return ConfigureAll<ISetTypeAnalyzer>(o => o.TypeAnalyzer = typeAnalyzer);
         }

         /// <summary>
@@ -108,9 +105,14 @@
         /// <param name="formatters">The list containing all formatters to be used.</param>
         /// <returns>The builder for method chaining.</returns>
         /// <exception cref="ArgumentNullException">Thrown when <paramref name="formatters" /> is null.</exception>
-        public JsonSerializerBuilder WithPrimitiveTypeFormatters(IList<IPrimitiveTypeFormatter> formatters)
-        {
+        /// <exception cref="EmptyCollectionException">Thrown when <paramref name="formatters"/> contains no items.</exception>
+        public JsonSerializerBuilder WithPrimitiveTypeFormatters(IEnumerable<IPrimitiveTypeFormatter> formatters)
+        {
+            // ReSharper disable PossibleMultipleEnumeration
+            formatters.MustNotBeNullOrEmpty(nameof(formatters));
+
             return WithPrimitiveTypeFormatters(formatters.ToDictionary(f => f.TargetType));
+            // ReSharper restore PossibleMultipleEnumeration
         }

         /// <summary>
@@ -119,17 +121,16 @@
         /// <param name="formattersMapping">The dictionary containing all formatters to be used.</param>
         /// <returns>The builder for method chaining.</returns>
         /// <exception cref="ArgumentNullException">Thrown when <paramref name="formattersMapping" /> is null.</exception>
+        /// <exception cref="EmptyCollectionException">Thrown when <paramref name="formattersMapping"/> is empty.</exception>
         public JsonSerializerBuilder WithPrimitiveTypeFormatters(IDictionary<Type, IPrimitiveTypeFormatter> formattersMapping)
         {
-            formattersMapping.MustNotBeNull(nameof(formattersMapping));
+            formattersMapping.MustNotBeNullOrEmpty(nameof(formattersMapping));

             Pool.RemoveAll(_primitiveTypeFormattersMapping.Values);
             _primitiveTypeFormattersMapping = formattersMapping;
             Pool.RegisterAll(formattersMapping.Values);

-            ConfigureAll<ISetPrimitiveTypeFormatters>(o => o.PrimitiveTypeFormattersMapping = _primitiveTypeFormattersMapping);
-
-            return this;
+            return ConfigureAll<ISetPrimitiveTypeFormatters>(o => o.PrimitiveTypeFormattersMapping = _primitiveTypeFormattersMapping);
         }

         /// <summary>
@@ -284,9 +285,7 @@
             metadataInstructor.MustNotBeNull(nameof(metadataInstructor));

             Pool.SetFieldAndReplaceInPool(ref _objectMetadataInstructor, metadataInstructor);
-            ConfigureAll<ISetObjectMetadataInstructor>(o => o.MetadataInstructor = metadataInstructor);
-
-            return this;
+            return ConfigureAll<ISetObjectMetadataInstructor>(o => o.MetadataInstructor = metadataInstructor);
         }

         /// <summary>
@@ -300,9 +299,7 @@
             metadataInstructor.MustNotBeNull(nameof(metadataInstructor));

             Pool.SetFieldAndReplaceInPool(ref _collectionMetadataInstructor, metadataInstructor);
-            ConfigureAll<ISetCollectionMetadataInstructor>(o => o.MetadataInstructor = metadataInstructor);
-
-            return this;
+            return ConfigureAll<ISetCollectionMetadataInstructor>(o => o.MetadataInstructor = metadataInstructor);
         }

         /// <summary>
@@ -343,8 +340,7 @@
         /// <returns>The builder for method chaining.</returns>
         public JsonSerializerBuilder DisableObjectReferencePreservation()
         {
-            ConfigureAll<ISetObjectReferencePreservationStatus>(o => o.IsSerializingObjectIds = false);
-            return this;
+            return ConfigureAll<ISetObjectReferencePreservationStatus>(o => o.IsSerializingObjectIds = false);
         }

         /// <summary>
@@ -353,8 +349,7 @@
         /// <returns>The builder for method chaining.</returns>
         public JsonSerializerBuilder EnableObjectReferencePreservation()
         {
-            ConfigureAll<ISetObjectReferencePreservationStatus>(o => o.IsSerializingObjectIds = true);
-            return this;
+            return ConfigureAll<ISetObjectReferencePreservationStatus>(o => o.IsSerializingObjectIds = true);
         }

         /// <summary>
@@ -363,8 +358,7 @@
         /// <returns>The builder for method chaining.</returns>
         public JsonSerializerBuilder DisableTypeMetadata()
         {
-            ConfigureAll<ISetTypeInfoSerializationStatus>(o => o.IsSerializingTypeInfo = false);
-            return this;
+            return ConfigureAll<ISetTypeInfoSerializationStatus>(o => o.IsSerializingTypeInfo = false);
         }

         /// <summary>
@@ -373,8 +367,7 @@
         /// <returns>The builder for method chaining.</returns>
         public JsonSerializerBuilder EnableTypeMetadata()
         {
-            ConfigureAll<ISetTypeInfoSerializationStatus>(o => o.IsSerializingTypeInfo = true);
-            return this;
+            return ConfigureAll<ISetTypeInfoSerializationStatus>(o => o.IsSerializingTypeInfo = true);
         }

         /// <summary>
@@ -388,10 +381,7 @@
             typeToNameMapping.MustNotBeNull(nameof(typeToNameMapping));

             Pool.SetFieldAndReplaceInPool(ref _typeToNameMapping, typeToNameMapping);
-
-            ConfigureAll<ISetTypeToNameMapping>(o => o.TypeToNameMapping = typeToNameMapping);
-
-            return this;
+            return ConfigureAll<ISetTypeToNameMapping>(o => o.TypeToNameMapping = typeToNameMapping);
         }

         /// <summary>
@@ -405,9 +395,7 @@
             keyNormalizer.MustNotBeNull(nameof(keyNormalizer));

             Pool.SetFieldAndReplaceInPool(ref _keyNormalizer, keyNormalizer);
-            ConfigureAll<ISetKeyNormalizer>(o => o.KeyNormalizer = keyNormalizer);
-
-            return this;
+            return ConfigureAll<ISetKeyNormalizer>(o => o.KeyNormalizer = keyNormalizer);
         }

         /// <summary>
@@ -430,8 +418,7 @@
         {
             createWhitespaceFormatter.MustNotBeNull(nameof(createWhitespaceFormatter));

-            ConfigureAll<ISetWhitespaceFormatterCreationDelegate>(o => o.CreateWhitespaceFormatter = createWhitespaceFormatter);
-            return this;
+            return ConfigureAll<ISetWhitespaceFormatterCreationDelegate>(o => o.CreateWhitespaceFormatter = createWhitespaceFormatter);
         }

         /// <summary>


fixed issue with resolving internal template filename

--- Commands/Provisioning/Site/ReadProvisioningTemplate.cs
+++ Commands/Provisioning/Site/ReadProvisioningTemplate.cs
@@ -60,8 +60,16 @@
             XMLTemplateProvider provider;
             if (isOpenOfficeFile)
             {
-                provider = new XMLOpenXMLTemplateProvider(new OpenXMLConnector(templateFileName, fileConnector));
-                templateFileName = templateFileName.Substring(0, templateFileName.LastIndexOf(".", StringComparison.Ordinal)) + ".xml";
+                var openXmlConnector = new OpenXMLConnector(templateFileName, fileConnector);
+                provider = new XMLOpenXMLTemplateProvider(openXmlConnector);
+                if (openXmlConnector.Info?.Properties?.TemplateFileName != null)
+                {
+                    templateFileName = openXmlConnector.Info.Properties.TemplateFileName;
+                }
+                else
+                {
+                    templateFileName = templateFileName.Substring(0, templateFileName.LastIndexOf(".", StringComparison.Ordinal)) + ".xml";
+                }
             }
             else
             {


Helper for Success checking

Helper for Success checking

--- DripDotNet/Protocol/DripResponse.cs
+++ DripDotNet/Protocol/DripResponse.cs
@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Net;

-namespace DripDotNet
+namespace Drip
 {
     /// <summary>
     /// Represents the response received from the Drip REST API. Subclasses of DripResponse
@@ -48,6 +48,11 @@
             return Errors != null && Errors.Count > 0;
         }

+        public bool HasSuccessStatusCode()
+        {
+            return (int)StatusCode < 400 && !HasErrors();
+        }
+
         internal protected virtual void ProcessRestResponse(IRestResponse restResponse)
         {
             if (restResponse == null) return;
@@ -55,16 +60,4 @@
             StatusCode = restResponse.StatusCode;
         }
     }
-
-    /// <summary>
-    /// A response that contains DripSubscriber items.
-    /// </summary>
-    public class DripSubscribersResponse : DripResponse
-    {
-        /// <summary>
-        /// The Subscribers that were returned by the API endpoint.
-        /// </summary>
-        public List<DripSubscriber> Subscribers { get; set; }
-    }
-
 }