Tweaking CORS responses

Tweaking CORS responses

--- Ao3tracksync/Controllers/Attributes.cs
+++ Ao3tracksync/Controllers/Attributes.cs
@@ -38,7 +38,7 @@
     /// <summary>
     /// Attribute to add to classes or methods to allow CORS access
     /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
+    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
     public class AllowCrossSiteAttribute : ActionFilterAttribute
     {
         /// <summary>
@@ -47,22 +47,19 @@
         /// <param name="ActionContext"></param>
         public override void OnActionExecuted(HttpActionExecutedContext ActionContext)
         {
-            var origin = "https://wenchy.net";
             if (ActionContext.Request.Headers.Contains("Origin"))
             {
+                var origin = "https://wenchy.net";
                 var url = ActionContext.Request.Headers.GetValues("Origin").FirstOrDefault();
                 if (!string.IsNullOrWhiteSpace(url)
-                    && Uri.TryCreate(url, UriKind.Absolute, out var uri))
+                    && Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out var uri))
                 {
                     if (uri?.Host == "wenchy.net"
                         || uri?.Scheme?.Contains("extension") == true)
                         origin = url;
                 }
+                ActionContext.Response.Headers.Add("Access-Control-Allow-Origin", origin);
             }
-            if (ActionContext.Response.Headers.Contains("Access-Control-Allow-Origin"))
-                ActionContext.Response.Headers.Remove("Access-Control-Allow-Origin");
-            ActionContext.Response.Headers.Add("Access-Control-Allow-Origin", origin);
-            ActionContext.Response.Headers.Add("Access-Control-Allow-Credentials", "true");

             base.OnActionExecuted(ActionContext);
         }
@@ -80,11 +77,13 @@
         /// <param name="ActionContext"></param>
         public override void OnActionExecuted(HttpActionExecutedContext ActionContext)
         {
-            if (!ActionContext.Response.Headers.Contains("Access-Control-Allow-Origin"))
-                ActionContext.Response.Headers.Add("Access-Control-Allow-Origin", "https://wenchy.net");
-            ActionContext.Response.Headers.Add("Access-Control-Allow-Headers", "Authorization, Content-Type");
-            ActionContext.Response.Headers.Add("Access-Control-Allow-Methods", "GET, POST, PUT, OPTIONS, DELETE");
-            ActionContext.Response.Headers.Add("Access-Control-Max-Age", "604800"); // 1 week
+            if (ActionContext.Request.Headers.Contains("Origin"))
+            {
+                ActionContext.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
+                ActionContext.Response.Headers.Add("Access-Control-Allow-Headers", "Authorization, Content-Type");
+                ActionContext.Response.Headers.Add("Access-Control-Allow-Methods", "GET, POST, PUT, OPTIONS");
+                ActionContext.Response.Headers.Add("Access-Control-Max-Age", "604800"); // 1 week
+            }

             base.OnActionExecuted(ActionContext);
         }


Avance en las validaciones

Avance en las validaciones

--- GUI/FrmAbmAlumno.cs
+++ GUI/FrmAbmAlumno.cs
@@ -8,6 +8,7 @@
 using System.Windows.Forms;
 using Bussines;
 using Entidades;
+using System.Text.RegularExpressions;   // Para validaciones

 namespace GUI
 {
@@ -25,5 +26,49 @@
             ca.insert(new Alumno(txtDni.Text, txtApellido.Text, txtNombre.Text, txtNacimiento.Text, txtTelefono.Text, txtDireccion.Text,
                 txtMail.Text, txtPassword.Text));
         }
+
+        private void validateForm()
+        {
+            // SEGUIR ACA <---------------------------------------------------------------
+        }
+
+#region Metodos para Validaciones
+        // Se agrupan en esta region los metodos privados para la validacion de los campos.
+        // Probablente en un futuro convenga agruparlos en una clase, para que esten todos
+        // juntos y sean reutilizables.
+
+        private bool validate(TextBox txt, String pattern)
+        {
+            // Validacion generica para ahorar codigo
+            Regex regex = new Regex(pattern);
+            return regex.IsMatch(txt.Text);
+        }
+
+        private bool validateMail(TextBox txt)
+        {
+            return validate(txt, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
+        }
+
+        private bool validateDni(TextBox txt)
+        {
+            return validate(txt, @"\d{9}");
+        }
+
+        private bool validateTexto(TextBox txt)
+        {
+            return validate(txt, @"\w+");
+        }
+
+        private bool validateNacimiento(TextBox txt)
+        {
+            return validate(txt, @"(\d{2}/){2}/\d{4}");
+        }
+
+        private bool validateTelefono(TextBox txt)
+        {
+            return validate(txt, @"\d{3,5}-\d{9}");
+        }
+{
+#endregion
     }
 }


build: addressed some code-analysis warnings.


Fixed Run: Access Process.Id in try catch as it can fail with InvalidOperationException

--- Rusty/Cores/Process.cs
+++ Rusty/Cores/Process.cs
@@ -136,12 +136,15 @@
             }

             ErrorLevel = 0;
+            pid = 0;
             try
             {
                 prc.Start();

                 if (wait)
                     prc.WaitForExit();
+
+                pid = prc.Id;
             }
             catch (Exception e)
             {
@@ -150,8 +153,6 @@
                 else if (wait)
                     ErrorLevel = prc.ExitCode;
             }
-
-            pid = prc.Id;
         }

         /// <summary>


Don't remove the message id header when clearing sender message headers

--- RockLib.Messaging/SenderMessage.cs
+++ RockLib.Messaging/SenderMessage.cs
@@ -219,6 +219,13 @@
                     this[HeaderNames.IsBinaryPayload] = true;
             }

+            public void Clear()
+            {
+                var messageId = this[HeaderNames.MessageId];
+                _headers.Clear();
+                this[HeaderNames.MessageId] = messageId;
+            }
+
             public object this[string key]
             {
                 get => _headers[key];
@@ -237,7 +244,6 @@
             public ICollection<object> Values => _headers.Values;
             public int Count => _headers.Count;
             public bool IsReadOnly => _headers.IsReadOnly;
-            public void Clear() => _headers.Clear();
             public bool Contains(KeyValuePair<string, object> item) => _headers.Contains(item);
             public bool ContainsKey(string key) => _headers.ContainsKey(key);
             public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex) => _headers.CopyTo(array, arrayIndex);


update search page

update search page

--- Dotchi/Dotchi/Views/Home/Search.cshtml
+++ Dotchi/Dotchi/Views/Home/Search.cshtml
@@ -61,6 +61,41 @@

+

+

+
詳細資訊

+

+
地址

+
電話

+
營業時間

+
價位

+
官網

+

+

+

+
朋友評價

+				            	@foreach (var commentItem in shopItem.CommentList)
+				            	{
+

+

+

+
+
+

+
@(commentItem.UserDetail.UserName) @(commentItem.Time)

+

+

+
@(commentItem.Text)

+

+
+

+

+

+				            	}
+				                更多朋友評價
+

+
+

 				    more


Dont add subscriptions with no tradeable dates

--- Engine/DataFeeds/FileSystemDataFeed.cs
+++ Engine/DataFeeds/FileSystemDataFeed.cs
@@ -91,18 +91,33 @@
             foreach (var security in _algorithm.Securities.Values)
             {
                 var subscription = CreateSubscription(resultHandler, security, algorithm.StartDate, algorithm.EndDate, _fillForwardResolution, true);
-                _subscriptions.AddOrUpdate(new SymbolSecurityType(security), subscription);
-
-                // prime the pump, run method checks current before move next calls
-                PrimeSubscriptionPump(subscription, true);
-            }
-        }
-
-        private static Subscription CreateSubscription(IResultHandler resultHandler, Security security, DateTime start, DateTime end, Resolution fillForwardResolution, bool userDefined)
+                if (subscription != null)
+                {
+                    _subscriptions.AddOrUpdate(new SymbolSecurityType(security), subscription);
+
+                    // prime the pump, run method checks current before move next calls
+                    PrimeSubscriptionPump(subscription, true);
+                }
+            }
+        }
+
+        private Subscription CreateSubscription(IResultHandler resultHandler, Security security, DateTime start, DateTime end, Resolution fillForwardResolution, bool userDefined)
         {
             var config = security.SubscriptionDataConfig;
             var tradeableDates = Time.EachTradeableDay(security, start.Date, end.Date);
+
+            // ReSharper disable once PossibleMultipleEnumeration
+            if (!tradeableDates.Any())
+            {
+                if (userDefined)
+                {
+                    _algorithm.Error(string.Format("No data loaded for {0} because there were no tradeable dates for this security.", security.Symbol));
+                }
+                return null;
+            }
+
             var symbolResolutionDate = userDefined ? (DateTime?)null : start;
+            // ReSharper disable once PossibleMultipleEnumeration
             IEnumerator<BaseData> enumerator = new SubscriptionDataReader(config, security, start, end, resultHandler, tradeableDates, false, symbolResolutionDate);

             // optionally apply fill forward logic, but never for tick data
@@ -127,6 +142,12 @@
         public void AddSubscription(Security security, DateTime utcStartTime, DateTime utcEndTime)
         {
             var subscription = CreateSubscription(_resultHandler, security, utcStartTime, utcEndTime, security.SubscriptionDataConfig.Resolution, false);
+            if (subscription == null)
+            {
+                // subscription will be null when there's no tradeable dates for the security between the requested times, so
+                // don't even try to load the data
+                return;
+            }
             _subscriptions.AddOrUpdate(new SymbolSecurityType(subscription),  subscription);

             // prime the pump, run method checks current before move next calls
@@ -265,12 +286,6 @@
             var frontier = DateTime.MaxValue;
             foreach (var subscription in Subscriptions)
             {
-                if (subscription.EndOfStream)
-                {
-                    Log.Trace("FileSystemDataFeed.Run(): Failed to load subscription: " + subscription.Configuration.Symbol);
-                    continue;
-                }
-
                 var current = subscription.Current;
                 if (current == null)
                 {
@@ -359,6 +374,7 @@
                 {
                     _algorithm.Error("Failed to load subscription: " + subscription.Security.Symbol);
                 }
+                _subscriptions.TryRemove(new SymbolSecurityType(subscription), out subscription);
             }
         }
     }


Update analytics and add AnalyticsNetworks for handling all analytics logging and events sending.  Currently plugged in GameAnalytics and Google.


Adding the ability to set a limit in the search filter

--- Extensions/Projections/SearchFilter.cs
+++ Extensions/Projections/SearchFilter.cs
@@ -55,7 +55,10 @@
             var settings = _siteService.GetSiteSettings().As<SearchSettingsPart>();
             string index = context.State.Index;

-            var hits = _searchService.Query(query, 0, null, settings.FilterCulture, index, settings.SearchedFields, hit => hit);
+            var hitCountLimit = 0;
+            int.TryParse(context.State.HitCountLimit.ToString(), out hitCountLimit);
+
+            var hits = _searchService.Query(query, 0, hitCountLimit != 0 ? new Nullable<int>(hitCountLimit) : null, settings.FilterCulture, index, settings.SearchedFields, hit => hit);
             if (hits.Any())
             {
                 context.Query.WhereIdIn(hits.Select(hit => hit.ContentItemId));
@@ -103,13 +106,16 @@
                             Title: T("Index"),
                             Description: T("The selected index will be queried."),
                             Size: 5,
-                            Multiple: false
-                            ),
+                            Multiple: false),
                         _SearchQuery: _shapeFactory.Textbox(
                             Id: "SearchQuery", Name: "SearchQuery",
                             Title: T("Search query"),
                             Description: T("The search query to match against."),
-                            Classes: new[] { "tokenized" })
+                            Classes: new[] { "tokenized" }),
+                        _HitCountLimit: _shapeFactory.Textbox(
+                            Id: "HitCountLimit", Name: "HitCountLimit",
+                            Title: T("Hit count limit"),
+                            Description: T("For performance reasons you can limit the maximal number of search hits used in the query. Having thousands of search hits will result in poor performance and increased load on the database server."))
                         );

                     foreach (var index in _indexProvider.List())


Turned issue repro test on again,

Turned issue repro test on again,

since it now works.

