.Editor: Add support to add volumes; Break rendering of new triles temporarily.

--- FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
+++ FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
@@ -603,6 +603,130 @@
                     window.Size.Y = Math.Min(512f, window.Size.Y);

                     window.Widgets.Add(new ButtonWidget(Game, "+", delegate() {
+                        ContainerWidget windowAdd;
+                        Widgets.Add(windowAdd = new ContainerWidget(Game) {
+                            Size = new Vector2(256f, 192f),
+                            Label = "Add Volume"
+                        });
+                        WindowHeaderWidget windowAddHeader;
+                        windowAdd.Widgets.Add(windowAddHeader = new WindowHeaderWidget(Game));
+
+                        ButtonWidget windowLabelId;
+                        windowAdd.Widgets.Add(windowLabelId = new ButtonWidget(Game, "ID:") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(96f, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 0f)
+                        });
+                        TextFieldWidget windowFieldId;
+                        windowAdd.Widgets.Add(windowFieldId = new TextFieldWidget(Game) {
+                            Size = new Vector2(windowAdd.Size.X - windowLabelId.Size.X, 24f),
+                            UpdateBounds = false,
+                            Position = new Vector2(windowLabelId.Size.X, windowLabelId.Position.Y)
+                        });
+
+                        ButtonWidget windowLabelFrom;
+                        windowAdd.Widgets.Add(windowLabelFrom = new ButtonWidget(Game, "From:") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(96f, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 24f)
+                        });
+                        TextFieldWidget windowFieldFrom;
+                        windowAdd.Widgets.Add(windowFieldFrom = new TextFieldWidget(Game) {
+                            Size = new Vector2(windowAdd.Size.X - windowLabelFrom.Size.X, 24f),
+                            UpdateBounds = false,
+                            Position = new Vector2(windowLabelFrom.Size.X, windowLabelFrom.Position.Y),
+                            Text = "0; 1; 1"
+                        });
+
+                        ButtonWidget windowLabelTo;
+                        windowAdd.Widgets.Add(windowLabelTo = new ButtonWidget(Game, "To:") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(96f, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 48f)
+                        });
+                        TextFieldWidget windowFieldTo;
+                        windowAdd.Widgets.Add(windowFieldTo = new TextFieldWidget(Game) {
+                            Size = new Vector2(windowAdd.Size.X - windowLabelTo.Size.X, 24f),
+                            UpdateBounds = false,
+                            Position = new Vector2(windowLabelTo.Size.X, windowLabelTo.Position.Y),
+                            Text = "1; 0; 1"
+                        });
+
+                        CheckboxWidget windowCheckFront;
+                        windowAdd.Widgets.Add(windowCheckFront = new CheckboxWidget(Game, "Front") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(windowAdd.Size.X, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 72f)
+                        });
+
+                        CheckboxWidget windowCheckLeft;
+                        windowAdd.Widgets.Add(windowCheckLeft = new CheckboxWidget(Game, "Left") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(windowAdd.Size.X, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 96f)
+                        });
+
+                        CheckboxWidget windowCheckBack;
+                        windowAdd.Widgets.Add(windowCheckBack = new CheckboxWidget(Game, "Back") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(windowAdd.Size.X, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 120f)
+                        });
+
+                        CheckboxWidget windowCheckRight;
+                        windowAdd.Widgets.Add(windowCheckRight = new CheckboxWidget(Game, "Right") {
+                            Background = new Color(EditorWidget.DefaultBackground, 0f),
+                            Size = new Vector2(windowAdd.Size.X, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = false,
+                            Position = new Vector2(0f, 144f)
+                        });
+
+                        windowAdd.Widgets.Add(new ButtonWidget(Game, "ADD", delegate() {
+                            //TODO Add Volume to level
+                            string[] fromSplit = windowFieldFrom.Text.Split(new char[] {';'});
+                            string[] toSplit = windowFieldTo.Text.Split(new char[] {';'});
+                            Volume volume = new Volume() {
+                                Id = int.Parse(windowFieldId.Text),
+                                From = new Vector3(
+                                    float.Parse(fromSplit[0].Trim()),
+                                    float.Parse(fromSplit[1].Trim()),
+                                    float.Parse(fromSplit[2].Trim())
+                                ),
+                                To = new Vector3(
+                                    float.Parse(toSplit[0].Trim()),
+                                    float.Parse(toSplit[1].Trim()),
+                                    float.Parse(toSplit[2].Trim())
+                                )
+                            };
+                            if (windowCheckFront.Checked) {volume.Orientations.Add(FaceOrientation.Front);}
+                            if (windowCheckLeft.Checked) {volume.Orientations.Add(FaceOrientation.Left);}
+                            if (windowCheckBack.Checked) {volume.Orientations.Add(FaceOrientation.Back);}
+                            if (windowCheckRight.Checked) {volume.Orientations.Add(FaceOrientation.Right);}
+                            LevelManager.Volumes.Add(volume.Id, volume);
+                            windowAddHeader.CloseButtonWidget.Action();
+                            window.Refresh();
+                        }) {
+                            Size = new Vector2(windowAdd.Size.X, 24f),
+                            UpdateBounds = false,
+                            LabelCentered = true,
+                            Position = new Vector2(0f, windowAdd.Size.Y - 24f)
+                        });
+
+                            windowAdd.Position.X = GraphicsDevice.Viewport.Width / 2 - (int) (windowAdd.Size.X / 2);
+                            windowAdd.Position.Y = GraphicsDevice.Viewport.Height / 2 - (int) (windowAdd.Size.Y / 2);
                     }) {
                         Background = new Color(0f, 0.125f, 0f, 1f),
                         Size = new Vector2(window.Size.X, 24f),
@@ -1275,7 +1399,9 @@
             }

             if (MouseState.RightButton.State == MouseButtonStates.Clicked && HoveredTrile != null) {
+                LevelMaterializer.CullInstanceOut(HoveredTrile);
                 LevelManager.ClearTrile(HoveredTrile);
+                LevelManager.RecullAt(HoveredTrile.Emplacement);
                 HoveredTrile = null;
             }

@@ -1397,7 +1523,7 @@

             if (LevelManager.TrileExists(trile.Emplacement)) {
                 TrileEmplacement emplacement = trile.Emplacement;
-                LevelMaterializer.RemoveInstance(LevelManager.TrileInstanceAt(ref emplacement));
+                LevelManager.ClearTrile(LevelManager.TrileInstanceAt(ref emplacement));
             }

             if (LevelManager.Triles.ContainsKey(trile.Emplacement)) {


Removed doc comment that was no longer relevant.

git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS06]$/51degrees;C75312

--- FoundationV3/Mobile/Detection/DetectorModule.cs
+++ FoundationV3/Mobile/Detection/DetectorModule.cs
@@ -410,7 +410,6 @@
         /// already assigned by Microsoft and returns a new capabilities provider.
         /// </summary>
         /// <param name="currentCapabilities">Current properties assigned by Microsoft</param>
-        /// <param name="overrideCapabilities">Properties enhanced from the original Microsoft values</param>
         /// <param name="fiftyOneCapabilities">Properties and values returned from 51Degrees</param>
         protected static HttpBrowserCapabilities CreateNewCapabilitiesProvider(
             SortedList<string, string[]> fiftyOneCapabilities,


tests(room): create test reopening stream should enable message notification

--- Gitter/Gitter.UnitTests/ViewModels/RoomTests.cs
+++ Gitter/Gitter.UnitTests/ViewModels/RoomTests.cs
@@ -244,7 +244,35 @@
         [Fact]
         public void ReopeningStream_Should_EnableMessageNotification()
         {
-            // TODO
+            // Arrange
+            var room = new Room
+            {
+                Id = "123456",
+                Name = "Room",
+                UnreadItems = 14
+            };
+
+            TestInitialize(room);
+
+            // Act
+            _roomViewModel.CloseRealtimeStream();
+            _roomViewModel.OpenRealtimeStream();
+
+            var message = new Message
+            {
+                Id = "a1d4gv",
+                UnreadByCurrent = true,
+                User = new User
+                {
+                    Id = "abcdef",
+                    Username = "Odonno"
+                }
+            };
+            _gitterApiService.StreamingMessages.OnNext(message);
+
+            // Assert
+            Assert.Equal(15, _roomViewModel.UnreadMessagesCount);
+            Assert.Equal(1, _localNotificationService.NotificationsSent);
         }

         #endregion


Solve build related issue

Solve build related issue

--- Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
+++ Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
@@ -13,13 +13,14 @@
         {
             _questionsRepository = questionsRepository;
         }
-
-        [Route("single-multiple-question")]
-        [HttpPost]
         /// <summary>
         /// Add single multiple answer question into model
         /// </summary>
         /// <param name="singleMultipleAnswerQuestion"></param>
+        /// <param name="singleMultipleAnswerQuestionOption"></param>
+        /// <returns></returns>
+        [Route("single-multiple-question")]
+        [HttpPost]
         public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
         {
             _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion, singleMultipleAnswerQuestionOption);


Fixes players being thrown off from the shuttles on rotation. (#7852)


Check all object for ispassable

Check all object for ispassable

Fixes  #1190

--- UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/ObjectLayer.cs
+++ UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/ObjectLayer.cs
@@ -45,20 +45,16 @@

 		public override bool IsPassableAt(Vector3Int origin, Vector3Int to)
 		{
-			RegisterTile objTo = Objects.GetFirst<RegisterTile>(to);
+			List<RegisterTile> objectsTo = Objects.Get<RegisterTile>(to);

-			if (objTo && !objTo.IsPassable(origin))
+			if (!objectsTo.All(o => o.IsPassable(origin)))
 			{
 				return false;
 			}

-			RegisterTile objOrigin = Objects.GetFirst<RegisterTile>(origin);
-			if (objOrigin && !objOrigin.IsPassable(to))
-			{
-				return false;
-			}
+			List<RegisterTile> objectsOrigin = Objects.Get<RegisterTile>(origin);

-			return base.IsPassableAt(origin, to);
+			return objectsOrigin.All(o => o.IsPassable(origin)) && base.IsPassableAt(origin, to);
 		}

 		public override bool IsPassableAt(Vector3Int position)


Better ShuttleControl logging (#7547)

Better ShuttleControl logging (#7547)

--- UnityProject/Assets/Scripts/UI/Objects/Shuttles/GUI_ShuttleControl.cs
+++ UnityProject/Assets/Scripts/UI/Objects/Shuttles/GUI_ShuttleControl.cs
@@ -142,7 +142,7 @@
 			}
 			catch (NullReferenceException exception)
 			{
-				Logger.LogError("Caught NRE in GUI_ShuttleControl.StartNormalOperation: " + exception.Message, Category.Shuttles);
+				Logger.LogError("Caught NRE in GUI_ShuttleControl.StartNormalOperation: " + exception.StackTrace, Category.Shuttles);
 			}
 		}
 		/// <summary>


Prepare test:  Duplication is resolved with labels merged.

--- WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
+++ WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
@@ -184,8 +184,25 @@
 			Assert.Equal(2, txStore.MempoolStore.GetTransactions().Count());
 			Assert.Equal(4, txStore.ConfirmedStore.GetTransactions().Count());

+			// Duplication is resolved with labels merged.
+			//mempoolFileContent = new[]
+			//{
+			//	uTx1.ToLine(),
+			//	uTx2.ToLine(),
+			//	uTx3.ToLine(),
+			//	new SmartTransaction(cTx1.Transaction, Height.Mempool).ToLine()
+			//};
+			//txFileContent = new[]
+			//{
+			//	cTx1.ToLine(),
+			//	cTx2.ToLine(),
+			//	cTx3.ToLine(),
+			//	new SmartTransaction(uTx1.Transaction, new Height(2)).ToLine()
+			//};
+			//await File.WriteAllLinesAsync(mempoolFile, mempoolFileContent);
+			//await File.WriteAllLinesAsync(txFile, txFileContent);
+
 			// ToDo: ensure correct order.
-			// ToDo: ensure labels get merged.
 		}

 		[Theory]


Added some ImageService unit tests

Added some ImageService unit tests

--- source/Tests/FFImageLoading.Tests/ImageService/ImageServiceBaseTests.cs
+++ source/Tests/FFImageLoading.Tests/ImageService/ImageServiceBaseTests.cs
@@ -12,6 +12,8 @@
         {
             ImageService.EnableMockImageService = true;
         }
+
+        const string RemoteImage = "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg";

         [Fact]
         public void CanInitialize()
@@ -30,15 +32,58 @@
         [Fact]
         public async Task CanDownloadOnly()
         {
-            await ImageService.Instance.LoadUrl("https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg")
+            await ImageService.Instance.LoadUrl(RemoteImage)
                 .DownloadOnlyAsync();
+
+            var diskCacheKey = ImageService.Instance.Config.MD5Helper.MD5(RemoteImage);
+            var cachedDisk = await ImageService.Instance.Config.DiskCache.ExistsAsync(diskCacheKey);
+            Assert.True(cachedDisk);
         }

         [Fact]
         public async Task CanPreload()
         {
-            await ImageService.Instance.LoadUrl("https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg")
+            await ImageService.Instance.LoadUrl(RemoteImage)
                 .PreloadAsync();
+
+            var diskCacheKey = ImageService.Instance.Config.MD5Helper.MD5(RemoteImage);
+            var cachedDisk = await ImageService.Instance.Config.DiskCache.ExistsAsync(diskCacheKey);
+            Assert.True(cachedDisk);
+
+            var cachedMemory = Mock.MockImageCache.Instance.Get(RemoteImage);
+            Assert.NotNull(cachedMemory);
+        }
+
+        [Fact]
+        public async Task CanInvalidate()
+        {
+            await ImageService.Instance.LoadUrl(RemoteImage)
+                .PreloadAsync();
+
+            await ImageService.Instance.InvalidateCacheAsync(Cache.CacheType.All);
+
+            var diskCacheKey = ImageService.Instance.Config.MD5Helper.MD5(RemoteImage);
+            var cachedDisk = await ImageService.Instance.Config.DiskCache.ExistsAsync(diskCacheKey);
+            Assert.False(cachedDisk);
+
+            var cachedMemory = Mock.MockImageCache.Instance.Get(RemoteImage);
+            Assert.Null(cachedMemory);
+        }
+
+        [Fact]
+        public async Task CanInvalidateEntry()
+        {
+            await ImageService.Instance.LoadUrl(RemoteImage)
+                .PreloadAsync();
+
+            await ImageService.Instance.InvalidateCacheEntryAsync(RemoteImage, Cache.CacheType.All, true);
+
+            var diskCacheKey = ImageService.Instance.Config.MD5Helper.MD5(RemoteImage);
+            var cachedDisk = await ImageService.Instance.Config.DiskCache.ExistsAsync(diskCacheKey);
+            Assert.False(cachedDisk);
+
+            var cachedMemory = Mock.MockImageCache.Instance.Get(RemoteImage);
+            Assert.Null(cachedMemory);
         }
     }
 }


