re-format whitespace for test

re-format whitespace for test

--- tests/ServiceStack.Redis.Tests/RedisClientListTests.cs
+++ tests/ServiceStack.Redis.Tests/RedisClientListTests.cs
@@ -6,38 +6,38 @@

 namespace ServiceStack.Redis.Tests
 {
-	[TestFixture]
-	public class RedisClientListTests
-		: RedisClientTestsBase
-	{
-		const string ListId = "rcl_testlist";
+    [TestFixture]
+    public class RedisClientListTests
+        : RedisClientTestsBase
+    {
+        const string ListId = "rcl_testlist";
         const string ListId2 = "rcl_testlist2";
-		private List<string> storeMembers;
+        private List<string> storeMembers;

         public RedisClientListTests()
         {
             CleanMask = "rcl_testlist*";
         }

-		public override void OnBeforeEachTest()
-		{
-			base.OnBeforeEachTest();
-			storeMembers = new List<string> { "one", "two", "three", "four" };
-		}
-
-		private static void AssertAreEqual(List<string> actualList, List<string> expectedList)
-		{
-			Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
-			var i = 0;
-			actualList.ForEach(x => Assert.That(x, Is.EqualTo(expectedList[i++])));
-		}
-
-		private static void AssertAreEqual(List<string> actualList, Queue<string> expectedList)
-		{
-			Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
-			var i = 0;
-			actualList.ForEach(x => Assert.That(x, Is.EqualTo(expectedList.Dequeue())));
-		}
+        public override void OnBeforeEachTest()
+        {
+            base.OnBeforeEachTest();
+            storeMembers = new List<string> { "one", "two", "three", "four" };
+        }
+
+        private static void AssertAreEqual(List<string> actualList, List<string> expectedList)
+        {
+            Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
+            var i = 0;
+            actualList.ForEach(x => Assert.That(x, Is.EqualTo(expectedList[i++])));
+        }
+
+        private static void AssertAreEqual(List<string> actualList, Queue<string> expectedList)
+        {
+            Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
+            var i = 0;
+            actualList.ForEach(x => Assert.That(x, Is.EqualTo(expectedList.Dequeue())));
+        }

         [Test]
         public void Can_PopAndPushItemBetweenLists()
@@ -63,348 +63,348 @@
             Assert.That(r, Is.Null);
         }

-		[Test]
-		public void Can_AddToList_and_GetAllFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var members = Redis.GetAllItemsFromList(ListId);
-
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_AddRangeToList_and_GetAllFromList()
-		{
-			Redis.AddRangeToList(ListId, storeMembers);
-
-			var members = Redis.GetAllItemsFromList(ListId);
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_PrependRangeToList_and_GetAllFromList()
-		{
-			Redis.PrependRangeToList(ListId, storeMembers);
-
-			var members = Redis.GetAllItemsFromList(ListId);
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_GetListCount()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var listCount = Redis.GetListCount(ListId);
-
-			Assert.That(listCount, Is.EqualTo(storeMembers.Count));
-		}
-
-		[Test]
-		public void Can_GetItemFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var storeMember3 = storeMembers[2];
-			var item3 = Redis.GetItemFromList(ListId, 2);
-
-			Assert.That(item3, Is.EqualTo(storeMember3));
-		}
-
-		[Test]
-		public void Can_SetItemInList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			storeMembers[2] = "five";
-			Redis.SetItemInList(ListId, 2, "five");
-
-			var members = Redis.GetAllItemsFromList(ListId);
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_PopFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var item4 = Redis.PopItemFromList(ListId);
-
-			Assert.That(item4, Is.EqualTo("four"));
-		}
-
-		[Test]
-		public void Can_EnqueueOnList()
-		{
-			var queue = new Queue<string>();
-			storeMembers.ForEach(queue.Enqueue);
-			storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
-
-			while (queue.Count > 0)
-			{
-				var actual = Redis.DequeueItemFromList(ListId);
-				Assert.That(actual, Is.EqualTo(queue.Dequeue()));
-			}
-		}
-
-		[Test]
-		public void Can_DequeueFromList()
-		{
-			var queue = new Queue<string>();
-			storeMembers.ForEach(queue.Enqueue);
-			storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
-
-			var item1 = Redis.DequeueItemFromList(ListId);
-
-			Assert.That(item1, Is.EqualTo(queue.Dequeue()));
-		}
-
-        [Test]
-        public void PopAndPushSameAsDequeue()
+        [Test]
+        public void Can_AddToList_and_GetAllFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var members = Redis.GetAllItemsFromList(ListId);
+
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_AddRangeToList_and_GetAllFromList()
+        {
+            Redis.AddRangeToList(ListId, storeMembers);
+
+            var members = Redis.GetAllItemsFromList(ListId);
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_PrependRangeToList_and_GetAllFromList()
+        {
+            Redis.PrependRangeToList(ListId, storeMembers);
+
+            var members = Redis.GetAllItemsFromList(ListId);
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_GetListCount()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var listCount = Redis.GetListCount(ListId);
+
+            Assert.That(listCount, Is.EqualTo(storeMembers.Count));
+        }
+
+        [Test]
+        public void Can_GetItemFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var storeMember3 = storeMembers[2];
+            var item3 = Redis.GetItemFromList(ListId, 2);
+
+            Assert.That(item3, Is.EqualTo(storeMember3));
+        }
+
+        [Test]
+        public void Can_SetItemInList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            storeMembers[2] = "five";
+            Redis.SetItemInList(ListId, 2, "five");
+
+            var members = Redis.GetAllItemsFromList(ListId);
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_PopFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var item4 = Redis.PopItemFromList(ListId);
+
+            Assert.That(item4, Is.EqualTo("four"));
+        }
+
+        [Test]
+        public void Can_EnqueueOnList()
         {
             var queue = new Queue<string>();
             storeMembers.ForEach(queue.Enqueue);
             storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));

