[050dev] Reminder TODO

[050dev] Reminder TODO

--- Opus.Core/Interfaces/IModule.cs
+++ Opus.Core/Interfaces/IModule.cs
@@ -31,6 +31,7 @@
             set;
         }

+        // TODO: this needs to be removed
         IToolset GetToolset(Target target);
     }
 }


sort usings

sort usings

--- src/Analyzers/CSharp/Analyzers/SimplifyLinqExpression/CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs
+++ src/Analyzers/CSharp/Analyzers/SimplifyLinqExpression/CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs
@@ -3,13 +3,12 @@
 // See the LICENSE file in the project root for more information.

 using System.Collections.Immutable;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.Diagnostics;
 using Microsoft.CodeAnalysis.Operations;
+using Microsoft.CodeAnalysis.PooledObjects;
 using Microsoft.CodeAnalysis.SimplifyLinqExpression;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.CodeAnalysis.PooledObjects;

 namespace Microsoft.CodeAnalysis.CSharp.SimplifyLinqExpression
 {


Removed stray symbol and unnecessary usings

--- CodeHub/Controls/IncrementalLoadButtonControl.xaml.cs
+++ CodeHub/Controls/IncrementalLoadButtonControl.xaml.cs
@@ -1,19 +1,8 @@
 using CodeHub.Helpers;
 using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
 using UICompositionAnimations;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;

 namespace CodeHub.Controls
 {
@@ -76,7 +65,7 @@
             }
             else if (sender.To<ScrollViewer>().VerticalOffset < VerticalOffsetThreshold &&
                 _ButtonShown)
-            {;
+            {
                 _ButtonShown = false;
                 this.IsHitTestVisible = false;
                 this.StartXAMLTransformFadeSlideAnimation(null, 0, TranslationAxis.Y, 0, 20, 200, null, null, EasingFunctionNames.SineEaseOut);


Start on Cheers part 2

Start on Cheers part 2

--- cheers/cheers/Program.cs
+++ cheers/cheers/Program.cs
@@ -13,21 +13,37 @@
             System.Console.WriteLine("Hello there! What's your name?");
             string name = System.Console.ReadLine();
             System.Console.WriteLine("Hi, " + name);
+            System.Console.WriteLine("What's your birthday? (MM/DD)");
+            string bday = System.Console.ReadLine();
+            DateTime convertedBday = Convert.ToDateTime(bday);
+            DateTime today = DateTime.Today;

             foreach (char letter in name.ToLower())
             {
-               string article = "a";
-                 foreach (char vowelSound in "halfnorsemix")
-                 {
-                 if (letter == vowelSound)
-                       {
-                          article = "an";
+                    string article = "a";
+                    foreach (char vowelSound in "halfnorsemix")
+                    {
+                        if (letter == vowelSound)
+                        {
+                            article = "an";
                         }
-                        }
+                    }
                Console.WriteLine("Give me " + article + " " + letter);
                           }

                 Console.WriteLine(name.ToUpper() + " is GRAND");
+            if (convertedBday.Equals(today))
+            {
+                Console.WriteLine("Happy Birthday!!");
+            }
+            else
+            {
+                if (convertedBday < today)
+                {
+                    convertedBday = convertedBday.AddYears(1);
+                }
+                Console.WriteLine("Your birthday is " + convertedBday.Subtract(today).Days + " days away! Happy Birthday in Advance!");
+            }
                 Console.WriteLine("Press any key to exit.");
                 Console.ReadKey();
         }


Renamed neo to created

Renamed neo to created

--- Core/Theraot/Collections/ThreadSafe/SafeDictionary.cs
+++ Core/Theraot/Collections/ThreadSafe/SafeDictionary.cs
@@ -137,14 +137,14 @@
         /// <exception cref="System.ArgumentException">An item with the same key has already been added</exception>
         public void AddNew(TKey key, TValue value)
         {
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var hashCode = _keyComparer.GetHashCode(key);
             var attempts = 0;
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
                 KeyValuePair<TKey, TValue> found;
-                if (_mapper.Insert(hashCode + attempts, neo, out found))
+                if (_mapper.Insert(hashCode + attempts, created, out found))
                 {
                     return;
                 }
@@ -309,13 +309,13 @@
         public TValue GetOrAdd(TKey key, TValue value)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
                 KeyValuePair<TKey, TValue> stored;
-                if (_mapper.TryGetOrInsert(hashCode + attempts, neo, out stored))
+                if (_mapper.TryGetOrInsert(hashCode + attempts, created, out stored))
                 {
                     return stored.Value;
                 }
@@ -683,13 +683,13 @@
         public void Set(TKey key, TValue value)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
                 bool isNew;
-                if (_mapper.TryGetCheckSet(hashCode + attempts, neo, found => _keyComparer.Equals(((KeyValuePair<TKey, TValue>)found).Key, key), out isNew))
+                if (_mapper.TryGetCheckSet(hashCode + attempts, created, found => _keyComparer.Equals(((KeyValuePair<TKey, TValue>)found).Key, key), out isNew))
                 {
                     return;
                 }
@@ -706,12 +706,12 @@
         public void Set(TKey key, TValue value, out bool isNew)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
-            var attempts = 0;
-            while (true)
-            {
-                ExtendProbingIfNeeded(attempts);
-                if (_mapper.TryGetCheckSet(hashCode + attempts, neo, found => _keyComparer.Equals(((KeyValuePair<TKey, TValue>)found).Key, key), out isNew))
+            var created = new KeyValuePair<TKey, TValue>(key, value);
+            var attempts = 0;
+            while (true)
+            {
+                ExtendProbingIfNeeded(attempts);
+                if (_mapper.TryGetCheckSet(hashCode + attempts, created, found => _keyComparer.Equals(((KeyValuePair<TKey, TValue>)found).Key, key), out isNew))
                 {
                     return;
                 }
@@ -730,13 +730,13 @@
         public bool TryAdd(TKey key, TValue value)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
                 KeyValuePair<TKey, TValue> found;
-                if (_mapper.Insert(hashCode + attempts, neo, out found))
+                if (_mapper.Insert(hashCode + attempts, created, out found))
                 {
                     return true;
                 }
@@ -760,14 +760,14 @@
         public bool TryAdd(TKey key, TValue value, out KeyValuePair<TKey, TValue> stored)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
-            var attempts = 0;
-            while (true)
-            {
-                ExtendProbingIfNeeded(attempts);
-                if (_mapper.Insert(hashCode + attempts, neo, out stored))
-                {
-                    stored = neo;
+            var created = new KeyValuePair<TKey, TValue>(key, value);
+            var attempts = 0;
+            while (true)
+            {
+                ExtendProbingIfNeeded(attempts);
+                if (_mapper.Insert(hashCode + attempts, created, out stored))
+                {
+                    stored = created;
                     return true;
                 }
                 if (_keyComparer.Equals(stored.Key, key))
@@ -781,13 +781,13 @@
         public bool TryGetOrAdd(TKey key, TValue value, out TValue stored)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
                 KeyValuePair<TKey, TValue> _stored;
-                if (_mapper.TryGetOrInsert(hashCode + attempts, neo, out _stored))
+                if (_mapper.TryGetOrInsert(hashCode + attempts, created, out _stored))
                 {
                     stored = _stored.Value;
                     return true;
@@ -853,7 +853,7 @@
         public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, newValue);
+            var created = new KeyValuePair<TKey, TValue>(key, newValue);
             for (var attempts = 0; attempts < _probing; attempts++)
             {
                 bool keyMatch = false;
@@ -863,7 +863,7 @@
                     keyMatch = _keyComparer.Equals(found.Key, key);
                     return keyMatch && _valueComparer.Equals(found.Value, comparisonValue);
                 };
-                if (_mapper.TryUpdate(hashCode + attempts, neo, check))
+                if (_mapper.TryUpdate(hashCode + attempts, created, check))
                 {
                     return true;
                 }
@@ -878,7 +878,7 @@
         public bool TryUpdate(TKey key, TValue newValue, Predicate<TValue> valueCheck)
         {
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, newValue);
+            var created = new KeyValuePair<TKey, TValue>(key, newValue);
             for (var attempts = 0; attempts < _probing; attempts++)
             {
                 bool keyMatch = false;
@@ -888,7 +888,7 @@
                     keyMatch = _keyComparer.Equals(found.Key, key);
                     return keyMatch && valueCheck(found.Value);
                 };
-                if (_mapper.TryUpdate(hashCode + attempts, neo, check))
+                if (_mapper.TryUpdate(hashCode + attempts, created, check))
                 {
                     return true;
                 }
@@ -1003,7 +1003,7 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
@@ -1023,7 +1023,7 @@
                 // No try-catch - let the exception go.
                 bool isNew;
                 // TryGetCheckSet will add if no item is found, otherwise it calls check
-                if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                 {
                     // It added a new item
                     return;
@@ -1042,7 +1042,7 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
@@ -1053,7 +1053,7 @@
                     var _found = (KeyValuePair<TKey, TValue>)found;
                     return _keyComparer.Equals(_found.Key, key) || keyOverwriteCheck(_found.Key);
                 };
-                if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                 {
                     return;
                 }
@@ -1072,7 +1072,7 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
@@ -1082,7 +1082,7 @@
                     var _found = (KeyValuePair<TKey, TValue>)found;
                     return _keyComparer.Equals(_found.Key, key) || keyOverwriteCheck(_found.Key);
                 };
-                if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                 {
                     return;
                 }
@@ -1103,7 +1103,7 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
@@ -1124,7 +1124,7 @@
                 {
                     bool isNew;
                     // TryGetCheckSet will add if no item is found, otherwise it calls check
-                    if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                    if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                     {
                         // It added a new item
                         return true;
@@ -1143,7 +1143,7 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
+            var created = new KeyValuePair<TKey, TValue>(key, value);
             var attempts = 0;
             while (true)
             {
@@ -1165,7 +1165,7 @@
                 {
                     bool isNew;
                     // TryGetCheckSet will add if no item is found, otherwise it calls check
-                    if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                    if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                     {
                         // It added a new item
                         stored = value;
@@ -1248,7 +1248,7 @@
             }
             var hashCode = _keyComparer.GetHashCode(key);
             var attempts = 0;
-            var neo = new KeyValuePair<TKey, TValue>(key, addValue);
+            var created = new KeyValuePair<TKey, TValue>(key, addValue);
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
@@ -1267,7 +1267,7 @@
                 var result = _mapper.InternalInsertOrUpdate
                              (
                                  hashCode + attempts,
-                                 neo,
+                                 created,
                                  updateFactory,
                                  check,
                                  out stored,
@@ -1333,7 +1333,7 @@
             }
             var hashCode = _keyComparer.GetHashCode(key);
             var attempts = 0;
-            var neo = new KeyValuePair<TKey, TValue>(key, addValue);
+            var created = new KeyValuePair<TKey, TValue>(key, addValue);
             while (true)
             {
                 ExtendProbingIfNeeded(attempts);
@@ -1351,7 +1351,7 @@
                 var result = _mapper.InternalInsertOrUpdate
                              (
                                  hashCode + attempts,
-                                 neo,
+                                 created,
                                  updateFactory,
                                  check,
                                  out stored,
@@ -1410,11 +1410,11 @@
         {
             // NOTICE this method has no null check
             var hashCode = _keyComparer.GetHashCode(key);
-            var neo = new KeyValuePair<TKey, TValue>(key, value);
-            var attempts = 0;
-            while (true)
-            {
-                KeyValuePair<TKey, TValue> _found = neo;
+            var created = new KeyValuePair<TKey, TValue>(key, value);
+            var attempts = 0;
+            while (true)
+            {
+                KeyValuePair<TKey, TValue> _found = created;
                 ExtendProbingIfNeeded(attempts);
                 Predicate<object> check = found =>
                 {
@@ -1432,10 +1432,10 @@
                 {
                     bool isNew;
                     // TryGetCheckSet will add if no item is found, otherwise it calls check
-                    if (_mapper.TryGetCheckSet(hashCode + attempts, neo, check, out isNew))
+                    if (_mapper.TryGetCheckSet(hashCode + attempts, created, check, out isNew))
                     {
                         // It added a new item
-                        stored = neo;
+                        stored = created;
                         return true;
                     }
                 }


Fix Bugsense Metadata.

Fix Bugsense Metadata.

Metadata was using the wrong assumption that JToken has an explicit cast
converter for objects. Instead JToken.FromObject(..) had to be used.

--- Phoebe/Bugsnag/Data/Metadata.cs
+++ Phoebe/Bugsnag/Data/Metadata.cs
@@ -17,7 +17,7 @@
         {
             var tab = GetTab (tabName);
             if (value != null) {
-                tab [key] = (JToken)value;
+                tab [key] = JToken.FromObject (value);
             } else {
                 tab.Remove (key);
             }


update

update

--- Demos/StencilShadowVolume/ShadowVolumeNode.shaders.cs
+++ Demos/StencilShadowVolume/ShadowVolumeNode.shaders.cs
@@ -164,7 +164,23 @@
 }
 ";

-        private const string ambientVert = @"";
-        private const string ambientFrag = @"";
+        private const string ambientVert = @"#version 330
+
+in vec3 inPosition;
+
+uniform mat4 mvpMat;
+
+void main(void) {
+	gl_Position = mvpMat * vec4(inPosition, 1.0);
+}";
+        private const string ambientFrag = @"#version 330
+
+uniform vec3 ambientColor;
+
+out vec4 out_Color;
+
+void main(void) {
+	out_Color = vec4(ambientColor, 1.0);
+}";
     }
 }


Fix a bug with the SceneViewer where it was improperly clearing all updates in the scene, forcing an entire scene refresh in the viewer when changing draw distance > the region size.

--- OpenSim/Region/Framework/Scenes/SceneViewer.cs
+++ OpenSim/Region/Framework/Scenes/SceneViewer.cs
@@ -106,13 +106,15 @@
                 if (m_presence.DrawDistance > m_presence.Scene.RegionInfo.RegionSizeX &&
                     m_presence.DrawDistance > m_presence.Scene.RegionInfo.RegionSizeY)
                 {
-                    lastGrpsInView.Clear ();
-                }
-
-                //Draw Distance chagned, force a cull check
-                m_forceCullCheck = true;
-                //Don't do this immediately
-                //SignificantClientMovement (m_presence.ControllingClient);
+                    lastGrpsInView.Clear();
+                }
+                else
+                {
+                    //Draw Distance chagned, force a cull check
+                    m_forceCullCheck = true;
+                    //Don't do this immediately
+                    //SignificantClientMovement (m_presence.ControllingClient);
+                }
             }
             else if (FunctionName == "SignficantCameraMovement")
             {
@@ -209,6 +211,13 @@
             //Only check our presence
             if (remote_client.AgentId != m_presence.UUID)
                 return;
+
+            if (m_presence.DrawDistance > m_presence.Scene.RegionInfo.RegionSizeX &&
+                    m_presence.DrawDistance > m_presence.Scene.RegionInfo.RegionSizeY)
+            {
+                m_forceCullCheck = false; //Make sure to reset it
+                return;
+            }

             if (m_presence.DrawDistance < 32)
             {


Avoid a possible race condition where the XEngine script compile thread could complete but see OnRezScript() insert a new job and complete before it set m_CurrentCompile = null

If the above happened, it would mean the new script would not compile until some  script was added for compilation.

--- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1101,7 +1101,15 @@
                 // due to a race condition
                 //
                 lock (m_CompileQueue)
+                {
                     m_CurrentCompile = null;
+
+                    // This is to avoid a situation where the m_CompileQueue while loop above could complete but
+                    // OnRezScript() place a new script on the queue and check m_CurrentCompile = null before we hit
+                    // this section.
+                    if (m_CompileQueue.Count > 0)
+                        m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null);
+                }
             }

             return null;


device group changes

device group changes

--- PushX/PushX/Misc/DeviceGroup.cs
+++ PushX/PushX/Misc/DeviceGroup.cs
@@ -10,7 +10,7 @@

 namespace PushX.Misc
 {
-    public class DeviceGroup : Server
+    public class DeviceGroup
     {
         internal string _groupName = null;

@@ -18,6 +18,8 @@

         private RegistrationIdCollection collection = null;

+        private string _Key;
+
         public string NotificationGroupId
         {
             get
@@ -37,6 +39,13 @@
         public DeviceGroup(string groupName, Servers.GCMPushServer server)
         {
             _groupName = groupName;
+            _server = server;
+        }
+
+        public DeviceGroup(string groupName, string groupKey, Servers.GCMPushServer server)
+        {
+            _groupName = groupKey;
+            _Key = groupKey;
             _server = server;
         }

@@ -158,21 +167,13 @@

         public string Send(IData data)
         {
-            return send(data);
-        }
-
-        protected override string send(object obj)
-        {
             IGCM gcm = new GCMData();
-            gcm.data = (IData)obj;
+            gcm.data = data;
             gcm.to = _Key;

             return _server.Send(gcm);
         }

-        protected override Task<string> sendAsync(object o)
-        {
-            throw new NotImplementedException();
-        }
+
     }
 }


Added test bodies to Rfc5646Tag tests

Added test bodies to Rfc5646Tag tests

--- Palaso.Tests/WritingSystems/RFC5646TagTests.cs
+++ Palaso.Tests/WritingSystems/RFC5646TagTests.cs
@@ -286,27 +286,67 @@
 		}

 		[Test]
+		public void Constructor_SetWithInvalidLanguageTag_Throws()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag("bogus", String.Empty,String.Empty,String.Empty));
+		}
+
+		[Test]
+		public void Constructor_SetWithInvalidScriptTag_Throws()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag("en", "bogus", String.Empty, String.Empty));
+		}
+
+		[Test]
+		public void Constructor_SetWithInvalidRegionTag_Throws()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag("en", String.Empty, "bogus", String.Empty));
+		}
+
+		[Test]
+		public void Constructor_SetWithInvalidVariantTag_Throws()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag("en", String.Empty, String.Empty, "bogus"));
+		}
+
+		[Test]
 		public void Language_SetWithInvalidLanguageTag_Throws()
 		{
-			throw new NotImplementedException();
+			var tag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty);
+			Assert.Throws<ArgumentException>(() => tag.Language = "bogus");
 		}

 		[Test]
 		public void Script_SetWithInvalidScriptTag_Throws()
 		{
-			throw new NotImplementedException();
+			var tag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty);
+			Assert.Throws<ArgumentException>(() => tag.Script = "bogus");
 		}

 		[Test]
 		public void Region_SetWithInvalidRegionTag_Throws()
 		{
-			throw new NotImplementedException();
+			var tag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty);
+			Assert.Throws<ArgumentException>(() => tag.Region = "bogus");
 		}

 		[Test]
 		public void Variant_SetPrivateUseTag_VariantisSet()
 		{
-			throw new NotImplementedException();
+			var tag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty);
+			Assert.Throws<ArgumentException>(() => tag.Variant = "bogus");
+		}
+
+		[Test]
+		public void Constructor_LanguageIsEmptyAndVariantIsNotPrivateUse_Throws()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag(String.Empty, String.Empty, String.Empty, String.Empty));
+		}
+
+		[Test]
+		public void Constructor_LanguageIsEmptyAndVariantIsPrivateUse_SetsVariant()
+		{
+			Assert.Throws<ArgumentException>(() => new RFC5646Tag(String.Empty, String.Empty, String.Empty, String.Empty));
 		}
 	}
 }