--- Hyprlinkr.UnitTest/RouteLinkerTests.cs
+++ Hyprlinkr.UnitTest/RouteLinkerTests.cs
@@ -86,7 +86,7 @@
             var actual = sut.GetUri<FooController>(r => r.GetById(id));

             var baseUri = request.RequestUri.GetLeftPart(UriPartial.Authority);
-            var expected = new Uri(new Uri(baseUri), "api/foo/"+ id);
+            var expected = new Uri(new Uri(baseUri), "api/foo/" + id);
             Assert.Equal(expected, actual);
         }

@@ -103,7 +103,7 @@
                 r.GetWithPloehAndFnaah(ploeh, fnaah));

             var baseUri = request.RequestUri.GetLeftPart(UriPartial.Authority);
-            var expected =
+            var expected =
                 new Uri(
                     new Uri(baseUri),
                     "api/foo?ploeh=" + ploeh + "&fnaah=" + fnaah);
@@ -242,13 +242,21 @@
             Assert.Equal(expected, actual);
         }

-        [Theory(Skip = "Awaiting fix."), AutoHypData]
+        [Theory, AutoHypData]
         public void GetUriFromModelControllerReturnsCorrectResponse(
             [Frozen]HttpRequestMessage request,
-            RouteLinker sut,
+            [Frozen]Mock<IRouteValuesQuery> queryStub,
+            [Frozen(As = typeof(IRouteDispatcher))]DefaultRouteDispatcher dummy,
+            [Greedy]RouteLinker sut,
             SomeModel model)
         {
             request.AddDefaultRoute();
+            queryStub.SetReturnsDefault<IDictionary<string, object>>(
+                new Dictionary<string, object>
+                {
+                    { "number", model.Number.ToString() },
+                    { "text", model.Text }
+                });

             var actual = sut.GetUri<ModelController>(c => c.Get(model));


Apply patch IronLanguages/main#1359 (#240)

--- Src/IronPython/Runtime/LiteralParser.cs
+++ Src/IronPython/Runtime/LiteralParser.cs
@@ -115,6 +115,7 @@
                             case '\n': continue;
 #if FEATURE_COMPRESSION
                             case 'N': {
+                                    IronPython.Modules.unicodedata.PerformModuleReload(null, null);
                                     if (i < l && text[i] == '{') {
                                         i++;
                                         StringBuilder namebuf = new StringBuilder();


Remove unnecessary space in copyright

Remove unnecessary space in copyright

--- SteamChatBot/Properties/AssemblyInfo.cs
+++ SteamChatBot/Properties/AssemblyInfo.cs
@@ -4,7 +4,7 @@
 using System.Runtime.InteropServices;
 using System.Windows;

-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("SteamChatBot")]
@@ -12,16 +12,16 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Steam-Chat-Bot")]
 [assembly: AssemblyProduct("SteamChatBot")]
-[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
 // COM, set the ComVisible attribute to true on that type.
 [assembly: ComVisible(false)]

-//In order to begin building localizable applications, set
+//In order to begin building localizable applications, set
 //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
 //inside a <PropertyGroup>.  For example, if you are using US english
 //in your source files, set the <UICulture> to en-US.  Then uncomment
@@ -33,10 +33,10 @@

 [assembly: ThemeInfo(
     ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
-                                     //(used if a resource is not found in the page,
+                                     //(used if a resource is not found in the page,
                                      // or application resource dictionaries)
     ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
-                                              //(used if a resource is not found in the page,
+                                              //(used if a resource is not found in the page,
                                               // app, or any theme specific resource dictionaries)
 )]

@@ -44,11 +44,11 @@
 // Version information for an assembly consists of the following four values:
 //
 //      Major Version
-//      Minor Version
+//      Minor Version
 //      Build Number
 //      Revision
 //
-// You can specify all the values or you can default the Build and Revision Numbers
+// You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("0.0.1.0")]


+CreateIcon +CopyToSquareCanvas

+CreateIcon
+CopyToSquareCanvas

--- Support.Drawing/Helpers/ImageHelpers.cs
+++ Support.Drawing/Helpers/ImageHelpers.cs
@@ -510,5 +510,31 @@
             }
         }

+        public static Bitmap CopyToSquareCanvas(Bitmap sourceBitmap, Color canvasBackground)
+        {
+            int maxSide = sourceBitmap.Width > sourceBitmap.Height ? sourceBitmap.Width : sourceBitmap.Height;
+            Bitmap bitmapResult = new Bitmap(maxSide, maxSide, PixelFormat.Format32bppArgb);
+            using (Graphics graphicsResult = Graphics.FromImage(bitmapResult))
+            {
+                graphicsResult.Clear(canvasBackground);
+                int xOffset = (sourceBitmap.Width - maxSide) / 2;
+                int yOffset = (sourceBitmap.Height - maxSide) / 2;
+                graphicsResult.DrawImage(sourceBitmap, new Point(xOffset, xOffset));
+            }
+            return bitmapResult;
+        }
+
+        public static Icon CreateIcon(Bitmap sourceBitmap, int iconSize)
+        {
+            Bitmap squareCanvas = CopyToSquareCanvas(sourceBitmap, Color.Transparent);
+            squareCanvas = (Bitmap)squareCanvas.GetThumbnailImage(iconSize, iconSize, null, new IntPtr());
+
+
+            Icon iconResult = Icon.FromHandle(squareCanvas.GetHicon());
+
+
+            return iconResult;
+        }
+
     }
 }


Update ECSRect.cs

Update ECSRect.cs

--- Svelto.ECS/Common/Components/ECSRect.cs
+++ Svelto.ECS/Common/Components/ECSRect.cs
@@ -15,4 +15,5 @@
             height = imageUvRect.height;
         }
     }
-}+}
+#endif


Update Index.cshtml

Update Index.cshtml

Update Lab Announcement to reflect current mission

--- Anlab.Mvc/Views/Home/Index.cshtml
+++ Anlab.Mvc/Views/Home/Index.cshtml
@@ -3,7 +3,7 @@
 }

-
In order to provide testing for on-going essential agricultural research the Analytical Lab will be re-opening on Monday March 30th with normal business hours.  Please feel free to email us before shipping samples if there is any concern about a future closure.

+
We are currently open with normal business hours in order to support on-going essential agricultural research.  Please feel free to email us before shipping samples if there is any concern about a future closure.

The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.

Analytical Laboratory clients are University of California academics, other educational institutions, government agencies, and research-based businesses.


[System]: Mono-specific implementation to get SecureChannel's connection info.

--- System/net/System/Net/_SecureChannel.cs
+++ System/net/System/Net/_SecureChannel.cs
@@ -1112,6 +1112,7 @@
             GlobalLog.Enter("SecureChannel#" + ValidationHelper.HashString(this) + "::ProcessHandshakeSuccess");
 #if MONO
             m_HeaderSize = m_TrailerSize = 0;