+            while (queue.Count > 0)
+            {
+                var actual = Redis.DequeueItemFromList(ListId);
+                Assert.That(actual, Is.EqualTo(queue.Dequeue()));
+            }
+        }
+
+        [Test]
+        public void Can_DequeueFromList()
+        {
+            var queue = new Queue<string>();
+            storeMembers.ForEach(queue.Enqueue);
+            storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
+
+            var item1 = Redis.DequeueItemFromList(ListId);
+
+            Assert.That(item1, Is.EqualTo(queue.Dequeue()));
+        }
+
+        [Test]
+        public void PopAndPushSameAsDequeue()
+        {
+            var queue = new Queue<string>();
+            storeMembers.ForEach(queue.Enqueue);
+            storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
+
             var item1 = Redis.PopAndPushItemBetweenLists(ListId, ListId2);
-            Assert.That(item1, Is.EqualTo(queue.Dequeue()));
-        }
-
-		[Test]
-		public void Can_BlockingDequeueFromList()
-		{
-			var queue = new Queue<string>();
-			storeMembers.ForEach(queue.Enqueue);
-			storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
-
-			var item1 = Redis.BlockingDequeueItemFromList(ListId, null);
-
-			Assert.That(item1, Is.EqualTo(queue.Dequeue()));
-		}
-
-		[Test]
-		public void BlockingDequeueFromList_Can_TimeOut()
-		{
-			var item1 = Redis.BlockingDequeueItemFromList(ListId, TimeSpan.FromSeconds(1));
-			Assert.That(item1, Is.Null);
-		}
-
-		[Test]
-		public void Can_PushToList()
-		{
-			var stack = new Stack<string>();
-			storeMembers.ForEach(stack.Push);
-			storeMembers.ForEach(x => Redis.PushItemToList(ListId, x));
-
-			while (stack.Count > 0)
-			{
-				var actual = Redis.PopItemFromList(ListId);
-				Assert.That(actual, Is.EqualTo(stack.Pop()));
-			}
-		}
-
-		[Test]
-		public void Can_BlockingPopFromList()
-		{
-			var stack = new Stack<string>();
-			storeMembers.ForEach(stack.Push);
-			storeMembers.ForEach(x => Redis.PushItemToList(ListId, x));
-
-			var item1 = Redis.BlockingPopItemFromList(ListId, null);
-
-			Assert.That(item1, Is.EqualTo(stack.Pop()));
-		}
-
-		[Test]
-		public void BlockingPopFromList_Can_TimeOut()
-		{
-			var item1 = Redis.BlockingPopItemFromList(ListId, TimeSpan.FromSeconds(1));
-			Assert.That(item1, Is.Null);
-		}
-
-		[Test]
-		public void Can_RemoveStartFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var item1 = Redis.RemoveStartFromList(ListId);
-
-			Assert.That(item1, Is.EqualTo(storeMembers.First()));
-		}
-
-		[Test]
-		public void Can_RemoveEndFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var item1 = Redis.RemoveEndFromList(ListId);
-
-			Assert.That(item1, Is.EqualTo(storeMembers.Last()));
-		}
-
-		[Test]
-		public void Can_BlockingRemoveStartFromList()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var item1 = Redis.BlockingRemoveStartFromList(ListId, null);
-
-			Assert.That(item1, Is.EqualTo(storeMembers.First()));
-		}
-
-		[Test]
-		public void Can_MoveBetweenLists()
-		{
-			var list1Members = new List<string> { "one", "two", "three", "four" };
-			var list2Members = new List<string> { "five", "six", "seven" };
-			const string item4 = "four";
-
-			list1Members.ForEach(x => Redis.AddItemToList(ListId, x));
-			list2Members.ForEach(x => Redis.AddItemToList(ListId2, x));
-
-			list1Members.Remove(item4);
-			list2Members.Insert(0, item4);
-			Redis.PopAndPushItemBetweenLists(ListId, ListId2);
-
-			var readList1 = Redis.GetAllItemsFromList(ListId);
-			var readList2 = Redis.GetAllItemsFromList(ListId2);
-
-			AssertAreEqual(readList1, list1Members);
-			AssertAreEqual(readList2, list2Members);
-		}
-
-
-		[Test]
-		public void Can_enumerate_small_list()
-		{
-			storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
-
-			var readMembers = new List<string>();
-			foreach (var item in Redis.Lists[ListId])
-			{
-				readMembers.Add(item);
-			}
-			AssertAreEqual(readMembers, storeMembers);
-		}
-
-		[Test]
-		public void Can_enumerate_large_list()
-		{
-			if (TestConfig.IgnoreLongTests) return;
-
-			const int listSize = 2500;
-
-			storeMembers = new List<string>();
-			listSize.Times(x =>
-			{
-				Redis.AddItemToList(ListId, x.ToString());
-				storeMembers.Add(x.ToString());
-			});
-
-			var members = new List<string>();
-			foreach (var item in Redis.Lists[ListId])
-			{
-				members.Add(item);
-			}
-			members.Sort((x, y) => int.Parse(x).CompareTo(int.Parse(y)));
-			Assert.That(members.Count, Is.EqualTo(storeMembers.Count));
-			Assert.That(members, Is.EquivalentTo(storeMembers));
-		}
-
-		[Test]
-		public void Can_Add_to_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			var members = list.ToList<string>();
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_Clear_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			Assert.That(list.Count, Is.EqualTo(storeMembers.Count));
-
-			list.Clear();
-
-			Assert.That(list.Count, Is.EqualTo(0));
-		}
-
-		[Test]
-		public void Can_Test_Contains_in_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			Assert.That(list.Contains("two"), Is.True);
-			Assert.That(list.Contains("five"), Is.False);
-		}
-
-		[Test]
-		public void Can_Remove_value_from_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			storeMembers.Remove("two");
-			list.Remove("two");
-
-			var members = list.ToList<string>();
-
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_RemoveAt_value_from_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			storeMembers.RemoveAt(2);
-			list.RemoveAt(2);
-
-			var members = list.ToList<string>();
-
-			AssertAreEqual(members, storeMembers);
-		}
-
-		[Test]
-		public void Can_get_default_index_from_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			for (var i = 0; i < storeMembers.Count; i++)
-			{
-				Assert.That(list[i], Is.EqualTo(storeMembers[i]));
-			}
-		}
-
-		[Test]
-		public void Can_test_for_IndexOf_in_IList()
-		{
-			var list = Redis.Lists[ListId];
-			storeMembers.ForEach(list.Add);
-
-			foreach (var item in storeMembers)
-			{
-				Assert.That(list.IndexOf(item), Is.EqualTo(storeMembers.IndexOf(item)));
-			}
-		}
-
-		[Test]
-		public void Can_AddRangeToList_and_GetSortedItems()
-		{
-			Redis.PrependRangeToList(ListId, storeMembers);
-
-			var members = Redis.GetSortedItemsFromList(ListId, new SortOptions { SortAlpha = true, SortDesc = true, Skip = 1, Take = 2 });
-			AssertAreEqual(members, storeMembers.OrderByDescending(s => s).Skip(1).Take(2).ToList());
-		}
+            Assert.That(item1, Is.EqualTo(queue.Dequeue()));
+        }
+
+        [Test]
+        public void Can_BlockingDequeueFromList()
+        {
+            var queue = new Queue<string>();
+            storeMembers.ForEach(queue.Enqueue);
+            storeMembers.ForEach(x => Redis.EnqueueItemOnList(ListId, x));
+
+            var item1 = Redis.BlockingDequeueItemFromList(ListId, null);
+
+            Assert.That(item1, Is.EqualTo(queue.Dequeue()));
+        }
+
+        [Test]
+        public void BlockingDequeueFromList_Can_TimeOut()
+        {
+            var item1 = Redis.BlockingDequeueItemFromList(ListId, TimeSpan.FromSeconds(1));
+            Assert.That(item1, Is.Null);
+        }
+
+        [Test]
+        public void Can_PushToList()
+        {
+            var stack = new Stack<string>();
+            storeMembers.ForEach(stack.Push);
+            storeMembers.ForEach(x => Redis.PushItemToList(ListId, x));
+
+            while (stack.Count > 0)
+            {
+                var actual = Redis.PopItemFromList(ListId);
+                Assert.That(actual, Is.EqualTo(stack.Pop()));
+            }
+        }
+
+        [Test]
+        public void Can_BlockingPopFromList()
+        {
+            var stack = new Stack<string>();
+            storeMembers.ForEach(stack.Push);
+            storeMembers.ForEach(x => Redis.PushItemToList(ListId, x));
+
+            var item1 = Redis.BlockingPopItemFromList(ListId, null);
+
+            Assert.That(item1, Is.EqualTo(stack.Pop()));
+        }
+
+        [Test]
+        public void BlockingPopFromList_Can_TimeOut()
+        {
+            var item1 = Redis.BlockingPopItemFromList(ListId, TimeSpan.FromSeconds(1));
+            Assert.That(item1, Is.Null);
+        }
+
+        [Test]
+        public void Can_RemoveStartFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var item1 = Redis.RemoveStartFromList(ListId);
+
+            Assert.That(item1, Is.EqualTo(storeMembers.First()));
+        }
+
+        [Test]
+        public void Can_RemoveEndFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var item1 = Redis.RemoveEndFromList(ListId);
+
+            Assert.That(item1, Is.EqualTo(storeMembers.Last()));
+        }
+
+        [Test]
+        public void Can_BlockingRemoveStartFromList()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var item1 = Redis.BlockingRemoveStartFromList(ListId, null);
+
+            Assert.That(item1, Is.EqualTo(storeMembers.First()));
+        }
+
+        [Test]
+        public void Can_MoveBetweenLists()
+        {
+            var list1Members = new List<string> { "one", "two", "three", "four" };
+            var list2Members = new List<string> { "five", "six", "seven" };
+            const string item4 = "four";
+
+            list1Members.ForEach(x => Redis.AddItemToList(ListId, x));
+            list2Members.ForEach(x => Redis.AddItemToList(ListId2, x));
+
+            list1Members.Remove(item4);
+            list2Members.Insert(0, item4);
+            Redis.PopAndPushItemBetweenLists(ListId, ListId2);
+
+            var readList1 = Redis.GetAllItemsFromList(ListId);
+            var readList2 = Redis.GetAllItemsFromList(ListId2);
+
+            AssertAreEqual(readList1, list1Members);
+            AssertAreEqual(readList2, list2Members);
+        }
+
+
+        [Test]
+        public void Can_enumerate_small_list()
+        {
+            storeMembers.ForEach(x => Redis.AddItemToList(ListId, x));
+
+            var readMembers = new List<string>();
+            foreach (var item in Redis.Lists[ListId])
+            {
+                readMembers.Add(item);
+            }
+            AssertAreEqual(readMembers, storeMembers);
+        }
+
+        [Test]
+        public void Can_enumerate_large_list()
+        {
+            if (TestConfig.IgnoreLongTests) return;
+
+            const int listSize = 2500;
+
+            storeMembers = new List<string>();
+            listSize.Times(x =>
+            {
+                Redis.AddItemToList(ListId, x.ToString());
+                storeMembers.Add(x.ToString());
+            });
+
+            var members = new List<string>();
+            foreach (var item in Redis.Lists[ListId])
+            {
+                members.Add(item);
+            }
+            members.Sort((x, y) => int.Parse(x).CompareTo(int.Parse(y)));
+            Assert.That(members.Count, Is.EqualTo(storeMembers.Count));
+            Assert.That(members, Is.EquivalentTo(storeMembers));
+        }
+
+        [Test]
+        public void Can_Add_to_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            var members = list.ToList<string>();
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_Clear_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            Assert.That(list.Count, Is.EqualTo(storeMembers.Count));
+
+            list.Clear();
+
+            Assert.That(list.Count, Is.EqualTo(0));
+        }
+
+        [Test]
+        public void Can_Test_Contains_in_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            Assert.That(list.Contains("two"), Is.True);
+            Assert.That(list.Contains("five"), Is.False);
+        }
+
+        [Test]
+        public void Can_Remove_value_from_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            storeMembers.Remove("two");
+            list.Remove("two");
+
+            var members = list.ToList<string>();
+
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_RemoveAt_value_from_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            storeMembers.RemoveAt(2);
+            list.RemoveAt(2);
+
+            var members = list.ToList<string>();
+
+            AssertAreEqual(members, storeMembers);
+        }
+
+        [Test]
+        public void Can_get_default_index_from_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            for (var i = 0; i < storeMembers.Count; i++)
+            {
+                Assert.That(list[i], Is.EqualTo(storeMembers[i]));
+            }
+        }
+
+        [Test]
+        public void Can_test_for_IndexOf_in_IList()
+        {
+            var list = Redis.Lists[ListId];
+            storeMembers.ForEach(list.Add);
+
+            foreach (var item in storeMembers)
+            {
+                Assert.That(list.IndexOf(item), Is.EqualTo(storeMembers.IndexOf(item)));
+            }
+        }
+
+        [Test]
+        public void Can_AddRangeToList_and_GetSortedItems()
+        {
+            Redis.PrependRangeToList(ListId, storeMembers);
+
+            var members = Redis.GetSortedItemsFromList(ListId, new SortOptions { SortAlpha = true, SortDesc = true, Skip = 1, Take = 2 });
+            AssertAreEqual(members, storeMembers.OrderByDescending(s => s).Skip(1).Take(2).ToList());
+        }

         public class Test
         {
@@ -425,6 +425,6 @@
             Assert.IsTrue(clientesRepo.Count == 0, "Count 3 = " + clientesRepo.Count);
         }

-	}
+    }

 }


Update DoxPageTests.cs

Update DoxPageTests.cs

--- tests/coreDox.Core.Tests/Project/Pages/DoxPageTests.cs
+++ tests/coreDox.Core.Tests/Project/Pages/DoxPageTests.cs
@@ -34,9 +34,9 @@
             project.Load(_testProjectPath);

             //Assert
-            Assert.AreEqual("Test Documentation", project.PageRoot.Title);
             Assert.AreEqual(1, project.PageRoot.PageList.Count);
             Assert.AreEqual(2, project.PageRoot.FolderList.Count);
+            Assert.AreEqual("Test Documentation", project.PageRoot.Title);
             Assert.IsNotNull(project.PageRoot.PageList.First().AssemblyFileInfo);
         }


POI：Provide an alternate method to get the OLE2 thumbnail that decodes

--- main/HPSF/SummaryInformation.cs
+++ main/HPSF/SummaryInformation.cs
@@ -463,10 +463,9 @@
         /// Gets or sets the thumbnail (or <c>null</c>) when this
         /// method is implemented. Please note that the return type is likely To
         /// Change!
-        /// Hint To developers: Drew Varner <Drew.Varner
-        /// -at- sc.edu> said that this is an image in WMF or Clipboard (BMP?)
-        /// format. However, we won't do any conversion into any image type but
-        /// instead just return a byte array.
+        ///
To process this data, you may wish to make use of the
+        ///  {@link Thumbnail} class. The raw data is generally
+        /// an image in WMF or Clipboard (BMP?) format

         ///
         /// <value>The thumbnail.</value>
         public byte[] Thumbnail
@@ -480,6 +479,19 @@
             }
         }

+        ///
+        /// Returns the thumbnail or null, processed as an object
+        /// which is (largely) able to unpack the thumbnail image data.
+        ///
+        public Thumbnail ThumbnailThumbnail
+        {
+            get
+            {
+                byte[] data = Thumbnail;
+                if (data == null) return null;
+                return new Thumbnail(data);
+            }
+        }
         ///
         /// Removes the thumbnail.
         ///


Reset SpinWait in writer thread

Reset SpinWait in writer thread

--- src/ZeroLog/LogManager.cs
+++ src/ZeroLog/LogManager.cs
@@ -46,7 +46,7 @@
             }

             IsRunning = true;
-            WriteTask = Task.Run(() => WriteToAppenders());
+            WriteTask = Task.Factory.StartNew(WriteToAppenders, TaskCreationOptions.LongRunning);
         }

         public Level Level { get; }