Change a Union to Concat. - In this case there will be no functional difference and Concat gives better performance.

--- PickupMailViewer/Controllers/HomeController.cs
+++ PickupMailViewer/Controllers/HomeController.cs
@@ -25,7 +25,7 @@
             var smsPaths = SmsHelper.ListSmsFiles(Properties.Settings.Default.MailDir);
             var sms = smsPaths.Select(path => new SmsModel(path));

-            var messages = mails.Cast<MessageModel>().Union(sms)
+            var messages = mails.Cast<MessageModel>().Concat(sms)
                 .OrderByDescending(m => m.SentOn);

             return messages;


Now MasterServer works again.

Now MasterServer works again.

--- Platform/Platform.Data.MasterServer/Program.cs
+++ Platform/Platform.Data.MasterServer/Program.cs
@@ -159,6 +159,7 @@
         private static ulong[] ProcessSequence(string sequence, bool forSearch = false)
         {
             var sequenceLength = sequence.Length;
+            if (forSearch) sequenceLength--;
             var w = 0;
             for (var r = 0; r < sequenceLength; r++)
             {


Load Confirmation plugin in PageBuilder

Load Confirmation plugin in PageBuilder

--- Portal.CMS.Web/Views/Shared/_DOMScripts.cshtml
+++ Portal.CMS.Web/Views/Shared/_DOMScripts.cshtml
@@ -1,9 +1,9 @@
 @Scripts.Render("~/Resources/JavaScript/Bootstrap")
+@Scripts.Render("~/Resources/JavaScript/Bootstrap/Confirmation")
 @Scripts.Render("~/Resources/JavaScript/Bootstrap/Popover")
 @Scripts.Render("~/Resources/JavaScript/Framework")

 @if (UserHelper.IsAdmin)
 {
     @Scripts.Render("~/Resources/JavaScript/Bootstrap/Tour")
-    @Scripts.Render("~/Resources/JavaScript/Bootstrap/Confirmation")
 }


Hide window

Hide window

--- PowerShellTools.HostService/MainWindow.xaml.cs
+++ PowerShellTools.HostService/MainWindow.xaml.cs
@@ -26,7 +26,6 @@
         {
             InitializeComponent();

-            this.Visibility = System.Windows.Visibility.Hidden;
             this.Left = 28000;
             this.Top = 28000;
             this.ShowInTaskbar = false;
@@ -34,7 +33,10 @@
                     PowerShellTools.Common.Constants.HostProcessWindowTitleFormat,
                     App.VsProcessId,
                     PowerShellTools.Common.Constants.PowerShellHostExeName);
+
+            // We have to visible the window first before hidding it so that we can find the window handle later
             this.Visibility = System.Windows.Visibility.Visible;
+            this.Visibility = System.Windows.Visibility.Hidden;

             ConsoleManager.AttachConsole();
         }


+ Added base vertex texture fetch support to RenderSystem.

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@2071 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/Axiom/Engine/Graphics/RenderSystem.cs
+++ Projects/Axiom/Engine/Graphics/RenderSystem.cs
@@ -571,11 +571,8 @@
             // Vertex Texture Binding?
             if (    this.HardwareCapabilities.HasCapability( Capabilities.VertexTextureFetch )
                  && this.HardwareCapabilities.VertexTextureUnitsShared )
-            {
-                LogManager.Instance.Write( "Vertex Texture not implemented using fallback method." );
-                this.SetTexture( unit, true, unitState.TextureName );
-                /*
-                if ( unitState.BindingType = BindingType.Vertex )
+            {
+                if ( unitState.BindingType == TextureBindingType.Vertex )
                 {
                     // Bind Vertex Texture
                     SetVertexTexture( unit, texture );
@@ -587,9 +584,9 @@
                 {
                     // vice versa
                     SetVertexTexture( unit, null );
-                    this.SetTexture( unit, true, texture );
+					this.SetTexture( unit, true, unitState.TextureName );
                 }
-                */
+
             }
             else
             {
@@ -1480,13 +1477,34 @@
         ///		Note that this method is called by SetMaterial.
         /// </summary>
         /// <param name="stage">The index of the texture unit to modify. Multitexturing hardware
-        //		can support multiple units (see TextureUnitCount)</param>
+		//		can support multiple units (see TextureUnitCount)</param>
         /// <param name="enabled">Boolean to turn the unit on/off</param>
         /// <param name="textureName">The name of the texture to use - this should have
         ///		already been loaded with TextureManager.Load.</param>
         public abstract void SetTexture( int stage, bool enabled, string textureName );

-        /// <summary>
+		/// <summary>
+		/// Binds a texture to a vertex sampler.
+		/// </summary>
+		/// <remarks>
+		/// Not all rendersystems support separate vertex samplers. For those that
+		/// do, you can set a texture for them, separate to the regular texture
+		/// samplers, using this method. For those that don't, you should use the
+		/// regular texture samplers which are shared between the vertex and
+		/// fragment units; calling this method will throw an exception.
+		/// <see>RenderSystemCapabilites.VertexTextureUnitsShared</see>
+		/// </remarks>
+		/// <param name="unit"></param>
+		/// <param name="texture"></param>
+		public virtual void SetVertexTexture( int unit, Texture texture )
+		{
+			throw new NotSupportedException(
+				"This rendersystem does not support separate vertex texture samplers, " +
+				"you should use the regular texture samplers which are shared between " +
+				"the vertex and fragment units." );
+		}
+
+    	/// <summary>
         ///		Tells the hardware how to treat texture coordinates.
         /// </summary>
         /// <param name="stage"></param>


Replace Tree click listener with routed events

--- MonoGdx/Scene2D/UI/Tree.cs
+++ MonoGdx/Scene2D/UI/Tree.cs
@@ -19,6 +19,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Input;
 using MonoGdx.Graphics.G2D;
 using MonoGdx.Scene2D.Utils;
@@ -41,8 +42,6 @@
         private float _prefHeight;
         private bool _sizeInvalid = true;
         private TreeNode _foundNode;
-        private TreeNode _overNode;
-        private ClickListener _clickListener;

         private readonly List<TreeNode> _selectEventAdd = new List<TreeNode>();
         private readonly List<TreeNode> _selectEventRemove = new List<TreeNode>();
@@ -67,112 +66,103 @@
                 CanSelectMultiple = true,
                 SelectionChangeHandler = SelectionChangeHandler,
             };
-
-            Initialize();
-        }
-
-        private void Initialize ()
-        {
-            AddListener(_clickListener = new LocalClickListener(this));
-        }
-
-        private class LocalClickListener : ClickListener
-        {
-            private Tree _tree;
-            public LocalClickListener (Tree tree)
-            {
-                _tree = tree;
-            }
-
-            public override void Clicked (InputEvent ev, float x, float y)
-            {
-                TreeNode node = _tree.NodeAt(y);
-                if (node == null)
-                    return;
-                if (node != _tree.NodeAt(TouchDownY))
-                    return;
-
-                KeyboardState keystate = Keyboard.GetState();
-                bool shiftPressed = keystate.IsKeyDown(Keys.LeftShift) || keystate.IsKeyDown(Keys.RightShift);
-                bool ctrlPressed = keystate.IsKeyDown(Keys.LeftControl) || keystate.IsKeyDown(Keys.RightControl);
-
-                if (_tree.MultiSelect && _tree._selectedNodes.Count > 0 && shiftPressed) {
-                    float low = _tree._selectedNodes.First().Actor.Y;
-                    float high = node.Actor.Y;
-
-                    _tree._selectionChanger.Begin(_tree._selectedNodes);
-
-                    if (!ctrlPressed)
-                        _tree._selectionChanger.UnselectAll();
-
-                    if (low > high)
-                        _tree.SelectNodes(_tree._rootNodes, high, low);
-                    else
-                        _tree.SelectNodes(_tree._rootNodes, low, high);
-
-                    _tree._selectionChanger.End();
-
-                    return;
-                }
-
-                if (!_tree.MultiSelect || !ctrlPressed) {
-                    if (_tree.Children.Count > 0) {
-                        float rowX = node.Actor.X;
-                        if (node.Icon != null)
-                            rowX -= _tree.IconSpacing + node.Icon.MinWidth;
-
-                        float indent = 0;
-                        if (node.Children == null || node.Children.Count == 0)
-                            indent = rowX;
-                        else {
-                            TreeNode parent = node.Parent;
-                            while (parent != null) {
-                                indent += _tree._indentSpacing;
-                                parent = parent.Parent;
-                            }
-                        }
-
-                        if (x > indent && x < rowX) {
-                            node.IsExpanded = !node.IsExpanded;
-                            return;
+        }
+
+        protected override void OnMouseMove (MouseEventArgs e)
+        {
+            Vector2 position = e.GetPosition(this);
+            OverNode = NodeAt(position.Y);
+
+            base.OnMouseMove(e);
+        }
+
+        protected override void OnTouchDown (TouchEventArgs e)
+        {
+            Vector2 position = e.GetPosition(this);
+
+            TreeNode node = NodeAt(position.Y);
+            if (node == null)
+                return;
+            if (node != NodeAt(position.Y))
+                return;
+
+            KeyboardState keystate = Keyboard.GetState();
+            bool shiftPressed = keystate.IsKeyDown(Keys.LeftShift) || keystate.IsKeyDown(Keys.RightShift);
+            bool ctrlPressed = keystate.IsKeyDown(Keys.LeftControl) || keystate.IsKeyDown(Keys.RightControl);
+
+            if (MultiSelect && _selectedNodes.Count > 0 && shiftPressed) {
+                float low = _selectedNodes.First().Actor.Y;
+                float high = node.Actor.Y;
+
+                _selectionChanger.Begin(_selectedNodes);
+
+                if (!ctrlPressed)
+                    _selectionChanger.UnselectAll();
+
+                if (low > high)
+                    SelectNodes(_rootNodes, high, low);
+                else
+                    SelectNodes(_rootNodes, low, high);
+
+                _selectionChanger.End();
+
+                return;
+            }
+
+            if (!MultiSelect || !ctrlPressed) {
+                if (Children.Count > 0) {
+                    float rowX = node.Actor.X;
+                    if (node.Icon != null)
+                        rowX -= IconSpacing + node.Icon.MinWidth;
+
+                    float indent = 0;
+                    if (node.Children == null || node.Children.Count == 0)
+                        indent = rowX;
+                    else {
+                        TreeNode parent = node.Parent;
+                        while (parent != null) {
+                            indent += _indentSpacing;
+                            parent = parent.Parent;
                         }
                     }

-                    if (!node.IsSelectable)
+                    if (position.X > indent && position.X < rowX) {
+                        node.IsExpanded = !node.IsExpanded;
                         return;
-
-                    bool unselect = _tree.ToggleSelect && _tree._selectedNodes.Count == 1 && _tree._selectedNodes.Contains(node);
-
-                    _tree._selectionChanger.Begin(_tree._selectedNodes);
-                    _tree._selectionChanger.UnselectAll();
-                    if (!unselect)
-                        _tree._selectionChanger.Select(node);
-                    _tree._selectionChanger.End();
-
+                    }
+                }
+
+                if (!node.IsSelectable)
                     return;
-                }
-                else if (!node.IsSelectable)
-                    return;
-
-                _tree._selectionChanger.Begin(_tree._selectedNodes);
-                _tree._selectionChanger.Select(node);
-                _tree._selectionChanger.End();
-            }
-
-            public override bool MouseMoved (InputEvent e, float x, float y)
-            {
-                _tree.OverNode = _tree.NodeAt(y);
-                return false;
-            }
-
-            public override void Exit (InputEvent e, float x, float y, int pointer, Actor toActor)
-            {
-                base.Exit(e, x, y, pointer, toActor);
-                if (toActor == null || !toActor.IsDescendentOf(_tree))
-                    _tree.OverNode = null;
-            }
-        }
-
+
+                bool unselect = ToggleSelect && _selectedNodes.Count == 1 && _selectedNodes.Contains(node);
+
+                _selectionChanger.Begin(_selectedNodes);
+                _selectionChanger.UnselectAll();
+                if (!unselect)
+                    _selectionChanger.Select(node);
+                _selectionChanger.End();
+
+                return;
+            }
+            else if (!node.IsSelectable)
+                return;
+
+            _selectionChanger.Begin(_selectedNodes);
+            _selectionChanger.Select(node);
+            _selectionChanger.End();
+
+            base.OnTouchDown(e);
+        }
+
+        protected override void OnTouchLeave (TouchEventArgs e)
+        {
+            if (e.RelatedActor == null || !e.RelatedActor.IsDescendentOf(this))
+                OverNode = null;
+
+            base.OnTouchLeave(e);
+        }
+
         private void SelectionChangeHandler (List<TreeNode> addedItems, List<TreeNode> removedItems)
         {
             OnSelectionChanged(removedItems, addedItems);
@@ -339,7 +329,7 @@
                 bool selected = _selectedNodes.Contains(node);
                 if (selected && _style.Selection != null)
                     _style.Selection.Draw(spriteBatch, x, y + actor.Y - YSpacing / 2, Width, node.Height + YSpacing);
-                else if (node == _overNode && _style.Over != null)
+                else if (node == OverNode && _style.Over != null)
                     _style.Over.Draw(spriteBatch, x, y + actor.Y - YSpacing / 2, Width, node.Height + YSpacing);

                 if (node.Icon != null) {
@@ -546,11 +536,6 @@
                 node.ExpandAll();
         }

-        public ClickListener ClickListener
-        {
-            get { return _clickListener; }
-        }
-
         public bool MultiSelect { get; set; }
         public bool ToggleSelect { get; set; }


fixed extension

fixed extension

--- Nomads.Utilities/Nomads.Utilities.Extensions/Nomads.Utilities.Extensions.Unified/StoryboardExtensions.cs
+++ Nomads.Utilities/Nomads.Utilities.Extensions/Nomads.Utilities.Extensions.Unified/StoryboardExtensions.cs
@@ -1,9 +1,9 @@
 using System;
-using AppKit;
+using UIKit;

 #if __IOS__
-using UNStoryboard = AppKit.UIStoryboard;
-using UNViewController = AppKit.UIViewController;
+using UNStoryboard = UIKit.UIStoryboard;
+using UNViewController = UIKit.UIViewController;
 #endif

 #if !__IOS__
@@ -40,7 +40,7 @@
 		public static UNViewController Instantiate (this UNStoryboard storyboard, string name)
 		{
 			#if __IOS__
-			return storyboard.InstantiateViewController(name) as UIViewController;
+			return storyboard.InstantiateViewController(name) as UNViewController;
 			#endif

 			#if !__IOS__


display error message

display error message

--- RegexPlanet-DotNet/Test.aspx.cs
+++ RegexPlanet-DotNet/Test.aspx.cs
@@ -75,6 +75,7 @@
 				}
 				catch (Exception en)
 				{
+					testResult.Message = en.Message;
 					sb.AppendLine("\t\t
");
 					sb.AppendLine("\t\t\tError	");
 					sb.Append("\t\t\t");
@@ -218,9 +219,9 @@
 					sb.AppendLine("\t
");
 					sb.AppendLine("
");

-					testResult.Success = true;
-					testResult.Html = sb.ToString();
-				}
+				}
+				testResult.Success = regularExpression == null ? false : true;
+				testResult.Html = sb.ToString();
 			}

 			String result = Serialize<TestResult>(testResult);


Update for test.

Update for test.

--- src/dotnet-svcutil/lib/tests/src/E2ETests.cs
+++ src/dotnet-svcutil/lib/tests/src/E2ETests.cs
@@ -167,7 +167,7 @@
             TestFixture();
             InitializeE2E(testCaseName);

-            // copy wsdl files into test project's path to make it easier to pass the params as relative paths.
+            //copy wsdl files into test project's path to make it easier to pass the params as relative paths.
             var wsdlFile = Path.Combine(this_TestGroupOutputDir, "wsdl", "tempuri.org.wsdl");
             if (!File.Exists(wsdlFile))
             {


Show the user name when receiving

Show the user name when receiving

--- Purchasing.Web/Services/NotificationService.cs
+++ Purchasing.Web/Services/NotificationService.cs
@@ -180,7 +180,7 @@
             if (!string.IsNullOrEmpty(order.Workgroup.NotificationEmailList))
             {
                 //var emailQueue = new EmailQueue(order, EmailPreferences.NotificationTypes.PerEvent, string.Format(ReceiveMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, quantity), actor, order.Workgroup.NotificationEmailList);
-                var emailQueue2 = new EmailQueueV2(order, EmailPreferences.NotificationTypes.PerEvent, "Received", string.Format("{0} item(s) by {1}.", quantity, actor), null, order.Workgroup.NotificationEmailList);
+                var emailQueue2 = new EmailQueueV2(order, EmailPreferences.NotificationTypes.PerEvent, "Received", string.Format("{0} item(s) by {1}.", quantity, actor.FullName), null, order.Workgroup.NotificationEmailList);
                 AddToQueue(queues, emailQueue2);
             }

@@ -191,7 +191,7 @@
                 if (IsMailRequested(preference, approval.StatusCode, order.StatusCode, EventCode.Received, order.OrderType))
                 {
                     //var emailQueue = new EmailQueue(order, preference.NotificationType, string.Format(ReceiveMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, quantity), approval.User);
-                    var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Received", string.Format("{0} item(s) by {1}.", quantity, actor), approval.User);
+                    var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Received", string.Format("{0} item(s) by {1}.", quantity, actor.FullName), approval.User);
                     AddToQueue(queues, emailQueue2);
                 }
             }


不要なテストを削除

不要なテストを削除

--- Ragnarok.NicoNico/Video/Tests/VideoDataTest.cs
+++ Ragnarok.NicoNico/Video/Tests/VideoDataTest.cs
@@ -437,7 +437,7 @@
         [Test()]
         public void SnapshotApiTest()
         {
-            var vs = SnapshotApi.Search("レッツゴー！陰陽師（フルコーラスバージョン）");
+            /*var vs = SnapshotApi.Search("レッツゴー！陰陽師（フルコーラスバージョン）");
             TestSM9(vs.OrderByDescending(_ => _.ViewCounter).FirstOrDefault(), RemoveTagType.ATagOnly);

             vs = SnapshotApi.Search("クリプトン開発のVOCALOID。つまり音声合成ソフトです");
@@ -456,7 +456,7 @@
             TestMemberOnly(vs.FirstOrDefault(), RemoveTagType.ATagOnly);

             vs = SnapshotApi.Search("どｊどういｔｓｄｋｊぁ", false);
-            Assert.AreEqual(0, vs.Count());
+            Assert.AreEqual(0, vs.Count());*/
         }
     }
 }


Added deconstructor to ExceptionParameter.

--- DragonSpark/Diagnostics/Logging/ExceptionParameter.cs
+++ DragonSpark/Diagnostics/Logging/ExceptionParameter.cs
@@ -1,4 +1,6 @@
-namespace DragonSpark.Diagnostics.Logging
+using JetBrains.Annotations;
+
+namespace DragonSpark.Diagnostics.Logging
 {
 	public readonly struct ExceptionParameter<T>
 	{
@@ -11,5 +13,11 @@
 		public System.Exception Exception { get; }

 		public T Argument { get; }
+
+		public void Deconstruct([NotNull] out System.Exception exception, out T argument)
+		{
+			exception = Exception;
+			argument  = Argument;
+		}
 	}
 }


Use HttpClient

Use HttpClient

--- Espera/Espera.View/ViewModels/YoutubeSongViewModel.cs
+++ Espera/Espera.View/ViewModels/YoutubeSongViewModel.cs
@@ -5,6 +5,7 @@
 using System.IO;
 using System.Linq;
 using System.Net;
+using System.Net.Http;
 using System.Reactive;
 using System.Reactive.Linq;
 using System.Threading.Tasks;
@@ -203,11 +204,11 @@
         {
             this.IsLoadingThumbnail = true;

-            using (var webClient = new WebClient())
+            using (var client = new HttpClient())
             {
                 try
                 {
-                    byte[] imageBytes = await webClient.DownloadDataTaskAsync(((YoutubeSong)this.Model).ThumbnailSource);
+                    byte[] imageBytes = await client.GetByteArrayAsync(((YoutubeSong)this.Model).ThumbnailSource);

                     if (imageBytes == null)
                     {


Properly handle properties with non-public setters.

--- Expressions/Expressions/ObservableExpressionBinder.cs
+++ Expressions/Expressions/ObservableExpressionBinder.cs
@@ -451,7 +451,7 @@

         private Expression CreateExpression(Type expressionType, BinaryExpression node)
         {
-            return System.Activator.CreateInstance(expressionType
+            return Activator.CreateInstance(expressionType
                         .MakeGenericType(new Type[] { GetLeastGeneralCommonType(node.Left.Type, node.Right.Type) }),
                         node, this) as Expression;
         }
@@ -546,12 +546,12 @@

         protected override Expression VisitConditional(ConditionalExpression node)
         {
-            return System.Activator.CreateInstance(typeof(ObservableConditionalExpression<>).MakeGenericType(node.Type), node, this) as Expression;
+            return Activator.CreateInstance(typeof(ObservableConditionalExpression<>).MakeGenericType(node.Type), node, this) as Expression;
         }

         protected override Expression VisitConstant(ConstantExpression node)
         {
-            return System.Activator.CreateInstance(typeof(ObservableConstant<>).MakeGenericType(node.Type), node.Value) as Expression;
+            return Activator.CreateInstance(typeof(ObservableConstant<>).MakeGenericType(node.Type), node.Value) as Expression;
         }

         protected override Expression VisitDebugInfo(DebugInfoExpression node)
@@ -619,7 +619,7 @@
         protected override Expression VisitListInit(ListInitExpression node)
         {
             if (node.Initializers.Count == 0) return Visit(node.NewExpression);
-            return System.Activator.CreateInstance(typeof(ObservableListInit<>).MakeGenericType(node.Type), node, this) as Expression;
+            return Activator.CreateInstance(typeof(ObservableListInit<>).MakeGenericType(node.Type), node, this) as Expression;
         }

         protected override Expression VisitLoop(LoopExpression node)
@@ -652,53 +652,52 @@

         private Expression VisitField(MemberExpression node, FieldInfo field)
         {
-            return System.Activator.CreateInstance(typeof(ObservableReversableMemberExpression<,>).MakeGenericType(field.DeclaringType, field.FieldType),
+            return Activator.CreateInstance(typeof(ObservableReversableMemberExpression<,>).MakeGenericType(field.DeclaringType, field.FieldType),
                 node, this, field.Name, field) as Expression;
         }

         private Expression VisitProperty(MemberExpression node, PropertyInfo property)
         {
-            object getter;
-            if (!ReflectionHelper.IsValueType(property.DeclaringType))
-            {
-                getter = ReflectionHelper.CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType, property.PropertyType), ReflectionHelper.GetGetter(property));
-            }
-            else
-            {
-                //TODO: This is a bug in the BCL, code here to get out of this shit
+            //We only handle value types differently because of a bug in the BCL
+            Delegate getter;
+            if (property.DeclaringType.GetTypeInfo().IsValueType)
+            {
                 var param = Expression.Parameter(property.DeclaringType);
                 var expression = Expression.Lambda(Expression.Property(param, property), param);
                 getter = expression.Compile();
             }
-            if (property.CanWrite)
-            {
-                var setter = ReflectionHelper.GetSetter(property);
-                if (setter != null)
+            else
+            {
+                getter = property.GetGetMethod().CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType, property.PropertyType));
+            }
+
+            //GetSetMethod() returns null if setter is private
+            if (property.CanWrite && property.GetSetMethod() != null)
+            {
+                Delegate setter;
+                if (property.DeclaringType.GetTypeInfo().IsValueType)
                 {
-                    if (!ReflectionHelper.IsValueType(property.DeclaringType))
-                    {
-                        return System.Activator.CreateInstance(typeof(ObservableReversableMemberExpression<,>).MakeGenericType(property.DeclaringType, property.PropertyType),
-                            node, this, property.Name, getter, ReflectionHelper.CreateDelegate(typeof(Action<,>).MakeGenericType(property.DeclaringType, property.PropertyType), setter)) as Expression;
-                    }
-                    else
-                    {
-                        var setParam1 = Expression.Parameter(property.DeclaringType);
-                        var setParam2 = Expression.Parameter(property.PropertyType);
-                        var setExpression = Expression.Lambda(Expression.Assign(Expression.Property(setParam1, property), setParam2), setParam1, setParam2);
-
-                        return System.Activator.CreateInstance(typeof(ObservableReversableMemberExpression<,>).MakeGenericType(property.DeclaringType, property.PropertyType),
-                            node, this, property.Name, getter, setExpression.Compile()) as Expression;
-                    }
+                    var setParam1 = Expression.Parameter(property.DeclaringType);
+                    var setParam2 = Expression.Parameter(property.PropertyType);
+                    var expression = Expression.Lambda(Expression.Assign(Expression.Property(setParam1, property), setParam2), setParam1, setParam2);
+                    setter = expression.Compile();
                 }
-            }
-            return System.Activator.CreateInstance(typeof(ObservableMemberExpression<,>).MakeGenericType(property.DeclaringType, property.PropertyType),
-                node, this, property.Name, getter) as Expression;
+                else
+                {
+                    setter = property.GetSetMethod().CreateDelegate(typeof(Action<,>).MakeGenericType(property.DeclaringType, property.PropertyType));
+                }
+
+                var reversableType = typeof(ObservableReversableMemberExpression<,>).MakeGenericType(property.DeclaringType, property.PropertyType);
+                return (Expression)Activator.CreateInstance(reversableType, node, this, property.Name, getter, setter);
+            }
+            var expressionType = typeof(ObservableMemberExpression<,>).MakeGenericType(property.DeclaringType, property.PropertyType);
+            return (Expression)Activator.CreateInstance(expressionType, node, this, property.Name, getter);
         }

         protected override Expression VisitMemberInit(MemberInitExpression node)
         {
             if (node.Bindings.Count == 0) return Visit(node.NewExpression);
-            return System.Activator.CreateInstance(typeof(ObservableMemberInit<>).MakeGenericType(node.Type), node, this) as Expression;
+            return Activator.CreateInstance(typeof(ObservableMemberInit<>).MakeGenericType(node.Type), node, this) as Expression;
         }

         protected override Expression VisitMethodCall(MethodCallExpression node)
@@ -763,7 +762,7 @@
                         }
                         else
                         {
-                            return System.Activator.CreateInstance(memberSimpleProxyTypes[node.Arguments.Count].MakeGenericType(types), node, this, proxyMethod) as Expression;
+                            return Activator.CreateInstance(memberSimpleProxyTypes[node.Arguments.Count].MakeGenericType(types), node, this, proxyMethod) as Expression;
                         }
                     }
                     else if (!staticMethod && proxyAttribute.InitializeProxyMethod(node.Method, typesArg, out proxyMethod))
@@ -774,7 +773,7 @@
                         }
                         CheckForOutParameter(proxyMethod.GetParameters());
                         CheckReturnTypeIsCorrect(node, proxyMethod);
-                        return System.Activator.CreateInstance(memberProxyCallTypes[typesLength - 2].MakeGenericType(types), node, this, proxyMethod) as Expression;
+                        return Activator.CreateInstance(memberProxyCallTypes[typesLength - 2].MakeGenericType(types), node, this, proxyMethod) as Expression;
                     }
                     else if (proxyAttribute.InitializeProxyMethod(node.Method, typesArgStaticInc, out proxyMethod))
                     {
@@ -820,7 +819,7 @@
                                 object proxy = proxyMethod.Invoke(null, proxyArgs);
                                 var proxyExp = proxy as Expression;
                                 if (proxyExp != null) return proxyExp;
-                                return System.Activator.CreateInstance(typeof(ObservableProxyExpression<>).MakeGenericType(node.Method.ReturnType), proxy) as Expression;
+                                return Activator.CreateInstance(typeof(ObservableProxyExpression<>).MakeGenericType(node.Method.ReturnType), proxy) as Expression;
                             }
                             catch (NullReferenceException)
                             {
@@ -836,7 +835,7 @@
                         }
                         CheckForOutParameter(proxyMethod.GetParameters());
                         CheckReturnTypeIsCorrect(node, proxyMethod);