clone tasksession messages (#114)

clone tasksession messages (#114)

--- src/DurableTask.Emulator/LocalOrchestrationService.cs
+++ src/DurableTask.Emulator/LocalOrchestrationService.cs
@@ -372,7 +372,7 @@

             TaskOrchestrationWorkItem wi = new TaskOrchestrationWorkItem()
             {
-                NewMessages = taskSession.Messages,
+                NewMessages = taskSession.Messages.ToList(),
                 InstanceId = taskSession.Id,
                 LockedUntilUtc = DateTime.UtcNow.AddMinutes(5),
                 OrchestrationRuntimeState =


Add comment.

Add comment.

--- SRNicoNico/Models/NicoNicoViewer/UpdateCheck.cs
+++ SRNicoNico/Models/NicoNicoViewer/UpdateCheck.cs
@@ -13,12 +13,16 @@
 namespace SRNicoNico.Models.NicoNicoViewer {
     public class UpdateCheck : NotificationObject {

+
+        //アップデート確認するURL
 #if DEBUG
         private static string CheckUrl = "https://mrtska.net/niconicowrapper/update";
 #else
         private static string CheckUrl = "http://download.mrtska.net/DownloadCounter/Download?file=NicoNicoViewer/update";
 #endif

+        //アップデート確認 trueならアップデートあり
+        //urlはダウンロードできるURL
         public static bool IsUpdateAvailable(double cur, ref string url) {

             try {
@@ -31,6 +35,7 @@
                 }
                 var json = DynamicJson.Parse(a);

+                //現在のバージョンとダウンロードしてきたjsonのバージョンを比較してjsonのほうが高かったらアップデートがあるってこと
                 if(cur < json.version) {

                     url = json.url;
@@ -39,6 +44,8 @@

                 return false;
+
+            //例外処理でたとえ私のサーバーが落ちてもViewerには何も影響が出ないように
             } catch(Exception ex) when (ex is XmlException || ex is RequestTimeout) {

                 return false;


Added reference to issue created in Redis repo related to the TakeLock method bug

--- src/Aqovia.Utilities.SagaMachine/StatePersistance/RedisKeyValueStore.cs
+++ src/Aqovia.Utilities.SagaMachine/StatePersistance/RedisKeyValueStore.cs
@@ -147,7 +147,7 @@
                     var trans = db.CreateTransaction();
                     trans.AddCondition(Condition.KeyNotExists(redisLockKey));
                     var acquireLockTask = trans.LockTakeAsync(redisLockKey, lockToken.ToString(), TimeSpan.MaxValue).ConfigureAwait(false);
-                    var setExpiryTimeTask = trans.KeyExpireAsync(redisLockKey, TimeSpan.FromMilliseconds(milliseconds)).ConfigureAwait(false);
+                    var setExpiryTimeTask = trans.KeyExpireAsync(redisLockKey, TimeSpan.FromMilliseconds(milliseconds)).ConfigureAwait(false); /* This is added to workaround bug discovered in the Redis client. Remove this line if bug resolved. Detail can be found here: https://github.com/StackExchange/StackExchange.Redis/issues/415 */
                     trans.Execute();

                     var hasLock = await acquireLockTask;


complaint for fighter

complaint for fighter

--- Scripts/Autopilot/Navigator/Response/Fighter.cs
+++ Scripts/Autopilot/Navigator/Response/Fighter.cs
@@ -52,18 +52,36 @@
 		public bool CanRespond()
 		{
 			if (!m_weaponArmed)
+			{
+				m_navSet.Settings_Commands.Complaint = "Fighter is unarmed";
 				return false;
+			}

 			GetPrimaryWeapon();
 			if (m_weapon_primary == null)
+			{
+				m_navSet.Settings_Commands.Complaint = "Fighter has no weapon to target with";
 				return false;
+			}
+
+			if (m_mover.ThrustersOverWorked())
+			{
+				m_navSet.Settings_Commands.Complaint = "Fighter cannot stabilize in gravity";
+				return false;
+			}

 			if (m_weaponDataDirty)
 				UpdateWeaponData();

 			//m_logger.debugLog("weapon count: " + m_weapons_all.Count, "CanRespond()");

-			return m_weapons_all.Count != 0;
+			if (m_weapons_all.Count == 0)
+			{
+				m_navSet.Settings_Commands.Complaint = "Fighter has no usable weapons";
+				return false;
+			}
+
+			return true;
 		}

 		public void UpdateTarget(LastSeen enemy)


Removed empty line

Removed empty line

--- Sharpex2D/Framework/Content/AsyncAssetLoader.cs
+++ Sharpex2D/Framework/Content/AsyncAssetLoader.cs
@@ -44,7 +44,7 @@
             {
                 throw new ArgumentException("The name already exists.");
             }
-
+
             _queue.Add(name, assetpath);
         }
         /// <summary>


- released v3.4.2

- released v3.4.2

--- Shuttle.ESB.RabbitMQ/Properties/AssemblyInfo.cs
+++ Shuttle.ESB.RabbitMQ/Properties/AssemblyInfo.cs
@@ -17,11 +17,11 @@
 [assembly: AssemblyTitle("Shuttle.ESB.RabbitMQ for .NET Framework 4.5.1")]
 #endif

-[assembly: AssemblyVersion("3.4.1.0")]
+[assembly: AssemblyVersion("3.4.2.0")]
 [assembly: AssemblyCopyright("Copyright © Eben Roux 2010-2014")]
 [assembly: AssemblyProduct("Shuttle.ESB")]
 [assembly: AssemblyCompany("Shuttle")]
 [assembly: AssemblyConfiguration("Release")]
-[assembly: AssemblyInformationalVersion("3.4.1")]
+[assembly: AssemblyInformationalVersion("3.4.2")]
 [assembly: ComVisible(false)]


server: reduce password req

server: reduce password req

--- Solitude.Server/Identity/SolitudeUserManager.cs
+++ Solitude.Server/Identity/SolitudeUserManager.cs
@@ -32,10 +32,7 @@
             manager.PasswordValidator = new PasswordValidator
                 {
                     RequiredLength = 6,
-                    RequireNonLetterOrDigit = true,
                     RequireDigit = true,
-                    RequireLowercase = true,
-                    RequireUppercase = true,
                 };

             // Configure user lockout defaults


Removed hardcoded moudle id #51

Removed hardcoded moudle id #51

--- Solution1/Web/Controllers/HomeworkController.cs
+++ Solution1/Web/Controllers/HomeworkController.cs
@@ -35,10 +35,9 @@
         [Authorize(Roles = "Student")]
         public IActionResult Upload(string moduleId)
         {
-            //Testing reasons, gets to be deleted
             if (moduleId == null)
             {
-                moduleId = "bade8051-f56d-4187-9726-8694c9ca6aef";
+                return NotFound();
             }
             return View("Upload", moduleId);
         }
@@ -83,10 +82,9 @@
         [Authorize(Roles = "Professor")]
         public IActionResult Evaluate(string moduleId)
         {
-            //Testing reasons, gets to be deleted
             if (moduleId == null)
             {
-                moduleId = "bade8051-f56d-4187-9726-8694c9ca6aef";
+                return NotFound();
             }
             IEnumerable<Player> thatUploaded = _homeworkService.GetPlayersThatUploaded(moduleId);
             ViewBag.Players = thatUploaded;


making CreationOptionsSpecs static

making CreationOptionsSpecs static

--- Source/FakeItEasy.Specs/CreationOptionsSpecs.cs
+++ Source/FakeItEasy.Specs/CreationOptionsSpecs.cs
@@ -12,7 +12,7 @@
     using Xbehave;

     [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Required for testing.")]
-    public class CreationOptionsSpecs
+    public static class CreationOptionsSpecs
     {
         [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces", Justification = "It's just used for testing.")]
         public interface IInterfaceThatWeWillAddAttributesTo1


Optimized numbering in tray menu; Add number for every menu item in submenu.

--- Clipy/Form1.cs
+++ Clipy/Form1.cs
@@ -397,16 +397,24 @@
             MenuItem menu = new MenuItem(); // dummy
             for (int i = 0; i < totalItems; i++)
             {
-                if (i % NUMBER_OF_ITEMS_PER_GROUP == 0)
-                {
+                int remainent = i % NUMBER_OF_ITEMS_PER_GROUP;
+                if (remainent == 0)
+                {
+                    int delta = NUMBER_OF_ITEMS_PER_GROUP;
+                    if ((totalItems - i) < NUMBER_OF_ITEMS_PER_GROUP)
+                    {
+                        delta = (totalItems - i);
+                    }
                     menu = new MenuItem();
-                    menu.Text = string.Format("{0} - {1}", 1 + i, (i / NUMBER_OF_ITEMS_PER_GROUP + 1) * NUMBER_OF_ITEMS_PER_GROUP);
+                    int upperLimit = (i / NUMBER_OF_ITEMS_PER_GROUP) * NUMBER_OF_ITEMS_PER_GROUP + delta;
+
+                    menu.Text = string.Format("{0} - {1}", 1 + i, upperLimit);
                     parentMenu.MenuItems.Add(menu);
                 }
                 MenuItem subMenu = new MenuItem();
                 var history = histories[i];
                 var content = history.Content.Trim();
-                subMenu.Text = shorttenedContent(content.FirstLine());
+                subMenu.Text = string.Format("{0}. {1}", remainent + 1, shorttenedContent(content.FirstLine()));
                 // TODO: Tooltip?
                 subMenu.Tag = history.Id;
                 subMenu.Click += menuEventHandler;


Refresh cinema data.

Refresh cinema data.

--- Code/Cinema.cs
+++ Code/Cinema.cs
@@ -30,6 +30,7 @@
         public static readonly Cinema Chesterfield = new Cinema(1010829, "Chesterfield");
         public static readonly Cinema Chichester = new Cinema(1010823, "Chichester");
         public static readonly Cinema Crawley = new Cinema(1010827, "Crawley");
+        public static readonly Cinema DaltonPark = new Cinema(1010899, "Dalton Park");
         public static readonly Cinema Didcot = new Cinema(1010830, "Didcot");
         public static readonly Cinema Didsbury = new Cinema(1010831, "Didsbury");
         public static readonly Cinema Dundee = new Cinema(1010832, "Dundee");
@@ -52,8 +53,6 @@
         public static readonly Cinema IsleOfWight = new Cinema(1010853, "Isle Of Wight");
         public static readonly Cinema Jersey = new Cinema(1010855, "Jersey");
         public static readonly Cinema Leigh = new Cinema(1010856, "Leigh");
-        [Obsolete("Cinema has closed - Liverpool will be removed in a future version.")]
-        public static readonly Cinema Liverpool = new Cinema(1010857, "Liverpool");
         public static readonly Cinema Llandudno = new Cinema(1010858, "Llandudno");
         public static readonly Cinema LondonBexleyheath = new Cinema(1010810, "London - Bexleyheath");
         public static readonly Cinema LondonChelsea = new Cinema(1010825, "London - Chelsea");
@@ -63,9 +62,7 @@
         public static readonly Cinema LondonHaymarket = new Cinema(1010848, "London - Haymarket");
         public static readonly Cinema LondonIlford = new Cinema(1010852, "London - Ilford");
         public static readonly Cinema LondonLeicesterSquare = new Cinema(1010820, "London - Leicester Square");
-        [Obsolete("Cinema has closed - LondonStaplesCorner will be removed in a future version.")]
-        public static readonly Cinema LondonStaplesCorner = new Cinema(1010873, "London - Staples Corner");
-        public static readonly Cinema LondonTheO2Greenwich = new Cinema(1010842, "London - The O2, Greenwich");
+        public static readonly Cinema LondonTheO2Greenwich = new Cinema(1010842, "London - The O2 Greenwich");
         public static readonly Cinema LondonWandsworth = new Cinema(1010879, "London - Wandsworth");
         public static readonly Cinema LondonWembley = new Cinema(1010880, "London - Wembley");
         public static readonly Cinema LondonWestIndiaQuay = new Cinema(1010882, "London - West India Quay");
@@ -82,8 +79,6 @@
         public static readonly Cinema Rochester = new Cinema(1010865, "Rochester");
         public static readonly Cinema Rugby = new Cinema(1010866, "Rugby");
         public static readonly Cinema Runcorn = new Cinema(1010867, "Runcorn");
-        [Obsolete("Use CheltenhamTheScreeningRooms instead - TheScreeningRoomsCheltenham will be removed in a future version.")]
-        public static readonly Cinema TheScreeningRoomsCheltenham = new Cinema(1010828, "The Screening Rooms - Cheltenham");
         public static readonly Cinema Sheffield = new Cinema(1010869, "Sheffield");
         public static readonly Cinema Shrewsbury = new Cinema(1010870, "Shrewsbury");
         public static readonly Cinema Solihull = new Cinema(1010871, "Solihull");


Advanced a little.

Advanced a little.

* [WIP] Modify async process.

--- XamarinLifeGameXAML/ViewModels/LifeGameViewModel.cs
+++ XamarinLifeGameXAML/ViewModels/LifeGameViewModel.cs
@@ -53,7 +53,7 @@
             if (IsExecuted)
             {
                 IsExecuted = false;
-                await StartGame();
+                await Task.Run(UpdateCellsAsync);
             }
             else
             {
@@ -63,20 +63,10 @@

         private async Task StartGame()
         {
-            var token = new CancellationToken();
-            await Task.Run(async () =>
-            {
-                token.ThrowIfCancellationRequested();
-
-                await Task.Delay(1000, token);
-                while (isExecuted)
-                {
-                    await UpdateCellsAsync();
-                }
-            }, token);
+            await UpdateCellsAsync();
         }

-        private Task UpdateCellsAsync()
+        private async Task UpdateCellsAsync()
         {
             var tcs = new TaskCompletionSource<object>();
             Device.BeginInvokeOnMainThread(() =>
@@ -91,7 +81,6 @@
                     tcs.SetException(e);
                 }
             });
-            return tcs.Task;
         }

         private void UpdateCells()


Fixes the lifestyles of the objects

Fixes the lifestyles of the objects

--- src/Elders.Cronus.Persistence.Cassandra/CassandraEventStoreDiscovery.cs
+++ src/Elders.Cronus.Persistence.Cassandra/CassandraEventStoreDiscovery.cs
@@ -17,10 +17,10 @@

         IEnumerable<DiscoveredModel> GetModels(DiscoveryContext context)
         {
-            yield return new DiscoveredModel(typeof(IEventStoreFactory), typeof(CassandraEventStoreFactory), ServiceLifetime.Transient);
+            yield return new DiscoveredModel(typeof(IEventStoreFactory), typeof(CassandraEventStoreFactory), ServiceLifetime.Singleton);
             yield return new DiscoveredModel(typeof(IEventStore), typeof(MultiTenantEventStore), ServiceLifetime.Transient);
-            yield return new DiscoveredModel(typeof(CassandraProviderForEventStore), typeof(CassandraProviderForEventStore), ServiceLifetime.Transient);
-            yield return new DiscoveredModel(typeof(ICassandraEventStoreTableNameStrategy), typeof(TablePerBoundedContext), ServiceLifetime.Transient);
+            yield return new DiscoveredModel(typeof(CassandraProviderForEventStore), typeof(CassandraProviderForEventStore), ServiceLifetime.Singleton);
+            yield return new DiscoveredModel(typeof(ICassandraEventStoreTableNameStrategy), typeof(TablePerBoundedContext), ServiceLifetime.Singleton);
             yield return new DiscoveredModel(typeof(ICassandraReplicationStrategy), provider => GetReplicationStrategy(context.Configuration), ServiceLifetime.Transient);
         }


Time Slider: Temporarily remove Tickbar.cs

--- src/Esri.ArcGISRuntime.Toolkit/Shared/UI/Controls/TimeSlider/TickBar.cs
+++ src/Esri.ArcGISRuntime.Toolkit/Shared/UI/Controls/TimeSlider/TickBar.cs
@@ -1,528 +0,0 @@
-// /*******************************************************************************
-//  * Copyright 2012-2018 Esri
-//  *
-//  *  Licensed under the Apache License, Version 2.0 (the "License");
-//  *  you may not use this file except in compliance with the License.
-//  *  You may obtain a copy of the License at
-//  *
-//  *  http://www.apache.org/licenses/LICENSE-2.0
-//  *
-//  *   Unless required by applicable law or agreed to in writing, software
-//  *   distributed under the License is distributed on an "AS IS" BASIS,
-//  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  *   See the License for the specific language governing permissions and
-//  *   limitations under the License.
-//  ******************************************************************************/
-
-// Implementation adapted and enhanced from https://github.com/Esri/arcgis-toolkit-sl-wpf
-
-#if !NETFX_CORE && !__IOS__ && !__ANDROID__
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Media;
-using Esri.ArcGISRuntime.Toolkit.Internal;
-
-namespace Esri.ArcGISRuntime.Toolkit.Primitives
-{
-    /// <summary>
-    /// *FOR INTERNAL USE ONLY* Tickbar control used for placing a specified amount of tick marks evenly spread out.
-    /// </summary>
-    /// <exclude/>
-    [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
-    public class Tickbar : Panel
-    {
-        internal static readonly DependencyProperty PositionProperty =
-            DependencyProperty.RegisterAttached("Position", typeof(double), typeof(Tickbar), new PropertyMetadata(0.0));
-        internal static readonly DependencyProperty IsMajorTickmarkProperty =
-            DependencyProperty.RegisterAttached("IsMajorTickmark", typeof(bool), typeof(Tickbar), new PropertyMetadata(false));
-        private const string _template =
-            "<DataTemplate xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">" +
-            "<TextBlock Text=\"|\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" />" +
-            "</DataTemplate>";
-        private static DataTemplate _defaultTickmarkTemplate;
-        private List<ContentPresenter> _majorTickmarks = new List<ContentPresenter>();
-        private List<ContentPresenter> _minorTickmarks = new List<ContentPresenter>();
-        private string _originalTickLabelFormat;
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="Tickbar"/> class.
-        /// </summary>
-        public Tickbar()
-        {
-            if (_defaultTickmarkTemplate == null)
-            {
-                System.IO.MemoryStream stream = new System.IO.MemoryStream(UTF8Encoding.Default.GetBytes(_template));
-                _defaultTickmarkTemplate = System.Windows.Markup.XamlReader.Load(stream) as DataTemplate;
-            }
-        }
-
-        /// <inheritdoc />
-        protected override Size ArrangeOverride(Size finalSize)
-        {
-            if (TickmarkPositions == null || TickmarkPositions.Count() < 2)
-                return finalSize;
-
-            Rect childBounds = new Rect(0, 0, finalSize.Width, finalSize.Height);
-            var majorTickmarksBounds = new List<Rect>();
-            var minorTickmarksBounds = new List<Rect>();
-
-            // Iterate all child ticks and calculate bounds for each
-            foreach (UIElement child in Children)
-            {
-                FrameworkElement c = (child as FrameworkElement);
-                if (c == null)
-                    continue;
-
-                double position = (double)c.GetValue(PositionProperty);
-                var isMajorTickmark = (bool)c.GetValue(IsMajorTickmarkProperty);
-
-                if (isMajorTickmark && !ShowTickLabels)
-                    continue; // Don't worry about calculating bounds for major ticks if labels are hidden
-
-                // Calculate the bounds of the tick mark
-                position = finalSize.Width * position;
-                childBounds.X = position - c.DesiredSize.Width * .5;
-                childBounds.Width = c.DesiredSize.Width;
-
-                // Store the bounds for application later once tick (i.e. label) collision has been accounted for
-                if (isMajorTickmark)
-                {
-                    majorTickmarksBounds.Add(childBounds);
-                }
-                else
-                {
-                    minorTickmarksBounds.Add(childBounds);
-                }
-            }
-
-            if (ShowTickLabels) // Calculate positioning of tick labels and major/minor ticks
-            {
-                var minimumLabelSpacing = 6;
-
-                var majorTickInterval = 2;
-                var doMajorTicksCollide = false;
-                var firstMajorTickIndex = 0;
-                var tickCount = _minorTickmarks.Count;
-
-                // Calculate the largest number of ticks to allow between major ticks.  This prevents scenarios where
-                // there are two major ticks placed undesirably close to the end of the tick bar.
-                var maxMajorTickInterval = Math.Ceiling(tickCount / 2d);
-
-                // Calculate the number of ticks between each major tick and the index of the first major tick
-                for (int i = majorTickInterval; i <= maxMajorTickInterval; i++)
-                {
-                    var prospectiveInterval = i;
-                    var allowsEqualNumberOfTicksOnEnds = false;
-                    doMajorTicksCollide = false;
-
-                    // Check that the prospective interval between major ticks results in an equal number of minor
-                    // ticks on both ends of the tick bar
-                    for (int m = prospectiveInterval; m < tickCount; m += prospectiveInterval)
-                    {
-                        var totalNumberOfTicksOnEnds = tickCount - m + 1;
-
-                        // If the total number of minor ticks on both ends of the tick bar (i.e. before and after the
-                        // first and last major ticks) is less than the major tick interval being tested, then we've
-                        // found the number of minor ticks that would be on the ends if we use this major tick interval.
-                        // If that total is divisible by two, then the major tick interval under test allows for an
-                        // equal number of minor ticks on the ends.
-                        if (totalNumberOfTicksOnEnds / 2 < prospectiveInterval && totalNumberOfTicksOnEnds % 2 == 0)
-                        {
-                            allowsEqualNumberOfTicksOnEnds = true;
-                            break;
-                        }
-                    }
-
-                    // Only consider intervals that leave an equal number of ticks on the ends
-                    if (!allowsEqualNumberOfTicksOnEnds)
-                        continue;
-
-                    // Calculate the tick index of the first major tick if we were to use the prospective interval.
-                    // The index is calculated such that there will be an equal number of minor ticks before and
-                    // after the first and last major tick mark.
-                    firstMajorTickIndex = (int)Math.Truncate(((tickCount - 1) % prospectiveInterval) / 2d);
-
-                    // With the given positioning of major tick marks, check whether they (i.e. their labels) will overlap
-                    for (var j = firstMajorTickIndex; j < tickCount - prospectiveInterval; j += i)
-                    {
-                        // Get the bounds of the major tick marks at index j and the one subsequent to that
-                        var currentBounds = majorTickmarksBounds[j];
-                        var nextBounds = majorTickmarksBounds[j + i];
-
-                        if (currentBounds.Right + minimumLabelSpacing > nextBounds.Left)
-                        {
-                            doMajorTicksCollide = true;
-                            break;
-                        }
-                    }
-
-                    if (!doMajorTicksCollide)
-                    {
-                        // The ticks don't at the given interval, so use that
-                        majorTickInterval = prospectiveInterval;
-                        break;
-                    }
-                }
-
-                if (doMajorTicksCollide)
-                {
-                    // Multiple major ticks (and their labels) won't fit without overlapping.  Display one major tick
-                    // in the middle instead
-                    majorTickInterval = tickCount;
-
-                    // Calculate the index of the middle tick.  Note that, if there are an even number of ticks, there
-                    // is not one perfectly centered.  This logic takes the one before the true center of the tick bar.
-                    if (tickCount % 2 == 0)
-                        firstMajorTickIndex = (int)Math.Truncate(tickCount / 2d) - 1;
-                    else
-                        firstMajorTickIndex = (int)Math.Truncate(tickCount / 2d);
-                }
-
-                // Apply the ticks' layouts
-                for (int i = 0; i < tickCount; i++)
-                {
-                    // Check whether the current tick index refers to a major or minor tick
-                    var isMajorTickIndex = (i - firstMajorTickIndex) % majorTickInterval == 0;
-
-                    // Arrange either the major or minor tick for the current index
-                    if (isMajorTickIndex)
-                    {
-                        _majorTickmarks[i].Arrange(majorTickmarksBounds[i]);
-                        _minorTickmarks[i].Arrange(new Rect(0, 0, 0, 0));
-                    }
-                    else
-                    {
-                        _minorTickmarks[i].Arrange(minorTickmarksBounds[i]);
-                        _majorTickmarks[i].Arrange(new Rect(0, 0, 0, 0));
-                    }
-                }
-            }
-            else // !ShowTickLabels
-            {
-                for (var i = 0; i < _minorTickmarks.Count; i++)
-                {
-                    _minorTickmarks[i].Arrange(minorTickmarksBounds[i]);
-                }
-
-                foreach (var majorTick in _majorTickmarks)
-                {
-                    majorTick.Arrange(new Rect(0, 0, 0, 0));
-                }
-            }
-
-            return finalSize;
-        }
-
-        /// <inheritdoc />
-        protected override Size MeasureOverride(Size availableSize)
-        {
-            double width = availableSize.Width == double.PositiveInfinity ? Width : availableSize.Width;
-            double height = availableSize.Height == double.PositiveInfinity ? Height : availableSize.Height;
-
-            // Get the set of ticks that we want to measure.  This could either be all ticks or only minor ticks
-            var measuredChildren = ShowTickLabels ? Children.Cast<UIElement>() : Children.Cast<UIElement>().Where(el => !(bool)el.GetValue(IsMajorTickmarkProperty));
-            foreach (UIElement d in measuredChildren)
-            {
-                d.Measure(availableSize);
-            }
-
-            if (double.IsNaN(height))
-            {
-                height = 0;
-                foreach (UIElement d in measuredChildren)
-                {
-                    height = Math.Max(d.DesiredSize.Height, height);
-                }
-            }
-            width = double.IsNaN(width) ? 0 : width;
-
-            return new Size(width, height);
-        }
-
-        /// <summary>
-        /// Gets or sets the tick mark positions.
-        /// </summary>
-        /// <value>The tick mark positions.</value>
-        /// <remarks>The tick mark position values should be between 0 and 1.  They represent proportional positions along the tick bar.</remarks>
-        public IEnumerable<double> TickmarkPositions
-        {
-            get { return (IEnumerable<double>)GetValue(TickmarkPositionsProperty); }
-            set { SetValue(TickmarkPositionsProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="TickmarkPositions"/> dependency property.
-        /// </summary>
-        public static readonly DependencyProperty TickmarkPositionsProperty =
-            DependencyProperty.Register(nameof(TickmarkPositions), typeof(IEnumerable<double>),
-            typeof(Tickbar), new PropertyMetadata(OnTickmarkPositionsPropertyChanged));
-
-        private static void OnTickmarkPositionsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            var bar = (Tickbar)d;
-
-            if (bar.MinorTickmarkTemplate == null)
-                bar.MinorTickmarkTemplate = _defaultTickmarkTemplate;
-
-            var newTickPositions = (IEnumerable<double>)e.NewValue;
-            var oldTickPositions = (IEnumerable<double>)e.OldValue;
-            var newTickCount = newTickPositions == null ? 0 : newTickPositions.Count();
-            var oldTickCount = oldTickPositions == null ? 0 : oldTickPositions.Count();
-
-            if (newTickCount < oldTickCount)
-            {
-                // Reduce the number of ticks to the number of positions specified
-                for (var i = oldTickCount; i > newTickCount; i--)
-                {
-                    var tickToRemove = bar._majorTickmarks[i - 1];
-                    bar.Children.Remove(tickToRemove);
-                    bar._majorTickmarks.Remove(tickToRemove);
-
-                    tickToRemove = bar._minorTickmarks[i - 1];
-                    bar.Children.Remove(tickToRemove);
-                    bar._minorTickmarks.Remove(tickToRemove);
-                }
-
-                // Update the positions of the remaining ticks
-                for (var i = 0; i < bar.Children.Count; i++)
-                {
-                    bar._minorTickmarks[i].SetValue(PositionProperty, newTickPositions.ElementAt(i));
-                    bar._majorTickmarks[i].SetValue(PositionProperty, newTickPositions.ElementAt(i));
-                }
-            }
-            else if (newTickPositions != null)
-            {
-                for (var i = 0; i < newTickCount; i++)
-                {
-                    if (i < oldTickCount)
-                    {
-                        // Update positions of existing ticks
-                        bar._minorTickmarks[i].SetValue(PositionProperty, newTickPositions.ElementAt(i));
-                        bar._majorTickmarks[i].SetValue(PositionProperty, newTickPositions.ElementAt(i));
-                    }
-                    else
-                    {
-                        // Add new ticks to bring the number of ticks up to the number of positions specified
-                        var tickDataSource = bar.TickmarkDataSources == null || i >= bar.TickmarkDataSources.Count() ? null : bar.TickmarkDataSources.ElementAt(i);
-                        bar.AddTickmark(newTickPositions.ElementAt(i), tickDataSource);
-                    }
-                }
-            }
-            bar.InvalidateMeasureAndArrange();
-        }
-
-        /// <summary>
-        /// Gets or sets the tick mark positions
-        /// </summary>
-        /// <value>The tick mark positions.</value>
-        public IEnumerable<object> TickmarkDataSources
-        {
-            get { return (IEnumerable<object>)GetValue(TickmarkDataSourcesProperty); }
-            set { SetValue(TickmarkDataSourcesProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="TickmarkDataSources"/> dependency property.
-        /// </summary>
-        public static readonly DependencyProperty TickmarkDataSourcesProperty =
-            DependencyProperty.Register(nameof(TickmarkDataSources), typeof(IEnumerable<object>), typeof(Tickbar), new PropertyMetadata(OnTickMarkDataSourcesPropertyChanged));
-
-        private static void OnTickMarkDataSourcesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            var bar = (Tickbar)d;
-            var newDataSources = e.NewValue == null ? new List<object>() : (IEnumerable<object>)e.NewValue;
-
-            for (var i = 0; i < bar._majorTickmarks.Count; i++)
-            {
-                bar._majorTickmarks[i].Content = i < newDataSources.Count() ? newDataSources.ElementAt(i) : null;
-            }
-        }
-
-        /// <summary>
-        /// Adds a tick to the bar's visual tree
-        /// </summary>
-        /// <param name="position">The position to place the tick at along the tick bar</param>
-        /// <param name="dataSource">The data to pass to the tick's template</param>
-        private void AddTickmark(double position, object dataSource)
-        {
-            // Create both a minor and major tick mark at the specified position.  Layout logic will determine which
-            // one to actually show at the position.
-
-            // Create a minor tickmark
-            ContentPresenter c = new ContentPresenter()
-            {
-                VerticalAlignment = VerticalAlignment.Top,
-                Content = dataSource
-            };
-            c.SetValue(PositionProperty, position);
-            c.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding()
-            {
-                Source = this,
-                BindsDirectlyToSource = true,
-                Path = new PropertyPath(nameof(MinorTickmarkTemplate)),
-            });
-            Children.Add(c);
-            _minorTickmarks.Add(c);
-
-            // Create a major tickmark
-            c = new ContentPresenter()
-            {
-                VerticalAlignment = VerticalAlignment.Top,
-                Content = dataSource
-            };
-            c.SetValue(PositionProperty, position);
-            c.SetValue(IsMajorTickmarkProperty, true);
-            c.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding()
-            {
-                Source = this,
-                BindsDirectlyToSource = true,
-                Path = new PropertyPath(nameof(MajorTickmarkTemplate))
-            });
-
-            if (TickLabelFormat != null)
-            {
-                ApplyTickLabelFormat(c, TickLabelFormat);
-            }
-            Children.Add(c);
-            _majorTickmarks.Add(c);
-        }
-
-        /// <summary>
-        /// Gets or sets the item template for each minor tick mark
-        /// </summary>
-        public DataTemplate MinorTickmarkTemplate
-        {
-            get { return (DataTemplate)GetValue(MinorTickmarkTemplateProperty); }
-            set { SetValue(MinorTickmarkTemplateProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="MinorTickmarkTemplate"/> dependency property.
-        /// </summary>
-        public static readonly DependencyProperty MinorTickmarkTemplateProperty =
-            DependencyProperty.Register(nameof(MinorTickmarkTemplate), typeof(DataTemplate), typeof(Tickbar));
-
-        /// <summary>
-        /// Gets or sets the item template for each major tick mark
-        /// </summary>
-        public DataTemplate MajorTickmarkTemplate
-        {
-            get { return (DataTemplate)GetValue(MajorTickmarkTemplateProperty); }
-            set { SetValue(MajorTickmarkTemplateProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="MajorTickmarkTemplate"/> dependency property.
-        /// </summary>
-        public static readonly DependencyProperty MajorTickmarkTemplateProperty =
-            DependencyProperty.Register(nameof(MajorTickmarkTemplate), typeof(DataTemplate), typeof(Tickbar));
-
-        /// <summary>
-        /// Gets or sets the fill color for each tick mark
-        /// </summary>
-        public Brush TickFill
-        {
-            get { return (Brush)GetValue(TickFillProperty); }
-            set { SetValue(TickFillProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="TickFill"/> dependency property
-        /// </summary>
-        public static readonly DependencyProperty TickFillProperty =
-            DependencyProperty.Register(nameof(TickFill), typeof(Brush), typeof(Tickbar), null);
-
-        /// <summary>
-        /// Gets or sets whether to display labels on the ticks
-        /// </summary>
-        /// <value>The item template.</value>
-        public bool ShowTickLabels
-        {
-            get { return (bool)GetValue(ShowTickLabelsProperty); }
-            set { SetValue(ShowTickLabelsProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="ShowTickLabels"/> dependency property
-        /// </summary>
-        public static readonly DependencyProperty ShowTickLabelsProperty =
-            DependencyProperty.Register(nameof(ShowTickLabels), typeof(bool), typeof(Tickbar), new PropertyMetadata(OnShowTickLabelsPropertyChanged));
-
-        private static void OnShowTickLabelsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            // Invoke a layout pass to account for tick labels being shown or hidden
-            ((Tickbar)d).InvalidateMeasureAndArrange();
-        }
-
-
-        /// <summary>
-        /// Gets or sets the string format to use for displaying the tick labels
-        /// </summary>
-        public string TickLabelFormat
-        {
-            get { return (string)GetValue(TickLabelFormatProperty); }
-            set { SetValue(TickLabelFormatProperty, value); }
-        }
-
-        /// <summary>
-        /// Identifies the <see cref="TickLabelFormat"/> dependency property.
-        /// </summary>
-        public static readonly DependencyProperty TickLabelFormatProperty =
-            DependencyProperty.Register(nameof(TickLabelFormat), typeof(string), typeof(Tickbar),
-                new PropertyMetadata(OnTickLabelFormatPropertyChanged));
-
-        private static void OnTickLabelFormatPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            var tickbar = (Tickbar)d;
-
-            // Update the label format string for each of the major ticks
-            foreach (var majorTick in tickbar._majorTickmarks)
-            {
-                tickbar.ApplyTickLabelFormat(majorTick, e.NewValue as string);
-            }
-
-            // Invoke a layout pass to accommodate new label sizes
-            tickbar.InvalidateMeasureAndArrange();
-        }
-
-        private void ApplyTickLabelFormat(ContentPresenter tick, string tickLabelFormat)
-        {
-            // The tick element must be loaded to access its visual tree
-            if (tick.IsLoaded)
-            {
-                // Find the tick label in the visual tree
-                var tickTemplate = tick.ContentTemplate;
-                var labelTextBlock = tickTemplate.FindName("TickLabel", tick) as TextBlock;
-                labelTextBlock.UpdateStringFormat(
-                    targetProperty: TextBlock.TextProperty,
-                    stringFormat: tickLabelFormat,
-                    fallbackFormat: ref _originalTickLabelFormat);
-            }
-            else // !tick.IsLoaded
-            {
-                // Defer the method call until the tick element is loaded
-                void tickLoadedHandler(object o, RoutedEventArgs e)
-                {
-                    ApplyTickLabelFormat(tick, tickLabelFormat);
-                    tick.Loaded -= tickLoadedHandler;
-                }
-
-                tick.Loaded += tickLoadedHandler;
-            }
-        }
-
-        private void InvalidateMeasureAndArrange()
-        {
-            InvalidateMeasure();
-            InvalidateArrange();
-        }
-    }
-}
-
-#endif


Bug note

Bug note

--- Desktop/Providers/Network/NetworkConnection.cs
+++ Desktop/Providers/Network/NetworkConnection.cs
@@ -687,14 +687,15 @@
 				remainingData -= length;
 			}

+			// BUG: This runs every time a ReceiveAsync completes without having received the whole message
 			if (remainingData > 0 || messageOffset + BaseHeaderLength >= buffer.Length)
 			{
-				byte[] newBuffer = new byte[(length > buffer.Length) ? length : buffer.Length];
-				reader = new BufferValueReader (newBuffer, 0, newBuffer.Length);
-				Buffer.BlockCopy (buffer, messageOffset, newBuffer, 0, remainingData);
-				buffer = newBuffer;
-				bufferOffset = remainingData;
-				messageOffset = 0;
+			    byte[] newBuffer = new byte[(length > buffer.Length) ? length : buffer.Length];
+			    reader = new BufferValueReader (newBuffer, 0, newBuffer.Length);
+			    Buffer.BlockCopy (buffer, messageOffset, newBuffer, 0, remainingData);
+			    buffer = newBuffer;
+			    bufferOffset = remainingData;
+			    messageOffset = 0;
 			}

 			Trace.WriteLineIf (NTrace.TraceVerbose, "Exiting", String.Format ("{0}:{6} {1}:BufferMessages({2},{3},{4},{5})", this.typeName, c, buffer.Length, bufferOffset, messageOffset, remainingData, connectionId));


Added session id and channel role in resent message metadata

--- src/Lime.Protocol/Network/Modules/Resend/ResendMessagesChannelModule.cs
+++ src/Lime.Protocol/Network/Modules/Resend/ResendMessagesChannelModule.cs
@@ -4,12 +4,15 @@
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using Lime.Protocol.Client;

 namespace Lime.Protocol.Network.Modules.Resend
 {
     public class ResendMessagesChannelModule : IChannelModule<Message>, IChannelModule<Notification>, IDisposable
     {
         const string RESENT_COUNT_METADATA_KEY = "#resentCount";
+        const string RESENT_SESSION_KEY = "#resentSession";
+        const string RESENT_CHANNEL_ROLE_METADATA_KEY = "#resentChannelRole";

         private readonly IChannel _channel;
         private readonly IMessageStorage _messageStorage;
@@ -224,10 +227,12 @@
             return 0;
         }

-        private static void SetMessageResendCount(Message expiredMessage, int resendCount)
+        private void SetMessageResendCount(Message expiredMessage, int resendCount)
         {
             if (expiredMessage.Metadata == null) expiredMessage.Metadata = new Dictionary<string, string>();
             expiredMessage.Metadata[RESENT_COUNT_METADATA_KEY] = resendCount.ToString();
+            expiredMessage.Metadata[RESENT_SESSION_KEY] = _channel.SessionId;
+            expiredMessage.Metadata[RESENT_CHANNEL_ROLE_METADATA_KEY] = _channel is IClientChannel ? "Client" : "Server";
         }

         public void Dispose()


Consistant formatting

Consistant formatting

--- Source/TeaCommerce.Umbraco.Install/Installer.cs
+++ Source/TeaCommerce.Umbraco.Install/Installer.cs
@@ -195,7 +195,7 @@

           #region 3.2.5

-          if ( stepTargetVersion == 6)
+          if ( stepTargetVersion == 6 )
           {
             #region Remove old payment provider dependencies


Split the client adapter into an abstract base and templated implementation.

--- JetBlack.MessageBus.TopicBus/Adapters/Client.cs
+++ JetBlack.MessageBus.TopicBus/Adapters/Client.cs
@@ -9,18 +9,14 @@

 namespace JetBlack.MessageBus.TopicBus.Adapters
 {
-    public class Client<T>
+    public abstract class Client
     {
-        public event EventHandler<DataReceivedEventArgs<T>> OnDataReceived;
         public event EventHandler<ForwardedSubscriptionEventArgs> OnForwardedSubscription;
-        public event EventHandler<AuthenticationResponseEventArgs<T>> OnAuthenticationResponse;

-        private readonly IByteEncoder<T> _byteEncoder;
         private readonly IObserver<Message> _messageObserver;

-        public Client(Socket socket, IByteEncoder<T> byteEncoder, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
+        protected Client(Socket socket, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
         {
-            _byteEncoder = byteEncoder;
             var bufferManager = BufferManager.CreateBufferManager(maxBufferPoolSize, maxBufferSize);
             socket.ToMessageObservable(bufferManager).SubscribeOn(scheduler).Subscribe(Dispatch, token);
             _messageObserver = socket.ToMessageObserver(bufferManager, token);
@@ -31,16 +27,16 @@
             switch (message.MessageType)
             {
                 case MessageType.MulticastData:
-                    RaiseOnData((MulticastData) message);
+                    RaiseOnData((MulticastData)message);
                     break;
                 case MessageType.UnicastData:
-                    RaiseOnData((UnicastData) message);
+                    RaiseOnData((UnicastData)message);
                     break;
                 case MessageType.ForwardedSubscriptionRequest:
-                    RaiseOnForwardedSubscriptionRequest((ForwardedSubscriptionRequest) message);
+                    RaiseOnForwardedSubscriptionRequest((ForwardedSubscriptionRequest)message);
                     break;
                 case MessageType.ForwardedAuthenticationResponse:
-                    RaiseOnAuthenticationResponse((ForwardedAuthenticationResponse) message);
+                    RaiseOnAuthenticationResponse((ForwardedAuthenticationResponse)message);
                     break;
                 default:
                     throw new ArgumentException("invalid message type");
@@ -57,29 +53,29 @@
             _messageObserver.OnNext(new SubscriptionRequest(topic, false));
         }

-        public void Send(int clientId, string topic, bool isImage, T data)
+        protected void Send(int clientId, string topic, bool isImage, byte[] data)
         {
-            _messageObserver.OnNext(new UnicastData(clientId, topic, isImage, _byteEncoder.Encode(data)));
+            _messageObserver.OnNext(new UnicastData(clientId, topic, isImage, data));
         }

-        public void Publish(string topic, bool isImage, T data)
+        protected void Publish(string topic, bool isImage, byte[] data)
         {
-            _messageObserver.OnNext(new MulticastData(topic, isImage, _byteEncoder.Encode(data)));
+            _messageObserver.OnNext(new MulticastData(topic, isImage, data));
         }

-        public virtual void AddNotification(string topicPattern)
+        public void AddNotification(string topicPattern)
         {
             _messageObserver.OnNext(new NotificationRequest(topicPattern, true));
         }

-        public virtual void RemoveNotification(string topicPattern)
+        public void RemoveNotification(string topicPattern)
         {
             _messageObserver.OnNext(new NotificationRequest(topicPattern, false));
         }

-        public void RequestAuthentication(T data)
+        public void RequestAuthentication(byte[] data)
         {
-            _messageObserver.OnNext(new AuthenticationRequest(_byteEncoder.Encode(data)));
+            _messageObserver.OnNext(new AuthenticationRequest(data));
         }

         private void RaiseOnForwardedSubscriptionRequest(ForwardedSubscriptionRequest message)
@@ -91,26 +87,64 @@

         private void RaiseOnData(MulticastData message)
         {
-            RaiseOnData(message.Topic, _byteEncoder.Decode(message.Data), false);
+            RaiseOnData(message.Topic, message.Data, false);
         }

         private void RaiseOnData(UnicastData message)
         {
-            RaiseOnData(message.Topic, _byteEncoder.Decode(message.Data), true);
+            RaiseOnData(message.Topic, message.Data, true);
         }

-        private void RaiseOnData(string topic, T data, bool isImage)
+        protected abstract void RaiseOnData(string topic, byte[] data, bool isImage);
+
+        private void RaiseOnAuthenticationResponse(ForwardedAuthenticationResponse forwardedAuthenticationResponse)
+        {
+            RaiseOnAuthenticationResponse(forwardedAuthenticationResponse.Status, forwardedAuthenticationResponse.Data);
+        }
+
+        protected abstract void RaiseOnAuthenticationResponse(AuthenticationStatus status, byte[] data);
+    }
+
+    public class Client<T> : Client
+    {
+        public event EventHandler<DataReceivedEventArgs<T>> OnDataReceived;
+        public event EventHandler<AuthenticationResponseEventArgs<T>> OnAuthenticationResponse;
+
+        private readonly IByteEncoder<T> _byteEncoder;
+
+        public Client(Socket socket, IByteEncoder<T> byteEncoder, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
+            : base(socket, maxBufferPoolSize, maxBufferSize, scheduler, token)
+        {
+            _byteEncoder = byteEncoder;
+        }
+
+        public void Send(int clientId, string topic, bool isImage, T data)
+        {
+            Send(clientId, topic, isImage, _byteEncoder.Encode(data));
+        }
+
+        public void Publish(string topic, bool isImage, T data)
+        {
+            Publish(topic, isImage, _byteEncoder.Encode(data));
+        }
+
+        public void RequestAuthentication(T data)
+        {
+            RequestAuthentication(_byteEncoder.Encode(data));
+        }
+
+        protected override void RaiseOnData(string topic, byte[] data, bool isImage)
         {
             var handler = OnDataReceived;
             if (handler != null)
-                handler(this, new DataReceivedEventArgs<T>(topic, data, isImage));
+                handler(this, new DataReceivedEventArgs<T>(topic, _byteEncoder.Decode(data), isImage));
         }

-        private void RaiseOnAuthenticationResponse(ForwardedAuthenticationResponse forwardedAuthenticationResponse)
+        protected override void RaiseOnAuthenticationResponse(AuthenticationStatus status, byte[] data)
         {
             var handler = OnAuthenticationResponse;
             if (handler != null)
-                OnAuthenticationResponse(this, new AuthenticationResponseEventArgs<T>(forwardedAuthenticationResponse.Status, _byteEncoder.Decode(forwardedAuthenticationResponse.Data)));
+                OnAuthenticationResponse(this, new AuthenticationResponseEventArgs<T>(status, _byteEncoder.Decode(data)));
         }
     }
 }


Fix break in XmlSerializerOutputFormatter tests

The wrong type is being passed in to the wrapper-provider for
XmlSerializer. DCS formatter is already correct.

--- src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs
+++ src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs
@@ -169,7 +169,7 @@
                 if (wrappingType != null && wrappingType != context.ObjectType)
                 {
                     var wrapperProvider = WrapperProviderFactories.GetWrapperProvider(new WrapperProviderContext(
-                        declaredType: wrappingType,
+                        declaredType: context.ObjectType,
                         isSerialization: true));

                     value = wrapperProvider.Wrap(value);


Change EngineVersion to "3.5.0.0" for attribute Extension for TeamCityEventListener

--- src/NUnitEngine/Addins/teamcity-event-listener/TeamCityEventListener.cs
+++ src/NUnitEngine/Addins/teamcity-event-listener/TeamCityEventListener.cs
@@ -34,7 +34,7 @@
     // purely documentary since engines prior to 3.6 do not
     // check the EngineVersion property and will try to
     // load this extension anyway.
-    [Extension(Enabled = false, EngineVersion = "3.6")]
+    [Extension(Enabled = false, EngineVersion = "3.5.0.0")]
     public class TeamCityEventListener : ITestEventListener
     {
         private readonly TextWriter _outWriter;


Broke down TransactionController.Post into sub methods

--- src/Portrack/Portrack/Controllers/Application/TransactionsController.cs
+++ src/Portrack/Portrack/Controllers/Application/TransactionsController.cs
@@ -9,102 +9,119 @@

 namespace Portrack.Controllers.Application
 {
-    /// <summary>
-    /// API class class against which all the transactions call are made.
-    /// All the calls in this class need authorization.
-    /// </summary>
-    [RoutePrefix("api/transactions")]
-    public class TransactionsController : BaseController
-    {
-        /// <summary>
-        /// Class constructor which injected 'IApplicationRepository' dependency.
-        /// </summary>
-        /// <param name="repository">Injected 'IApplicationRepository' dependency.</param>
-        /// <param name="provider">Injected 'IMarketDataProvider' dependency.</param>
-        public TransactionsController(IApplicationRepository repository, IMarketDataProvider provider)
-            : base(repository, provider)
-        {
-        }
+	/// <summary>
+	/// API class class against which all the transactions call are made.
+	/// All the calls in this class need authorization.
+	/// </summary>
+	[RoutePrefix("api/transactions")]
+	public class TransactionsController : BaseController
+	{
+		/// <summary>
+		/// Class constructor which injected 'IApplicationRepository' dependency.
+		/// </summary>
+		/// <param name="repository">Injected 'IApplicationRepository' dependency.</param>
+		/// <param name="provider">Injected 'IMarketDataProvider' dependency.</param>
+		public TransactionsController(IApplicationRepository repository, IMarketDataProvider provider)
+			: base(repository, provider)
+		{
+		}

-        /// <summary>
-        /// Get method to get the transactions of the current authenticated user.
-        /// </summary>
-        /// <param name="portfolioName">Comma-separated string of the portfolio name.</param>
-        /// <param name="tickers">Comma-separated string of the tickers wanted.</param>
-        /// <returns>Ok status with a list of transactions.</returns>
-        [Route("{portfolioName?}/{tickers?}")]
-        [HttpGet]
-        public async Task<IHttpActionResult> Get(string portfolioName = null, string tickers = null)
-        {
-            ICollection<Transaction> transactions;
-            if (string.IsNullOrWhiteSpace(portfolioName))
-            {
-                transactions = await _repository.GetTransactionsAsync(User.Identity.Name);
-                return Ok(transactions);
-            }
+		/// <summary>
+		/// Get method to get the transactions of the current authenticated user.
+		/// </summary>
+		/// <param name="portfolioName">Comma-separated string of the portfolio name.</param>
+		/// <param name="tickers">Comma-separated string of the tickers wanted.</param>
+		/// <returns>Ok status with a list of transactions.</returns>
+		[Route("{portfolioName?}/{tickers?}")]
+		[HttpGet]
+		public async Task<IHttpActionResult> Get(string portfolioName = null, string tickers = null)
+		{
+			ICollection<Transaction> transactions;
+			if (string.IsNullOrWhiteSpace(portfolioName))
+			{
+				transactions = await _repository.GetTransactionsAsync(User.Identity.Name);
+				return Ok(transactions);
+			}

-            if (string.IsNullOrWhiteSpace(tickers))
-            {
-                transactions = await _repository.GetTransactionsAsync(User.Identity.Name, portfolioName);
-                return Ok(transactions);
-            }
+			if (string.IsNullOrWhiteSpace(tickers))
+			{
+				transactions = await _repository.GetTransactionsAsync(User.Identity.Name, portfolioName);
+				return Ok(transactions);
+			}

-            IEnumerable<string> tickerEnum = tickers.Split(',').Select(s => s.Trim());
-            transactions = await _repository.GetTransactionsAsync(User.Identity.Name, portfolioName, tickerEnum);
-            return Ok(transactions);
-        }
+			IEnumerable<string> tickerEnum = tickers.Split(',').Select(s => s.Trim());
+			transactions = await _repository.GetTransactionsAsync(User.Identity.Name, portfolioName, tickerEnum);
+			return Ok(transactions);
+		}

-        /// <summary>
-        /// Post method to upload a new transacton for the current authenticated user.
-        /// </summary>
-        /// <param name="portfolio">The embodied transaction to upload.</param>
-        /// <returns>
-        ///     Ok(createdPortfolio) if datalayer accepted transaction.
-        ///     BadRequest(ModelState) if modelstate is invalid.
-        /// </returns>
-        [Route("")]
-        [HttpPost]
-        public async Task<IHttpActionResult> Post([FromBody]Transaction transaction)
-        {
-            if (!ModelState.IsValid) return BadRequest(ModelState);
+		/// <summary>
+		/// Post method to upload a new transacton for the current authenticated user.
+		/// </summary>
+		/// <param name="portfolio">The embodied transaction to upload.</param>
+		/// <returns>
+		///     Ok(createdPortfolio) if datalayer accepted transaction.
+		///     BadRequest(ModelState) if modelstate is invalid.
+		/// </returns>
+		[Route("")]
+		[HttpPost]
+		public async Task<IHttpActionResult> Post([FromBody]Transaction transaction)
+		{
+			if (!ModelState.IsValid) return BadRequest(ModelState);

+			// Get the portfolio represented by the PortfolioName in the posted transaction.
+			Portfolio portfolio = await _repository.GetPortfolioAsync(User.Identity.Name, transaction.PortfolioName, true, true);
+			IHttpActionResult portFolioError;
+			if ((portFolioError = checkForPortfolioError(portfolio, transaction)) != null)
+			{
+				return portFolioError;
+			}
+
+			// Get the instrument represented by the Ticker in the posted transaction
+			Instrument instrument = await _repository.GetInstrumentAsync(transaction.Ticker);
+			if (instrument == null)
+			{
+				return Ok(TransactionResult.Failed(portfolio, null, transaction,
+					string.Format("Instrument '{0}' doens't exist.", transaction.Ticker)));
+			}
+
+			// Get the position associated position if it exists.
+			Position position = await _repository.GetPositionAsync(portfolio.UserName, portfolio.PortfolioName, instrument.Ticker);

-            // Get the portfolio represented by the PortfolioName in the posted transaction.
-            Portfolio portfolio = await _repository.GetPortfolioAsync(User.Identity.Name, transaction.PortfolioName, true, true);
-            if (portfolio == null)
-                return Ok(TransactionResult.Failed(null, null, transaction,
-                    string.Format("Portfolio '{0}' | '{1}' not found.", User.Identity.Name, transaction.PortfolioName)));
+			// Add the transaction and get the transaction result.
+			TransactionResult result = portfolio.AddTransaction(transaction, position, instrument);
+			clearPositionIfNoMoreShares(result);

-            if (portfolio.Positions == null)
-                return InternalServerError(new Exception("Positions loading for portfolio failed."));
-            if (portfolio.Transactions == null)
-                return InternalServerError(new Exception("Transactions loading for portfolio failed."));
-
+			// Send the changes made in the data layer to the database and return the transaction results.
+			await _repository.SaveAsync();
+			return Ok(result);
+		}

-            // Get the instrument represented by the Ticker in the posted transaction
-            Instrument instrument = await _repository.GetInstrumentAsync(transaction.Ticker);
-            if (instrument == null)
-                return Ok(TransactionResult.Failed(portfolio, null, transaction,
-                    string.Format("Instrument '{0}' doens't exist.", transaction.Ticker)));
+		private IHttpActionResult checkForPortfolioError(Portfolio portfolio, Transaction transaction)
+		{
+			IHttpActionResult retVal = null;
+			if (portfolio == null)
+			{
+				return Ok(TransactionResult.Failed(null, null, transaction,
+					string.Format("Portfolio '{0}' | '{1}' not found.", User.Identity.Name, transaction.PortfolioName)));
+			} else if (portfolio.Positions == null)
+			{
+				retVal = InternalServerError(new Exception("Positions loading for portfolio failed."));
+			} else if (portfolio.Transactions == null)
+			{
+				retVal = InternalServerError(new Exception("Transactions loading for portfolio failed."));
+			}

+			return retVal;
+		}

-            // Get the position associated position if it exists.
-            Position position = await _repository.GetPositionAsync(portfolio.UserName, portfolio.PortfolioName, instrument.Ticker);
+		private void clearPositionIfNoMoreShares(TransactionResult result) {
+			if (result.IsSuccess && result.Position.Shares == 0)
+			{
+				_repository.DeletePositionAsync(result.Position);
+			}
+		}

-
-            // Add the transaction and get the transaction result.
-            TransactionResult result = portfolio.AddTransaction(transaction, position, instrument);
-            if (result.IsSuccess && result.Position.Shares == 0) // if no more shares in the position, delete it.
-            {
-                _repository.DeletePositionAsync(result.Position);
-            }
-
-
-            // Send the changes made in the data layer to the database and return the transaction results.
-            await _repository.SaveAsync();
-            return Ok(result);
-        }
-    }
+	}
 }


Set IndexedAttachments to version 2.0.3.0

--- src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
+++ src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
@@ -2,5 +2,5 @@

 [assembly: AssemblyTitle("Raven.Bundles.Contrib.IndexedAttachments")]
 [assembly: AssemblyDescription("Plugin for RavenDB that extracts text from attachments so they can be indexed.")]
-[assembly: AssemblyVersion("2.0.2.0")]
-[assembly: AssemblyFileVersion("2.0.2.0")]
+[assembly: AssemblyVersion("2.0.3.0")]
+[assembly: AssemblyFileVersion("2.0.3.0")]


#112 bug fix for unicode non-xml supported chars

Fixes #112

--- src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/XmlPropertyFormatter.cs
+++ src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/XmlPropertyFormatter.cs
@@ -1,4 +1,4 @@
-// Copyright 2015 Serilog Contributors
+// Copyright 2015 Serilog Contributors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -28,6 +28,14 @@
     /// </summary>
     public static class XmlPropertyFormatter
     {
+
+        /// <summary>
+        /// Regex to trasnform any non-xml char into ?, acoiding any exceptions on inserting the xml properties into the database
+        /// </summary>
+        private static Regex _invalidXMLChars = new Regex(
+        @"(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFEFF\uFFFE\uFFFF]",
+        RegexOptions.Compiled);
+
         /// <summary>
         ///     Simplify the object so as to make handling the serialized
         ///     representation easier.
@@ -204,7 +212,7 @@
         {
             if (value == null) return null;

-            return new XText(value.ToString()).ToString();
+            return new XText(_invalidXMLChars.Replace(value.ToString(), m => "\\u" + ((int)(byte)m.Value[0]).ToString("x4"))).ToString();
         }
     }
-}+}


Cleand up source code (removed todos into own file)

--- CsLisp/Fuel.cs
+++ CsLisp/Fuel.cs
@@ -77,7 +77,7 @@
             if (args.Contains("--doc"))
             {
                 script = "(println (doc))";
-                loadFiles = false;
+                loadFiles = false;
             }
             if (args.Contains("--html"))
             {
@@ -121,7 +121,7 @@
                 if (args.Contains("-i"))
                 {
                     InteractiveLoopHeader(output);
-                    debugger.InteractiveLoop(startedFromMain:true, tracing: trace);
+                    debugger.InteractiveLoop(startedFromMain: true, tracing: trace);
                     loadFiles = false;
                     wasDebugging = true;
                 }
@@ -142,9 +142,9 @@
                     result = debugger.DebuggerLoop(script, fileName, tracing: trace);
                     loadFiles = false;
                     wasDebugging = true;
-                }
-            }
-
+                }
+            }
+
             if (loadFiles)
             {
                 var scriptFiles = LispUtils.GetScriptFilesFromProgramArgs(args);
@@ -196,12 +196,12 @@
             output.WriteLine("  -v          : show version");
             output.WriteLine("  -h          : show help");
             output.WriteLine("  -e \"script\" : execute given script");
-			output.WriteLine("  -l=\"path\"   : path to library");
+            output.WriteLine("  -l=\"path\"   : path to library");
             output.WriteLine("  --doc       : show language documentation");
             output.WriteLine("  --html      : show language documentation in html");
             output.WriteLine("  -m          : measure execution time");
-			output.WriteLine("  -t          : enable tracing");
-			output.WriteLine("  -x          : exhaustive error output");
+            output.WriteLine("  -t          : enable tracing");
+            output.WriteLine("  -x          : exhaustive error output");
             if (TryGetDebugger() != null)
             {
                 output.WriteLine("  -i          : interactive shell");
@@ -220,7 +220,7 @@
             else
             {
                 output.WriteLine();
-                output.WriteLine("Info: no compiler support installed !");
+                output.WriteLine("Info: no compiler support installed !");
             }
             output.WriteLine();
         }
@@ -241,7 +241,7 @@
         {
             return TryGetClassFromDll<ILispDebugger>("FuelDebugger.dll", "CsLisp.LispDebugger");
         }
-
+
         private static T TryGetClassFromDll<T>(string dllName, string className)
         {
             var applicationPath = GetApplicationPath();
@@ -270,320 +270,4 @@

         #endregion
     }
-
-
-    // TODO:
-    // (- License und Copyright header in quellcode dateien einbauen
-    // - Quellcode aufraeumen
-    // - Dokumentation fuer homepage auf github (Einfuehrung fuel) --> siehe https://bitbucket.org/ktg/lfgo
-    // - Logo Icon fuer fuel erstellen ?
-    // - Umbenennen CsLispInterpreter.dll --> FuelInterpreter.dll etc. ?
-    // - Namespace CsLisp in Fuel ?
-    // - ggf. einfacheres foreach mit native objekten --> Dict, List, Array --> ggf. in fuellib ?
-    // (- Einfache Registrierung von application objects via API ermoeglichen
-    // (- Unit Test und Anwendungs Beispiel fuer Registrierung von App Objekten
-    // (- weitere stdlib objekte in test script testen
-    // (- Suchen nach Funktionen Doku ermoeglichen: help File oder help File-WriteAllText... wildcard suche ?
-    // (- Unit test fuer (doc 'blub)
-    // (- timer funktionen in builtin functions aufnehmen
-    // (- Todos entfernen
-    // (- FileInfo, Directory Klasse in stdlib hinzufuegen
-    // (- Native Methoden dokumentieren unterstuetzen, auslesen aus .NET api ?
-    // (- Bug: erlaube \n in string konstanten...
-    // (- (do ...) in jedem fuel file vermeiden (automatisch erzeugen?)
-    // (- API Dokumentation in html aus dem Code generieren...
-    // (- TODOs behandeln
-    // (- Makro Behandlung aufraeumen
-    // (- setf macro implementieren...
-    // (- unit test reparieren (output/input queue behandlung)
-    // (- unit tests erweitern um neue Features: set breakpoints in modulen, debuggen von modulen, line no anzeige in stack, source code anzeige aktualisierung in up/down
-    // (- Testabdeckung verbessern
-    // (- Tuple<int, int, int> in einen typsicheren struct verwandeln? --> gibt es auch in Interface --> unschoen !
-    // - Behandlung von Variablen im Modulen korrekt realisieren --> sind global nicht sichtbar, nur im Modul selbst --> im debugger anzeigen
-    // - ggf. weitere Verbesserung der native Methoden automatischen Dokumentation --> .NET doku zurueck liefern?
-    // - ggf. im debugger: zeige keine lokal definierte funktionen an in der liste der lokalen variablen !
-    // - ggf. debuggen: set next statement realisieren?
-    // - ggf. bug: step out funktioniert anscheinend bei modulen nicht ganz korrekt
-    // - ggf. stdlib unit tests in eigenes modul auslagern
-    // - ggf. Bug ---> (list 1 '2 3) == (list 1 2 3) d. h. '2 liefert immer int 2 und kein symbol !?
-    // (- ueberladene native methoden unterstuetzen --> argument typen pruefen --> (List-Sort ...) (List-IndexOf ...)
-    // (- Native Properties unterstuetzen --> Math.PI
-    // (- parameter in arrays unterstuetzen
-    // (- im debugger: zeige keine funktionen der std lib an !
-    // (- debuggen: show loaded module names
-    // (- debuggen: funcs befehl um module erweitern und anzeige von funktionen in modulen
-    // (- debuggen: macros --> DumpMacros implementieren
-
-    // native calls verbessern --> type mapping implementieren --> ggf. reflection optimieren --> lambda zurueckgeben?
-    // reflection zum aufloesen von funktionen verwenden?
-    // warum ist LispScope bei Environment funktionen notwendig? --> fuer meta befehle wie z. b. vars, break, trace, ...
-
-    // ggf. compiler reparieren
-    // fuer compiler: closure fuer compiler modus implementieren --> siehe ClosoureChain
-    // fuer compiler: braucht man wirklich LispToken.cs module? --> Referenzen von LispVariant.Token pruefen?
-    // fuer compiler: manche environment funktionen benoetigen den Interpreter/Eval, dies gibt doch probleme im Compile modus?
-
-    // see: https://bitbucket.org/ktg/lfgo
-
-/*
-https://news.ycombinator.com/item?id=11278065
-http://nbviewer.jupyter.org/url/norvig.com/ipython/Probability.ipynb
-http://www.qtcentre.org/threads/62415-QProcess-not-communicating-with-net-framework-gt-3-5
-https://www.tensorflow.org/
-
-http://setosa.io/ev/markov-chains/
-
-http://www.zdnet.com/article/microsoft-and-canonical-partner-to-bring-ubuntu-to-windows-10/
-
-https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/
-https://blogs.msdn.microsoft.com/visualstudio/2016/03/31/mobile-app-development-made-easy-with-visual-studio-and-xamarin/
-https://blog.xamarin.com/xamarin-for-all/
-*/
-
-    //http://www.heise.de/newsticker/meldung/Neue-Version-des-c-t-Windows-Backup-unterstuetzt-auch-Windows-10-3116411.html
-    //http://stackoverflow.com/questions/11501697/programmatically-call-c-sharp-compiler-to-compile-c-sharp-code
-
-    // (environment: hoehere Datentypen wie array/dyn-liste und map implementieren
-    // (- debuggen: run funktioniert nicht in errorinmodule.fuel
-    // ((- debuggen: anzeige module und line no in stack
-    // (- debuggen: anzeige des korrekten codes, falls module geladen ist
-    // ((- debuggen: set breakpoints in andren modulen realisieren
-    // (- debuggen: up/down sollte auch den --> Zeiger anpassen
-    // (- ist LispScope.Finished und LispScope.SourceCode noch notwendig?
-    // (- ggf. module als eigenen Scope implementieren --> ###modules###
-    // (- stdlib um list<object> erweitern, damit man immer mit listen arbeiten kann
-    // (- debugger: v (step over) funktioniert nicht so wie erwartet --> haengt bei quote
-    // ((- option -e funktioniert nicht mit -d korrekt
-    // ((- start unhd end position bei aktuellem step ausgeben --> besserer Support für debuggen
-    // ((- Start/StopPos in LispException setzen, fuer bessere fehlermeldung
-    // ((- GetPosInfoString() in Exceptions ggf. nicht mehr notwendig, da infos an Exception gesetzt wird
-    // (- tracen auch mit Start/StopPos fuer besseren debugger support  --> highlighte aktuelles statement: (+ 1 2 3)
-    // ((- Unterstuetzung fuer statische Funktionen hinzufuegen --> System.IO.File ! --> MethodInfo.IsStatic
-
-
-    /*
-mindia: pfade beim film erzeugen mit "" versehen, wegen leerzeichen im pfad !
-mindia: probleme mit msc++ in minbase.h mit mem_fun()
-mindia: filelist --> mcisendstring_test.txt; mindia_org.pro; *.bat; *.lst
-mindia: readme.txt --> windows konform CR/LF!
-mindia: demo diashow mit auslieferen und automatisch anzeigen
-mindia: einfache Anleitung erstellen (HTML) --> Dias sortieren, Sound hinzufügen, Zeiten anpassen, Ausschnitt anpassen, Dyn-Texte hinzufügen, vorführen/testen, als Film exportieren
-mindia: *.gz enthält noch ._* Dateien --> make_src_tar.sh anpassen, siehe visiscript batches
-mindia: TODO.txt nicht in source code distribution aufnehmen --> aus file.lst entfernen
-visiscript: win32-msvc2013:LIBS += ../../build-visiscript-Desktop_Qt_5_4_1_MSVC2013_32bit-Debug/QScintilla-gpl-2.9/Qt4Qt5/debug/qscintilla2.lib <-- lib aus namen entfernen
-visiscript: Execution time Ausgabe unschoen:
-Measure execution time for interpreter: QScript
-QScript return=ReferenceError: Can't find variable: graphicslib
-Fehler: unbehandelte Ausnahme in Zeile 71 ReferenceError: Can't find variable: graphicslibAusführungszeit: 150 ms
-visiscript: TODO.txt nicht in source code distribution aufnehmen --> aus file.lst entfernen
-visiscript: visiscriptextensions/files/android aus distribution entfernen --> *.lst
-    visiscriptextensions/files/windows aus distribution entfernen --> *.lst
-visiscript: main.cpp so anpassen, dass auch fuer Windows die extensions.dll (out of the box) gefunden wird und kein Pfad-Patchen notwendig ist
-#if defined(Q_OS_WIN)
-    sExtension = QCoreApplication::applicationDirPath()+QDir::separator()+"extensions/extensions%0.dll";
-
-https://todoist.com/
-
-http://www.mobiflip.de/asus-zenbook-ux303lb-testbericht/
-
-     */
-
-    //private static bool IsMacroDefine(LispVariant funcName)
-    //{
-    //    if (funcName != null)
-    //    {
-    //        var name = funcName.ToString();
-    //        return name == DEFINEMACRO;
-    //    }
-    //    return false;
-    //}
-
-    //public LispScope CurrentTop
-    //{
-    //    get
-    //    {
-    //        var current = GlobalScope;
-    //        while (current.Next != null)
-    //        {
-    //            current = current.Next;
-    //        }
-    //        return current;
-    //    }
-    //}
-
-    // TODO --> flaches expandieren ?
-    //var lstResult = expandResult as IEnumerable<object>;
-    //if (lstResult == null)
-    //{
-    //    var variant = expandResult as LispVariant;
-    //    if (variant != null && variant.IsList)
-    //    {
-    //        lstResult = variant.ListValue;
-    //    }
-    //}
-    //if (lstResult != null)
-    //{
-    //    foreach (var item in lstResult)
-    //    {
-    //        expandedAst.Add(item);
-    //    }
-    //}
-    //else
-
-    // csc /debug+ simplebench.cs ..\..\CsLispDll\LispVariant.cs ..\..\CsLispDll\LispToken.cs ..\..\CsLispDll\LispEnvironment.cs ..\..\CsLispDll\LispException.cs ..\..\CsLispDll\LispInterpreter.cs ..\..\CsLispDll\LispDebuggerInterface.cs
-    // csc /debug+ simplebench.cs /reference:cslispinterpreter.dll
-
-    /*
-    https://www.quora.com/What-are-the-special-forms-for-Scheme
-    http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Special-Forms.html#Special-Forms
-
-
-// --> http://howtowriteaprogram.blogspot.de/2010/11/lisp-interpreter-in-90-lines-of-c.html
-// --> http://stackoverflow.com/questions/6169706/lisp-interpreter-in-a-c-program
-// --> http://norvig.com/lispy.html
-// --> http://stackoverflow.com/questions/70004/using-lisp-in-c-sharp
-    (define-macro forx (lambda (e in container block) (display `(,e in ,container ,block))))
-
-    (define-macro forx (lambda (e in container block) (begin (set! e (car container)) (display `(,e in ,container ,block)))))
-
-    (define-macro forx (lambda (ee in container block) (begin (set! ee (car container)) block)))
-
-    (forx e in '(1 2 3) (display e))
-
-    geht so was mit lisp macros?
-    (forx e in [1 2 3] : print e*e)
-    (forx e in (1 2 3) : print e*e)
-
-    e  --> symbol (formaler parameter)
-    in --> keyword (kann ignoriert werden)
-    */
-
-    // OK:
-    // (help)
-    // (break)
-    // REPL loop
-    // unit tests einen ordern hoeher verschieben
-    // Kommentare parsen --> ;
-    // compare logische operatoren: ==, <, >, <=, >=, and, or, not
-    // reduce
-    // (def 6 9) ist erlaubt !!!
-    // runtime methoden robuster machen --> anzahl argumente pruefen und typ pruefen
-    // funcs --> builtin functions
-    // (vars)/vars anzeige verbessern
-    // (stack)/where implementieren
-    // debugger commands: stepout, step over, step into, callstack up/down
-    // breakpoints angeben
-    // lamba mit closures testen
-    // harte referenzen entfernen: compiler und ggf. debugger
-
-    /*
-                //LispVariant variant = args[0] as LispVariant;
-                //if (variant != null)
-                //{
-                //    if (variant.IsSymbol)
-                //    {
-                //        macroFcn = (LispVariant)LispInterpreter.ResolveArgsInScopes(scope, new object[] { variant.ToString() }, false)[0];
-                //    }
-                //}
-                //else
-                //{
-                //    macroFcn = LispInterpreter.EvalAst(args[0], scope);
-                //}
-
-
-                string program      = "(do (test 3 4 hallo  \"string \\\" \\\\ blub\" (+ 1.23 asdf -345.34)))";
-                string programX     = "(do (print \"hallo\")\n (print \"world\"))";
-                //string programY   = "(do (def a 42) (print a) (print (quote (1 2 3))))";
-                //string programY   = "(do (define-macro blub (lambda (x y) (print x y))) (print (quote (1 2 3))) (blub 3 4))";
-                //string programY   = "(apply (lambda (x) (print \"hello\" x)) 55)";
-                //string programY   = "(print `(1 2 3))";
-                //string programY   = "(print '(1 2 3))";
-                //string programY   = "(do (def a 42) (print `(1 2 3 ,@a)))";
-                //string programY   = "(do (def a '(42 99)) (print `(1 2 3 ,@a)))";
-                //string programY   = "(do (def a '(42 99)) (print (len `(1 2 3 ,@a))))";
-                //string programY   = "(do (def a '(42 99 102 \"hello\")) (def b 55) (print (type a)) (print (nth 1 `(1 2 3 ,@a))))";
-                //string programY     = "(do (def obj 0) (setf obj (call \"CsLisp.DummyNative\" \"dummy\")) (print obj (type obj)) (call obj \"Test\"))";
-                //string programY = "(do (def g_prn \"START:\") (defn prn (x) (setf g_prn (add g_prn x))) (prn (print \"hallo\")) (print g_prn))";
-                //string programY = "(do (def g_prn \"START:\") (defn prn (x) (setf g_prn (add g_prn x))) (prn \"34\") (print g_prn))";
-                //string programY = "(do (trace #t) (print \"hello world\") (gettrace))";
-                string programY = "(do (def g_prn \"START:\") (def a 42) (defn prn (x) (do (setf g_prn (add g_prn x)) (break))) (prn \"34\") (print g_prn) (break))";
-                //string programY = "(help)";
-
-                LispVariant val = Lisp.Eval(programY);
-
-                var resultx = LispInterpreter.Tokenize(programY);
-                foreach (var elem in resultx)
-                {
-                    Console.WriteLine(string.Format("{0} {1} {2}",elem, elem.Type, elem.Value));
-                }
-
-    //            Console.WriteLine("Result=" + res);
-                Console.WriteLine("done.");
-
-    // (if true (print "then") (print "else"))
-    // read token (space/whitespace and ( ) separated)
-    // --> ( if true ( print "then" ) ( print "else" ) )
-    // ( --> new List<object>
-    // ) --> close current list
-    // other --> add to current list
-
-    // Arrays ? (add [1, 2 , 3])
-    // (add '(1, 2, 3))
-
-    // state machine:
-    // WS* [QUOTE | LIST_START | SYMBOL] WS*
-    //
-    // QUOTE        = '
-    // LIST_START   = (
-    // LIST_STOP    = )
-    // LIST         = LIST_START [LIST | ITEM]* LIST_STOP
-    // ITEM         = STRING | INT | DOUBLE | SYMBOL
-    // STRING       = "..."
-    // INT
-    // DOUBLE
-    // SYMBOL       = alles not WS ' ( )
-
-     http://stackoverflow.com/questions/517113/lisp-grammar-in-yacc
-     %%
-    sexpr: atom                 {printf("matched sexpr\n");}
-        | list
-        ;
-    list: '(' members ')'       {printf("matched list\n");}
-        | '('')'                {printf("matched empty list\n");}
-        ;
-    members: sexpr              {printf("members 1\n");}
-        | sexpr members         {printf("members 2\n");}
-        ;
-    atom: ID                    {printf("ID\n");}
-        | NUM                   {printf("NUM\n");}
-        | STR                   {printf("STR\n");}
-        ;
-     %%
-
-
-
-    program: (sexpr)*;
-
-    sexpr: list
-        |  atom            {Console.WriteLine("matched sexpr");}
-        ;
-
-    list:
-       '('')'              {Console.WriteLine("matched empty list");}
-       | '(' members ')'   {Console.WriteLine("matched list");}
-
-        ;
-
-    members: (sexpr)+      {Console.WriteLine("members 1");};
-
-    atom: Id               {Console.WriteLine("ID");}
-        | Num              {Console.WriteLine("NUM");}
-        ;
-
-
-    Num: ( '0' .. '9')+;
-    Id: ('a' .. 'z' | 'A' .. 'Z')+;
-    Whitespace : ( ' ' | '\r' '\n' | '\n' | '\t' ) {Skip();};
-
-     */
 }


Fix new media not showing in published cache

--- src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
+++ src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
@@ -141,7 +141,7 @@
                 .OrderBy<NodeDto>(x => x.Level, x => x.SortOrder);

             var dto = scope.Database.Fetch<ContentSourceDto>(sql).FirstOrDefault();
-            return dto == null ? new ContentNodeKit() : CreateContentNodeKit(dto);
+            return dto == null ? new ContentNodeKit() : CreateMediaNodeKit(dto);
         }

         public IEnumerable<ContentNodeKit> GetAllMediaSources(IScope scope)


Fix incorrect xlsx export of DataSet (ListOfTables) results

--- KInspector.Modules/Export/Modules/ExportXlsx.cs
+++ KInspector.Modules/Export/Modules/ExportXlsx.cs
@@ -69,7 +69,13 @@
                         ISheet currentSheet = document.CreateSheet(moduleName);
                         foreach (DataTable tab in data.Tables)
                         {
-                            currentSheet.CreateRow(tab);
+                            // Create header
+                            currentSheet.CreateRow(tab.TableName);
+                            // Write data
+                            currentSheet.CreateRows(tab);
+
+                            // Create divider
+                            currentSheet.CreateRow();
                         }

                         resultSummary.CreateRow(moduleName, "See details in tab", result.ResultComment, meta.Comment);