@@ -131,8 +131,9 @@

         private IInternalLogEvent AcquireLogEvent()
         {
+            var spinwait = new SpinWait();
+
             IInternalLogEvent logEvent;
-            var spinwait = new SpinWait();
             while (!_pool.TryAcquire(out logEvent))
             {
                 spinwait.SpinOnce();
@@ -143,20 +144,22 @@

         private void WriteToAppenders()
         {
-            var spinWait = default(SpinWait);
+            var spinWait = new SpinWait();
             var stringBuffer = new StringBuffer(16 * 1024);
             var destination = new byte[16 * 1024];
+
             while (IsRunning || !_queue.IsEmpty)
             {
-                if (!TryToProcessQueue(stringBuffer, destination))
+                if (TryToProcessQueue(stringBuffer, destination))
+                    spinWait.Reset();
+                else
                     spinWait.SpinOnce();
             }
         }

         private bool TryToProcessQueue(StringBuffer stringBuffer, byte[] destination)
         {
-            IInternalLogEvent logEvent;
-            if (!_queue.TryDequeue(out logEvent))
+            if (!_queue.TryDequeue(out var logEvent))
                 return false;

             var isSpecialEvent = false;


Remove jQuery

Remove jQuery

--- alert-roster.web/Global.asax.cs
+++ alert-roster.web/Global.asax.cs
@@ -37,7 +37,6 @@
         public static void RegisterBundles(BundleCollection bundles)
         {
             bundles.Add(new ScriptBundle("~/bundles/libs").Include(
-                        "~/Scripts/jquery-{version}.js",
                         "~/Scripts/moment.js",
                         "~/Scripts/modernizr-*",
                         "~/Scripts/bootstrap.js",


Scope: now supports setting event after instantiation

--- src/x2net/Scope.cs
+++ src/x2net/Scope.cs
@@ -27,9 +27,13 @@
         }

         /// <summary>
-        /// Gets the event to be posted on disposal.
+        /// Gets or sets the event to be posted on disposal.
         /// </summary>
-        public Event Event { get { return e; } }
+        public Event Event
+        {
+            get { return e; }
+            set { e = value; }
+        }

         /// <summary>
         /// A delegate type for hooking up Dispose notifications.


Fix: Memory plugin not updating ppcalculator in resultsScreen

resulted in incorrect mods in pp calc

--- plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
+++ plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
@@ -119,9 +119,6 @@

         public async Task SetNewMap(IMapSearchResult map, CancellationToken cancellationToken)
         {
-            if ((map.Action & OsuStatus.ResultsScreen) != 0)
-                return;
-
             var ppCalculator = await map.GetPpCalculator(cancellationToken);
             lock (_lockingObject)
             {


add reference

add reference

--- SentenceScraping/run.csx
+++ SentenceScraping/run.csx
@@ -1,4 +1,5 @@
 #r "System.Configuration"
+#r "System.Collections"
 #r "System.Linq.Expressions"
 #load "../QuestionEntity.csx"


activated high quality interpolation

activated high quality interpolation

--- SettingsForm.Designer.cs
+++ SettingsForm.Designer.cs
@@ -623,17 +623,17 @@
             this.pictureBox.ImageOffset = ((System.Drawing.PointF)(resources.GetObject("pictureBox.ImageOffset")));
             this.pictureBox.InfoBackgroundColor = System.Drawing.SystemColors.Window;
             this.pictureBox.InfoForegroundColor = System.Drawing.SystemColors.WindowText;
-            this.pictureBox.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
+            this.pictureBox.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
             this.pictureBox.IsBoundToMaster = false;
             this.pictureBox.Location = new System.Drawing.Point(217, 75);
             this.pictureBox.Master = null;
             this.pictureBox.Name = "pictureBox";
             this.pictureBox.OrientationBackgroundColor = System.Drawing.SystemColors.Window;
             this.pictureBox.OrientationForegroundColor = System.Drawing.SystemColors.WindowText;
-            this.pictureBox.Overlay = de.mastersign.controls.ZoomPictureBox.OverlayMode.None;
+            this.pictureBox.Overlay = de.mastersign.controls.ZoomPictureBox.OverlayMode.Compass;
             this.pictureBox.Rotation = 0F;
             this.pictureBox.ShowMeasureTools = false;
-            this.pictureBox.ShowRotationTools = false;
+            this.pictureBox.ShowRotationTools = true;
             this.pictureBox.ShowSelectionTools = false;
             this.pictureBox.ShowZoomLevelTools = true;
             this.pictureBox.Size = new System.Drawing.Size(414, 385);


Oops, casing in fingerprint lookup was wrong

--- plugins/extras/p5.mime/helpers/GnuPrivacyContext.cs
+++ plugins/extras/p5.mime/helpers/GnuPrivacyContext.cs
@@ -143,7 +143,8 @@
                 if (idxMailbox.Mailbox is SecureMailboxAddress) {

                     // Using fingerprint.
-                    if ((idxMailbox.Mailbox as SecureMailboxAddress).Fingerprint == BitConverter.ToString (key.PublicKey.GetFingerprint ()).Replace ("-", ""))
+                    if ((idxMailbox.Mailbox as SecureMailboxAddress).Fingerprint.ToLower () ==
+                        BitConverter.ToString (key.PublicKey.GetFingerprint ()).Replace ("-", "").ToLower ())
                         return idxMailbox.Password;

                 } else {


CRQ-20851 : Ability to constraint results by namespace

--- webapp-net/Search/Controllers/TridionDocsSearchController.cs
+++ webapp-net/Search/Controllers/TridionDocsSearchController.cs
@@ -24,6 +24,7 @@
         private static readonly Regex RegexpDoubleQuotes = new Regex("^\"(.*)\"$", RegexOptions.Compiled);
         private static readonly HashSet<string> Cjk = new HashSet<string> { "chinese", "japanese", "korean" };
         private readonly string _separator;
+        private readonly string _namespace;
         private string PublicationOnlineStatusField => $"dynamic{_separator}FISHDITADLVRREMOTESTATUS.lng.element";
         private string ContentField(string language) => $"content{_separator}{language}";

@@ -32,6 +33,7 @@
             try
             {
                 _separator = WebConfigurationManager.AppSettings["iq-field-separator"] ?? DEFAULT_SEPARATOR;
+                _namespace = WebConfigurationManager.AppSettings["iq-namespace"];
             }
             catch (Exception e)
             {
@@ -61,41 +63,53 @@

                 var searchParams = JsonConvert.DeserializeObject<SearchParameters>(json);
                 var lang = GetLanguage(searchParams);
-                ICriteria criteria;
+                ICriteria criteria = null;
+
+                var queryString = GetSearchQueryString(searchParams);
+                var pubId = GetPublicationId(searchParams);
+
                 if (Cjk.Contains(lang))
-                {
-                    var queryString = GetSearchQueryString(searchParams);
-                    var pubId = GetPublicationId(searchParams);
-                    if (pubId != null)
-                    {
-                        var q = new SearchQuery().GroupStart()
-                            .Field(PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE)
-                            .And().Field("publicationId", new DefaultTermValue(pubId))
-                            .GroupEnd()
-                            .And()
-                            .GroupStart()
-                            .Field(ContentField("cjk"), queryString)
-                            .Or()
-                            .Field(ContentField(lang), queryString)
-                            .GroupEnd();
-                        criteria = q.Compile();
+                {
+                    if (pubId == null && string.IsNullOrEmpty(_namespace))
+                    {
+                        criteria = CompileMultiLangQuery(lang, queryString);
                     }
                     else
                     {
-                        var q = new SearchQuery().GroupStart()
-                            .Field(PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE)
-                            .GroupEnd()
-                            .And()
-                            .GroupStart()
-                            .Field(ContentField("cjk"), queryString)
-                            .Or()
-                            .Field(ContentField(lang), queryString)
-                            .GroupEnd();
-                        criteria = q.Compile();
+                        if (pubId != null && !string.IsNullOrEmpty(_namespace))
+                        {
+                            criteria = CompileMultiLangQuery("publicationId", pubId, "namespace", _namespace, lang, queryString);
+                        }
+                        else
+                        {
+                            if (pubId != null)
+                                criteria = CompileMultiLangQuery("publicationId", pubId, lang,
+                                    queryString);
+                            else if (!string.IsNullOrEmpty(_namespace))
+                                criteria = CompileMultiLangQuery("namespace", _namespace, lang,
+                                    queryString);
+                        }
                     }
                 }
                 else
-                    criteria = SingleLanguageSearchQuery(searchParams);
+                {
+                    var fields = new List<string> { PublicationOnlineStatusField };
+                    var values = new List<object> { new DefaultTermValue(PUBLICATION_ONLINE_STATUS_VALUE) };
+                    if (pubId != null)
+                    {
+                        fields.Add("publicationId");
+                        values.Add(new DefaultTermValue(pubId));
+                    }
+                    if (_namespace != null)
+                    {
+                        fields.Add("namespace");
+                        values.Add(new DefaultTermValue(_namespace));
+                    }
+
+                    fields.Add(ContentField(GetLanguage(searchParams)));
+                    values.Add(new DefaultTermValue(GetSearchQueryString(searchParams)));
+                    criteria = new SearchQuery().GroupedAnd(fields, values).Compile();
+                }

                 var search = ApiClientFactory.Instance.CreateSearchClient<SearchResultSet, SearchResult>();
                 var results = search.WithResultFilter(new SearchResultFilter
@@ -120,31 +134,50 @@
             }
         }

-        private ICriteria SingleLanguageSearchQuery(SearchParameters searchParameters)
-        {
-            var queryFieldsPair = CreateQueryFieldsPair();
-            SetPublicationIdField(queryFieldsPair, searchParameters);
-            AddQueryField(queryFieldsPair, PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE);
-            SetSearchQuery(queryFieldsPair, searchParameters);
-            return new SearchQuery().GroupedAnd(queryFieldsPair.Item1, queryFieldsPair.Item2).Compile();
-        }
-
-        private void SetPublicationIdField(Tuple<List<string>, List<object>> queryFieldsPair, SearchParameters searchParameters)
-        {
-            var pubId = GetPublicationId(searchParameters);
-            if (pubId == null) return;
-            AddQueryField(queryFieldsPair, "publicationId", searchParameters.PublicationId.Value.ToString());
-        }
-
-        private void SetSearchQuery(Tuple<List<string>, List<object>> queryFieldsPair, SearchParameters searchParameters) =>
-            AddQueryField(queryFieldsPair, ContentField(GetLanguage(searchParameters)),
-                GetSearchQueryString(searchParameters));
-
-        private static void AddQueryField(Tuple<List<string>, List<object>> queryFieldsPair, string fieldName, object fieldValue)
-        {
-            queryFieldsPair.Item1.Add(fieldName);
-            queryFieldsPair.Item2.Add(new DefaultTermValue(fieldValue));
-        }
+        private ICriteria CompileMultiLangQuery(string language, string queryString) =>
+            new SearchQuery()
+                .Field(PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE)
+                .And()
+                .GroupStart()
+                .Field(ContentField("cjk"), queryString)
+                .Or()
+                .Field(ContentField(language), queryString)
+                .GroupEnd()
+                .Compile();
+
+        private ICriteria CompileMultiLangQuery(string fieldName, object fieldValue, string language, string queryString) =>
+            new SearchQuery()
+                .GroupStart()
+                .Field(PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE)
+                .And()
+                .Field(fieldName, new DefaultTermValue(fieldValue))
+                .GroupEnd()
+                .And()
+                .GroupStart()
+                .Field(ContentField("cjk"), queryString)
+                .Or()
+                .Field(ContentField(language), queryString)
+                .GroupEnd()
+                .Compile();
+
+        private ICriteria CompileMultiLangQuery(string fieldName1, object fieldValue1, string fieldName2, object fieldValue2, string language, string queryString) =>
+            new SearchQuery()
+                .GroupStart()
+                .Field(PublicationOnlineStatusField, PUBLICATION_ONLINE_STATUS_VALUE)
+                .And()
+                .Field(fieldName1, new DefaultTermValue(fieldValue1))
+                .GroupEnd()
+                .And()
+                .GroupStart()
+                .Field(fieldName2, new DefaultTermValue(fieldValue2))
+                .And()
+                .GroupStart()
+                .Field(ContentField("cjk"), queryString)
+                .Or()
+                .Field(ContentField(language), queryString)
+                .GroupEnd()
+                .GroupEnd()
+                .Compile();

         private string GetPublicationId(SearchParameters searchParameters)
             => searchParameters.PublicationId?.ToString();
@@ -163,8 +196,5 @@
             }
             return searchQuery;
         }
-
-        private static Tuple<List<string>, List<object>> CreateQueryFieldsPair()
-            => new Tuple<List<string>, List<object>>(new List<string>(), new List<object>());
     }
 }


added additional console logging

added additional console logging

--- PebbleCmd/Program.cs
+++ PebbleCmd/Program.cs
@@ -16,39 +16,44 @@
     {
         static void Main()
         {
-            ShowPebbles();
-            Console.WriteLine("Enter to exit");
-            Console.ReadLine();
+            ShowPebbles().Wait();
         }

         private static async Task ShowPebbles()
         {
-            //check if BlueZ support is enabled
-            Console.WriteLine("Radio Software Manufacturer {0}",BluetoothRadio.PrimaryRadio.SoftwareManufacturer);
+            try
+            {
+                //check if BlueZ support is enabled
+                Console.WriteLine("Radio Software Manufacturer {0}", BluetoothRadio.PrimaryRadio.SoftwareManufacturer);

-            Console.WriteLine( "PebbleCmd" );
-            Console.WriteLine( "Select Pebble to connect to:" );
-            var pebbles = PebbleNet45.DetectPebbles();
-            if (pebbles != null && pebbles.Any())
-            {
-                var options = pebbles.Select(x => x.PebbleID).Union(new[] { "Exit" });
-                var menu = new Menu(options.ToArray());
-                var result = menu.ShowMenu();
-                if (result >= 0 && result < pebbles.Count)
+                Console.WriteLine("PebbleCmd");
+                Console.WriteLine("Select Pebble to connect to:");
+                var pebbles = PebbleNet45.DetectPebbles();
+                if (pebbles != null && pebbles.Any())
                 {
-                    var selectedPebble = pebbles[result];
-                    Console.WriteLine("Connecting to Pebble " + selectedPebble.PebbleID);
-                    await selectedPebble.ConnectAsync();
-                    Console.WriteLine("Connected");
-                    await ShowPebbleMenu(selectedPebble);
+                    var options = pebbles.Select(x => x.PebbleID).Union(new[] { "Exit" });
+                    var menu = new Menu(options.ToArray());
+                    var result = menu.ShowMenu();
+                    if (result >= 0 && result < pebbles.Count)
+                    {
+                        var selectedPebble = pebbles[result];
+                        Console.WriteLine("Connecting to Pebble " + selectedPebble.PebbleID);
+                        await selectedPebble.ConnectAsync();
+                        Console.WriteLine("Connected");
+                        await ShowPebbleMenu(selectedPebble);
+                    }
+                }
+                else
+                {
+                    Console.WriteLine("No Pebbles Detected");
                 }
             }
-            else
+            catch(Exception ex)
             {
-                Console.WriteLine("No Pebbles Detected");
+                Console.WriteLine(ex.Message + " " + ex.StackTrace);
+                throw;
             }
-
         }

         private static async Task ShowPebbleMenu( Pebble pebble )


Fix to prevent ImageProcessor from hijacking the statistics gif.

--- PerplexMail/Email.cs
+++ PerplexMail/Email.cs
@@ -444,7 +444,7 @@
                 //tag.Attributes.Add("style", "opacity:0"); // Make the tag not "visible", but it still needs to be rendered by the client (else the image won't get loaded) so make sure not to use display:none
                 //doc.DocumentNode.LastChild.AppendChild(tag);

-                string statTracker = "";
+                string statTracker = "";
                 bodyContent += statTracker; // Place the stat tracker image at the end
             }
             #endregion


code cleanup:  * use correct local member notation  * use s_ prefix for static members

--- PgProfileProvider.cs
+++ PgProfileProvider.cs
@@ -42,10 +42,10 @@
 {
 	public class PgProfileProvider : ProfileProvider
 	{
-		private const string m_ProfilesTableName = "Profiles";
-		private const string m_ProfileDataTableName = "ProfileData";
-		private string m_ConnectionString = string.Empty;
-		private const string m_serializationNamespace = "http://schemas.nauck-it.de/PostgreSQLProvider/1.0/";
+		private const string s_profilesTableName = "Profiles";
+		private const string m_profileDataTableName = "ProfileData";
+		private const string s_serializationNamespace = "http://schemas.nauck-it.de/PostgreSQLProvider/1.0/";
+		private string m_connectionString = string.Empty;

 		/// <summary>
 		/// System.Configuration.Provider.ProviderBase.Initialize Method
@@ -68,22 +68,22 @@
 			// Initialize the abstract base class.
 			base.Initialize(name, config);

-			m_ApplicationName = PgMembershipProvider.GetConfigValue(config["applicationName"], HostingEnvironment.ApplicationVirtualPath);
+			m_applicationName = PgMembershipProvider.GetConfigValue(config["applicationName"], HostingEnvironment.ApplicationVirtualPath);

 			// Get connection string.
-			m_ConnectionString = PgMembershipProvider.GetConnectionString(config["connectionStringName"]);
+			m_connectionString = PgMembershipProvider.GetConnectionString(config["connectionStringName"]);
 		}

 		/// <summary>
 		/// System.Web.Profile.ProfileProvider properties.
 		/// </summary>
 		#region System.Web.Security.ProfileProvider properties
-		private string m_ApplicationName = string.Empty;
+		private string m_applicationName = string.Empty;

 		public override string ApplicationName
 		{
-			get { return m_ApplicationName; }
-			set { m_ApplicationName = value; }
+			get { return m_applicationName; }
+			set { m_applicationName = value; }
 		}
 		#endregion

@@ -151,14 +151,14 @@
 			bool isAuthenticated = (bool)context["IsAuthenticated"];
 			Dictionary<string, object> databaseResult = new Dictionary<string, object>();

-			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_ConnectionString))
+			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
 			{
 				using (NpgsqlCommand dbCommand = dbConn.CreateCommand())
 				{
-					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "SELECT \"Name\", \"ValueString\", \"ValueBinary\" FROM \"{0}\" WHERE \"Profile\" = (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated)", m_ProfileDataTableName, m_ProfilesTableName);
+					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "SELECT \"Name\", \"ValueString\", \"ValueBinary\" FROM \"{0}\" WHERE \"Profile\" = (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated)", m_profileDataTableName, s_profilesTableName);

 					dbCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;
 					dbCommand.Parameters.Add("@IsAuthenticated", NpgsqlDbType.Boolean).Value = !isAuthenticated;

 					try
@@ -211,7 +211,7 @@
 						itemValue.PropertyValue = SerializationHelper.DeserializeFromBase64<object>((string)databaseResult[item.Name]);

 					else if (item.SerializeAs == SettingsSerializeAs.Xml)
-						itemValue.PropertyValue = SerializationHelper.DeserializeFromXml<object>((string)databaseResult[item.Name], m_serializationNamespace);
+						itemValue.PropertyValue = SerializationHelper.DeserializeFromXml<object>((string)databaseResult[item.Name], s_serializationNamespace);

 					else if (item.SerializeAs == SettingsSerializeAs.Binary)
 						itemValue.PropertyValue = SerializationHelper.DeserializeFromBinary<object>((byte[])databaseResult[item.Name]);
@@ -239,20 +239,20 @@
 			if (!ProfileExists(username))
 				CreateProfileForUser(username, isAuthenticated);

-			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_ConnectionString))
+			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
 			{
 				using (NpgsqlCommand deleteCommand = dbConn.CreateCommand(),
 					insertCommand = dbConn.CreateCommand())
 				{
-					deleteCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "DELETE FROM \"{0}\" WHERE \"Name\" = @Name AND \"Profile\" = (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated)", m_ProfileDataTableName, m_ProfilesTableName);
+					deleteCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "DELETE FROM \"{0}\" WHERE \"Name\" = @Name AND \"Profile\" = (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated)", m_profileDataTableName, s_profilesTableName);

 					deleteCommand.Parameters.Add("@Name", NpgsqlDbType.Varchar, 255);
 					deleteCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					deleteCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					deleteCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;
 					deleteCommand.Parameters.Add("@IsAuthenticated", NpgsqlDbType.Boolean).Value = !isAuthenticated;

-					insertCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "INSERT INTO \"{0}\" (\"pId\", \"Profile\", \"Name\", \"ValueString\", \"ValueBinary\") VALUES (@pId, (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated), @Name, @ValueString, @ValueBinary)", m_ProfileDataTableName, m_ProfilesTableName);
+					insertCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "INSERT INTO \"{0}\" (\"pId\", \"Profile\", \"Name\", \"ValueString\", \"ValueBinary\") VALUES (@pId, (SELECT \"pId\" FROM \"{1}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated), @Name, @ValueString, @ValueBinary)", m_profileDataTableName, s_profilesTableName);

 					insertCommand.Parameters.Add("@pId", NpgsqlDbType.Varchar, 36);
 					insertCommand.Parameters.Add("@Name", NpgsqlDbType.Varchar, 255);
@@ -261,7 +261,7 @@
 					insertCommand.Parameters.Add("@ValueBinary", NpgsqlDbType.Bytea);
 					insertCommand.Parameters["@ValueBinary"].IsNullable = true;
 					insertCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					insertCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					insertCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;
 					insertCommand.Parameters.Add("@IsAuthenticated", NpgsqlDbType.Boolean).Value = !isAuthenticated;

 					NpgsqlTransaction dbTrans = null;
@@ -292,7 +292,7 @@
 								}
 								else if (item.Property.SerializeAs == SettingsSerializeAs.Xml)
 								{
-									item.SerializedValue = SerializationHelper.SerializeToXml<object>(item.PropertyValue, m_serializationNamespace);
+									item.SerializedValue = SerializationHelper.SerializeToXml<object>(item.PropertyValue, s_serializationNamespace);
 									insertCommand.Parameters["@ValueString"].Value = item.SerializedValue;
 									insertCommand.Parameters["@ValueBinary"].Value = DBNull.Value;
 								}
@@ -353,15 +353,15 @@
 			if (ProfileExists(username))
 				throw new ProviderException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ErrProfileAlreadyExist, username));