-                        return System.Activator.CreateInstance(staticProxyCallTypes[typesLength - 2].MakeGenericType(types), node, this, proxyMethod) as Expression;
+                        return Activator.CreateInstance(staticProxyCallTypes[typesLength - 2].MakeGenericType(types), node, this, proxyMethod) as Expression;
                     }
                     else
                     {
@@ -853,7 +852,7 @@
             {
                 methodArray = memberMethodTypes;
             }
-            return System.Activator.CreateInstance(methodArray[typesLength - 2].MakeGenericType(types), node, this) as Expression;
+            return Activator.CreateInstance(methodArray[typesLength - 2].MakeGenericType(types), node, this) as Expression;
         }

         private void CheckReturnTypeIsCorrect(MethodCallExpression node, MethodInfo proxyMethod)


- Updating Glimesh chat sample

- Updating Glimesh chat sample

--- Glimesh/Samples/Glimesh.ChatSample.Console/Program.cs
+++ Glimesh/Samples/Glimesh.ChatSample.Console/Program.cs
@@ -72,7 +72,7 @@
                                         while (true)
                                         {
                                             string line = System.Console.ReadLine();
-                                            //await chat.SendMessage(line);
+                                            await chat.SendMessage(channel.id, line);
                                         }
                                     }
                                 }