+            m_ConnectionInfo = SSPIWrapper.GetConnectionInfo(m_SecModule, m_SecurityContext);
 #else
             StreamSizes streamSizes = SSPIWrapper.QueryContextAttributes(m_SecModule, m_SecurityContext, ContextAttribute.StreamSizes) as StreamSizes;
             if (streamSizes != null) {


removed IMessage.cs since it wasn't in use and caused errors at build time

--- src/Nether.Analytics/IMessage.cs
+++ src/Nether.Analytics/IMessage.cs
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-//// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-//using System;
-//using System.Collections.Generic;
-
-//namespace Nether.Analytics
-//{
-//    public interface IMessage : IVersionedMessageType
-//    {
-//        DateTime EnqueueTimeUtc { get; set; }
-//        Dictionary<string, string> Properties { get; }
-//    }
-//}


Updated file.

Updated file.


cleanup mSPO_AST.cs

cleanup mSPO_AST.cs

--- SPO_CS/src/mSPO_AST.cs
+++ SPO_CS/src/mSPO_AST.cs
@@ -878,8 +878,8 @@
 			case tFalseNode<tPos> _: {
 				return a2 is tFalseNode<tPos>;
 			}
-			case tIntNode<tPos> _1: {
-				return a2 is tIntNode<tPos> _2 && _1.Value == _2.Value;
+			case tIntNode<tPos> Node1: {
+				return a2 is tIntNode<tPos> Node2 && Node1.Value == Node2.Value;
 			}
 			case tEmptyTypeNode<tPos> _: {
 				return a2 is tEmptyTypeNode<tPos>;
@@ -893,40 +893,40 @@
 			case tTypeTypeNode<tPos> _: {
 				return a2 is tTypeTypeNode<tPos>;
 			}
-			case tTextNode<tPos> _1: {
-				return a2 is tTextNode<tPos> _2 && _1.Value == _2.Value;
+			case tTextNode<tPos> Node1: {
+				return a2 is tTextNode<tPos> Node2 && Node1.Value == Node2.Value;
 			}
 			case tIgnoreMatchNode<tPos> _: {
 				return a2 is tIgnoreMatchNode<tPos>;
 			}
-			case tIdentNode<tPos> _1: {
-				return a2 is tIdentNode<tPos> _2 && _1.Name == _2.Name;
-			}
-			case tMatchFreeIdentNode<tPos> _1: {
-				return a2 is tMatchFreeIdentNode<tPos> _2 && _1.Name == _2.Name;
-			}
-			case tMatchTupleNode<tPos> _1: {
-				return (
-					a2 is tMatchTupleNode<tPos> _2 &&
-					mStream.Zip(_1.Items, _2.Items).All(_ => AreEqual(_._1, _._2))
-				);
-			}
-			case tMatchNode<tPos> _1: {
-				return (
-					a2 is tMatchNode<tPos> _2 &&
-					AreEqual(_1.Pattern, _2.Pattern) &&
-					AreEqual(_1.Type, _2.Type)
+			case tIdentNode<tPos> Node1: {
+				return a2 is tIdentNode<tPos> Node2 && Node1.Name == Node2.Name;
+			}
+			case tMatchFreeIdentNode<tPos> Node1: {
+				return a2 is tMatchFreeIdentNode<tPos> Node2 && Node1.Name == Node2.Name;
+			}
+			case tMatchTupleNode<tPos> Node1: {
+				return (
+					a2 is tMatchTupleNode<tPos> Node2 &&
+					mStream.Zip(Node1.Items, Node2.Items).All(_ => AreEqual(_._1, _._2))
+				);
+			}
+			case tMatchNode<tPos> Node1: {
+				return (
+					a2 is tMatchNode<tPos> Node2 &&
+					AreEqual(Node1.Pattern, Node2.Pattern) &&
+					AreEqual(Node1.Type, Node2.Type)
 				);
 			}
 			case tPrefixNode<tPos> _: {
 				break;
 			}
-			case tRecordNode<tPos> _1: {
-				return (
-					a2 is tRecordNode<tPos> _2 &&
+			case tRecordNode<tPos> Node1: {
+				return (
+					a2 is tRecordNode<tPos> Node2 &&
 					mStream.Zip(
-						_1.Elements,
-						_2.Elements
+						Node1.Elements,
+						Node2.Elements
 					).All(
 						_ => (
 							AreEqual(_._1.Key, _._2.Key) &&
@@ -935,12 +935,12 @@
 					)
 				);
 			}
-			case tMatchRecordNode<tPos> _1: {
-				return (
-					a2 is tMatchRecordNode<tPos> _2 &&
+			case tMatchRecordNode<tPos> Node1: {
+				return (
+					a2 is tMatchRecordNode<tPos> Node2 &&
 					mStream.Zip(
-						_1.Elements,
-						_2.Elements
+						Node1.Elements,
+						Node2.Elements
 					).All(
 						_ => (
 							AreEqual(_._1.Key, _._2.Key) &&
@@ -949,21 +949,21 @@
 					)
 				);
 			}
-			case tMatchPrefixNode<tPos> _1: {
-				return (
-					a2 is tMatchPrefixNode<tPos> _2 &&
-					_1.Prefix == _2.Prefix &&
-					AreEqual(_1.Match, _2.Match)
+			case tMatchPrefixNode<tPos> Node1: {
+				return (
+					a2 is tMatchPrefixNode<tPos> Node2 &&
+					Node1.Prefix == Node2.Prefix &&
+					AreEqual(Node1.Match, Node2.Match)
 				);
 			}
 			case tMatchGuardNode<tPos> _: {
 				break;
 			}
-			case tLambdaNode<tPos> _1: {
-				return (
-					a2 is tLambdaNode<tPos> _2 &&
-					AreEqual(_1.Head , _2.Head) &&
-					AreEqual(_1.Body, _2.Body)
+			case tLambdaNode<tPos> Node1: {
+				return (
+					a2 is tLambdaNode<tPos> Node2 &&
+					AreEqual(Node1.Head , Node2.Head) &&
+					AreEqual(Node1.Body, Node2.Body)
 				);
 			}
 			case tMethodNode<tPos> _: {
@@ -972,31 +972,31 @@
 			case tBlockNode<tPos> _: {
 				break;
 			}
-			case tCallNode<tPos> _1: {
-				return (
-					a2 is tCallNode<tPos> _2 &&
-					AreEqual(_1.Func, _2.Func) &&
-					AreEqual(_1.Arg, _2.Arg)
-				);
-			}
-			case tDefNode<tPos> _1: {
-				return (
-					a2 is tDefNode<tPos> _2 &&
-					AreEqual(_1.Src, _2.Src) &&
-					AreEqual(_1.Des, _2.Des)
-				);
-			}
-			case tRecLambdaItemNode<tPos> _1: {
-				return (
-					a2 is tRecLambdaItemNode<tPos> _2 &&
-					AreEqual(_1.Ident, _2.Ident) &&
-					AreEqual(_1.Lambda, _2.Lambda)
-				);
-			}
-			case tRecLambdasNode<tPos> _1: {
-				return (
-					a2 is tRecLambdasNode<tPos> _2 &&
-					mStream.Zip(_1.List, _2.List).All(_ => AreEqual(_._1, _._2))
+			case tCallNode<tPos> Node1: {
+				return (
+					a2 is tCallNode<tPos> Node2 &&
+					AreEqual(Node1.Func, Node2.Func) &&
+					AreEqual(Node1.Arg, Node2.Arg)
+				);
+			}
+			case tDefNode<tPos> Node1: {
+				return (
+					a2 is tDefNode<tPos> Node2 &&
+					AreEqual(Node1.Src, Node2.Src) &&
+					AreEqual(Node1.Des, Node2.Des)
+				);
+			}
+			case tRecLambdaItemNode<tPos> Node1: {
+				return (
+					a2 is tRecLambdaItemNode<tPos> Node2 &&
+					AreEqual(Node1.Ident, Node2.Ident) &&
+					AreEqual(Node1.Lambda, Node2.Lambda)
+				);
+			}
+			case tRecLambdasNode<tPos> Node1: {
+				return (
+					a2 is tRecLambdasNode<tPos> Node2 &&
+					mStream.Zip(Node1.List, Node2.List).All(_ => AreEqual(_._1, _._2))
 				);
 			}
 			case tReturnIfNode<tPos> _: {
@@ -1032,25 +1032,25 @@
 			case tDefVarNode<tPos> _: {
 				break;
 			}
-			case tVarToValNode<tPos> _1: {
-				return (
-					a2 is tVarToValNode<tPos> _2 &&
-					AreEqual(_1.Obj, _2.Obj)
-				);
-			}
-			case tMethodCallNode<tPos> _1: {
-				return (
-					a2 is tMethodCallNode<tPos> _2 &&
-					AreEqual(_1.Method, _2.Method) &&
-					AreEqual(_1.Argument, _2.Argument) &&
-					AreEqual(_1.Result, _2.Result)
-				);
-			}
-			case tMethodCallsNode<tPos> _1: {
-				return (
-					a2 is tMethodCallsNode<tPos> _2 &&
-					AreEqual(_1.Object, _2.Object) &&
-					mStream.Zip(_1.MethodCalls, _2.MethodCalls).All(_ => AreEqual(_._1, _._2))
+			case tVarToValNode<tPos> Node1: {
+				return (
+					a2 is tVarToValNode<tPos> Node2 &&
+					AreEqual(Node1.Obj, Node2.Obj)
+				);
+			}
+			case tMethodCallNode<tPos> Node1: {
+				return (
+					a2 is tMethodCallNode<tPos> Node2 &&
+					AreEqual(Node1.Method, Node2.Method) &&
+					AreEqual(Node1.Argument, Node2.Argument) &&
+					AreEqual(Node1.Result, Node2.Result)
+				);
+			}
+			case tMethodCallsNode<tPos> Node1: {
+				return (
+					a2 is tMethodCallsNode<tPos> Node2 &&
+					AreEqual(Node1.Object, Node2.Object) &&
+					mStream.Zip(Node1.MethodCalls, Node2.MethodCalls).All(_ => AreEqual(_._1, _._2))
 				);
 			}
 			case tPipeToRightNode<tPos> _: {
@@ -1059,10 +1059,10 @@
 			case tPipeToLeftNode<tPos> _: {
 				break;
 			}
-			case tTupleNode<tPos> _1: {
-				return (
-					a2 is tTupleNode<tPos> _2 &&
-					mStream.Zip(_1.Items, _2.Items).All(_ => AreEqual(_._1, _._2))
+			case tTupleNode<tPos> Node1: {
+				return (
+					a2 is tTupleNode<tPos> Node2 &&
+					mStream.Zip(Node1.Items, Node2.Items).All(_ => AreEqual(_._1, _._2))
 				);
 			}
 			case tImportNode<tPos> _: {
@@ -1080,5 +1080,4 @@
 		}
 		throw mError.Error("not implemented: " + a1.GetType().Name);
 	}
-
 }


new working version

new working version


Add `ShareMode` property

Add `ShareMode` property

--- src/PcscDotNet/PcscConnection.cs
+++ src/PcscDotNet/PcscConnection.cs
@@ -18,6 +18,8 @@

         public string ReaderName { get; private set; }

+        public SCardShare ShareMode { get; private set; } = SCardShare.Undefined;
+
         public PcscConnection(PcscContext context, string readerName)
         {
             Provider = (Context = context).Provider;
@@ -35,6 +37,7 @@
             SCardHandle handle;
             Provider.SCardConnect(Context.Handle, ReaderName, shareMode, protocols, &handle, &protocols).ThrowIfNotSuccess(onException);
             Handle = handle;
+            ShareMode = shareMode;
             Protocols = protocols;
             return this;
         }
@@ -58,6 +61,7 @@
         {
             if (IsDisposed) throw new ObjectDisposedException(nameof(PcscConnection), nameof(Reconnect));
             Provider.SCardReconnect(Handle, shareMode, protocols, initializationDisposition, &protocols).ThrowIfNotSuccess(onException);
+            ShareMode = shareMode;
             Protocols = protocols;
             return this;
         }
@@ -67,6 +71,7 @@
             if (!IsConnect) return;
             Provider.SCardDisconnect(Handle, disposition).ThrowIfNotSuccess(onException);
             Handle = SCardHandle.Default;
+            ShareMode = SCardShare.Undefined;
             Protocols = SCardProtocols.Undefined;
         }
     }


doc comment update

doc comment update

--- src/Peachpie.Runtime/PhpValue.cs
+++ src/Peachpie.Runtime/PhpValue.cs
@@ -17,7 +17,7 @@
     /// Represents a PHP value.
     /// </summary>
     /// <remarks>
-    /// Note, <c>default(PhpValue)</c> does not represent a valid state of the object.
+    /// Note, <c>default(PhpValue)</c> represents a <c>NULL</c> value, equivalent to <see cref="PhpValue.Null"/>.
     /// </remarks>
     [StructLayout(LayoutKind.Sequential)]
     public readonly partial struct PhpValue : IPhpConvertible, IEquatable<PhpValue> // <T>


Additional test, evaluate length of vector

--- Src/RSharp.Core.Tests/EvaluateTests.cs
+++ Src/RSharp.Core.Tests/EvaluateTests.cs
@@ -36,6 +36,15 @@

             Assert.IsNotNull(result);
             Assert.AreEqual(2, result);
+        }
+
+        [TestMethod]
+        public void EvaluateVectorLength()
+        {
+            var result = Evaluate("length(c(1,2,3))");
+
+            Assert.IsNotNull(result);
+            Assert.AreEqual(3, result);
         }

         [TestMethod]


Variable name change

Variable name change

Old name: PreviousPivot
New name: LastPivot

--- Assets/BoxStairsTool/BoxStairs.cs
+++ Assets/BoxStairsTool/BoxStairs.cs
@@ -36,6 +36,7 @@

         [SerializeField]
         private PivotType Pivot;
+        private PivotType LastPivot;
         [SerializeField]
         private float StairsWidth;
         [SerializeField]
@@ -59,8 +60,6 @@

         private GameObject Root;

-        private PivotType PreviousPivot;
-
         private void Start ()
         {
             Root = this.gameObject;
@@ -70,7 +69,7 @@
         public BoxStairs ()
         {
             Pivot = PivotType.Downstairs;
-            PreviousPivot = PivotType.Downstairs;
+            LastPivot = PivotType.Downstairs;
             StairsWidth = 1.0f;
             StairsHeight = 0.5f;
             StairsDepth = 1.0f;
@@ -199,20 +198,20 @@
                 }
             }

-            if (Pivot != PreviousPivot)
-            {
-                if (Pivot == PivotType.Downstairs && PreviousPivot == PivotType.Upstairs)
+            if (Pivot != LastPivot)
+            {
+                if (Pivot == PivotType.Downstairs && LastPivot == PivotType.Upstairs)
                 {
                     Root.transform.position = Root.transform.position - (StairsDepth * Root.transform.forward);
                     Root.transform.position = Root.transform.position - (StairsHeight * Root.transform.up);
                 }
-                else // if (Pivot == PivotType.Upstairs && PreviousPivot == PivotType.Downstairs)
+                else // if (Pivot == PivotType.Upstairs && LastPivot == PivotType.Downstairs)
                 {
                     Root.transform.position = Root.transform.position + (StairsDepth * Root.transform.forward);
                     Root.transform.position = Root.transform.position + (StairsHeight * Root.transform.up);
                 }

-                PreviousPivot = Pivot;
+                LastPivot = Pivot;
             }
         }


Evaluate call defined function, WIP|

Evaluate call defined function, WIP|

--- Src/RSharp.Core.Tests/EvaluateTests.cs
+++ Src/RSharp.Core.Tests/EvaluateTests.cs
@@ -98,6 +98,15 @@
             Assert.IsInstanceOfType(result, typeof(DefinedFunction));
         }

+        [TestMethod]
+        public void EvaluateCallFunctionExpression()
+        {
+            var result = Evaluate("function (a) return(a+1) (1)");
+
+            Assert.IsNotNull(result);
+            Assert.IsInstanceOfType(2, typeof(DefinedFunction));
+        }
+
         private static object Evaluate(string text)
         {
             Machine machine = new Machine();


Pushing new row the moment you mess up combo

--- Assets/Code/Models/Player/Ship.cs
+++ Assets/Code/Models/Player/Ship.cs
@@ -69,7 +69,7 @@
         public void RecordHit(Block block)
         {
             this.outstandingBlocks.Add(block);
-            if (this.outstandingBlocks.Count == 3)
+            if (this.outstandingBlocks.Count == 3 || this.outstandingBlocks.Count == 2 && block.BlockType != this.outstandingBlocks[0].BlockType)
             {
                 this.Match(this, new MatchEventArgs(this.outstandingBlocks.ToArray()));
                 this.outstandingBlocks.Clear();


Expose logical tree events on IControl.

Expose logical tree events on IControl.

--- src/Perspex.Controls/IControl.cs
+++ src/Perspex.Controls/IControl.cs
@@ -1,6 +1,7 @@
 // Copyright (c) The Perspex Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.

+using System;
 using Perspex.Controls.Templates;
 using Perspex.Input;
 using Perspex.Layout;
@@ -13,6 +14,16 @@
     /// </summary>
     public interface IControl : IVisual, ILogical, ILayoutable, IInputElement, INamed, IStyleable, IStyleHost
     {
+        /// <summary>
+        /// Raised when the control is attached to a rooted logical tree.
+        /// </summary>
+        event EventHandler<LogicalTreeAttachmentEventArgs> AttachedToLogicalTree;
+
+        /// <summary>
+        /// Raised when the control is detached from a rooted logical tree.
+        /// </summary>
+        event EventHandler<LogicalTreeAttachmentEventArgs> DetachedFromLogicalTree;
+
         /// <summary>
         /// Gets or sets the control's styling classes.
         /// </summary>


NULL Check

NULL Check

--- Assets/Scripts/AI/AIController.cs
+++ Assets/Scripts/AI/AIController.cs
@@ -86,7 +86,9 @@
 		}

 		if (savedPlatform == null) {
-			savedPlatform = AI.currentPlatform.GetComponent<Platform> ();
+			if (AI.currentPlatform != null) {
+				savedPlatform = AI.currentPlatform.GetComponent<Platform> ();
+			}
 		} else if (AI.currentPlatform != null && savedPlatform.transform != AI.currentPlatform) {
 			savedPlatform = AI.currentPlatform.GetComponent<Platform> ();
 			jumpingToNextPlatform = false;


blood added

blood added


update multi state demo

update multi state demo

--- Assets/Slua/example/MultiState.cs
+++ Assets/Slua/example/MultiState.cs
@@ -14,24 +14,21 @@
 	}

 	void complete() {
-
+		// create 10 lua state
+		for (int n = 0; n < 10; n++) {
+			ls[n] = new LuaState ();
+			ls[n].doString (string.Format ("print('this is #{0} lua state')", n));
+		}
 	}

 	// Update is called once per frame
 	void Update () {
-
-		// create 10 lua state
-		for (int n = 0; n < 2; n++) {
-			ls[n] = new LuaState ();
-			ls[n].doString (string.Format ("print('this is #{0} lua state')", n));
-			ls [n].Dispose ();
-		}

 	}

 	void OnDestroy() {
-//		for (int n = 0; n < 10; n++) {
-//			ls [n].Dispose ();
-//		}
+		for (int n = 0; n < 10; n++) {
+			ls [n].Dispose ();
+		}
 	}
 }


working on University

working on University

--- Assignment5/BackEnd/University.cs
+++ Assignment5/BackEnd/University.cs
@@ -46,7 +46,7 @@
         {
             Func<string[], Student<Int64>> makeStudent = (line) =>
             {
-                int id = Convert.ToInt32(line[0]);
+                var id = Convert.ToInt64(line[0]);
                 string name = line[1];
                 DateTime birth = DateTime.Parse(line[2]);
                 string address = line[3];
@@ -123,9 +123,26 @@
                        where e.StudentId == studentId
                        select this.FindPaper(e.PaperCode);
             return data.ToList();
-            //var student = FindStudent(studentId);
-            //var ret = from entry in Enrollment where entry.Value.Contains(student) select entry.Key;
-            //return ret.ToList();
+        }
+
+        public bool Enrol(Int64 paperCode, Int64 studentId)
+        {
+            if(this.Papers.Contains(this.FindPaper(paperCode))
+                && this.Students.Contains(this.FindStudent(studentId)))
+                return this.Enrollments.Add(new Enrollment<long>(paperCode, studentId));
+            else
+                return false;
+        }
+
+        public bool Enrol(string line)
+        {
+            string[] buff = line.Split(',');
+            long paperCode = 0, studentId = 0;
+            if (!long.TryParse(buff[0], out paperCode))
+                throw new Exception(buff[0] + " is not a valid paper code");
+            if (!long.TryParse(buff[1], out studentId))
+                throw new Exception(buff[1] + " is not a valid student id");
+            return this.Enrol(paperCode, studentId);
         }
     }
 }


Issue 49: Generated nested static Types class should be partial

--- src/ProtoGen/MessageGenerator.cs
+++ src/ProtoGen/MessageGenerator.cs
@@ -242,7 +242,7 @@
                 writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]");
                 writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]",
                                  GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version);
-                writer.WriteLine("public static class Types {");
+                writer.WriteLine("public static partial class Types {");
                 writer.Indent();
                 WriteChildren(writer, null, Descriptor.EnumTypes);
                 WriteChildren(writer, null, Descriptor.NestedTypes);


add HasInitRequest()

add HasInitRequest()

--- Unity/ABFetcher/ABFetcherLoaderBase.cs
+++ Unity/ABFetcher/ABFetcherLoaderBase.cs
@@ -28,6 +28,11 @@
 		Debug.LogWarning("ActiveOverrideBundleFolderURL() _URL" + _URL);
 		s_IsActiveOverrideBundleFolder = _Active ;
 		s_OverrideBundleFolderURL = _URL ;
+	}
+
+	public bool HasInitRequest()
+	{
+		return (null != m_InitRequest );
 	}

 	public bool IsInitialized


Adding some working examples as point of reference

--- src/ReportWriter/GraphManager.cs
+++ src/ReportWriter/GraphManager.cs
@@ -6,44 +6,215 @@
     public class GraphManager : IGraphManager
     {
         // TODO: make this customizable
-         public void DefineChart(Document document)
-         {
-             document.AddSection();
-
-             Paragraph paragraph = document.LastSection.AddParagraph("Chart Overview", "Heading1");
-             paragraph.AddBookmark("Charts");
-
-             document.LastSection.AddParagraph("Sample Chart", "Heading2");
-
-             var chart = new Chart
-                 {
-                     Left = 0,
-                     Width = Unit.FromCentimeter(16),
-                     Height = Unit.FromCentimeter(12)
-                 };
-
-             var series = chart.SeriesCollection.AddSeries();
-             series.ChartType = ChartType.Column2D;
-             series.Add(new double[] {1, 17, 45, 5, 3, 20, 11, 23, 8, 19});
-             series.HasDataLabel = true;
-
-             series = chart.SeriesCollection.AddSeries();
-             series.ChartType = ChartType.Line;
-             series.Add(new double[] {41, 7, 5, 45, 13, 10, 21, 13, 18, 9});
-
-             var xseries = chart.XValues.AddXSeries();
-             xseries.Add("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N");
-
-             chart.XAxis.MajorTickMark = TickMarkType.Outside;
-             chart.XAxis.Title.Caption = "X-Axis";
-
-             chart.YAxis.MajorTickMark = TickMarkType.Outside;
-             chart.YAxis.HasMajorGridlines = true;
-
-             chart.PlotArea.LineFormat.Color = Colors.DarkGoldenrod;
-             chart.PlotArea.LineFormat.Width = 1;
-
-             document.LastSection.Add(chart);
-         }
+        public void DefineChart(Document document)
+        {
+            document.AddSection();
+
+            Paragraph paragraph = document.LastSection.AddParagraph("Chart Overview", "Heading1");
+            paragraph.AddBookmark("Charts");
+
+            document.LastSection.AddParagraph("Sample Chart", "Heading2");
+
+            ComboGraphExample(document);
+            //BarChartExample(document);
+            //BarStackedChartExample(document);
+            //AreaChartExample(document);
+            //PieChartExample(document);
+            //ExplodedPieChartExample(document);
+        }
+
+        private void ComboGraphExample(Document document)
+        {
+            var chart = new Chart
+                {
+                    Left = 0,
+                    Width = Unit.FromCentimeter(16),
+                    Height = Unit.FromCentimeter(12)
+                };
+
+            var series = chart.SeriesCollection.AddSeries();
+            series.ChartType = ChartType.Column2D;
+            series.Add(new double[] { 1, 17, 45, 5, 3, 20, 11, 23, 8, 19 });
+            series.HasDataLabel = true;
+
+            series = chart.SeriesCollection.AddSeries();
+            series.ChartType = ChartType.Line;
+            series.Add(new double[] { 4, 17, 5, 25, 13, 6, 42, 31, 11, 28 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.ChartType = ChartType.Line;
+            series.Add(new double[] { 41, 7, 5, 45, 13, 10, 21, 13, 18, 9 });
+
+            var xseries = chart.XValues.AddXSeries();
+            xseries.Add("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N");
+
+            chart.XAxis.MajorTickMark = TickMarkType.Outside;
+            chart.XAxis.Title.Caption = "X-Axis";
+
+            chart.YAxis.MajorTickMark = TickMarkType.Outside;
+            chart.YAxis.HasMajorGridlines = true;
+
+            chart.PlotArea.LineFormat.Color = Colors.DarkGoldenrod;
+            chart.PlotArea.LineFormat.Width = 1;
+
+            document.LastSection.Add(chart);
+        }
+
+        private void BarChartExample(Document document)
+        {
+            var chart = new Chart
+                {
+                    Left = 0,
+                    Width = Unit.FromCentimeter(16),
+                    Height = Unit.FromCentimeter(12),
+                    Type = ChartType.Bar2D
+                };
+
+            Series series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 1";
+            series.Add(new double[] { 1, 5, -3, 20, 11 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 2";
+            series.Add(new double[] { 22, 4, 12, 8, 12 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 3";
+            series.Add(new double[] { 12, 14, 2, 18, 1 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 4";
+            series.Add(new double[] { 17, 13, 10, 9, 15 });
+
+            chart.XAxis.MajorTickMark = TickMarkType.Outside;
+            chart.XAxis.Title.Caption = "X-Axis";
+
+            chart.YAxis.MajorTickMark = TickMarkType.Outside;
+            chart.YAxis.HasMajorGridlines = true;
+
+            chart.PlotArea.LineFormat.Color = Colors.DarkGray;
+            chart.PlotArea.LineFormat.Width = 1;
+            chart.PlotArea.LineFormat.Visible = true;
+
+            chart.DataLabel.Type = DataLabelType.Value;
+            chart.DataLabel.Position = DataLabelPosition.InsideEnd;
+
+            document.LastSection.Add(chart);
+        }
+
+        private void BarStackedChartExample(Document document)
+        {
+            var chart = new Chart
+                {
+                    Left = 0,
+                    Width = Unit.FromCentimeter(16),
+                    Height = Unit.FromCentimeter(12),
+                    Type = ChartType.BarStacked2D
+                };
+
+            Series series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 1";
+            series.Add(new double[] { 1, 5, -3, 20, 11 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 2";
+            series.Add(new double[] { 22, 4, 12, 8, 12 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 3";
+            series.Add(new double[] { 12, 14, 2, 18, 1 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Name = "Series 4";
+            series.Add(new double[] { 17, 13, 10, 9, 15 });
+
+            chart.XAxis.MajorTickMark = TickMarkType.Outside;
+            chart.XAxis.Title.Caption = "X-Axis";
+
+            chart.YAxis.MajorTickMark = TickMarkType.Outside;
+            chart.YAxis.HasMajorGridlines = true;
+
+            chart.PlotArea.LineFormat.Color = Colors.DarkGray;
+            chart.PlotArea.LineFormat.Width = 1;
+            chart.PlotArea.LineFormat.Visible = true;
+
+            chart.DataLabel.Type = DataLabelType.Value;
+            chart.DataLabel.Position = DataLabelPosition.Center;
+
+            document.LastSection.Add(chart);
+        }
+
+        private void AreaChartExample(Document document)
+        {
+            var chart = new Chart
+                {
+                    Left = 0,
+                    Width = Unit.FromCentimeter(16),
+                    Height = Unit.FromCentimeter(12),
+                    Type = ChartType.Area2D
+                };
+
+            Series series = chart.SeriesCollection.AddSeries();
+            series.Add(new double[] { 31, 9, 15, 28, 13 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Add(new double[] { 22, 7, 12, 21, 12 });
+
+            series = chart.SeriesCollection.AddSeries();
+            series.Add(new double[] { 16, 5, 3, 20, 11 });
+
+            chart.XAxis.TickLabels.Format = "00";
+            chart.XAxis.MajorTickMark = TickMarkType.Outside;
+            chart.XAxis.Title.Caption = "X-Axis";
+
+            chart.YAxis.MajorTickMark = TickMarkType.Outside;
+            chart.YAxis.HasMajorGridlines = true;
+
+            chart.PlotArea.LineFormat.Color = Colors.DarkGray;
+            chart.PlotArea.LineFormat.Width = 1;
+            chart.PlotArea.LineFormat.Visible = true;
+
+            document.LastSection.Add(chart);
+        }
+
+        private void PieChartExample(Document document)
+        {
+            var chart = new Chart
+                {
+                    Left = 0,
+                    Width = Unit.FromCentimeter(16),
+                    Height = Unit.FromCentimeter(12),
+                    Type = ChartType.Pie2D
+                };
+
+            var series = chart.SeriesCollection.AddSeries();
+            series.Add(new double[] { 1, 5, 11, -3, 20 });
+
+            var xseries = chart.XValues.AddXSeries();
+            xseries.Add("Production", "Lab", "Licenses", "Taxes", "Insurances");
+            chart.DataLabel.Type = DataLabelType.Percent;
+            chart.DataLabel.Position = DataLabelPosition.OutsideEnd;
+
+            document.LastSection.Add(chart);
+        }
+
+        private void ExplodedPieChartExample(Document document)
+        {
+            var chart = new Chart
+            {
+                Left = 0,
+                Width = Unit.FromCentimeter(16),
+                Height = Unit.FromCentimeter(12),
+                Type = ChartType.PieExploded2D
+            };
+
+            var series = chart.SeriesCollection.AddSeries();
+            series.Add(new double[] { 1, 17, 45, 5, 3, 20, 11, 23, 8, 19, 34, 56, 23, 45 });
+
+            chart.DataLabel.Type = DataLabelType.Percent;
+            chart.DataLabel.Position = DataLabelPosition.Center;
+
+            document.LastSection.Add(chart);
+        }
     }
 }


Pass only SpentOutputs

Pass only SpentOutputs

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -619,7 +619,7 @@
 						TransactionCache.TryAdd(tx);

 						// If it's being mixed and anonset is not sufficient, then queue it.
-						if (newCoin.Unspent && ChaumianClient.HasIngredients && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet && SpendsEnqueued(tx.Transaction))
+						if (newCoin.Unspent && ChaumianClient.HasIngredients && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet && SpendsEnqueued(newCoin.SpentOutputs))
 						{
 							Task.Run(async () =>
 							{
@@ -679,12 +679,12 @@
 		/// <summary>
 		/// Tests if a transaction already spends an enqueued coin or not.
 		/// </summary>
-		private bool SpendsEnqueued(Transaction transaction)
-		{
-			foreach (var input in transaction.Inputs)
+		private bool SpendsEnqueued(IEnumerable<TxoRef> spentInputs)
+		{
+			foreach (var input in spentInputs)
 			{
 				// If it's enqueued.
-				var enqueued = ChaumianClient.State.GetSingleOrDefaultCoin(new TxoRef(input.PrevOut.Hash, input.PrevOut.N));
+				var enqueued = ChaumianClient.State.GetSingleOrDefaultCoin(new TxoRef(input.TransactionId, input.Index));
 				if (enqueued != null)
 				{
 					return true;


Fix CF

Fix CF

--- WalletWasabi/Wallets/PasswordFinder.cs
+++ WalletWasabi/Wallets/PasswordFinder.cs
@@ -40,7 +40,9 @@
 				catch (SecurityException)
 				{
 				}
-				var percentage = (int)((float)++attempts / maxNumberAttempts * 100);
+
+				attempts++;
+				var percentage = (int)((float)attempts / maxNumberAttempts * 100);

 				reportPercentage.Invoke(percentage);
 			}


サムネイルオプション修正

サムネイルオプション修正

--- Shanghai/CameraTask.cs
+++ Shanghai/CameraTask.cs
@@ -52,7 +52,7 @@

             Directory.CreateDirectory(dirPath);
             var p = Process.Start("raspistill",
-                string.Format(@"-o ""{0}"" -thumb {1}", filePath, ThumOption));
+                string.Format(@"-o ""{0}"" -th {1}", filePath, ThumOption));
             p.WaitForExit();

             // Create thumb


Add a few more <see>

Add a few more <see>

--- src/SetupApi.Desktop/SetupApi.cs
+++ src/SetupApi.Desktop/SetupApi.cs
@@ -120,8 +120,8 @@
         /// <param name="deviceInterfaceDetailData">
         /// A pointer to an SP_DEVICE_INTERFACE_DETAIL_DATA structure to receive
         /// information about the specified interface. This parameter is optional and can be <see langword="null" />. This
-        /// parameter must be <see langword="null" /> if DeviceInterfaceDetailSize is zero. If this parameter is specified, the
-        /// caller must set DeviceInterfaceDetailData.cbSize to sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) before calling this
+        /// parameter must be <see langword="null" /> if <paramref name="deviceInterfaceDetailDataSize"/> is zero. If this parameter is specified, the
+        /// caller must set <paramref name="deviceInterfaceDetailData"/>.cbSize to sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) before calling this
         /// function. The cbSize member always contains the size of the fixed part of the data structure, not a size reflecting the
         /// variable-length string at the end.
         /// </param>
@@ -165,7 +165,7 @@
         /// </param>
         /// <param name="memberIndex">A zero-based index of the device information element to retrieve.</param>
         /// <param name="deviceInfoData">
-        /// A pointer to an SP_DEVINFO_DATA structure to receive information about an enumerated
+        /// A pointer to an <see cref="DeviceInfoData"/> structure to receive information about an enumerated
         /// device information element. The caller must set <see cref="DeviceInfoData.Size" /> before calling this function either
         /// manually or via <see cref="DeviceInfoData.Create" />.
         /// </param>


Fixed WP8 push notification callback not firing in time

--- SharedSource/Helper.cs
+++ SharedSource/Helper.cs
@@ -30,42 +30,42 @@

 namespace MarkerMetro.Unity.WinIntegration
 {
-    /// <summary>
-    /// Integration Helpers
-    /// </summary>
-    public class Helper
-    {
-
-        private static Helper _instance;
-        private static readonly object _sync = new object();
-
-        public static Helper Instance
-        {
-            get
-            {
-                lock (_sync)
-                {
-                    if (_instance == null)
-                        _instance = new Helper();
-                }
-                return _instance;
-            }
-        }
-
-        /// <summary>
-        /// Fired when the App visibility has changed
-        /// </summary>
-        /// <remarks>
-        /// This should be activated in CommonMainPage.cs, when a Window.Current.VisibilityChanged happens.
-        /// </remarks>
-        public Action<bool> OnVisibilityChanged;
-
-        /// <summary>
-        /// Returns the application package version
-        /// </summary>
-        /// <returns></returns>
-        public string GetAppVersion()
-        {
+	/// <summary>
+	/// Integration Helpers
+	/// </summary>
+	public class Helper
+	{
+
+		private static Helper _instance;
+		private static readonly object _sync = new object();
+
+		public static Helper Instance
+		{
+			get
+			{
+				lock (_sync)
+				{
+					if (_instance == null)
+						_instance = new Helper();
+				}
+				return _instance;
+			}
+		}
+
+		/// <summary>
+		/// Fired when the App visibility has changed
+		/// </summary>
+		/// <remarks>
+		/// This should be activated in CommonMainPage.cs, when a Window.Current.VisibilityChanged happens.
+		/// </remarks>
+		public Action<bool> OnVisibilityChanged;
+
+		/// <summary>
+		/// Returns the application package version
+		/// </summary>
+		/// <returns></returns>
+		public string GetAppVersion()
+		{
 #if NETFX_CORE
             var major = Package.Current.Id.Version.Major;
             var minor = Package.Current.Id.Version.Minor.ToString();
@@ -74,20 +74,20 @@
             var version = String.Format("{0}.{1}.{2}.{3}", major, minor, build, revision);
             return version;
 #elif WINDOWS_PHONE
-            return XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
+			return XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
 #else
             return String.Empty;
 #endif
-        }
-
-        /// <summary>
-        /// Clears all local state
-        /// </summary>
-        /// <remarks>
-        /// used to clear all local state from the app
-        /// </remarks>
-        public void ClearLocalState(Action<bool> callback)
-        {
+		}
+
+		/// <summary>
+		/// Clears all local state
+		/// </summary>
+		/// <remarks>
+		/// used to clear all local state from the app
+		/// </remarks>
+		public void ClearLocalState(Action<bool> callback)
+		{
 #if NETFX_CORE
             Dispatcher.InvokeOnUIThread(async () =>
             {
@@ -108,28 +108,28 @@
                 }
             });
 #elif WINDOWS_PHONE
-            try
-            {
-                using (var store = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication())
-                {
-                    store.Remove();
-                }
-                if (callback != null)
-                {
-                    Dispatcher.InvokeOnAppThread(() => callback(true));
-                };
-            }
-            catch
-            {
-                if (callback != null)
-                {
-                    Dispatcher.InvokeOnAppThread(() => callback(false));
-                };
-            }
+			try
+			{
+				using (var store = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication())
+				{
+					store.Remove();
+				}
+				if (callback != null)
+				{
+					Dispatcher.InvokeOnAppThread(() => callback(true));
+				};
+			}
+			catch
+			{
+				if (callback != null)
+				{
+					Dispatcher.InvokeOnAppThread(() => callback(false));
+				};
+			}
 #else
              throw new PlatformNotSupportedException("ClearLocalState");
 #endif
-        }
+		}

 		public void GetPushChannel(string channelName, Action<string> callback)
 		{
@@ -162,17 +162,25 @@
 				{
 					pushChannel = new HttpNotificationChannel(channelName);

-					pushChannel.ChannelUriUpdated += (s, e) => { channelUri = e.ChannelUri.ToString(); };
+					pushChannel.ChannelUriUpdated += (s, e) =>
+					{
+						channelUri = e.ChannelUri.ToString();
+						if (callback != null)
+							Dispatcher.InvokeOnAppThread(() => callback(channelUri));
+					};

 					pushChannel.Open();
 					pushChannel.BindToShellToast();
 					pushChannel.BindToShellTile();
 				}
 				else
+				{
 					channelUri = pushChannel.ChannelUri.ToString();
-
-				if (callback != null)
-					Dispatcher.InvokeOnAppThread(() => callback(channelUri));
+					if (callback != null)
+						Dispatcher.InvokeOnAppThread(() => callback(channelUri));
+				}
+
+
 			}
 			catch
 			{
@@ -184,28 +192,28 @@
 #endif
 		}

-        /// <summary>
-        /// Returns the application language
-        /// </summary>
-        /// <remarks>
-        /// it's important to use this call rather than Unity APIs, which just return the top system language
-        /// </remarks>
-        public string GetAppLanguage()
-        {
+		/// <summary>
+		/// Returns the application language
+		/// </summary>
+		/// <remarks>
+		/// it's important to use this call rather than Unity APIs, which just return the top system language
+		/// </remarks>
+		public string GetAppLanguage()
+		{
 #if NETFX_CORE
             return Windows.Globalization.ApplicationLanguages.Languages[0];
 #elif WINDOWS_PHONE
+			return System.Globalization.CultureInfo.CurrentUICulture.Name;
+#else
             return System.Globalization.CultureInfo.CurrentUICulture.Name;
-#else
-            return System.Globalization.CultureInfo.CurrentUICulture.Name;
-#endif
-        }
-
-        /// <summary>
-        /// Show the Share UI
-        /// </summary>
-        public void ShowShareUI()
-        {
+#endif
+		}
+
+		/// <summary>
+		/// Show the Share UI
+		/// </summary>
+		public void ShowShareUI()
+		{
 #if NETFX_CORE
             try
             {
@@ -221,47 +229,47 @@
             }

 #elif WINDOWS_PHONE
-            var guidString = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("ProductID").Value;
-            var productId = guidString.TrimStart('{').TrimEnd('}').ToLower();
-            var task = new MarketplaceDetailTask();
-            task.Show();
-#endif
-        }
-
-        /// <summary>
-        /// Show the Share UI with a link - WP8 only
-        /// </summary>
-        /// <param name="text"></param>
-        /// <param name="linkURL"></param>
-        public void ShowShareUI(string text, string linkURL)
-        {
-            ShowShareUI(text, text, linkURL);
-        }
-
-        /// <summary>
-        /// Show the Share UI with a link - WP8 only
-        /// </summary>
-        /// <param name="text"></param>
-        /// <param name="message"></param>
-        /// <param name="linkURL"></param>
-        public void ShowShareUI(string text, string message, string linkURL)
-        {
+			var guidString = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("ProductID").Value;
+			var productId = guidString.TrimStart('{').TrimEnd('}').ToLower();
+			var task = new MarketplaceDetailTask();
+			task.Show();
+#endif
+		}
+
+		/// <summary>
+		/// Show the Share UI with a link - WP8 only
+		/// </summary>
+		/// <param name="text"></param>
+		/// <param name="linkURL"></param>
+		public void ShowShareUI(string text, string linkURL)
+		{
+			ShowShareUI(text, text, linkURL);
+		}
+
+		/// <summary>
+		/// Show the Share UI with a link - WP8 only
+		/// </summary>
+		/// <param name="text"></param>
+		/// <param name="message"></param>
+		/// <param name="linkURL"></param>
+		public void ShowShareUI(string text, string message, string linkURL)
+		{
 #if NETFX_CORE
             throw new NotImplementedException("Not implemented for Windows Store Apps, use ShowShareUI() instead.");
 #elif WINDOWS_PHONE
-            var task = new ShareLinkTask();
-            task.Title = text;
-            task.Message = message;
-            task.LinkUri = new Uri(linkURL);
-            task.Show();
-#endif
-        }
-
-        /// <summary>
-        /// Show the Rate UI
-        /// </summary>
-        public void ShowRateUI()
-        {
+			var task = new ShareLinkTask();
+			task.Title = text;
+			task.Message = message;
+			task.LinkUri = new Uri(linkURL);
+			task.Show();
+#endif
+		}
+
+		/// <summary>
+		/// Show the Rate UI
+		/// </summary>
+		public void ShowRateUI()
+		{
 #if NETFX_CORE
             Dispatcher.InvokeOnUIThread(
                 async () =>
@@ -283,42 +291,42 @@
 # endif
                     }
                 });
-#elif WINDOWS_PHONE
-            Dispatcher.InvokeOnUIThread(() =>
-            {
-                var marketplaceReviewTask = new MarketplaceReviewTask();
-                marketplaceReviewTask.Show();
-            });
+#elif WINDOWS_PHONE
+			Dispatcher.InvokeOnUIThread(() =>
+			{
+				var marketplaceReviewTask = new MarketplaceReviewTask();
+				marketplaceReviewTask.Show();
+			});
 #else
             throw new NotImplementedException("Not implemented for unknown platform");
 #endif
-        }
-
-        /// <summary>
-        /// Uses a roaming Guid for Windows 8 and the device id for WP8
-        /// </summary>
-        /// <returns></returns>
-        public string GetUserDeviceId()
-        {
+		}
+
+		/// <summary>
+		/// Uses a roaming Guid for Windows 8 and the device id for WP8
+		/// </summary>
+		/// <returns></returns>
+		public string GetUserDeviceId()
+		{
 #if WINDOWS_PHONE
-            const string key = "UserDeviceId";
-
-            var store = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
-
-            if (!store.Contains(key))
-            {
-                var anid = Math.Abs(UserExtendedProperties.GetValue("ANID2").GetHashCode()).ToString();
-                var did = Math.Abs(DeviceExtendedProperties.GetValue("DeviceUniqueId").GetHashCode()).ToString();
-
-                store[key] = anid + did;
-                try
-                {
-                    store.Save();
-                }
-                catch { }
-            }
-
-            return (string)store[key];
+			const string key = "UserDeviceId";
+
+			var store = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
+
+			if (!store.Contains(key))
+			{
+				var anid = Math.Abs(UserExtendedProperties.GetValue("ANID2").GetHashCode()).ToString();
+				var did = Math.Abs(DeviceExtendedProperties.GetValue("DeviceUniqueId").GetHashCode()).ToString();
+
+				store[key] = anid + did;
+				try
+				{
+					store.Save();
+				}
+				catch { }
+			}
+
+			return (string)store[key];
 #elif NETFX_CORE
             const string key = "UserDeviceId";

@@ -334,57 +342,57 @@
 #else
             throw new PlatformNotSupportedException("GetUserDeviceId()");
 #endif
-        }
-
-        /// <summary>
-        /// Returns the device manufacturer name.
-        /// </summary>
-        public string GetManufacturer()
-        {
+		}
+
+		/// <summary>
+		/// Returns the device manufacturer name.
+		/// </summary>
+		public string GetManufacturer()
+		{
 #if WINDOWS_PHONE
-            return DeviceStatus.DeviceManufacturer;
+			return DeviceStatus.DeviceManufacturer;
 #elif NETFX_CORE
             return new EasClientDeviceInformation().SystemManufacturer;
 #else
             throw new PlatformNotSupportedException("GetManufacturer()");
 #endif
-        }
-
-        /// <summary>
-        /// Returns the device model (e.g. "NOKIA Lumia 720").
-        /// </summary>
-        /// <remarks>
-        /// If we need a more friendly name on WP8, read this:
-        /// http://stackoverflow.com/questions/17425016/information-about-windows-phone-model-number
-        /// </remarks>
-        public string GetModel()
-        {
+		}
+
+		/// <summary>
+		/// Returns the device model (e.g. "NOKIA Lumia 720").
+		/// </summary>
+		/// <remarks>
+		/// If we need a more friendly name on WP8, read this:
+		/// http://stackoverflow.com/questions/17425016/information-about-windows-phone-model-number
+		/// </remarks>
+		public string GetModel()
+		{
 #if WINDOWS_PHONE
-            return DeviceStatus.DeviceName;
+			return DeviceStatus.DeviceName;
 #elif NETFX_CORE
             return new EasClientDeviceInformation().SystemProductName;
 #else
             throw new PlatformNotSupportedException("GetManufacturer()");
 #endif

-        }
-
-        /// <summary>
-        /// Returns the application's store url. Note: This won't be valid until the apps are published
-        /// </summary>
-        /// <returns></returns>
-        public string GetAppStoreUri()
-        {
+		}
+
+		/// <summary>
+		/// Returns the application's store url. Note: This won't be valid until the apps are published
+		/// </summary>
+		/// <returns></returns>
+		public string GetAppStoreUri()
+		{
 #if WINDOWS_PHONE
-            return "http://www.windowsphone.com/s?appid=" + CurrentApp.AppId;
+			return "http://www.windowsphone.com/s?appid=" + CurrentApp.AppId;
 #elif NETFX_CORE
             return "ms-windows-store:PDP?PFN=" + Package.Current.Id.FamilyName;
 #else
             return "";
 #endif
-        }
-
-
+		}
+
+

 #if NETFX_CORE
         public enum ProcessorArchitecture : ushort
@@ -423,24 +431,24 @@
         internal static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);
 #endif

-        /// <summary>
-        /// Determine whether or not a Windows device is generally considered low end
-        /// </summary>
-        /// <returns>Windows 8 Arm or Windows Phone Low Mem returns true</returns>
-        public bool IsLowEndDevice()
-        {
+		/// <summary>
+		/// Determine whether or not a Windows device is generally considered low end
+		/// </summary>
+		/// <returns>Windows 8 Arm or Windows Phone Low Mem returns true</returns>
+		public bool IsLowEndDevice()
+		{
 #if WINDOWS_PHONE
-            long result = 0;
-            try
-            {
-                result = (long)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");
-            }
-            catch (ArgumentOutOfRangeException)
-            {
-                // The device does not support querying for this value. This occurs
-                // on Windows Phone OS 7.1 and older phones without OS updates.
-            }
-            return result <= 188743680; // less than or equal to 180MB including failure scenario
+			long result = 0;
+			try
+			{
+				result = (long)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");
+			}
+			catch (ArgumentOutOfRangeException)
+			{
+				// The device does not support querying for this value. This occurs
+				// on Windows Phone OS 7.1 and older phones without OS updates.
+			}
+			return result <= 188743680; // less than or equal to 180MB including failure scenario

 #elif NETFX_CORE
             var systemInfo = new SYSTEM_INFO();
@@ -450,14 +458,14 @@
 #else
             return false;
 #endif
-        }
-
-        public bool HasInternetConnection
-        {
-            get
-            {
+		}
+
+		public bool HasInternetConnection
+		{
+			get
+			{
 #if WINDOWS_PHONE
-                return Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsNetworkAvailable;
+				return Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsNetworkAvailable;
 #elif NETFX_CORE
                 var profile = NetworkInformation.GetInternetConnectionProfile();
                 return profile != null &&
@@ -465,42 +473,42 @@
 #else
                 throw new PlatformNotSupportedException("HasInternetConnection");
 #endif
-            }
-        }
-
-        public bool IsMeteredConnection
-        {
-            get
-            {
+			}
+		}
+
+		public bool IsMeteredConnection
+		{
+			get
+			{
 #if WINDOWS_PHONE || NETFX_CORE
-                var profile = NetworkInformation.GetInternetConnectionProfile();
-                return profile.GetConnectionCost().NetworkCostType != NetworkCostType.Unrestricted;
+				var profile = NetworkInformation.GetInternetConnectionProfile();
+				return profile.GetConnectionCost().NetworkCostType != NetworkCostType.Unrestricted;
 #else
                 throw new PlatformNotSupportedException("IsMeteredConnection");
 #endif
-            }
-        }
-
-        public void ShowDialog(string contentKey, string titleKey, Action callback)
-        {
+			}
+		}
+
+		public void ShowDialog(string contentKey, string titleKey, Action callback)
+		{
 #if WINDOWS_PHONE || NETFX_CORE
-            if (string.IsNullOrWhiteSpace(contentKey))
-                throw new ArgumentNullException("You must specify content resource key");
-
-            Dispatcher.InvokeOnUIThread(() =>
-            {
-                var resourceHelper = ResourceHelper.GetInstance();
-                var content = resourceHelper.GetString(contentKey);
-                var title = string.Empty;
-                if(titleKey!=null)
-                    title = resourceHelper.GetString(titleKey);
+			if (string.IsNullOrWhiteSpace(contentKey))
+				throw new ArgumentNullException("You must specify content resource key");
+
+			Dispatcher.InvokeOnUIThread(() =>
+			{
+				var resourceHelper = ResourceHelper.GetInstance();
+				var content = resourceHelper.GetString(contentKey);
+				var title = string.Empty;
+				if (titleKey != null)
+					title = resourceHelper.GetString(titleKey);

 # if WINDOWS_PHONE
-                MessageBox.Show(content, title, MessageBoxButton.OK);
-
-                if (callback != null)
-                    Dispatcher.InvokeOnAppThread(() => callback());
-            });
+				MessageBox.Show(content, title, MessageBoxButton.OK);
+
+				if (callback != null)
+					Dispatcher.InvokeOnAppThread(() => callback());
+			});
 # elif NETFX_CORE
                 ShowDialogAsync(contentKey, titleKey, callback).ContinueWith(t => { });
             });
@@ -508,22 +516,22 @@
 #else
             throw new PlatformNotSupportedException("ShowDialog");
 #endif
-        }
-
-        public void ShowDialog(string content, string title, Action<bool> callback, string okText = "", string cancelText = "")
-        {
+		}
+
+		public void ShowDialog(string content, string title, Action<bool> callback, string okText = "", string cancelText = "")
+		{
 # if WINDOWS_PHONE
-            MessageBoxResult res;
-            Dispatcher.InvokeOnUIThread(() =>
-            {
-                if (string.IsNullOrWhiteSpace(okText) || (string.IsNullOrWhiteSpace(cancelText)))
-                    res = MessageBox.Show(content, title, MessageBoxButton.OK);
-                else
-                    res = MessageBox.Show(content, title, MessageBoxButton.OKCancel);
-
-                if (callback != null)
-                    Dispatcher.InvokeOnAppThread(() => callback(res == MessageBoxResult.OK));
-            });
+			MessageBoxResult res;
+			Dispatcher.InvokeOnUIThread(() =>
+			{
+				if (string.IsNullOrWhiteSpace(okText) || (string.IsNullOrWhiteSpace(cancelText)))
+					res = MessageBox.Show(content, title, MessageBoxButton.OK);
+				else
+					res = MessageBox.Show(content, title, MessageBoxButton.OKCancel);
+
+				if (callback != null)
+					Dispatcher.InvokeOnAppThread(() => callback(res == MessageBoxResult.OK));
+			});
 # elif NETFX_CORE

             Dispatcher.InvokeOnUIThread(() =>
@@ -533,7 +541,7 @@
 #else
             throw new PlatformNotSupportedException("ShowDialog");
 #endif
-        }
+		}

 #if NETFX_CORE
         async Task ShowDialogAsync(string content, string title, Action callback)
@@ -575,8 +583,8 @@
         }
 #endif

-        public void ChooseEmailContacts(Action<IList<EmailContact>> callback, string buttonText = "Select")
-        {
+		public void ChooseEmailContacts(Action<IList<EmailContact>> callback, string buttonText = "Select")
+		{
 #if NETFX_CORE
             ContactPicker picker = new ContactPicker();
             picker.CommitButtonText = buttonText;
@@ -609,44 +617,44 @@
             });

 #elif WINDOWS_PHONE
-            Contacts contacts = new Contacts();
-
-            Action<object, ContactsSearchEventArgs> onCompleted = (sender, e) =>
-                {
-                    Dispatcher.InvokeOnUIThread(() =>
-                    {
-                        List<EmailContact> contactList = new List<EmailContact>();
-                        foreach (var contact in e.Results)
-                            foreach (var em in contact.EmailAddresses)
-                                contactList.Add(new EmailContact(contact.DisplayName, em.EmailAddress));
-
-                        Dispatcher.InvokeOnAppThread(() =>
-                        {
-                            if(callback != null)
-                                callback(contactList);
-                        });
-                    });
-                };
-            contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(onCompleted);
-            Dispatcher.InvokeOnUIThread(() =>
-            {
-                contacts.SearchAsync(String.Empty, FilterKind.None, "");
-            });
+			Contacts contacts = new Contacts();
+
+			Action<object, ContactsSearchEventArgs> onCompleted = (sender, e) =>
+				{
+					Dispatcher.InvokeOnUIThread(() =>
+					{
+						List<EmailContact> contactList = new List<EmailContact>();
+						foreach (var contact in e.Results)
+							foreach (var em in contact.EmailAddresses)
+								contactList.Add(new EmailContact(contact.DisplayName, em.EmailAddress));
+
+						Dispatcher.InvokeOnAppThread(() =>
+						{
+							if (callback != null)
+								callback(contactList);
+						});
+					});
+				};
+			contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(onCompleted);
+			Dispatcher.InvokeOnUIThread(() =>
+			{
+				contacts.SearchAsync(String.Empty, FilterKind.None, "");
+			});
 #else
             throw new PlatformNotSupportedException();
 #endif
-        }
-
-        /// <summary>
-        /// Win8 - Launches a mailto: URI
-        /// WP8 - Calls email compose task
-        /// </summary>
-        /// <param name="to">A ; delimited list of email addresses to send the message to</param>
-        /// <param name="subject">The subject of the message</param>
-        /// <param name="body">The body of the message</param>
-        /// <param name="callback">The callback method with a bool param, true = success, false = failed</param>
-        public void SendEmail(string to, string subject, string body, Action<bool, string> callback)
-        {
+		}
+
+		/// <summary>
+		/// Win8 - Launches a mailto: URI
+		/// WP8 - Calls email compose task
+		/// </summary>
+		/// <param name="to">A ; delimited list of email addresses to send the message to</param>
+		/// <param name="subject">The subject of the message</param>
+		/// <param name="body">The body of the message</param>
+		/// <param name="callback">The callback method with a bool param, true = success, false = failed</param>
+		public void SendEmail(string to, string subject, string body, Action<bool, string> callback)
+		{
 #if NETFX_CORE
             Dispatcher.InvokeOnUIThread(async () =>
             {
@@ -655,37 +663,40 @@
                 callback(success, to);
             });
 #elif WINDOWS_PHONE
-            Dispatcher.InvokeOnUIThread(() =>
-            {
-                var task = new EmailComposeTask {
-                    To = to, Subject = subject, Body = body
-                };
-                task.Show();
-            });
-#endif
-        }
-
-        public class EmailContact
-        {
-            public string name { get; private set; }
-            public string email {get ; private set; }
-            public EmailContact(string name, string email)
-            {
-                this.name = name;
-                this.email = email;
-            }
-        }
+			Dispatcher.InvokeOnUIThread(() =>
+			{
+				var task = new EmailComposeTask
+				{
+					To = to,
+					Subject = subject,
+					Body = body
+				};
+				task.Show();
+			});
+#endif
+		}
+
+		public class EmailContact
+		{
+			public string name { get; private set; }
+			public string email { get; private set; }
+			public EmailContact(string name, string email)
+			{
+				this.name = name;
+				this.email = email;
+			}
+		}

 #if !NETFX_CORE
-        public System.Net.EndPoint GetDnsEndPoint(string host, int port)
-        {
-            // DnsEndPoint only exists on Windows Phone
+		public System.Net.EndPoint GetDnsEndPoint(string host, int port)
+		{
+			// DnsEndPoint only exists on Windows Phone
 #if WINDOWS_PHONE
-            return new System.Net.DnsEndPoint(host, port);
+			return new System.Net.DnsEndPoint(host, port);
 #else
             throw new PlatformNotSupportedException();
 #endif
-        }
-#endif
-    }
+		}
+#endif
+	}
 }


Update code

Update code

--- WinrtSample/SensorUwp/MainPage.xaml.cs
+++ WinrtSample/SensorUwp/MainPage.xaml.cs
@@ -48,7 +48,7 @@
             compass.ReadingChanged += (o, e) => RunOnUIAsync(() => notifyCompass(e.Reading));
         }

-        void RunOnUIAsync(DispatchedHandler action) =>
-            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, action);
+        async void RunOnUIAsync(DispatchedHandler action) =>
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, action);
     }
 }


Cleanup.

Cleanup.

--- WmcSoft.Components/Drawing/Pipeline.cs
+++ WmcSoft.Components/Drawing/Pipeline.cs
@@ -41,17 +41,9 @@
             _transformations = new List<ImageTransformation>();
         }

-        public int Count {
-            get {
-                return _transformations.Count;
-            }
-        }
+        public int Count => _transformations.Count;

-        public bool IsReadOnly {
-            get {
-                return ((ICollection<ImageTransformation>)_transformations).IsReadOnly;
-            }
-        }
+        public bool IsReadOnly => false;

         public bool PreserveProperties { get; set; }

@@ -101,7 +93,7 @@

         public IEnumerator<ImageTransformation> GetEnumerator()
         {
-            return ((ICollection<ImageTransformation>)_transformations).GetEnumerator();
+            return _transformations.GetEnumerator();
         }

         public bool Remove(ImageTransformation item)
@@ -111,7 +103,7 @@

         IEnumerator IEnumerable.GetEnumerator()
         {
-            return ((ICollection<ImageTransformation>)_transformations).GetEnumerator();
+            return GetEnumerator();
         }
     }
-}+}


[Gtk] Fix Image drawing during widget reallocation

--- Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs
+++ Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs
@@ -521,9 +521,17 @@
 		{
 			if (image.IsNull)
 				return true;
-
-			int x = (int)(((float)Allocation.Width - (float)image.Size.Width) * xalign);
-			int y = (int)(((float)Allocation.Height - (float)image.Size.Height) * yalign);
+			var a = Allocation;
+
+			// HACK: Gtk sends sometimes an expose/draw event while the widget reallocates.
+			//       In that case we would draw in the wrong area, which may lead to artifacts
+			//       if no other widget updates it. Alternative: we could clip the
+			//       allocation bounds, but this may have other issues.
+			if (a.Width == 1 && a.Height == 1 && a.X == -1 && a.Y == -1) // the allocation coordinates on reallocation
+				return base.OnDrawn (cr);
+
+			int x = (int)(((float)a.Width - (float)image.Size.Width) * xalign);
+			int y = (int)(((float)a.Height - (float)image.Size.Height) * yalign);
 			if (x < 0) x = 0;
 			if (y < 0) y = 0;
 			((GtkImage)image.Backend).Draw (actx, cr, Util.GetScaleFactor (this), x, y, image);


LUCENENET-365 Significant performance improvement for CompressionTools

git-svn-id: b2dcba4c53c5fa0a86ccceee81d7e0ce197ae049@940122 13f79535-47bb-0310-9956-ffa450edef68

--- C#/src/Lucene.Net/SupportClass.cs
+++ C#/src/Lucene.Net/SupportClass.cs
@@ -2176,74 +2176,120 @@

         public class Inflater
         {
-            object inflaterInstance = null;
-            Type inflaterType;
+            delegate void SetInputDelegate(byte[] buffer);
+            delegate bool GetIsFinishedDelegate();
+            delegate int InflateDelegate(byte[] buffer);
+
+            SetInputDelegate setInputMethod;
+            GetIsFinishedDelegate getIsFinishedMethod;
+            InflateDelegate inflateMethod;

             internal Inflater(object inflaterInstance)
             {
-                this.inflaterInstance = inflaterInstance;
-                this.inflaterType = inflaterInstance.GetType();
+                Type type = inflaterInstance.GetType();
+
+                setInputMethod = (SetInputDelegate)Delegate.CreateDelegate(
+                    typeof(SetInputDelegate),
+                    inflaterInstance,
+                    type.GetMethod("SetInput", new Type[] { typeof(byte[]) }));
+
+                getIsFinishedMethod = (GetIsFinishedDelegate)Delegate.CreateDelegate(
+                    typeof(GetIsFinishedDelegate),
+                    inflaterInstance,
+                    type.GetMethod("get_IsFinished", Type.EmptyTypes));
+
+                inflateMethod = (InflateDelegate)Delegate.CreateDelegate(
+                    typeof(InflateDelegate),
+                    inflaterInstance,
+                    type.GetMethod("Inflate", new Type[] { typeof(byte[]) }));
             }

             public void SetInput(byte[] buffer)
             {
-                inflaterType.InvokeMember("SetInput", System.Reflection.BindingFlags.InvokeMethod, null, inflaterInstance, new object[] { buffer });
+                setInputMethod(buffer);
             }

             public bool IsFinished
             {
-                get
-                {
-                    return (bool)inflaterType.InvokeMember("get_IsFinished", System.Reflection.BindingFlags.InvokeMethod, null, inflaterInstance, null);
-                }
+                get { return getIsFinishedMethod(); }
             }

             public int Inflate(byte[] buffer)
             {
-                return (int)inflaterType.InvokeMember("Inflate", System.Reflection.BindingFlags.InvokeMethod, null, inflaterInstance, new object[] { buffer });
+                return inflateMethod(buffer);
             }
         }

         public class Deflater
         {
+            delegate void SetLevelDelegate(int level);
+            delegate void SetInputDelegate(byte[] input, int offset, int count);
+            delegate void FinishDelegate();
+            delegate bool GetIsFinishedDelegate();
+            delegate int DeflateDelegate(byte[] output);
+
+            SetLevelDelegate setLevelMethod;
+            SetInputDelegate setInputMethod;
+            FinishDelegate finishMethod;
+            GetIsFinishedDelegate getIsFinishedMethod;
+            DeflateDelegate deflateMethod;
+
             public const int BEST_COMPRESSION = 9;

-            object deflaterInstance = null;
-            Type deflaterType;
-
             internal Deflater(object deflaterInstance)
             {
-                this.deflaterInstance = deflaterInstance;
-                this.deflaterType = deflaterInstance.GetType();
+                Type type = deflaterInstance.GetType();
+
+                setLevelMethod = (SetLevelDelegate)Delegate.CreateDelegate(
+                    typeof(SetLevelDelegate),
+                    deflaterInstance,
+                    type.GetMethod("SetLevel", new Type[] { typeof(int) }));
+
+                setInputMethod = (SetInputDelegate)Delegate.CreateDelegate(
+                    typeof(SetInputDelegate),
+                    deflaterInstance,
+                    type.GetMethod("SetInput", new Type[] { typeof(byte[]), typeof(int), typeof(int) }));
+
+                finishMethod = (FinishDelegate)Delegate.CreateDelegate(
+                    typeof(FinishDelegate),
+                    deflaterInstance,
+                    type.GetMethod("Finish", Type.EmptyTypes));
+
+                getIsFinishedMethod = (GetIsFinishedDelegate)Delegate.CreateDelegate(
+                    typeof(GetIsFinishedDelegate),
+                    deflaterInstance,
+                    type.GetMethod("get_IsFinished", Type.EmptyTypes));
+
+                deflateMethod = (DeflateDelegate)Delegate.CreateDelegate(
+                    typeof(DeflateDelegate),
+                    deflaterInstance,
+                    type.GetMethod("Deflate", new Type[] { typeof(byte[]) }));
             }

             public void SetLevel(int level)
             {
-                deflaterType.InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, deflaterInstance, new object[] { level });
+                setLevelMethod(level);
             }

             public void SetInput(byte[] input, int offset, int count)
             {
-                deflaterType.InvokeMember("SetInput", System.Reflection.BindingFlags.InvokeMethod, null, deflaterInstance, new object[] { input,offset,count });
+                setInputMethod(input, offset, count);
             }

             public void Finish()
             {
-                deflaterType.InvokeMember("Finish", System.Reflection.BindingFlags.InvokeMethod, null, deflaterInstance, null);
+                finishMethod();
             }

             public bool IsFinished
             {
-                get
-                {
-                    return (bool)deflaterType.InvokeMember("get_IsFinished", System.Reflection.BindingFlags.InvokeMethod, null, deflaterInstance, null); ;
-                }
+                get { return getIsFinishedMethod(); }
             }

             public int Deflate(byte[] output)
             {
-                return (int)deflaterType.InvokeMember("Deflate", System.Reflection.BindingFlags.InvokeMethod, null, deflaterInstance, new object[] { output });
+                return deflateMethod(output);
             }
         }
     }


Renamed cubicMilimeters to cubicMillimeters.

--- Src/UnitsNet/Volume.cs
+++ Src/UnitsNet/Volume.cs
@@ -141,9 +141,9 @@
             return new Volume(cubicCentimeters * CubicCentimetersToCubicMetersRatio);
         }

-        public static Volume FromCubicMillimeters(double cubicMilimeters)
-        {
-            return new Volume(cubicMilimeters * CubicMillimetersToCubicMetersRatio);
+        public static Volume FromCubicMillimeters(double cubicMillimeters)
+        {
+            return new Volume(cubicMillimeters * CubicMillimetersToCubicMetersRatio);
         }

         public static Volume FromHectoliters(double hectoliters)


Scaffolding for DomainListener

Scaffolding for DomainListener

--- pddlnet/pddl.cs
+++ pddlnet/pddl.cs
@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using System.IO;
 using Antlr4.Runtime;

@@ -16,6 +17,189 @@
 }

 internal class DomainListener : pddlBaseListener {
+    HashSet<object> objects = new HashSet<object>();
+    HashSet<object> operators = new HashSet<object>();
+    List<object> scopes = new List<object>();
+    List<object> negativescopes = new List<object>();
+    bool typesdef = false;
+
+
+    public override void EnterActionDef(pddlParser.ActionDefContext ctx) {
+        /*
+        opname = ctx.actionSymbol().getText()
+        opvars = {}
+        self.scopes.append(Operator(opname))
+        */
+    }
+
+    public override void ExitActionDef(pddlParser.ActionDefContext ctx) {
+        /*
+        action = self.scopes.pop()
+        self.operators[action.operator_name] = action
+        */
+    }
+
+    public override void EnterPredicatesDef(pddlParser.PredicatesDefContext ctx) {
+        /*
+        self.scopes.append(Operator(None))
+        */
+    }
+
+    public override void ExitPredicatesDef(pddlParser.PredicatesDefContext ctx) {
+        /*
+        dummyop = self.scopes.pop()
+        */
+    }
+
+    public override void EnterTypesDef(pddlParser.TypesDefContext ctx) {
+        /*
+        self.scopes.append(Obj())
+        */
+    }
+
+    public override void ExitTypesDef(pddlParser.TypesDefContext ctx) {
+        /*
+        self.typesdef = True
+        self.scopes.pop()
+        */
+    }
+
+    public override void EnterTypedVariableList(pddlParser.TypedVariableListContext ctx) {
+        /*
+        # print("-> tvar")
+        for v in ctx.VARIABLE():
+            vname = v.getText()
+            self.scopes[-1].variable_list[v.getText()] = None
+        for vs in ctx.singleTypeVarList():
+            t = vs.r_type().getText()
+            for v in vs.VARIABLE():
+                vname = v.getText()
+                self.scopes[-1].variable_list[vname] = t
+        */
+    }
+
+    public override void EnterAtomicTermFormula(pddlParser.AtomicTermFormulaContext ctx) {
+        /*
+        # print("-> terf")
+        neg = self.negativescopes[-1]
+        pred = []
+        for c in ctx.getChildren():
+            n = c.getText()
+            if n == '(' or n == ')':
+                continue
+            pred.append(n)
+        scope = self.scopes[-1]
+        if not neg:
+            scope.addatom(Atom(pred))
+        else:
+            scope.addnegatom(Atom(pred))
+
+        */
+    }
+
+    public override void EnterPrecondition(pddlParser.PreconditionContext ctx) {
+        /*
+        self.scopes.append(Scope())
+        */
+    }
+
+    public override void ExitPrecondition(pddlParser.PreconditionContext ctx) {
+        /*
+        scope = self.scopes.pop()
+        self.scopes[-1].precondition_pos = set( scope.atoms )
+        self.scopes[-1].precondition_neg = set( scope.negatoms )
+        */
+    }
+
+    public override void EnterEffect(pddlParser.EffectContext ctx) {
+        /*
+        self.scopes.append(Scope())
+        */
+    }
+
+    public override void ExitEffect(pddlParser.EffectContext ctx) {
+        /*
+        scope = self.scopes.pop()
+        self.scopes[-1].effect_pos = set( scope.atoms )
+        self.scopes[-1].effect_neg = set( scope.negatoms )
+        */
+    }
+
+    public override void EnterGoalDesc(pddlParser.GoalDescContext ctx) {
+        /*
+        negscope = False
+        for c in ctx.getChildren():
+            if c.getText() == 'not':
+                negscope = True
+                break
+        self.negativescopes.append(negscope)
+        */
+    }
+
+    public override void ExitGoalDesc(pddlParser.GoalDescContext ctx) {
+        /*
+        self.negativescopes.pop()
+        */
+    }
+
+    public override void EnterPEffect(pddlParser.PEffectContext ctx) {
+        /*
+        negscope = False
+        for c in ctx.getChildren():
+            if c.getText() == 'not':
+                negscope = True
+                break
+        self.negativescopes.append(negscope)
+        */
+    }
+
+    public override void ExitPEffect(pddlParser.PEffectContext ctx) {
+        /*
+        self.negativescopes.pop()
+        */
+    }
+
+    public override void EnterTypedNameList(pddlParser.TypedNameListContext ctx) {
+        /*
+        # print("-> tnam")
+        for v in ctx.NAME():
+            vname = v.getText()
+            self.scopes[-1].variable_list[v.getText()] = None
+        for vs in ctx.singleTypeNameList():
+            t = vs.r_type().getText()
+            for v in vs.NAME():
+                vname = v.getText()
+                self.scopes[-1].variable_list[vname] = t
+        */
+    }
+
+    public override void EnterConstantsDef(pddlParser.ConstantsDefContext ctx) {
+        /*
+        self.scopes.append(Obj())
+        */
+    }
+
+    public override void ExitConstantsDef(pddlParser.ConstantsDefContext ctx) {
+        /*
+        scope = self.scopes.pop()
+        self.objects = scope.variable_list
+        */
+    }
+
+    public override void ExitDomain(pddlParser.DomainContext ctx) {
+        /*
+        if not self.objects and not self.typesdef:
+            vs = set()
+            for opn, oper in self.operators.items():
+                alls = oper.precondition_pos | oper.precondition_neg | oper.effect_pos | oper.      effect_neg
+                for a in alls:
+                    for s in a.predicate:
+                        if s[0] != '?':
+                            vs.add( (s, None) )
+            self.objects = dict( vs)
+        */
+    }
+
 }

 internal class ProblemListener : pddlBaseListener {


THRIFT-1709 Warning "Bitwise-or operator used on a sign-extended operand; consider casting to a smaller unsigned type first" in TBinaryProtocol.cs at ReadInt64()

Patch: Jens Geyer

--- lib/csharp/src/Protocol/TBinaryProtocol.cs
+++ lib/csharp/src/Protocol/TBinaryProtocol.cs
@@ -341,12 +341,14 @@
 		{
 			ReadAll(i32in, 0, 4);
 			return (int)(((i32in[0] & 0xff) << 24) | ((i32in[1] & 0xff) << 16) | ((i32in[2] & 0xff) << 8) | ((i32in[3] & 0xff)));
-		}
-
-		private byte[] i64in = new byte[8];
+		}
+
+#pragma warning disable 675
+
+        private byte[] i64in = new byte[8];
 		public override long ReadI64()
 		{
-			ReadAll(i64in, 0, 8);
+			ReadAll(i64in, 0, 8);
             unchecked {
               return (long)(
                   ((long)(i64in[0] & 0xff) << 56) |
@@ -358,9 +360,11 @@
                   ((long)(i64in[6] & 0xff) << 8) |
                   ((long)(i64in[7] & 0xff)));
             }
-        }
-
-		public override double ReadDouble()
+        }
+
+#pragma warning restore 675
+
+        public override double ReadDouble()
 		{
 #if !SILVERLIGHT
 			return BitConverter.Int64BitsToDouble(ReadI64());


Add unit test check Ctrl+A, Ctrl+Z

Add unit test check Ctrl+A, Ctrl+Z

--- tests/Avalonia.Controls.UnitTests/TextBoxTests.cs
+++ tests/Avalonia.Controls.UnitTests/TextBoxTests.cs
@@ -42,6 +42,58 @@
         }

         [Fact]
+        public void Press_Ctrl_A_Select_All_Text()
+        {
+            using (UnitTestApplication.Start(Services))
+            {
+                var target = new TextBox
+                {
+                    Template = CreateTemplate(),
+                    Text = "1234"
+                };
+
+                RaiseKeyEvent(target, Key.A, InputModifiers.Control);
+
+                Assert.Equal(0, target.SelectionStart);
+                Assert.Equal(4, target.SelectionEnd);
+            }
+        }
+
+        [Fact]
+        public void Press_Ctrl_A_Select_All_Null_Text()
+        {
+            using (UnitTestApplication.Start(Services))
+            {
+                var target = new TextBox
+                {
+                    Template = CreateTemplate()
+                };
+
+                RaiseKeyEvent(target, Key.A, InputModifiers.Control);
+
+                Assert.Equal(0, target.SelectionStart);
+                Assert.Equal(0, target.SelectionEnd);
+            }
+        }
+
+        [Fact]
+        public void Press_Ctrl_Z_With_Not_Modify_Text()
+        {
+            using (UnitTestApplication.Start(Services))
+            {
+                var target = new TextBox
+                {
+                    Template = CreateTemplate(),
+                    Text = "1234"
+                };
+
+                RaiseKeyEvent(target, Key.Z, InputModifiers.Control);
+
+                Assert.Equal("1234", target.Text);
+            }
+        }
+
+        [Fact]
         public void Typing_Beginning_With_0_Should_Not_Modify_Text_When_Bound_To_Int()
         {
             using (UnitTestApplication.Start(Services))


Decided to split tests that test more than one test outcome

--- tests/FixieSpec.Tests/FixieSpecConventionTests.cs
+++ tests/FixieSpec.Tests/FixieSpecConventionTests.cs
@@ -67,13 +67,18 @@
             testRunResult.Failed.ShouldBe(1);
         }

-        public void ShouldFailWhenASetupStepFails()
+        public void ShouldStopWhenASetupStepFails()
         {
             var testRunResult = Execute<FailingSetupStepExampleSpecification>();

             testRunResult.ConsoleOutput.ShouldEqual(
                 "Given_a_specification_context",
                 "And_given_a_secondary_setup_step_fails");
+        }
+
+        public void ShouldFailAllAssertionStepsWhenASetupStepFails()
+        {
+            var testRunResult = Execute<FailingSetupStepExampleSpecification>();

             testRunResult.Failed.ShouldBe(2);
         }


further broke down into tasks

further broke down into tasks

--- CDS/CDS.Common/TcpMessageEncap.cs
+++ CDS/CDS.Common/TcpMessageEncap.cs
@@ -21,6 +21,7 @@
         TcpClient c;
         NetworkStream stream;
         public static List<TcpMessageEncap> Encaps = new List<TcpMessageEncap>();
+        bool ReceivingMessage = false;
         public TcpMessageEncap(TcpClient client)
         {
             OnClose += () => Encaps.Remove(this);
@@ -48,8 +49,9 @@
         }
         void ReceiveMessage()
         {
-            if (c.Available >= 4)
+            if (c.Available >= 4 && !ReceivingMessage)
             {
+                ReceivingMessage = true;
                 Task.Factory.StartNew(MessageIncoming);
             }
             try
@@ -82,6 +84,7 @@
                 c.Close();
                 OnClose();
             }
+            ReceivingMessage = false;
         }
     }
     public delegate void Close();