-			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_ConnectionString))
+			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
 			{
 				using (NpgsqlCommand dbCommand = dbConn.CreateCommand())
 				{
-					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "INSERT INTO \"{0}\" (\"pId\", \"Username\", \"ApplicationName\", \"IsAnonymous\", \"LastActivityDate\", \"LastUpdatedDate\") Values (@pId, @Username, @ApplicationName, @IsAuthenticated, @LastActivityDate, @LastUpdatedDate)", m_ProfilesTableName);
+					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "INSERT INTO \"{0}\" (\"pId\", \"Username\", \"ApplicationName\", \"IsAnonymous\", \"LastActivityDate\", \"LastUpdatedDate\") Values (@pId, @Username, @ApplicationName, @IsAuthenticated, @LastActivityDate, @LastUpdatedDate)", s_profilesTableName);

 					dbCommand.Parameters.Add("@pId", NpgsqlDbType.Varchar, 36).Value = Guid.NewGuid().ToString();
 					dbCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;
 					dbCommand.Parameters.Add("@IsAuthenticated", NpgsqlDbType.Boolean).Value = !isAuthenticated;
 					dbCommand.Parameters.Add("@LastActivityDate", NpgsqlDbType.TimestampTZ).Value = DateTime.Now;
 					dbCommand.Parameters.Add("@LastUpdatedDate", NpgsqlDbType.TimestampTZ).Value = DateTime.Now;