Fixed controller bug

Fixed controller bug

--- Selly.Website/Controllers/SummaryController.cs
+++ Selly.Website/Controllers/SummaryController.cs
@@ -12,8 +12,8 @@
     public class SummaryController : ApiController
     {
         [HttpGet]
-        [ActionName("GetSummay")]
-        public async Task<IHttpActionResult> GetSummary()
+        [ActionName("Get")]
+        public async Task<IHttpActionResult> Get()
         {
             try
             {


fix typo

fix typo

--- Serenity.Web/Common/TemplateScriptRegistrar.cs
+++ Serenity.Web/Common/TemplateScriptRegistrar.cs
@@ -51,7 +51,7 @@
                 ts.Changed();

             if (bundle != null)
-                ts.Changed();
+                bundle.Changed();
         }

         public void Initialize(string[] rootUrls, bool watchForChanges = true)


Fix ReflectionTools Parse value is " "

Fix ReflectionTools Parse value is " "

--- Signum.Utilities/Reflection/ReflectionTools.cs
+++ Signum.Utilities/Reflection/ReflectionTools.cs
@@ -415,7 +415,7 @@
             if (type == typeof(string))
                 return (object)value;

-            if (value == null || value == "")
+            if (value == null || value == "" || value == " ")
                 return (object)null;

             Type utype = type.UnNullify();


Improve decoder logic.

Improve decoder logic.

--- SkyTimer.Utils/Decoder/StackmatDecoder_8bit.cs
+++ SkyTimer.Utils/Decoder/StackmatDecoder_8bit.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;

 namespace SkyTimer.Utils.Decoder
 {
@@ -21,7 +22,8 @@
         private List<int> Buffer = new List<int>();
         private int counter0 = 0;
         private int counter1 = 0;
-        private List<int> values = new List<int> { 0, 0, 0, 0, 0, 0 };
+        private List<int> decodedValues = new List<int> { 0, 0, 0, 0, 0, 0 };
+        private List<int> values = new List<int>();

         public void Decode(byte[] ssData)
@@ -31,14 +33,47 @@
                 Buffer.Clear();
                 counter1 = 0;
                 counter0 = 0;
-                //LostConnection(this, null);

                 return;
             }

-            for (int i = 0; i < ssData.Length; i++)
-            {
-                if (ssData[i] > 127)
+            int value = 0;
+            var threshold = (int)((ssData.Max() - ssData.Min()) * 0.4);
+            values.Clear();
+
+            //Find the first switch to determine the value
+            for (int i = 1; i < ssData.Length; i++)
+            {
+                if (ssData[i] - ssData[i - 1] > threshold)
+                {
+                    value = 0;
+                    break;
+                }
+                else if (ssData[i - 1] - ssData[i] > threshold)
+                {
+                    value = 1;
+                    break;
+                }
+            }
+
+            values.Add(value);
+            for (int i = 1; i < ssData.Length; i++)
+            {
+                if (ssData[i] - ssData[i - 1] > threshold)
+                {
+                    value = 1;
+                }
+                else if (ssData[i - 1] - ssData[i] > threshold)
+                {
+                    value = 0;
+                }
+                values.Add(value);
+            }
+
+            for (int i = 0; i < values.Count; i++)
+            {
+                //if (ssData[i] > 127)
+                if (values[i] == 1)
                 {
                     counter1++;
                     if (counter0 != 0)
@@ -144,15 +179,15 @@
                                 switch (n3)
                                 {
                                     case 1:
-                                        values[i] = (5);
+                                        decodedValues[i] = (5);
                                         index += 8;
                                         break;
                                     case 2:
-                                        values[i] = (9);
+                                        decodedValues[i] = (9);
                                         index += 6;
                                         break;
                                     case 3:
-                                        values[i] = (1);
+                                        decodedValues[i] = (1);
                                         index += 6;
                                         break;
                                     default:
@@ -160,11 +195,11 @@
                                 }
                                 break;
                             case 2:
-                                values[i] = (3);
+                                decodedValues[i] = (3);
                                 index += 6;
                                 break;
                             case 3:
-                                values[i] = (7);
+                                decodedValues[i] = (7);
                                 index += 6;
                                 break;
                             default:
@@ -175,11 +210,11 @@
                         switch (n2)
                         {
                             case 1:
-                                values[i] = (2);
+                                decodedValues[i] = (2);
                                 index += 6;
                                 break;
                             case 2:
-                                values[i] = (6);
+                                decodedValues[i] = (6);
                                 index += 6;
                                 break;
                             default:
@@ -187,15 +222,15 @@
                         }
                         break;
                     case 3:
-                        values[i] = (4);
+                        decodedValues[i] = (4);
                         index += 6;
                         break;
                     case 4:
-                        values[i] = (8);
+                        decodedValues[i] = (8);
                         index += 4;
                         break;
                     case 5:
-                        values[i] = (0);
+                        decodedValues[i] = (0);
                         index += 4;
                         break;
                     default:
@@ -203,7 +238,7 @@
                 }
             }

-            frame.Time = values[0] * 60000 + values[1] * 10000 + values[2] * 1000 + values[3] * 100 + values[4] * 10 + values[5];
+            frame.Time = decodedValues[0] * 60000 + decodedValues[1] * 10000 + decodedValues[2] * 1000 + decodedValues[3] * 100 + decodedValues[4] * 10 + decodedValues[5];
             return true;
         }


Part of #114

Part of #114

--- Snittlistan.Web/Areas/V2/V2AreaRegistration.cs
+++ Snittlistan.Web/Areas/V2/V2AreaRegistration.cs
@@ -1,8 +1,8 @@
-namespace Snittlistan.Web.Areas.V2
+using System.Web.Http;
+using System.Web.Mvc;
+
+namespace Snittlistan.Web.Areas.V2
 {
-    using System.Web.Http;
-    using System.Web.Mvc;
-
     public class V2AreaRegistration : AreaRegistration
     {
         public override string AreaName
@@ -24,13 +24,6 @@
                 "{action}/{id}",
                 new { controller = "App", id = RouteParameter.Optional },
                 new { action = "^players$|^results$" });
-
-            // To allow IIS to execute "/notfound" when requesting something which is disallowed,
-            // such as /bin or /add_data.
-            //context.MapRoute(
-            //    name: "NotFound",
-            //    url: "notfound",
-            //    defaults: new { controller = "NotFound", action = "NotFound" });

             context.MapRoute(
                 name: "Redirects1",
@@ -68,22 +61,37 @@
                 "MatchResult/Register/{season}",
                 new { controller = "MatchResult", action = "Register" });

-            // view roster
-            context.MapRoute(
-                "ViewRoster",
-                "Roster/{season}/{turn}",
-                new { controller = "Roster", action = "View", turn = UrlParameter.Optional });
+            RosterRoutes(context);

             // default route
             context.MapRoute(
                 "V2_default",
                 "{controller}/{action}/{id}",
                 new { controller = "Roster", action = "Index", id = RouteParameter.Optional });
+        }

-            //context.MapRoute(
-            //    name: "NotFound-Catch-All",
-            //    url: "{*any}",
-            //    defaults: new { controller = "NotFound", action = "NotFound" });
+        private static void RosterRoutes(AreaRegistrationContext context)
+        {
+            // edit players
+            context.MapRoute(
+                "EditPlayers",
+                "Roster/Players/{id}",
+                new
+                {
+                    controller = "Roster",
+                    action = "EditPlayers"
+                });
+
+            // view roster
+            context.MapRoute(
+                "ViewRoster",
+                "Roster/{season}/{turn}",
+                new
+                {
+                    controller = "Roster",
+                    action = "View",
+                    turn = UrlParameter.Optional
+                });
         }
     }
 }


Add noheader support to NUnit3 #62

Add noheader support to NUnit3 #62

--- Solutions/Main/Framework/CodeQuality/NUnit3.cs
+++ Solutions/Main/Framework/CodeQuality/NUnit3.cs
@@ -240,6 +240,7 @@
         protected override string GenerateCommandLineCommands()
         {
             CommandLineBuilder builder = new CommandLineBuilder();
+            builder.AppendSwitch("--noheader");
             builder.AppendFileNamesIfNotNull(this.Assemblies, " ");
             if (this.Use32Bit)
             {


Allow UserName and UserPassword in HttpWebRequest

Creates a NetworkCredential for the request with a specific user name
and password from the task attributes

--- Solutions/Main/Framework/Web/HttpWebRequest.cs
+++ Solutions/Main/Framework/Web/HttpWebRequest.cs
@@ -14,8 +14,8 @@

     ///
     /// Valid TaskActions are:
-    /// <para>GetResponse (Required:  Url Optional: ContentType, Timeout, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication Output: Response, Status)</para>
-    /// <para>Post (Required:  Url Optional: ContentType, Timeout, RequestContent, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication Output: Response, Status)</para>
+    /// <para>GetResponse (Required:  Url Optional: ContentType, Timeout, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication, UserName, UserPassword Output: Response, Status)</para>
+    /// <para>Post (Required:  Url Optional: ContentType, Timeout, RequestContent, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication, UserName, UserPassword Output: Response, Status)</para>
     /// <para>Remote Execution Support: NA</para>
     ///
     /// <example>
@@ -163,6 +163,10 @@
             {
                 request.Credentials = CredentialCache.DefaultCredentials;
             }
+            else if (!string.IsNullOrEmpty(this.UserName))
+            {
+                request.Credentials = new System.Net.NetworkCredential(this.UserName, this.UserPassword);
+            }

             request.Timeout = this.Timeout;
             if (!string.IsNullOrEmpty(this.ContentType))


remove non-retail ResetTrade from initiation (#3692)

--- Source/ACE.Server/WorldObjects/Player_Trade.cs
+++ Source/ACE.Server/WorldObjects/Player_Trade.cs
@@ -65,10 +65,6 @@

                     Session.Network.EnqueueSend(new GameEventRegisterTrade(Session, Guid, tradePartner.Guid));

-                    // this fixes current version of DoThingsBot
-                    // ideally future version of DTB should be updated to be based on RegisterTrade event, instead of ResetTrade
-                    Session.Network.EnqueueSend(new GameEventResetTrade(Session, Guid));
-
                     tradePartner.HandleActionOpenTradeNegotiations(Guid.Full, false);
                 });
             }