@@ -390,14 +390,14 @@

 		private bool ProfileExists(string username)
 		{
-			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_ConnectionString))
+			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
 			{
 				using (NpgsqlCommand dbCommand = dbConn.CreateCommand())
 				{
-					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "SELECT COUNT(*) FROM \"{0}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName", m_ProfilesTableName);
+					dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "SELECT COUNT(*) FROM \"{0}\" WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName", s_profilesTableName);

 					dbCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;

 					try
 					{
@@ -436,26 +436,26 @@
 		/// <param name="activityOnly"></param>
 		private void UpdateActivityDates(string username, bool isAuthenticated, bool activityOnly)
 		{
-			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_ConnectionString))
+			using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
 			{
 				using (NpgsqlCommand dbCommand = dbConn.CreateCommand())
 				{
 					if (activityOnly)
 					{
-						dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "UPDATE \"{0}\" SET \"LastActivityDate\" = @LastActivityDate WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated", m_ProfilesTableName);
+						dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "UPDATE \"{0}\" SET \"LastActivityDate\" = @LastActivityDate WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated", s_profilesTableName);

 						dbCommand.Parameters.Add("@LastActivityDate", NpgsqlDbType.TimestampTZ).Value = DateTime.Now;
 					}
 					else
 					{
-						dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "UPDATE \"{0}\" SET \"LastActivityDate\" = @LastActivityDate, \"LastUpdatedDate\" = @LastActivityDate WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated", m_ProfilesTableName);
+						dbCommand.CommandText = string.Format(CultureInfo.InvariantCulture, "UPDATE \"{0}\" SET \"LastActivityDate\" = @LastActivityDate, \"LastUpdatedDate\" = @LastActivityDate WHERE \"Username\" = @Username AND \"ApplicationName\" = @ApplicationName AND \"IsAnonymous\" = @IsAuthenticated", s_profilesTableName);

 						dbCommand.Parameters.Add("@LastActivityDate", NpgsqlDbType.TimestampTZ).Value = DateTime.Now;
 						//dbCommand.Parameters.Add("@LastUpdatedDate", NpgsqlDbType.TimestampTZ).Value = DateTime.Now;
 					}

 					dbCommand.Parameters.Add("@Username", NpgsqlDbType.Varchar, 255).Value = username;
-					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_ApplicationName;
+					dbCommand.Parameters.Add("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = m_applicationName;
 					dbCommand.Parameters.Add("@IsAuthenticated", NpgsqlDbType.Boolean).Value = !isAuthenticated;

 					try


Fixed stack overflow exception.

Fixed stack overflow exception.

--- Phoebe/Data/Model.cs
+++ Phoebe/Data/Model.cs
@@ -34,9 +34,11 @@
         {
             if (!IsShared || IsMerging)
                 return;
-            if (!IsDirty)
+            if (!IsDirty) {
+                // Order here is important, else we'll get into a stack overflow if we set ModifiedAt first.
+                IsDirty = true;
                 ModifiedAt = DateTime.UtcNow;
-            IsDirty = true;
+            }
         }

         public virtual void Delete ()


Update TestFairy.cs

Update TestFairy.cs

--- Plugins/TestFairy.cs
+++ Plugins/TestFairy.cs
@@ -63,7 +63,41 @@
 		private static extern void TestFairy_setUserId(string userId);

 		[DllImport("__Internal")]
-		private static extern bool TestFairy_setAttribute(string aKey, string aValue);
+		private static extern void TestFairy_setAttribute(string aKey, string aValue);
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableCrashHandler();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_disableCrashHandler();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableFeedbackForm();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_disableFeedbackForm();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableMetric(string metric);
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_disableMetric(string metric);
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableAutoUpdate();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_disableAutoUpdate();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableCrashHandler();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_disableVideo();
+
+		[DllImport("__Internal")]
+		private static extern void TestFairy_enableVideo(string policy, string quality, float framesPerSecond);
+
 #elif UNITY_ANDROID && !UNITY_EDITOR
 		void Start () {
 			AndroidJNI.AttachCurrentThread();
@@ -73,28 +107,6 @@
 			return new AndroidJavaClass("com.testfairy.TestFairy");
 		}
 #endif
-
-		/// <summary>
-		/// Initialize a TestFairy session.
-		/// </summary>
-		/// <param name="APIKey"></param>
-		public static void begin(string APIKey)
-		{
-#if UNITY_IPHONE && !UNITY_EDITOR
-			TestFairy_begin(APIKey);
-#elif UNITY_ANDROID && !UNITY_EDITOR
-			AndroidJavaObject activityContext = null;
-			using(AndroidJavaClass activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
-				activityContext = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
-			}
-
-			using(AndroidJavaClass pluginClass = getTestFairyClass()) {
-				if(pluginClass != null) {
-					pluginClass.CallStatic("begin", activityContext, APIKey);
-				}
-			}
-#endif
-		}

 		/// <summary>
 		/// Push the feedback view controller. Hook a button to this method
@@ -290,7 +302,7 @@
 				}
 			}
 #endif
-            return sessionUrlStr;
+			return sessionUrlStr;
 		}

 		/// <summary>
@@ -309,7 +321,7 @@
 				}
 			}
 #endif
-            return versionStr;
+			return versionStr;
 		}

 		/// <summary>
@@ -341,18 +353,6 @@
 #endif
 		}

-		public static void setScreenName(string name) {
-#if UNITY_IPHONE && !UNITY_EDITOR
-			TestFairy_setScreenName(name);
-#elif UNITY_ANDROID && !UNITY_EDITOR
-			using(AndroidJavaClass pluginClass = getTestFairyClass()) {
-				if(pluginClass != null) {
-					pluginClass.CallStatic("setScreenName", name);
-				}
-			}
-#endif
-		}
-
 		public static void log(string message) {
 #if UNITY_IPHONE && !UNITY_EDITOR
 			TestFairy_log(message);
@@ -398,5 +398,121 @@
 #endif
 			return added;
 		}
+
+#if UNITY_IPHONE && !UNITY_EDITOR
+		public static void disableVideo() {
+			TestFairy_disableVideo();
+		}
+
+		public static void enableVideo(string policy, string quality, float framesPerSecond) {
+			TestFairy_enableVideo(policy, quality, framesPerSecond);
+		}
+
+		public static void disableCrashHandler() {
+			TestFairy_disableCrashHandler();
+		}
+
+		public static void enableMetric(string metric) {
+			TestFairy_enableMetric(metric);
+		}
+
+		public static void disableMetric(string metric) {
+			TestFairy_disableMetric(metric);
+		}
+
+		public static void enableFeedbackForm(string method) {
+			TestFairy_enableFeedbackForm(method);
+		}
+
+		public static void disableFeedbackForm() {
+			TestFairy_disableFeedbackForm();
+		}
+
+		public static void enableAutoUpdate() {
+			TestFairy_enableAutoUpdate();
+		}
+
+		public static void disableAutoUpdate() {
+			TestFairy_disableAutoUpdate();
+		}
+
+		public static void begin(string APIKey)
+		{
+			TestFairy_begin(APIKey);
+		}
+
+		public static void setScreenName(string name) {
+			TestFairy_setScreenName(name);
+		}
+
+#endif
+
+#if UNITY_ANDROID && !UNITY_EDITOR
+		public static void disableVideo() {
+			using (AndroidJavaClass pluginClass = getTestFairyClass()) {
+				if (pluginClass != null) {
+					pluginClass.CallStatic<void>("disableVideo");
+				}
+			}
+		}
+
+		public static void begin(string APIKey)
+		{
+			AndroidJavaObject activityContext = null;
+			using (AndroidJavaClass activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
+				activityContext = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
+			}
+
+			using (AndroidJavaClass pluginClass = getTestFairyClass()) {
+				if (pluginClass != null) {
+					pluginClass.CallStatic("begin", activityContext, APIKey);
+				}
+			}
+		}
+
+		public static void setScreenName(string name) {
+			using (AndroidJavaClass pluginClass = getTestFairyClass()) {
+				if (pluginClass != null) {
+					pluginClass.CallStatic("setScreenName", name);
+				}
+			}
+		}
+#endif
+
+#if UNITY_EDITOR
+		public static void begin(string APIKey) {
+		}
+
+		public static void setScreenName(string name) {
+		}
+
+		public static void disableVideo() {
+		}
+
+		public static void enableVideo(string policy, string quality, float framesPerSecond) {
+		}
+
+		public static void disableCrashHandler() {
+		}
+
+		public static void enableMetric(string metric) {
+		}
+
+		public static void disableMetric(string metric) {
+		}
+
+		public static void enableFeedbackForm(string method) {
+		}
+
+		public static void disableFeedbackForm() {
+		}
+
+		public static void enableAutoUpdate() {
+		}
+
+		public static void disableAutoUpdate() {
+		}
+
+#endif
 	}
 }


CarcosaActor: Now handles StartMessage and StopMessage

--- projects/RagingBool.Carcosa.Core_cs/CarcosaActor.cs
+++ projects/RagingBool.Carcosa.Core_cs/CarcosaActor.cs
@@ -38,9 +38,13 @@
             {
                 _controlActor.Forward(message);
             }
-            else if (message is CarcosaShutDownMessage)
+            else if (message is StartMessage)
             {
-                OnShutDown();
+                _controlActor.Forward(message);
+            }
+            else if (message is StopMessage)
+            {
+                OnStop((StopMessage)message);
             }
             else
             {
@@ -49,20 +53,15 @@
         }

         // Shutting down
-        private void OnReceiveShutDown(object message)
+        private void OnReceiveStop(object message)
         {
             Unhandled(message);
         }

-        private void OnShutDown()
+        private void OnStop(StopMessage message)
         {
-            Become(OnReceiveShutDown);
-            ShutDown();
-        }
-
-        private void ShutDown()
-        {
-            // TODO
+            _controlActor.Forward(message);
+            Become(OnReceiveStop);
         }
     }
 }


Add comment

Add comment

Add comment