@@ -86,10 +82,6 @@
                 tradePartner.ItemsInTradeWindow.Clear();

                 Session.Network.EnqueueSend(new GameEventRegisterTrade(Session, tradePartner.Guid, tradePartner.Guid));
-
-                // this fixes current version of DoThingsBot
-                // ideally future version of DTB should be updated to be based on RegisterTrade event, instead of ResetTrade
-                Session.Network.EnqueueSend(new GameEventResetTrade(Session, tradePartner.Guid));
             }
         }


Fix back button not working

Fix back button not working

--- HiPMobile/HiPMobile.Droid/Activities/RouteActivity.cs
+++ HiPMobile/HiPMobile.Droid/Activities/RouteActivity.cs
@@ -100,6 +100,9 @@
                     intent.PutExtra("activeTags", activeTags);
                     StartActivityForResult(intent, ActivityFilterResult);
                     return true;*/
+                case Android.Resource.Id.Home:
+                    SupportFinishAfterTransition();
+                    return true;
                 default:
                     return base.OnOptionsItemSelected (item);
             }


Mac: Ignore errors when wiring up Button.TextChanged event

--- Source/Eto.Mac/Forms/Controls/ButtonHandler.cs
+++ Source/Eto.Mac/Forms/Controls/ButtonHandler.cs
@@ -140,6 +140,8 @@
 		{
 			switch (id)
 			{
+				case TextControl.TextChangedEvent:
+					break;
 				default:
 					base.AttachEvent(id);
 					break;


Wpf: Font sizes should be in Points, not pixels.

--- Source/Eto.Platform.Wpf/Drawing/FontHandler.cs
+++ Source/Eto.Platform.Wpf/Drawing/FontHandler.cs
@@ -23,9 +23,14 @@
 			{
 				// adjust font size for DPI settings
 				var m = sw.PresentationSource.FromVisual (sw.Application.Current.MainWindow).CompositionTarget.TransformToDevice;
-				control.FontSize = Size * m.M22;
+				control.FontSize = PointsToPixels(Size * m.M22);
 			}
-			else control.FontSize = Size;
+			else control.FontSize = PointsToPixels(Size);
+		}
+
+		public static double PointsToPixels (double points)
+		{
+			return points * (96.0 / 72.0);
 		}

 		public static void Apply (swc.Control control, Font font)


Issue 9986: MeshBuilder.GetCircle - freeze point collection to make it thread safe

--- Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
+++ Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
@@ -314,6 +314,9 @@
                     double theta = Math.PI * 2 * ((double)i / (thetaDiv - 1));
                     circle.Add(new Point(Math.Cos(theta), -Math.Sin(theta)));
                 }
+
+                // PointCollection is not thread safe unless frozen
+                ((PointCollection)circle).Freeze();
             }

             return circle;


Added description and definition of problem in comments

--- Intro-Programming-Homework/PrintMyName/PrintMyName.cs
+++ Intro-Programming-Homework/PrintMyName/PrintMyName.cs
@@ -5,6 +5,12 @@
     {
         static void Main()
         {
+            //Problem 5. Print Your Name
+
+            //Modify the previous application to print your name.
+            //Ensure you have named the application well (e.g. “PrintMyName”).
+            //You should submit a separate project Visual Studio project holding the PrintMyName class as part of your homework.
+
             Console.WriteLine("My name is Panayot");
         }
     }


Apply fix from Udovenko Sergey <Sergey.Udovenko@swx.com>

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@1038 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- InversionOfControl/Castle.Windsor/WindsorContainer.cs
+++ InversionOfControl/Castle.Windsor/WindsorContainer.cs
@@ -134,7 +134,12 @@
 		public IWindsorContainer Parent
 		{
 			get { return _parent; }
-			set { _parent = value; }
+			set
+			{
+				_parent = value;
+
+				if (value != null) Kernel.Parent = value.Kernel;
+			}
 		}

 		/// <summary>


Fix flush failed when upgrading

Fix flush failed when upgrading

--- Src/EngineIoClientDotNet.mono/Client/Socket.cs
+++ Src/EngineIoClientDotNet.mono/Client/Socket.cs
@@ -838,8 +838,8 @@
                                 {
                                     _onTransportOpenListener.Parameters.Transport[0].Send(packetList);

+                                    _onTransportOpenListener.Parameters.Socket.Upgrading = false;
                                     _onTransportOpenListener.Parameters.Socket.Flush();
-                                    _onTransportOpenListener.Parameters.Socket.Upgrading = false;

                                     _onTransportOpenListener.Parameters.Socket.Emit(EVENT_UPGRADE,
                                         _onTransportOpenListener.Parameters.Transport[0]);


Socket.js added code to prevent error loop

--- Src/EngineIoClientDotNet.mono/Client/Socket.cs
+++ Src/EngineIoClientDotNet.mono/Client/Socket.cs
@@ -588,6 +588,7 @@
             //if (ReadyState == ReadyStateEnum.OPEN && Upgrade && this.Transport)
             {
                 log.Info("OnOpen starting upgrade probes");
+                _errorCount = 0;
                 foreach (var upgrade in Upgrades)
                 {
                     Probe(upgrade);
@@ -1056,14 +1057,22 @@

         }

+        private int _errorCount = 0;
+
         internal void OnError(Exception exception)
         {
             var log = LogManager.GetLogger(Global.CallerName());

             log.Error("socket error", exception);
             PriorWebsocketSuccess = false;
-            Emit(EVENT_ERROR, exception);
-            OnClose("transport error", exception);
+
+            //prevent endless loop
+            if (_errorCount == 0)
+            {
+                _errorCount++;
+                Emit(EVENT_ERROR, exception);
+                OnClose("transport error", exception);
+            }
         }


fix #1838 trace only message to avoid noise

--- Kudu.Core/SourceControl/Git/LibGit2SharpRepository.cs
+++ Kudu.Core/SourceControl/Git/LibGit2SharpRepository.cs
@@ -247,14 +247,12 @@
             }
             catch (LibGit2SharpException exception)
             {
-                tracer.TraceWarning("LibGit2SharpRepository fetch failed with {0}", exception);
-
                 // LibGit2Sharp doesn't support SSH yet. Use GitExeRepository
                 // LibGit2Sharp only supports smart Http protocol
                 if (exception.Message.Equals("Unsupported URL protocol") ||
                     exception.Message.Equals("Received unexpected content-type"))
                 {
-                    tracer.TraceWarning("LibGit2SharpRepository fallback to git.exe");
+                    tracer.TraceWarning("LibGit2SharpRepository fallback to git.exe due to {0}", exception.Message);

                     _legacyGitExeRepository.FetchWithoutConflict(remoteUrl, branchName);
                 }


Controller reflection

Controller reflection

--- Test/TestsController/ProfileControllerTests.cs
+++ Test/TestsController/ProfileControllerTests.cs
@@ -1,4 +1,5 @@
-using Anlab.Core.Domain;
+using System;
+using Anlab.Core.Domain;
 using AnlabMvc.Controllers;
 using AnlabMvc.Data;
 using Microsoft.AspNetCore.Http;
@@ -6,11 +7,16 @@
 using Moq;
 using Shouldly;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
 using System.Security.Claims;
 using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
 using Test.Helpers;
 using Xunit;
+using Xunit.Abstractions;

 namespace Test.TestsController
@@ -18,6 +24,8 @@
     [Trait("Category", "ControllerTests")]
     public class ProfileControllerTests
     {
+
+
         [Fact]
         public async Task TestWithMoqDb()
         {
@@ -61,7 +69,172 @@
             var result = Assert.IsType<ViewResult>(controllerResult);
             var model = Assert.IsType<User>(result.Model);
             model.FirstName.ShouldBe("FirstName2");
-        }
+        }

     }
+
+    [Trait("Category", "Controller Reflection")]
+    public class ProfileControllerReflectionTests
+    {
+        private readonly ITestOutputHelper output;
+        public ProfileControllerReflectionTests(ITestOutputHelper output)
+        {
+            this.output = output;
+        }
+        protected readonly Type ControllerClass = typeof(ProfileController);
+
+        #region Controller Class Tests
+        [Fact]
+        public void TestControllerInheritsFromApplicationController()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass.GetTypeInfo();
+            #endregion Arrange
+
+            #region Act
+            controllerClass.BaseType.ShouldNotBe(null);
+            var result = controllerClass.BaseType.Name;
+            #endregion Act
+
+            #region Assert
+            result.ShouldBe("ApplicationController");
+
+            #endregion Assert
+        }
+
+        [Fact]
+        public void TestControllerExpectedNumberOfAttributes()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass.GetTypeInfo();
+            #endregion Arrange
+
+            #region Act
+            var result = controllerClass.GetCustomAttributes(true);
+            #endregion Act
+
+            #region Assert
+            foreach (var o in result)
+            {
+                output.WriteLine(o.ToString()); //Output shows
+            }
+            result.Count().ShouldBe(2);
+
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// #1
+        /// </summary>
+        [Fact]
+        public void TestControllerHasControllerAttribute()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass.GetTypeInfo();
+            #endregion Arrange
+
+            #region Act
+            var result = controllerClass.GetCustomAttributes(true).OfType<ControllerAttribute>();
+            #endregion Act
+
+            #region Assert
+            result.Count().ShouldBeGreaterThan(0, "ControllerAttribute not found.");
+
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// #2
+        /// </summary>
+        [Fact]
+        public void TestControllerHasAuthorizeAttribute()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass.GetTypeInfo();
+            #endregion Arrange
+
+            #region Act
+            var result = controllerClass.GetCustomAttributes(true).OfType<AuthorizeAttribute>();
+            #endregion Act
+
+            #region Assert
+            result.Count().ShouldBeGreaterThan(0, "AuthorizeAttribute not found.");
+
+            #endregion Assert
+        }
+        #endregion Controller Class Tests
+
+        #region Controller Method Tests
+
+        [Fact(Skip = "Tests are still being written. When done, remove this line.")]
+        public void TestControllerContainsExpectedNumberOfPublicMethods()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass;
+            #endregion Arrange
+
+            #region Act
+            var result = controllerClass.GetMethods().Where(a => a.DeclaringType == controllerClass);
+            #endregion Act
+
+            #region Assert
+            result.Count().ShouldBe(1);
+
+            #endregion Assert
+        }
+#if DEBUG
+        [Fact]
+        public void TestControllerMethodIndexContainsExpectedAttributes1()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass;
+            var controllerMethod = controllerClass.GetMethod("Index");
+            #endregion Arrange
+
+            #region Act
+            var expectedAttribute = controllerMethod.GetCustomAttributes(true).OfType<DebuggerStepThroughAttribute>();
+            var allAttributes = controllerMethod.GetCustomAttributes(true);
+            #endregion Act
+
+            #region Assert
+            foreach (var o in allAttributes)
+            {
+                output.WriteLine(o.ToString()); //Output shows if the test fails
+            }
+            allAttributes.Count().ShouldBe(2, "No Attributes");
+            expectedAttribute.Count().ShouldBe(1, "DebuggerStepThroughAttribute not found");
+            #endregion Assert
+        }
+#endif
+        [Fact]
+        public void TestControllerMethodIndexContainsExpectedAttributes2()
+        {
+            #region Arrange
+            var controllerClass = ControllerClass;
+            var controllerMethod = controllerClass.GetMethod("Index");
+            #endregion Arrange
+
+            #region Act
+            var expectedAttribute = controllerMethod.GetCustomAttributes(true).OfType<AsyncStateMachineAttribute>();
+            var allAttributes = controllerMethod.GetCustomAttributes(true);
+            #endregion Act
+
+            #region Assert
+            foreach (var o in allAttributes)
+            {
+                output.WriteLine(o.ToString()); //Output shows if the test fails
+            }
+#if DEBUG
+            allAttributes.Count().ShouldBe(2, "No Attributes");
+#else
+            allAttributes.Count().ShouldBe(1, "No Attributes");
+#endif
+            expectedAttribute.Count().ShouldBe(1, "AsyncStateMachineAttribute not found");
+            #endregion Assert
+        }
+
+#endregion Controller Method Tests
+    }
+
+
 }


Added logic when eating a good apple, fixed bugs when head is out of buffer, fixed particles to bi only in the range of the mouth