--- QueueDataGraphic/QueueDataGraphic/CSharpFiles/Debug.cs
+++ QueueDataGraphic/QueueDataGraphic/CSharpFiles/Debug.cs
@@ -14,8 +14,8 @@

 namespace QueueDataGraphic.CSharpFiles
 {
-	class Debug
-	{
+	class Debug                                                                 // Debug class, Debug類別
+	{				                                                            // Debug class start, 進入Debug類別
 		/// <summary>
 		/// DebugMode would be setted "true" during debugging.
 		/// 在偵錯模式中將DebugMode設為true


Fix cast

Fix cast

--- RefactoringEssentials/CSharp/Converter/NodesVisitor.cs
+++ RefactoringEssentials/CSharp/Converter/NodesVisitor.cs
@@ -16,14 +16,12 @@
 		{
 			SemanticModel semanticModel;
 			Document targetDocument;
-			CSharpCompilationOptions options;
 			readonly Dictionary<MemberDeclarationSyntax, MemberDeclarationSyntax[]> additionalDeclarations = new Dictionary<MemberDeclarationSyntax, MemberDeclarationSyntax[]>();

 			public NodesVisitor(SemanticModel semanticModel, Document targetDocument)
 			{
 				this.semanticModel = semanticModel;
 				this.targetDocument = targetDocument;
-				this.options = (CSharpCompilationOptions)targetDocument?.Project.CompilationOptions;
 			}

 			public override CSharpSyntaxNode DefaultVisit(SyntaxNode node)


账户登录时添加服务器端BS系统的版本验证。

账户登录时添加服务器端BS系统的版本验证。

--- 软件系统浏览器模版/Controllers/AccountController.cs
+++ 软件系统浏览器模版/Controllers/AccountController.cs
@@ -1,6 +1,7 @@
 using ClientsLibrary;
 using CommonLibrary;
 using HslCommunication;
+using HslCommunication.BasicFramework;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -75,6 +76,34 @@
                 return Login(result.Message);
             }

+
+            result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.更新检查);
+            if (result.IsSuccess)
+            {
+                //服务器应该返回服务器的版本号
+                SystemVersion sv = new SystemVersion(result.Content);
+                //系统账户跳过低版本检测
+                if (fc["UserName"] != "admin")
+                {
+                    if (UserClient.CurrentVersion != sv)
+                    {
+                        return Login("当前版本号不正确，需要服务器更新才允许登录。");
+                    }
+                }
+                else
+                {
+                    if (UserClient.CurrentVersion < sv)
+                    {
+                        return Login("版本号过时，需要管理员更新才允许登录。");
+                    }
+                }
+            }
+            else
+            {
+                //访问失败
+                return Login(result.Message);
+            }
+
             //允许登录，并记录到Session
             return RedirectToAction("Index", "Home");
         }


Ensured dispose is not called twice.

Ensured dispose is not called twice.

--- Rhino.ServiceBus/RhinoQueues/PhtSubscriptionStorage.cs
+++ Rhino.ServiceBus/RhinoQueues/PhtSubscriptionStorage.cs
@@ -24,7 +24,7 @@
         private readonly ILog logger = LogManager.GetLogger(typeof (PhtSubscriptionStorage));

         private readonly IMessageSerializer messageSerializer;
-        private readonly PersistentHashTable.PersistentHashTable pht;
+        private PersistentHashTable.PersistentHashTable pht;
         private readonly IReflection reflection;

         private readonly MultiValueIndexHashtable<Guid, string, Uri, int> remoteInstanceSubscriptions =
@@ -54,7 +54,10 @@
         public void Dispose()
         {
             if (pht != null)
+            {
                 pht.Dispose();
+                pht = null;
+            }
         }

         #endregion


ScadaComm: fix getting DLL name

ScadaComm: fix getting DLL name

--- ScadaComm/ScadaComm/ScadaCommCommon/Devices/KPLogic.cs
+++ ScadaComm/ScadaComm/ScadaCommCommon/Devices/KPLogic.cs
@@ -147,7 +147,7 @@
             Bound = false;
             Number = number;
             Name = "";
-            Dll = Assembly.GetCallingAssembly().GetName().Name;
+            Dll = GetType().Assembly.GetName().Name;
             Address = 0;
             CallNum = "";
             ReqParams = KPReqParams.Default;


add EmailTemplateLogic.ParseData

add EmailTemplateLogic.ParseData

--- Signum.Engine.Extensions/Mailing/EmailTemplateLogic.cs
+++ Signum.Engine.Extensions/Mailing/EmailTemplateLogic.cs
@@ -102,6 +102,20 @@
             return emailTemplates;
         }

+        public static EmailTemplateEntity ParseData(this EmailTemplateEntity emailTemplate)
+        {
+            if (!emailTemplate.IsNew || emailTemplate.queryName == null)
+                throw new InvalidOperationException("emailTemplate should be new and have queryName");
+
+            emailTemplate.Query = QueryLogic.GetQueryEntity(emailTemplate.queryName);
+
+            QueryDescription description = DynamicQueryManager.Current.QueryDescription(emailTemplate.queryName);
+
+            emailTemplate.ParseData(description);
+
+            return emailTemplate;
+        }
+
         static void EmailTemplateLogic_Retrieved(EmailTemplateEntity emailTemplate)
         {
             using (emailTemplate.DisableAuthorization ? ExecutionMode.Global() : null)


Arreglo error al apuntar a recursos con rutas relativas usando url('..') (en este caso, fuentes)

(TFS CS 5799)

--- Signum.Web.Extensions/ScriptCombiner/ScriptCombiner.cs
+++ Signum.Web.Extensions/ScriptCombiner/ScriptCombiner.cs
@@ -334,7 +334,7 @@
             string[] parts = fileName.Split('/');
             //replace relative paths

-            Match m = Regex.Match(content, "(?<begin>url\\(\"?)(?<content>.+?)[\"\\)]+");
+            Match m = Regex.Match(content, "(?<begin>url\\([\"\']?)(?<content>.+?)[\"\'\\)]+");

             StringBuilder sb = new StringBuilder();
             int firstIndex = 0;


Make ctor of abstract class `DoubleBuffer` protected

--- SolidworksAddinFramework/EventHandlers/DoubleBuffer.cs
+++ SolidworksAddinFramework/EventHandlers/DoubleBuffer.cs
@@ -8,7 +8,7 @@
     {
         private readonly Thread _InitialThread;

-        public DoubleBuffer(T t)
+        protected DoubleBuffer(T t)
         {
             Back = t;
             Front = t;


GSF.Security: Added ValidateCurrentProvider method to SecurityProviderCache to simplify CurrentProvider usage patten; general code clean-up.

--- Source/Libraries/GSF.Security/SecurityProviderCache.cs
+++ Source/Libraries/GSF.Security/SecurityProviderCache.cs
@@ -24,6 +24,8 @@
 //       inside WPF applications.
 //  12/20/2012 - Starlynn Danyelle Gilliam
 //       Modified Header.
+//  04/27/2016 - J. Ritchie Carroll
+//      Added ValidateCurrentProvider method to simplify CurrentProvider usage patten; code clean-up.
 //
 //******************************************************************************************************

@@ -68,24 +70,12 @@
             /// <summary>
             /// Gets the <see cref="ISecurityProvider"/> managed by this <see cref="CacheContext"/>.
             /// </summary>
-            public ISecurityProvider Provider
-            {
-                get
-                {
-                    return m_provider;
-                }
-            }
+            public ISecurityProvider Provider => m_provider;

             /// <summary>
             /// Gets the <see cref="DateTime"/> of when the <see cref="CacheContext"/> was created.
             /// </summary>
-            public DateTime CacheCreationTime
-            {
-                get
-                {
-                    return m_cacheCreationTime;
-                }
-            }
+            public DateTime CacheCreationTime => m_cacheCreationTime;
         }

         // Constants
@@ -162,9 +152,7 @@
                 CacheContext cache;

                 lock (s_cache)
-                {
                     s_cache.TryGetValue(Thread.CurrentPrincipal.Identity.Name, out cache);
-                }

                 if ((object)cache == null)
                     return null;
@@ -189,9 +177,7 @@
                     {
                         // Cache provider to in-process memory.
                         lock (s_cache)
-                        {
                             s_cache[value.UserData.LoginID] = new CacheContext(value);
-                        }
                     }
                 }
                 else
@@ -210,12 +196,13 @@
                         // Remove previously cached provider from session state.
                         HttpContext.Current.Session[typeof(ISecurityProvider).Name] = null;
                     }
-                    else if (s_cache.ContainsKey(identity.Provider.UserData.LoginID))
-                    {
-                        // Remove previously cached provider from in-process memory.
+                    else
+                    {
                         lock (s_cache)
                         {
-                            s_cache.Remove(identity.Provider.UserData.LoginID);
+                            // Remove previously cached provider from in-process memory if it already exists
+                            if (s_cache.ContainsKey(identity.Provider.UserData.LoginID))
+                                s_cache.Remove(identity.Provider.UserData.LoginID);
                         }
                     }
                 }
@@ -225,7 +212,27 @@
         // Static Methods

         /// <summary>
-        /// Attempts to get cached <see cref="ISecurityProvider"/> for the given username.
+        /// Validates that current provider is ready, creating it if necessary.
+        /// </summary>
+        /// <param name="username">User name of the user for whom the<see cref= "ISecurityProvider" /> is to be created; defaults to current user.</param>
+        public static void ValidateCurrentProvider(string username = null)
+        {
+            // Initialize the security principal from caller's windows identity if uninitialized, note that
+            // simply by checking current provider any existing cached security principal will be restored,
+            // if no current provider exists we create a new one
+            if (CurrentProvider == null)
+            {
+                lock (typeof(SecurityProviderCache))
+                {
+                    // Let's see if we won the race...
+                    if (CurrentProvider == null)
+                        CurrentProvider = SecurityProviderUtility.CreateProvider(username);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Attempts to get cached <see cref="ISecurityProvider"/> for the given <paramref name="username"/>.
         /// </summary>
         /// <param name="username">Name of the user.</param>
         /// <param name="provider">Security provider to return.</param>
@@ -233,8 +240,13 @@
         public static bool TryGetCachedProvider(string username, out ISecurityProvider provider)
         {
             CacheContext cacheContext;
-            bool result = s_cache.TryGetValue(username, out cacheContext);
+            bool result;
+
+            lock (s_cache)
+                result = s_cache.TryGetValue(username, out cacheContext);
+
             provider = result ? cacheContext.Provider : null;
+
             return result;
         }

@@ -266,9 +278,7 @@

             // Reset the current principal
             WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();
-
-            if ((object)currentIdentity != null)
-                Thread.CurrentPrincipal = new WindowsPrincipal(currentIdentity);
+            Thread.CurrentPrincipal = new WindowsPrincipal(currentIdentity);

             // Create a new provider associated with current identity
             provider = SecurityProviderUtility.CreateProvider(currentPrincipal.Identity.Name);


Added query and revision creation logic

Added query and revision creation logic

--- App/StackExchange.DataExplorer/Controllers/QueryController.cs
+++ App/StackExchange.DataExplorer/Controllers/QueryController.cs
@@ -46,12 +46,52 @@
                 }
             ).FirstOrDefault();

+            int? saveID = null, queryID = null;
+
             // We only create revisions if something actually changed.
             // We'll log it as an execution anyway if applicable, so the user will
             // still get a link in their profile, just not their own revision.
             if (!(parent != null && query != null && query.ID == parent.ID))
             {
-
+                if (query == null)
+                {
+                    queryID = (int)Current.DB.Query<decimal>(@"
+                        INSERT INTO Queries(
+                            QueryHash, QueryBody
+                        ) VALUES(
+                            @hash, @body
+                        )
+
+                        SELECT SCOPE_IDENTITY()",
+                        new
+                        {
+                            hash = parsedQuery.Hash,
+                            body = parsedQuery.RawSql
+                        }
+                    ).First();
+                }
+                else
+                {
+                    queryID = query.ID;
+                }
+
+                saveID = (int)Current.DB.Query<decimal>(@"
+                    INSERT INTO Revisions(
+                        QueryID, RootID, OwnerID, OwnerIP, CreationDate
+                    ) VALUES(
+                        @query, @root, @owner, @ip, @creation
+                    )
+
+                    SELECT SCOPE_IDENTITY()",
+                    new
+                    {
+                        query = queryID,
+                        root = parent != null ? (int?)parent.ID : null,
+                        owner = CurrentUser.IsAnonymous ? null : (int?)CurrentUser.Id,
+                        ip = GetRemoteIP(),
+                        creation = DateTime.UtcNow
+                    }
+                ).First();
             }

             ActionResult response = null;


Reduce references to ctor to a single location

--- Source/MundlTransit.WP8/Services/DefaultDataService.cs
+++ Source/MundlTransit.WP8/Services/DefaultDataService.cs
@@ -15,9 +15,14 @@
 {
     public class DefaultDataService : IDataService
     {
+        private ReferenceDataContext GetReferenceDataContext()
+        {
+            return new ReferenceDataContext();
+        }
+
         public async Task<List<Data.Reference.Haltestelle>> GetHaltestellenAsync()
         {
-            var ctx = new ReferenceDataContext();
+            var ctx = GetReferenceDataContext();
             var hst = await ctx.GetHaltestellenAsync().ConfigureAwait(false);

             return hst;
@@ -27,7 +32,7 @@
         {
             try
             {
-                var ctx = new ReferenceDataContext();
+                var ctx = GetReferenceDataContext();
                 var result = await ctx.GetHaltestellenContainingAsync(s).ConfigureAwait(false);

                 var startingWithString = result
@@ -81,7 +86,7 @@
                 var p3 = NearestLocationHelpers.CalculateDerivedPosition(center, mult * radius, 180);
                 var p4 = NearestLocationHelpers.CalculateDerivedPosition(center, mult * radius, 270);

-                var db = new ReferenceDataContext();
+                var db = GetReferenceDataContext();
                 var haltestellen = await db.GetNearestHaltestellenAsync(p3.Latitude, p1.Latitude, p2.Longitude, p4.Longitude).ConfigureAwait(false);

                 foreach (var h in haltestellen)
@@ -101,21 +106,21 @@

         public async Task<Haltestelle> GetHaltestelleAsync(int id)
         {
-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             var h = await db.GetHaltestelleAsync(id).ConfigureAwait(false);
             return h;
         }

         public async Task<Haltestelle> GetHaltestelleAsync(string name)
         {
-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             var h = await db.GetHaltestelleAsync(name).ConfigureAwait(false);
             return h;
         }

         public async Task<List<Haltestelle>> GetHaltestellenAsync(List<int> ids)
         {
-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             var h = await db.GetHaltestellenAsync(ids).ConfigureAwait(false);
             return h;
         }
@@ -148,7 +153,7 @@

         public async Task<List<OgdLinie>> GetLinienAsync()
         {
-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             return await db.GetLinienAsync().ConfigureAwait(false);
         }

@@ -156,13 +161,13 @@
         {
             var vms = mlt.Select(MonitorLineTypeMapper.TypeToTypeString).ToList();

-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             return await db.GetLinienAsync(vms).ConfigureAwait(false);
         }

         public async Task<List<LinienHaltestelleView>> GetHaltestellenForLinieAsync(int linienId)
         {
-            var db = new ReferenceDataContext();
+            var db = GetReferenceDataContext();
             return await db.GetHaltestellenForLinieAsync(linienId).ConfigureAwait(false);
         }


Made sure the QueryResults are transformed to actual responses

--- App/StackExchange.DataExplorer/Controllers/QueryController.cs
+++ App/StackExchange.DataExplorer/Controllers/QueryController.cs
@@ -49,12 +49,13 @@
                     crossSite == true,
                     excludeMetas == true
                 );
+                QueryResults results = null;

                 // Just in case we get into a situation where we want to create a
                 // new revision but not run anything in the process.
                 if (executeQuery)
                 {
-                    var results = ExecuteWithResults(parsedQuery, siteId.Value, textResults == true);
+                    results = ExecuteWithResults(parsedQuery, siteId.Value, textResults == true);
                 }

                 var query = Current.DB.Query<Query>(
@@ -119,6 +120,11 @@
                     queryId = query.Id;
                 }

+                if (executeQuery)
+                {
+                    QueryRunner.LogQueryExecution(CurrentUser, siteId.Value, queryId);
+                }
+
                 if (!saveId.HasValue)
                 {
                     throw new ApplicationException("Unable to save revision");
@@ -126,7 +132,14 @@

                 if (executeQuery)
                 {
-                    QueryRunner.LogQueryExecution(CurrentUser, siteId.Value, queryId);
+                    // Need to fix up the way we pass back results
+                    results.QueryId = saveId.Value;
+                    // Consider handling this XSS condition (?) in the ToJson() method instead, if possible
+                    response = Content(results.ToJson().Replace("/", "\\/"), "application/json");
+                }
+                else
+                {
+                    // Return a response appropriate for an executionless creation
                 }
             }
             catch (Exception ex)
@@ -173,6 +186,9 @@

                 var results = ExecuteWithResults(parsedQuery, siteId, textResults == true);
                 QueryRunner.LogQueryExecution(CurrentUser, siteId, query.Id);
+
+                // Consider handling this XSS condition (?) in the ToJson() method instead, if possible
+                response = Content(results.ToJson().Replace("/", "\\/"), "application/json");
             }
             catch (Exception ex)
             {


Added a "RequiredAttribute" property. If this is defined, only properties with the attribute set are shown.

--- Source/PropertyEditor/PropertyEditor/PropertyEditor.cs
+++ Source/PropertyEditor/PropertyEditor/PropertyEditor.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Diagnostics;
@@ -295,6 +296,24 @@

         #endregion

+        #region RequiredAttribute Dependency Property
+
+        /// <summary>
+        /// Gets or sets the required attribute type.
+        /// If the required attribute type is set, only properties where this attribute is set will be shown.
+        /// </summary>
+        public Type RequiredAttribute
+        {
+            get { return (Type)GetValue(RequiredAttributeProperty); }
+            set { SetValue(RequiredAttributeProperty, value); }
+        }
+
+        public static readonly DependencyProperty RequiredAttributeProperty =
+            DependencyProperty.Register("RequiredAttribute", typeof(Type), typeof(PropertyEditor),
+            new UIPropertyMetadata(null));
+
+        #endregion
+
         #region PropertyAttributeProvider Dependency Property

         public IPropertyAttributeProvider PropertyAttributeProvider
@@ -393,6 +412,24 @@
             UpdatePropertyStates(SelectedObject);
         }

+        private Type FindBiggestCommonType(IEnumerable list)
+        {
+            Type type = null;
+            foreach (var item in list)
+            {
+                var itemType = item.GetType();
+                if (type == null)
+                {
+                    type = itemType;
+                    continue;
+                }
+                while (type.BaseType != null && !type.IsAssignableFrom(itemType))
+                {
+                    type = type.BaseType;
+                }
+            }
+            return type;
+        }

         /// <summary>
         /// This method takes an object Instance and creates the property model.
@@ -412,6 +449,12 @@

             Type instanceType = instance.GetType();

+            // todo: if changing a collection of objects
+            //if (instance is IEnumerable)
+            //{
+            //    instanceType = FindBiggestCommonType(instance as IEnumerable);
+            //}
+
             // The GetPropertyModel method does not return properties in a particular order,
             // such as alphabetical or declaration order. Your code must not depend on the
             // order in which properties are returned, because that order varies.
@@ -454,6 +497,10 @@

                 // Read-only properties
                 if (!ShowReadOnlyProperties && descriptor.IsReadOnly)
+                    continue;
+
+                // If RequiredAttribute is set, check if the property has the given attribute
+                if (RequiredAttribute != null && !ContainsAttributeOfType(descriptor.Attributes,RequiredAttribute))
                     continue;

                 ParseTabAndCategory(descriptor, ref tabName, ref categoryName);
@@ -493,6 +540,20 @@
             return result;
         }

+        /// <summary>
+        /// Check if an attribute collection contains an attribute of the given type
+        /// </summary>
+        /// <param name="attributes"></param>
+        /// <param name="attributeType"></param>
+        /// <returns></returns>
+        private bool ContainsAttributeOfType(AttributeCollection attributes, Type attributeType)
+        {
+            foreach (var a in attributes)
+                if (attributeType.IsAssignableFrom(a.GetType()))
+                    return true;
+            return false;
+        }
+
         void SortPropertyModel(List<PropertyTab> result)
         {
             // SortPropertyModel tabs


Pro ASP.Net MVC 5 - SportsStore - Ch 11 - Changed List UI

Changed the UI to use Bootstrap and simplified the look.

--- SportsStore/SportsStore.WebUI/Views/Admin/Index.cshtml
+++ SportsStore/SportsStore.WebUI/Views/Admin/Index.cshtml
@@ -1,52 +1,37 @@
 @model IEnumerable<SportsStore.Domain.Entities.Product>

 @{
-    ViewBag.Title = "Index";
+    ViewBag.Title = "Admin: All Products";
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
 }

-
Index

-
-

-    @Html.ActionLink("Create New", "Create")
-

-

-

-
-            @Html.DisplayNameFor(model => model.Name)
-
-
-            @Html.DisplayNameFor(model => model.Description)
-
-
-            @Html.DisplayNameFor(model => model.Price)
-
-
-            @Html.DisplayNameFor(model => model.Category)
-
-
-

-
-@foreach (var item in Model) {
-

-
-            @Html.DisplayFor(modelItem => item.Name)
-
-
-            @Html.DisplayFor(modelItem => item.Description)
-
-
-            @Html.DisplayFor(modelItem => item.Price)
-
-
-            @Html.DisplayFor(modelItem => item.Category)
-
-
-            @Html.ActionLink("Edit", "Edit", new { id=item.ProductID }) |
-            @Html.ActionLink("Details", "Details", new { id=item.ProductID }) |
-            @Html.ActionLink("Delete", "Delete", new { id=item.ProductID })
-
-

-}
-
-

+

+

+
All Products

+

+

+

+

+                ID
+                Name
+                Price
+                Actions
+

+            @foreach (var item in Model) {
+

+                @item.ProductID
+                @Html.ActionLink(item.Name, "Edit", new { item.ProductID })
+                @item.Price.ToString("c")
+
+                @using (Html.BeginForm("Delete", "Admin")) {
+                    <input type="submit" class="btn btn-default btn-xs" value="Delete" />
+                }
+
+

+            }
+

+

+

+        @Html.ActionLink("Add a new product", "Create", null, new { @class = "btn btn-default" })
+

+


Fixed issue with property not being updated if set at design time and then changed at runtime

--- Src/ManageMessageNamespace/ModifyNamespaceComponent.cs
+++ Src/ManageMessageNamespace/ModifyNamespaceComponent.cs
@@ -88,22 +88,9 @@

         public virtual void Load(IPropertyBag pb, int errlog)
         {
-            NamespaceToModify =
-                PropertyBagHelper.ToStringOrDefault(
-                    PropertyBagHelper.ReadPropertyBag(pb, NamespaceToModifyPropertyName),
-                    string.Empty);
-
-            NewNamespace =
-                PropertyBagHelper.ToStringOrDefault(PropertyBagHelper.ReadPropertyBag(pb, NewNamespacePropertyName),
-                    string.Empty);
-
-            var shouldUpdateMessageTypeContext = PropertyBagHelper.ReadPropertyBag(pb,
-                ShouldUpdateMessagewTypeContextPropertyName);
-
-            if ((shouldUpdateMessageTypeContext != null))
-            {
-                ShouldUpdateMessageTypeContext = ((bool) (shouldUpdateMessageTypeContext));
-            }
+            NamespaceToModify = PropertyBagHelper.ReadPropertyBag(pb, NamespaceToModifyPropertyName, NamespaceToModify);
+            NewNamespace = PropertyBagHelper.ReadPropertyBag(pb, NewNamespacePropertyName, NewNamespace);
+            ShouldUpdateMessageTypeContext = PropertyBagHelper.ReadPropertyBag(pb, ShouldUpdateMessagewTypeContextPropertyName, ShouldUpdateMessageTypeContext);
         }

         public virtual void Save(IPropertyBag pb, bool fClearDirty,


Add new nav item github

Add new nav item github

--- Src/Nager.Date.WebsiteCore/Views/Shared/_Layout.cshtml
+++ Src/Nager.Date.WebsiteCore/Views/Shared/_Layout.cshtml
@@ -29,6 +29,9 @@

@Html.ActionLink("Countries", "Countries", "Home", null, new { @class = "nav-link" })

@Html.ActionLink("API", "Index", "Api", null, new { @class = "nav-link" })

+

+

+
 Github


daily

daily

--- Template/TaskTrayTemplate/TTTTTMPL/MainWin.Designer.cs
+++ Template/TaskTrayTemplate/TTTTTMPL/MainWin.Designer.cs
@@ -74,7 +74,7 @@
 			this.Name = "MainWin";
 			this.ShowInTaskbar = false;
 			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
-			this.Text = "TTTTTMPL_MainWindow";
+			this.Text = "TTTTTMPL_HiddenMainWin";
 			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWin_FormClosing);
 			this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainWin_FormClosed);
 			this.Load += new System.EventHandler(this.MainWin_Load);


documentation

documentation

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@gmail.com>

--- Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
+++ Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
@@ -1,5 +1,26 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
+
+/*!
+
+\namespace Terradue.OpenSearch.GeoJson
+@{
+    DotNetOpenSearchGeoJson Software Package
+
+    \xrefitem sw_version "Versions" "Software Package Version" 1.2.3
+
+    \xrefitem sw_link "Links" "Software Package List" [DotNetOpenSearchGeoJson](https://github.com/Terradue/DotNetOpenSearchGeoJson)
+
+    \xrefitem sw_license "License" "Software License" [GPLv3](https://github.com/Terradue/DotNetOpenSearchGeoJson/blob/master/LICENSE.txt)
+
+    \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
+
+    \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.GeoJson
+
+    \ingroup OpenSearch
+@}
+
+*/

 // Information about this assembly is defined by the following attributes.
 // Change them to the values specific to your project.


Map SCHEDULE-STATUS to Outlook FINVITED flag,  which shows if invitation email has been sent, gh issue 162.

--- CalDavSynchronizer/Implementation/Events/EventEntityMapper.cs
+++ CalDavSynchronizer/Implementation/Events/EventEntityMapper.cs
@@ -53,6 +53,7 @@
     private const string PR_SENDER_ENTRYID = "http://schemas.microsoft.com/mapi/proptag/0x0C190102";
     private const string PR_GLOBAL_OBJECT_ID = "http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/00030102";
     private const string PR_CLEAN_GLOBAL_OBJECT_ID = "http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/00230102";
+    private const string PR_FINVITED = "http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/8229000B";

     private readonly int _outlookMajorVersion;

@@ -549,6 +550,7 @@
               string organizerEmail = OutlookUtility.GetSenderEmailAddressOrNull (source, logger, s_logger);
               SetOrganizer (target, source.Organizer, organizerEmail, logger);
             }
+            SetOrganizerSchedulingParameters (source, target, logger);
           }
         }
       }