--- TheGiraffeGame/TheGiraffeGame/StartingPoint.cs
+++ TheGiraffeGame/TheGiraffeGame/StartingPoint.cs
@@ -11,6 +11,12 @@
 {
     class StartingPoint
     {
+        public static GiraffesHead GiraffesHead;
+        private static int rows = 20;
+        private static int columns = 60;
+        public static bool isHit = false;
+        private static Random numGenerator = new Random();
+        private static int ApplesEaten = 0;

         private static void MoveHead(ConsoleKeyInfo keyinfo, char[,] screen)
         {
@@ -19,7 +25,7 @@
             switch (keyinfo.Key)
             {
                 case ConsoleKey.UpArrow:
-                    if (GiraffesHead.Row > 2)
+                    if (GiraffesHead.Row > 3)
                     {
                         Console.SetCursorPosition(GiraffesHead.Col, GiraffesHead.Row);
                         Console.Write(' ');
@@ -73,7 +79,7 @@

             char particleChar = isGoodParticle ? 'Ơ' : '¤';//'#';

-            int particleRow = numGenerator.Next(0, rows);
+            int particleRow = numGenerator.Next(3, rows);
             particles.Add(new Particle(particleRow, columns - 1, particleChar, isGoodParticle));
         }

@@ -96,7 +102,8 @@
                     {
                         if (particles[i].IsGood)
                         {
-                           // TODO: remove article and increase score
+                            ApplesEaten++;
+                            particles.Remove(particles[i]);
                         }
                         else
                         {
@@ -107,9 +114,9 @@
                     }

                     Console.SetCursorPosition(particles[i].getCol(), particles[i].getRow());
-
+
                     // If the particle is good it will be green, else it will be red
-                    Console.ForegroundColor = particles[i].IsGood? ConsoleColor.Green : ConsoleColor.Red;
+                    Console.ForegroundColor = particles[i].IsGood ? ConsoleColor.Green : ConsoleColor.Red;
                     Console.Write(particles[i].getSymbol());
                     SetDefaultForegroundColor();
                 }
@@ -128,11 +135,7 @@
             Console.Write('@');
         }

-        public static GiraffesHead GiraffesHead;
-        private static int rows = 20;
-        private static int columns = 60;
-        public static bool isHit = false;
-        private static Random numGenerator = new Random();
+

         static void Main()
         {
@@ -167,13 +170,15 @@

                 if (isHit)
                 {
+                    stopwatch.Stop();
                     Console.Clear();
                     Console.WriteLine("Game over");
-                    stopwatch.Stop();
-                    string score = stopwatch.Elapsed.ToString();
+                    Console.WriteLine("Your ate {0} apples!", ApplesEaten);
+
+                    string timeAlive = stopwatch.Elapsed.ToString();

                     //Saving the score to text file ->>>
-                    Console.WriteLine("Your managed to stay alive for: {0}", score);
+                    Console.WriteLine("Your managed to stay alive for: {0}", timeAlive);
                     Console.WriteLine("What is your name, you brave GiraffeWarrior?");
                     string player = Console.ReadLine();
                     Console.WriteLine(@"Your score has been saved on your TheGiraffeGame\bin\Debug directory - {0}.txt", player);
@@ -181,7 +186,7 @@

                     string savePath = Path.Combine(Environment.CurrentDirectory, "Score.txt"); //save to current directory
                     StreamWriter Writer = new StreamWriter(@savePath);
-                    Writer.WriteLine("Player name: " + player + " | score: " + score);
+                    Writer.WriteLine("Player name: " + player + " | score: " + timeAlive);
                     Writer.Close();
                     break;
                 }


Added bool markers to csv.

Added bool markers to csv.

--- UI.MVC4/Controllers/API/ItProjectController.cs
+++ UI.MVC4/Controllers/API/ItProjectController.cs
@@ -142,6 +142,8 @@
                     header.Add(role.Name, role.Name);
                 header.Add("ID", "Projekt ID");
                 header.Add("Type", "Type");
+                header.Add("Strategisk", "Strategisk");
+                header.Add("Tværgaaende", "Tværgående");
                 header.Add("Fase", "Fase");
                 header.Add("Status", "Status projekt");
                 header.Add("Maal", "Status mål");
@@ -165,6 +167,8 @@
                     }
                     obj.Add("ID", project.ItProjectId);
                     obj.Add("Type", project.ItProjectTypeName);
+                    obj.Add("Strategisk", project.IsStrategy);
+                    obj.Add("Tværgaaende", project.IsTransversal);
                     obj.Add("Fase", phases.SingleOrDefault(x => x.Id == project.CurrentPhaseId));
                     obj.Add("Status", project.StatusProject);
                     obj.Add("Maal", project.GoalStatusStatus);


Update UnityProject/Assets/Scripts/Player/Pettable.cs

Co-Authored-By: Foma <6885dc5378a8eff13135d589f243bb9dc41186c0@users.noreply.github.com>

--- UnityProject/Assets/Scripts/Player/Pettable.cs
+++ UnityProject/Assets/Scripts/Player/Pettable.cs
@@ -14,7 +14,7 @@
 		// Is the target in range for a pet? Is the target conscious for the pet? Is the performer's intent set to help?
 		// Is the performer's hand empty? Is the performer not stunned/downed? Is the performer conscious to perform the interaction?
 		// Is the performer interacting with itself?
-		if (!Validations.CanApply(interaction.Performer, interaction.TargetObject, NetworkSide.Server, true, ReachRange.Standard, interaction.TargetVector))
+		if (!Validations.CanApply(interaction.Performer, interaction.TargetObject, side, true, ReachRange.Standard, interaction.TargetVector))
 		{
 			return false;
 		}


Toggle Throw Action when Grenade HandActivate

Toggles the throw action when a grenade is interacted with.

Remove unused "explosion" string.

--- UnityProject/Assets/Scripts/Weapons/Grenade.cs
+++ UnityProject/Assets/Scripts/Weapons/Grenade.cs
@@ -96,6 +96,8 @@
 		{
 			timerRunning = true;
 			PlayPinSFX(originator.transform.position);
+			UIManager.Action.Throw();
+
 			if (unstableFuse)
 			{
 				float fuseVariation = fuseLength / 4;
@@ -107,7 +109,7 @@
 				radius = Random.Range(radius - radiusVariation, radius + radiusVariation);
 			}
 			yield return WaitFor.Seconds(fuseLength);
-			Explode("explosion");
+			Explode();
 		}
 	}

@@ -140,7 +142,7 @@

 	}

-	public void Explode(string damagedBy)
+	public void Explode()
 	{
 		if (hasExploded)
 		{
@@ -151,7 +153,7 @@
 		{
 			PlaySoundAndShake();
 			CreateShape();
-			CalcAndApplyExplosionDamage(damagedBy);
+			CalcAndApplyExplosionDamage();
 			Despawn.ServerSingle(gameObject);
 		}
 	}
@@ -160,9 +162,8 @@
 	/// Calculate and apply the damage that should be caused by the explosion, updating the server's state for the damaged
 	/// objects. Currently always uses a circle
 	/// </summary>
-	/// <param name="thanksTo">string of the entity that caused the explosion</param>
 	[Server]
-	public void CalcAndApplyExplosionDamage(string thanksTo)
+	public void CalcAndApplyExplosionDamage()
 	{
 		Vector2 explosionPos = objectBehaviour.AssumedWorldPositionServer().To2Int();
 		//trigger a hotspot caused by grenade explosion


[UBB-4] Fix potential crash if settings file cannot be written when changing platform setting.

--- UnrealBinaryBuilder/Classes/BuilderSettings.cs
+++ UnrealBinaryBuilder/Classes/BuilderSettings.cs
@@ -355,18 +355,29 @@

 		public static void UpdatePlatformInclusion(string InPlatform, bool bIncluded)
 		{
-			BuilderSettingsJson BSJ = GetSettingsFile();
-			foreach (GitPlatform gp in BSJ.GitDependencyPlatforms)
-			{
-				if (gp.Name.ToLower() == InPlatform.ToLower())
-				{
-					gp.bIsIncluded = bIncluded;
-					break;
-				}
-			}
-
-			string JsonOutput = JsonConvert.SerializeObject(BSJ, Formatting.Indented);
-			File.WriteAllText(PROGRAM_SETTINGS_PATH, JsonOutput);
+			try
+			{
+				BuilderSettingsJson BSJ = GetSettingsFile();
+				foreach (GitPlatform gp in BSJ.GitDependencyPlatforms)
+				{
+					if (gp.Name.ToLower() == InPlatform.ToLower())
+					{
+						gp.bIsIncluded = bIncluded;
+						break;
+					}
+				}
+
+				string JsonOutput = JsonConvert.SerializeObject(BSJ, Formatting.Indented);
+				File.WriteAllText(PROGRAM_SETTINGS_PATH, JsonOutput);
+			}
+			catch (Exception ex)
+			{
+				Sentry.SentrySdk.CaptureException(ex);
+				string ErrorMessage = $"Failed to update platform setting. ERROR: {ex.Message}";
+				MainWindow mainWindow = ((MainWindow)Application.Current.MainWindow);
+				mainWindow.AddLogEntry(ErrorMessage, true);
+				HandyControl.Controls.MessageBox.Fatal(ErrorMessage);
+			}
 		}

 		public static void LoadInitialValues()


Added validation message for GRN

Added validation message for GRN

--- Web/Areas/Hub/Controllers/ReceiveController.cs
+++ Web/Areas/Hub/Controllers/ReceiveController.cs
@@ -578,7 +578,7 @@
                         {
                             receiveModels.IsEditMode = true;
                         }
-                        ModelState.AddModelError("Errors", @"GRN Already Existed Please Change GRN Number");
+                        ModelState.AddModelError("GRN", @"GRN Already Existed");
                         return View(receiveModels);
                     }
                     //Even though they are updated they are not saved so move them in to the inserted at the end of a succcessful submit


Register page now uses the username set by the user (close #16)

--- WebDev/WebDev/Controllers/AccountController.cs
+++ WebDev/WebDev/Controllers/AccountController.cs
@@ -151,7 +151,7 @@
         {
             if (ModelState.IsValid)
             {
-                var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
+                var user = new ApplicationUser { UserName = model.Username, Email = model.Email };
                 var result = await UserManager.CreateAsync(user, model.Password);
                 if (result.Succeeded)
                 {


Fix Mask on List.

Fix Mask on List.

--- WmcSoft.Core/Collections/BitArrayExtensions.cs
+++ WmcSoft.Core/Collections/BitArrayExtensions.cs
@@ -60,6 +60,14 @@
             return result;
         }

+        static IReadOnlyList<TSource> ReadOnly<TSource>(IEnumerable<TSource> x) {
+            var rx = x as IReadOnlyList<TSource>;
+            if (rx != null) return rx;
+            var wx = x as IList<TSource>;
+            if (wx != null) return wx.AsReadOnly();
+            return null;
+        }
+
         /// <summary>
         /// Takes values from the enumerables depending on the value of the bit in the mask.
         /// </summary>
@@ -72,12 +80,9 @@
             if (x == null) throw new ArgumentNullException("x");
             if (y == null) throw new ArgumentNullException("y");

-            var rx = x as IReadOnlyList<TSource>;
-            var ry = y as IReadOnlyList<TSource>;
+            var rx = ReadOnly(x);
+            var ry = ReadOnly(y);
             if (rx != null && ry != null) return DoMask(mask, rx, ry);
-            var wx = x as IList<TSource>;
-            var wy = y as IList<TSource>;
-            if (rx != null && ry != null) return DoMask(mask, wx.AsReadOnly(), wy.AsReadOnly());
             return DoMask(mask, x, y);
         }


Add manual deref type for DeepPointer (#1864)

* Add deref type for DeepPointer

* Fix badly derived constructor

* Apply suggestions from code review

Co-authored-by: wooferzfg <bcac81f68e029312010593a3abbb61a3e425236b@gmail.com>

Co-authored-by: wooferzfg <bcac81f68e029312010593a3abbb61a3e425236b@gmail.com>

--- LiveSplit/LiveSplit.Core/ComponentUtil/DeepPointer.cs
+++ LiveSplit/LiveSplit.Core/ComponentUtil/DeepPointer.cs
@@ -14,30 +14,44 @@

     public class DeepPointer
     {
+        public enum DerefType { Auto, Bit32, Bit64 }
+
         private IntPtr _absoluteBase;
         private bool _usingAbsoluteBase;
+        private DerefType _derefType;

         private OffsetT _base;
         private List<OffsetT> _offsets;
         private string _module;
-
+
         public DeepPointer(IntPtr absoluteBase, params OffsetT[] offsets)
+            : this(absoluteBase, DerefType.Auto, offsets) { }
+
+        public DeepPointer(IntPtr absoluteBase, DerefType derefType, params OffsetT[] offsets)
         {
             _absoluteBase = absoluteBase;
             _usingAbsoluteBase = true;
+            _derefType = derefType;

             InitializeOffsets(offsets);
         }

         public DeepPointer(string module, OffsetT base_, params OffsetT[] offsets)
-            : this(base_, offsets)
+            : this(module, base_, DerefType.Auto, offsets) { }
+
+        public DeepPointer(string module, OffsetT base_, DerefType derefType, params OffsetT[] offsets)
+            : this(base_, derefType, offsets)
         {
             _module = module.ToLower();
         }

         public DeepPointer(OffsetT base_, params OffsetT[] offsets)
+            : this(base_, DerefType.Auto, offsets) { }
+
+        public DeepPointer(OffsetT base_, DerefType derefType, params OffsetT[] offsets)
         {
             _base = base_;
+            _derefType = derefType;
             InitializeOffsets(offsets);
         }

@@ -134,7 +148,11 @@

         public bool DerefOffsets(Process process, out IntPtr ptr)
         {
-            bool is64Bit = process.Is64Bit();
+            bool is64Bit;
+            if (_derefType == DerefType.Auto)
+                is64Bit = process.Is64Bit();
+            else
+                is64Bit = _derefType == DerefType.Bit64;

             if (!string.IsNullOrEmpty(_module))
             {


Fix Fix CameraApiContentsOperator to detect camera state

--- Locana/Playback/Operator/CameraApiContentsOperator.cs
+++ Locana/Playback/Operator/CameraApiContentsOperator.cs
@@ -99,6 +99,7 @@
         public override void Dispose()
         {
             HttpClient.Dispose();
+            TargetDevice.Observer.Stop();

             MovieStreamHelper.INSTANCE.StreamClosed -= StreamHelper_StreamClosed;
             MovieStreamHelper.INSTANCE.StatusChanged -= StreamHelper_StatusChanged;
@@ -112,6 +113,7 @@
         public override async Task LoadContents()
         {
             var loader = new RemoteApiContentsLoader(TargetDevice);
+            await TargetDevice.Observer.StartAsync();
             try
             {
                 OnProgressMessage(SystemUtil.GetStringResource("Progress_ChangingCameraState"));


Added Commented-Out LINQ example

Added Commented-Out LINQ example

--- cli-samples-master/Speakr/Controllers/SubmissionsController.cs
+++ cli-samples-master/Speakr/Controllers/SubmissionsController.cs
@@ -17,6 +17,7 @@
         {
             var db = new SubmissionContext();
             return View(db.Submissions);
+//            return View(db.Submissions.Take(3));
         }
         // GET: Submissions/Details/5
         public IActionResult Details(int? id)


properly close XmlWriter

properly close XmlWriter

--- src/main/net-core/Diff/DefaultComparisonFormatter.cs
+++ src/main/net-core/Diff/DefaultComparisonFormatter.cs
@@ -262,8 +262,9 @@
             try {
                 int numberOfBlanksToIndent = formatXml ? 2 : -1;
                 StringBuilder sb = new StringBuilder();
-                XmlWriter writer = CreateXmlWriter(sb, numberOfBlanksToIndent);
-                nodeToConvert.WriteTo(writer);
+                using (XmlWriter writer = CreateXmlWriter(sb, numberOfBlanksToIndent)) {
+                    nodeToConvert.WriteTo(writer);
+                }
                 return sb.ToString();
             } catch (Exception e) {
                 return string.Format("ERROR {0}", e.Message);