@@ -561,41 +563,53 @@
       if (organizer != null)
         targetOrganizer.CommonName = organizer.Name;
       target.Organizer = targetOrganizer;
+    }
+
+    private void SetOrganizer (IEvent target, string organizerCN, string organizerEmail, IEntityMappingLogger logger)
+    {
+      Organizer targetOrganizer;
+
+      if (organizerEmail != null)
+      {
+        var emailAddress = string.Format ("MAILTO:{0}", organizerEmail);
+        if (Uri.IsWellFormedUriString (emailAddress, UriKind.Absolute))
+        {
+          targetOrganizer = new Organizer (emailAddress);
+        }
+        else
+        {
+          s_logger.WarnFormat ("Invalid email address URI {0} for organizer", organizerEmail);
+          logger.LogMappingWarning ($"Invalid email address Uri '{organizerEmail}' for organizer");
+          targetOrganizer = new Organizer();
+        }
+      }
+      else
+      {
+        targetOrganizer = new Organizer();
+      }
+
+      targetOrganizer.CommonName = organizerCN;
+      target.Organizer = targetOrganizer;
+    }
+
+    private void SetOrganizerSchedulingParameters (AppointmentItem source, IEvent target, IEntityMappingLogger logger)
+    {
       if (_configuration.ScheduleAgentClient)
         target.Organizer.Parameters.Add ("SCHEDULE-AGENT", "CLIENT");
       if (_configuration.SendNoAppointmentNotifications)
         target.Properties.Add (new CalendarProperty ("X-SOGO-SEND-APPOINTMENT-NOTIFICATIONS", "NO"));
-    }
-
-    private void SetOrganizer (IEvent target, string organizerCN, string organizerEmail, IEntityMappingLogger logger)
-    {
-      Organizer targetOrganizer;
-
-      if (organizerEmail != null)
-      {
-        var emailAddress = string.Format ("MAILTO:{0}", organizerEmail);
-        if (Uri.IsWellFormedUriString (emailAddress, UriKind.Absolute))
-        {
-          targetOrganizer = new Organizer (emailAddress);
-        }
-        else
-        {
-          s_logger.WarnFormat ("Invalid email address URI {0} for organizer", organizerEmail);
-          logger.LogMappingWarning ($"Invalid email address Uri '{organizerEmail}' for organizer");
-          targetOrganizer = new Organizer();
-        }
-      }
-      else
-      {
-        targetOrganizer = new Organizer();
-      }
-
-      targetOrganizer.CommonName = organizerCN;
-      target.Organizer = targetOrganizer;
-      if (_configuration.ScheduleAgentClient)
-        target.Organizer.Parameters.Add ("SCHEDULE-AGENT", "CLIENT");
-      if (_configuration.SendNoAppointmentNotifications)
-        target.Properties.Add (new CalendarProperty ("X-SOGO-SEND-APPOINTMENT-NOTIFICATIONS", "NO"));
+
+      try
+      {
+        if (source.GetPropertySafe (PR_FINVITED))
+        {
+          target.Organizer.Parameters.Add ("SCHEDULE-STATUS", "1.1");
+        }
+      }
+      catch (COMException ex)
+      {
+        s_logger.Warn ("Can't access FINVITED property of appointment.", ex);
+      }
     }

     private string GetMailUrlOrNull (AddressEntry addressEntry, string defaultMailAddress, IEntityMappingLogger logger)
@@ -1248,7 +1262,7 @@
           {
             SetOrganizer (target, recipient.Name, null, logger);
           }
-
+          SetOrganizerSchedulingParameters (source, target, logger);
           organizerSet = true;
         }
       }
@@ -1683,6 +1697,8 @@
     private void MapAttendeesAndOrganizer2To1 (IEvent source, AppointmentItem target, IEntityMappingLogger logger)
     {
       var recipientsToDispose = new HashSet<Recipient>();
+      var invitationSent = false;
+
       try
       {
         var targetRecipientsWhichShouldRemain = new HashSet<Recipient>();
@@ -1705,7 +1721,7 @@
               logger.LogMappingWarning ("Ignoring invalid Uri in attendee email.", ex);
             }
           }
-          if (attendeeEmail.Length >= s_mailtoSchemaLength && !string.IsNullOrEmpty (attendeeEmail.Substring (s_mailtoSchemaLength)))
+          if (attendeeEmail.Length >= s_mailtoSchemaLength && !string.IsNullOrEmpty (attendeeEmail.Substring(s_mailtoSchemaLength)))
           {
             if (!indexByEmailAddresses.TryGetValue (attendeeEmail, out targetRecipient))
             {
@@ -1717,6 +1733,12 @@
               {
                 targetRecipient = target.Recipients.Add (attendeeEmail.Substring (s_mailtoSchemaLength));
               }
+            }
+            if (attendee.Parameters.ContainsKey ("SCHEDULE-STATUS"))
+            {
+              var scheduleStatus = attendee.Parameters.Get ("SCHEDULE-STATUS");
+              if (scheduleStatus == "1.1" || scheduleStatus == "1.2")
+                invitationSent = true;
             }
           }
           else
@@ -1816,6 +1838,36 @@
           else if (target.Recipients.Count > 0)
           {
             target.MeetingStatus = OlMeetingStatus.olMeeting;
+
+            if (source.Organizer.Parameters.ContainsKey ("SCHEDULE-STATUS"))
+            {
+              var scheduleStatus = source.Organizer.Parameters.Get ("SCHEDULE-STATUS");
+              if (scheduleStatus == "1.1" || scheduleStatus == "1.2")
+              {
+                invitationSent = true;
+              }
+              else
+              {
+                invitationSent = false;
+              }
+            }
+            if (invitationSent)
+            {
+              using (var oPa = GenericComObjectWrapper.Create (target.PropertyAccessor))
+              {
+                if (oPa.Inner != null)
+                {
+                  try
+                  {
+                    oPa.Inner.SetProperty (PR_FINVITED, true);
+                  }
+                  catch (COMException ex)
+                  {
+                    s_logger.Warn ("Could not set property PR_FINVITED for appointment", ex);
+                  }
+                }
+              }
+            }
           }
           else
           {


Add more tests re: event method resolution

--- tests/Moq.Tests/Regressions/IssueReportsFixture.cs
+++ tests/Moq.Tests/Regressions/IssueReportsFixture.cs
@@ -2923,6 +2923,30 @@
 				Assert.Equal(1, beRaiseCount);
 			}

+			[Fact]
+			public void Method_resolution__Subscribe_to_class_event__Raise_interface_event__succeeds()
+			{
+				var raised = false;
+				var mock = new Mock<A>();
+				mock.Object.E += () => raised = true;
+
+				mock.As<IA>().Raise(m => m.E += null);
+
+				Assert.True(raised);
+			}
+
+			[Fact]
+			public void Method_resolution__Subscribe_to_interface_event__Raise_class_event__succeeds()
+			{
+				var raised = false;
+				var mock = new Mock<A>();
+				(mock.Object as IA).E += () => raised = true;
+
+				mock.Raise(m => m.E += null);
+
+				Assert.True(raised);
+			}
+
 			public interface IA
 			{
 				event Action E;
@@ -2931,6 +2955,11 @@
 			public interface IB
 			{
 				event Action E;
+			}
+
+			public class A : IA
+			{
+				public virtual event Action E;
 			}

 			public class AB : IA, IB