Polimorphic - Add -> SetDefinition

Polimorphic - Add -> SetDefinition

--- Signum.Utilities/Polymorphic.cs
+++ Signum.Utilities/Polymorphic.cs
@@ -97,10 +97,10 @@
                 throw new InvalidOperationException("{0} is not a {1}".Formato(type.Name, minimumType.Name));
         }

-        public Polymorphic(PolymorphicMerger<T> merger, Type type)
+        public Polymorphic(PolymorphicMerger<T> merger, Type minimumType)
         {
             this.merger = merger;
-            this.minimumType = type;
+            this.minimumType = minimumType;
         }

         public Polymorphic(PolymorphicMerger<T> merger): this(merger, GetDefaultType(typeof(T)))
@@ -168,7 +168,7 @@
             return merger(KVP.Create(type, currentValue), KVP.Create(type.BaseType, baseValue), interfaces.Select(inter => KVP.Create(inter, TryGetValue(inter))).ToList());
         }

-        public void Add(Type type, T value)
+        public void SetDefinition(Type type, T value)
         {
             AssertAllowed(type);

@@ -204,7 +204,7 @@

             value = new T();

-            polymorophic.Add(type, value);
+            polymorophic.SetDefinition(type, value);

             return value;
         }
@@ -212,53 +212,53 @@

         public static void Register<T, S>(this Polymorphic<Action<T>> polymorphic, Action<S> action) where S:T
         {
-            polymorphic.Add(typeof(S), t => action((S)t));
+            polymorphic.SetDefinition(typeof(S), t => action((S)t));
         }

         public static void Register<T, S, P0>(this Polymorphic<Action<T, P0>> polymorphic, Action<S, P0> action) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0) => action((S)t, p0));
+            polymorphic.SetDefinition(typeof(S), (t, p0) => action((S)t, p0));
         }

         public static void Register<T, S, P0, P1>(this Polymorphic<Action<T, P0, P1>> polymorphic, Action<S, P0, P1> action) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1) => action((S)t, p0, p1));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1) => action((S)t, p0, p1));
         }

         public static void Register<T, S, P0, P1, P2>(this Polymorphic<Action<T, P0, P1, P2>> polymorphic, Action<S, P0, P1, P2> action) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1, p2) => action((S)t, p0, p1, p2));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2) => action((S)t, p0, p1, p2));
         }

         public static void Register<T, S, P0, P1, P2, P3>(this Polymorphic<Action<T, P0, P1, P2, P3>> polymorphic, Action<S, P0, P1, P2, P3> action) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1, p2, p3) => action((S)t, p0, p1, p2, p3));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2, p3) => action((S)t, p0, p1, p2, p3));
         }

         public static void Register<T, S, R>(this Polymorphic<Func<T, R>> polymorphic, Func<S, R> func) where S : T
         {
-            polymorphic.Add(typeof(S), t => func((S)t));
+            polymorphic.SetDefinition(typeof(S), t => func((S)t));
         }

         public static void Register<T, S, P0, R>(this Polymorphic<Func<T, P0, R>> polymorphic, Func<S, P0, R> func) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0) => func((S)t, p0));
+            polymorphic.SetDefinition(typeof(S), (t, p0) => func((S)t, p0));
         }

         public static void Register<T, S, P0, P1, R>(this Polymorphic<Func<T, P0, P1, R>> polymorphic, Func<S, P0, P1, R> func) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1) => func((S)t, p0, p1));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1) => func((S)t, p0, p1));
         }

         public static void Register<T, S, P0, P1, P2, R>(this Polymorphic<Func<T, P0, P1, P2, R>> polymorphic, Func<S, P0, P1, P2, R> func) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1, p2) => func((S)t, p0, p1, p2));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2) => func((S)t, p0, p1, p2));
         }

         public static void Register<T, S, P0, P1, P2, P3, R>(this Polymorphic<Func<T, P0, P1, P2, P3, R>> polymorphic, Func<S, P0, P1, P2, P3, R> func) where S : T
         {
-            polymorphic.Add(typeof(S), (t, p0, p1, p2, p3) => func((S)t, p0, p1, p2, p3));
+            polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2, p3) => func((S)t, p0, p1, p2, p3));
         }


create data folder at start-up, if it does not exist yet (fixes #46)

--- Solutionizer/AppBootstrapper.cs
+++ Solutionizer/AppBootstrapper.cs
@@ -31,6 +31,10 @@
         /// By default, we are configured to use MEF
         /// </summary>
         protected override void Configure() {
+            if (!Directory.Exists(_dataFolder)) {
+                Directory.CreateDirectory(_dataFolder);
+            }
+
             _settingsProvider = new SettingsProvider(_dataFolder);

             ConfigureLogging();


Added ConnectionStatusChanged event to Device

Added ConnectionStatusChanged event to the UWP Device class in preparation for fixing the broken DeviceConnected / DeviceConnectionLost / DeviceDisconnected events in the UWP Adapter class

--- Source/Plugin.BLE.UWP/Device.cs
+++ Source/Plugin.BLE.UWP/Device.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Threading.Tasks;

@@ -23,6 +24,18 @@
             Id = ParseDeviceId(nativeDevice.BluetoothAddress.ToString("x"));
             Name = nativeDevice.Name;
             AdvertisementRecords = advertisementRecords;
+            _nativeDevice.PropertyChanged += NativeDevice_PropertyChanged;
+        }
+
+        public delegate void ConnectionStatusChangedHandler(Device device, BluetoothConnectionStatus status);
+        public ConnectionStatusChangedHandler ConnectionStatusChanged;
+
+        private void NativeDevice_PropertyChanged(object sender, PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName != "IsConnected")
+                return;
+
+            ConnectionStatusChanged?.Invoke(this, _nativeDevice.BluetoothLEDevice.ConnectionStatus);
         }

         /// <summary>


[13324] Make Code39Reader.ALPHABET_STRING public

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS05/]$/ZXingNet/trunk;C89358

--- Source/lib/oned/Code39Reader.cs
+++ Source/lib/oned/Code39Reader.cs
@@ -32,6 +32,14 @@
       private static readonly char[] ALPHABET = ALPHABET_STRING.ToCharArray();

       /// <summary>
+      /// Returns a string with all possible characters
+      /// </summary>
+      public static string Alphabet
+      {
+         get { return ALPHABET_STRING; }
+      }
+
+      /// <summary>
       /// These represent the encodings of characters, as patterns of wide and narrow bars.
       /// The 9 least-significant bits of each int correspond to the pattern of wide and narrow,
       /// with 1s representing "wide" and 0s representing narrow.


Fix for saving files.

Fix for saving files.

--- Libraries/Rss/RssCacheCollection.cs
+++ Libraries/Rss/RssCacheCollection.cs
@@ -159,7 +159,7 @@
             if (feed == null) return;

             if (!IO.Exists(Directory)) IO.CreateDirectory(Directory);
-            using (var s = IO.OpenWrite(CacheName(uri))) SettingsType.Json.Save(s, feed);
+            using (var s = IO.Create(CacheName(uri))) SettingsType.Json.Save(s, feed);

             feed.Items.Clear();
         }


Fix interfaces

Fix interfaces

--- Libraries/Views/Forms/NotifyForm.cs
+++ Libraries/Views/Forms/NotifyForm.cs
@@ -63,27 +63,19 @@
         /// </summary>
         ///
         /* --------------------------------------------------------------------- */
-        [Browsable(true)]
-        public string Title
-        {
-            get { return _title.Content; }
-            set { _title.Content = value; }
-        }
-
-        /* --------------------------------------------------------------------- */
-        ///
-        /// Description
-        ///
-        /// <summary>
-        /// 本文を取得または設定します。
-        /// </summary>
-        ///
-        /* --------------------------------------------------------------------- */
-        [Browsable(true)]
-        public string Description
-        {
-            get { return _text.Content; }
-            set { _text.Content = value; }
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public NotifyItem Value
+        {
+            get { return _value; }
+            set
+            {
+                if (_value == value) return;
+                _value = value;
+
+                _title.Content = value?.Title ?? string.Empty;
+                _text.Content  = value?.Description ?? string.Empty;
+            }
         }

         /* --------------------------------------------------------------------- */
@@ -206,8 +198,7 @@
         /* ----------------------------------------------------------------- */
         public void Show(NotifyItem item, NotifyStyle style)
         {
-            Title       = item.Title;
-            Description = item.Description;
+            Value = item;

             SetStyle(style);
             Show(item.DisplayTime, item.InitialDelay);
@@ -449,6 +440,7 @@
         }

         #region Fields
+        private NotifyItem _value;
         private TableLayoutPanel _panel;
         private FlatButton _image;
         private FlatButton _title;


Refactoring

Refactoring

--- MadCat/NutEngine/Collisions/AABB.cs
+++ MadCat/NutEngine/Collisions/AABB.cs
@@ -22,12 +22,12 @@
         public bool Intersects(AABB other)
         {
             if (MaxX >= other.MinX && MinX <= other.MaxX &&
-                MaxY >= other.MinY && MinY <= other.MaxY)
-            {
+                MaxY >= other.MinY && MinY <= other.MaxY) {
                 return true;
             }
-
-            return false;
+            else {
+                return false;
+            }
         }

         /// <summary>
@@ -42,18 +42,15 @@
             float bottom = other.MinY - MaxY;
             float top = other.MaxY - MinY;

-            var translation = new Vector2()
-            {
+            var translation = new Vector2() {
                 X = Math.Abs(left) < Math.Abs(right) ? left : right,
                 Y = Math.Abs(bottom) < Math.Abs(top) ? bottom : top
             };

-            if (Math.Abs(translation.X) < Math.Abs(translation.Y))
-            {
+            if (Math.Abs(translation.X) < Math.Abs(translation.Y)) {
                 translation.Y = 0.0f;
             }
-            else
-            {
+            else {
                 translation.X = 0.0f;
             }


#1 Fix InvalidCastException

#1 Fix InvalidCastException

--- src/resharper-template-compiler/SettingsDeserialisation.cs
+++ src/resharper-template-compiler/SettingsDeserialisation.cs
@@ -60,7 +60,7 @@
             {
                 var fieldPath = MakePath(fieldsPath, SerialisationMetadata.FormatKey(key));
                 bool editable = true;
-                int initialRange;
+                long initialRange;
                 if (TryGetValue(fieldPath, "InitialRange", out initialRange))
                     editable = initialRange != -1;
                 string expression;


JimEvans (on behalf of TimSukhachev): Fixing .NET FirefoxExtension to allow for parallel installation of extensions into profiles being run by parallel tests.

r16282

--- dotnet/src/WebDriver/Firefox/FirefoxExtension.cs
+++ dotnet/src/WebDriver/Firefox/FirefoxExtension.cs
@@ -72,7 +72,9 @@
         /// <param name="profileDir">The Firefox profile directory into which to install the extension.</param>
         public void Install(string profileDir)
         {
-            string tempFileName = Path.Combine(Path.GetTempPath(), Path.GetFileName(this.extensionFileName));
+            DirectoryInfo info = new DirectoryInfo(profileDir);
+            string stagingDirectoryName = Path.Combine(Path.GetTempPath(), info.Name + ".staging");
+            string tempFileName = Path.Combine(stagingDirectoryName, Path.GetFileName(this.extensionFileName));
             if (Directory.Exists(tempFileName))
             {
                 Directory.Delete(tempFileName, true);
@@ -98,7 +100,10 @@

             Directory.CreateDirectory(extensionDirectory);
             FileUtilities.CopyDirectory(tempFileName, extensionDirectory);
-            Directory.Delete(tempFileName, true);
+
+            // By deleting the staging directory, we also delete the temporarily
+            // expanded extension, which we copied into the profile.
+            Directory.Delete(stagingDirectoryName, true);
         }

         private static string ReadIdFromInstallRdf(string root)


JimEvans: Removing unnecessary Console.WriteLine() statements from .NET tests.

r15249

--- dotnet/test/WebDriver.Common.Tests/WindowTest.cs
+++ dotnet/test/WebDriver.Common.Tests/WindowTest.cs
@@ -18,7 +18,6 @@
         public void ShouldBeAbleToGetTheSizeOfTheCurrentWindow()
         {
             Size size = driver.Manage().Window.Size;
-            Console.WriteLine("Window size: {0}, {1}", size.Width, size.Height);
             Assert.Greater(size.Width, 0);
             Assert.Greater(size.Height, 0);
         }
@@ -33,14 +32,12 @@
         {
             IWindow window = driver.Manage().Window;
             Size size = window.Size;
-            Console.WriteLine("Window size: {0}, {1}", size.Width, size.Height);

             // resize relative to the initial size, since we don't know what it is
             Size targetSize = new Size(size.Width - 20, size.Height - 20);
             window.Size = targetSize;

             Size newSize = window.Size;
-            Console.WriteLine("Window size: {0}, {1}", newSize.Width, newSize.Height);
             Assert.AreEqual(targetSize.Width, newSize.Width);
             Assert.AreEqual(targetSize.Height, newSize.Height);
         }
@@ -54,7 +51,6 @@
         public void ShouldBeAbleToGetThePositionOfTheCurrentWindow()
         {
             Point position = driver.Manage().Window.Position;
-            Console.WriteLine("Window postion: {0}, {1}", position.X, position.Y);
             Assert.Greater(position.X, 0);
             Assert.Greater(position.Y, 0);
         }
@@ -69,13 +65,11 @@
         {
             IWindow window = driver.Manage().Window;
             Point position = window.Position;
-            Console.WriteLine("Window postion: {0}, {1}", position.X, position.Y);

             Point targetPosition = new Point(position.X + 10, position.Y + 10);
             window.Position = targetPosition;

             Point newLocation = window.Position;
-            Console.WriteLine("Window postion: {0}, {1}", newLocation.X, newLocation.Y);

             Assert.AreEqual(targetPosition.X, newLocation.X);
             Assert.AreEqual(targetPosition.Y, newLocation.Y);


use name not text consistently

use name not text consistently

--- TraverseAllSystems/Command.cs
+++ TraverseAllSystems/Command.cs
@@ -237,7 +237,7 @@
       const string _json_format_to_store_systems_in_root
         = "{{"
         + "\"id\" : {0}, "
-        + "\"text\" : \"{1}\", "
+        + "\"name\" : \"{1}\", "
         + "\"children\" : [{2}]}}";

       json = string.Format(


Add missing selectors (4.2) for QLPreviewControllerDelegate

--- src/quicklook.cs
+++ src/quicklook.cs
@@ -36,6 +36,7 @@
 using MonoMac.UIKit;
 #endif
 using System;
+using System.ComponentModel;
 using System.Drawing;

 namespace MonoMac.QuickLook {
@@ -97,6 +98,18 @@

 		[Export ("previewController:shouldOpenURL:forPreviewItem:"), DelegateName ("QLOpenUrl"), DefaultValue (false)]
 		bool ShouldOpenUrl (QLPreviewController controller, NSUrl url, QLPreviewItem item);
+
+#if !MONOMAC
+		// UIView and UIImage do not exists in MonoMac
+
+		[Since (4,2)]
+		[Export ("previewController:frameForPreviewItem:inSourceView:"), DelegateName ("QLFrame"), DefaultValue (null)]
+		RectangleF FrameForPreviewItem (QLPreviewItem item, [NullAllowed] UIView view);
+
+		[Since (4,2)]
+		[Export ("previewController:transitionImageForPreviewItem:contentRect:"), DelegateName ("QLTransition"), DefaultValue (null)]
+		UIImage TransitionImageForPreviewItem (QLPreviewItem item, RectangleF contentRect);
+#endif
 	}

 	[Since (4,0)]


Fix for negative co-ordinates translation world->chunk

--- InfiniMap/Chunk.cs
+++ InfiniMap/Chunk.cs
@@ -45,8 +45,8 @@
             get
             {
                 // Translate from world-space to chunk-space
-                int blockX = x%_height;
-                int blockY = y%_width;
+                int blockX = Math.Abs(x)%_height;
+                int blockY = Math.Abs(y)%_width;
                 // Flat array, so walk the stride length for the Y component.
                 return Blocks[blockX + (blockY*_width)];
             }


Missed a save.

Missed a save.


Changed Seed method to include PID

Changed Seed method to include PID

--- VORBS/DAL/VORBSInitializer.cs
+++ VORBS/DAL/VORBSInitializer.cs
@@ -54,46 +54,46 @@

             var bookings = new List<Booking>()
             {
-                new Booking(){ RoomID = 1, Owner = "User9", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 2, Owner = "User9", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 3, Owner = "User9", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 4, Owner = "User9", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 6, Owner = "User9", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 7, Owner = "User10", StartDate = new DateTime(2015, 5, 13, 10, 0, 0), EndDate = new DateTime(2015, 5, 13, 14, 0, 0) }
-                ,new Booking(){ RoomID = 8, Owner = "User11", StartDate = new DateTime(2015, 5, 13, 10, 30, 0), EndDate = new DateTime(2015, 5, 13, 14, 0, 0) }
-                ,new Booking(){ RoomID = 9, Owner = "User12", StartDate = new DateTime(2015, 5, 13, 11, 0, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
-                ,new Booking(){ RoomID = 10, Owner = "User13", StartDate = new DateTime(2015, 5, 13, 11, 0, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
-                ,new Booking(){ RoomID = 11, Owner = "User14", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 12, Owner = "User15", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 16, 30, 0) }
-                ,new Booking(){ RoomID = 13, Owner = "User16", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 14, Owner = "User17", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 15, Owner = "User18", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 16, Owner = "User19", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 17, Owner = "User19", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
-                ,new Booking(){ RoomID = 10, Owner = "User20", StartDate = new DateTime(2015, 5, 13, 15, 0, 0), EndDate = new DateTime(2015, 5, 13, 15, 30, 0) }
-                ,new Booking(){ RoomID = 18, Owner = "User21", StartDate = new DateTime(2015, 5, 13, 11, 00, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
-                ,new Booking(){ RoomID = 18, Owner = "User22", StartDate = new DateTime(2015, 5, 13, 13, 00, 0), EndDate = new DateTime(2015, 5, 13, 16, 30, 0) }
-                ,new Booking(){ RoomID = 19, Owner = "User23", StartDate = new DateTime(2015, 5, 13, 10, 00, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
-                ,new Booking(){ RoomID = 19, Owner = "User24", StartDate = new DateTime(2015, 5, 13, 13, 00, 0), EndDate = new DateTime(2015, 5, 13, 14, 30, 0) }
+                new Booking(){ RoomID = 1, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 2, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 3, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 4, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 6, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 7, Owner = "7212369", StartDate = new DateTime(2015, 5, 13, 10, 0, 0), EndDate = new DateTime(2015, 5, 13, 14, 0, 0) }
+                ,new Booking(){ RoomID = 8, Owner = "7224333", StartDate = new DateTime(2015, 5, 13, 10, 30, 0), EndDate = new DateTime(2015, 5, 13, 14, 0, 0) }
+                ,new Booking(){ RoomID = 9, Owner = "0000002", StartDate = new DateTime(2015, 5, 13, 11, 0, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
+                ,new Booking(){ RoomID = 10, Owner = "0000004", StartDate = new DateTime(2015, 5, 13, 11, 0, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
+                ,new Booking(){ RoomID = 11, Owner = "0000001", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 12, Owner = "0000001", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 16, 30, 0) }
+                ,new Booking(){ RoomID = 13, Owner = "0000004", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 14, Owner = "7217426", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 15, Owner = "0000004", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 16, Owner = "0000001", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 17, Owner = "0000001", StartDate = new DateTime(2015, 5, 13, 9, 0, 0), EndDate = new DateTime(2015, 5, 13, 17, 0, 0) }
+                ,new Booking(){ RoomID = 10, Owner = "0000004", StartDate = new DateTime(2015, 5, 13, 15, 0, 0), EndDate = new DateTime(2015, 5, 13, 15, 30, 0) }
+                ,new Booking(){ RoomID = 18, Owner = "0000003", StartDate = new DateTime(2015, 5, 13, 11, 00, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
+                ,new Booking(){ RoomID = 18, Owner = "0000002", StartDate = new DateTime(2015, 5, 13, 13, 00, 0), EndDate = new DateTime(2015, 5, 13, 16, 30, 0) }
+                ,new Booking(){ RoomID = 19, Owner = "0000002", StartDate = new DateTime(2015, 5, 13, 10, 00, 0), EndDate = new DateTime(2015, 5, 13, 12, 30, 0) }
+                ,new Booking(){ RoomID = 19, Owner = "0000001", StartDate = new DateTime(2015, 5, 13, 13, 00, 0), EndDate = new DateTime(2015, 5, 13, 14, 30, 0) }
                 ,new Booking(){ RoomID = 19, Owner = "User8", StartDate = new DateTime(2015, 5, 13, 15, 00, 0), EndDate = new DateTime(2015, 5, 13, 15, 30, 0) }
-                ,new Booking(){ RoomID = 20, Owner = "User25", StartDate = new DateTime(2015, 5, 13, 09, 00, 0), EndDate = new DateTime(2015, 5, 13, 17, 00, 0) }
+                ,new Booking(){ RoomID = 20, Owner = "0000002", StartDate = new DateTime(2015, 5, 13, 09, 00, 0), EndDate = new DateTime(2015, 5, 13, 17, 00, 0) }

-                ,new Booking(){ RoomID = 2, Owner = "User9", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 3, Owner = "User9", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 4, Owner = "User9", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 7, Owner = "User17", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 9, Owner = "User22", StartDate = new DateTime(2015, 5, 28, 11, 30, 0), EndDate = new DateTime(2015, 5, 28, 13, 30, 0) }
-                ,new Booking(){ RoomID = 9, Owner = "User13", StartDate = new DateTime(2015, 5, 28, 14, 0, 0), EndDate = new DateTime(2015, 5, 28, 16, 30, 0) }
-                ,new Booking(){ RoomID = 10, Owner = "User26", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 11, 00, 0) }
-                ,new Booking(){ RoomID = 12, Owner = "User27", StartDate = new DateTime(2015, 5, 28, 13, 30, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 14, Owner = "User17", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 15, Owner = "User28", StartDate = new DateTime(2015, 5, 28, 13, 0, 0), EndDate = new DateTime(2015, 5, 28, 14, 30, 0) }
-                ,new Booking(){ RoomID = 16, Owner = "User19", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 17, Owner = "User19", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 18, Owner = "User29", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 11, 30, 0) }
-                ,new Booking(){ RoomID = 18, Owner = "User30", StartDate = new DateTime(2015, 5, 28, 12, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
-                ,new Booking(){ RoomID = 19, Owner = "User31", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 12, 30, 0) }
-                ,new Booking(){ RoomID = 20, Owner = "User25", StartDate = new DateTime(2015, 5, 28, 09, 00, 0), EndDate = new DateTime(2015, 5, 28, 17, 00, 0) }
+                ,new Booking(){ RoomID = 2, Owner = "0000003", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 3, Owner = "0000003", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 4, Owner = "0000003", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 7, Owner = "7217426", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 9, Owner = "7212369", StartDate = new DateTime(2015, 5, 28, 11, 30, 0), EndDate = new DateTime(2015, 5, 28, 13, 30, 0) }
+                ,new Booking(){ RoomID = 9, Owner = "0000002", StartDate = new DateTime(2015, 5, 28, 14, 0, 0), EndDate = new DateTime(2015, 5, 28, 16, 30, 0) }
+                ,new Booking(){ RoomID = 10, Owner = "0000002", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 11, 00, 0) }
+                ,new Booking(){ RoomID = 12, Owner = "7224333", StartDate = new DateTime(2015, 5, 28, 13, 30, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 14, Owner = "7217426", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 15, Owner = "7224333", StartDate = new DateTime(2015, 5, 28, 13, 0, 0), EndDate = new DateTime(2015, 5, 28, 14, 30, 0) }
+                ,new Booking(){ RoomID = 16, Owner = "0000001", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 17, Owner = "0000001", StartDate = new DateTime(2015, 5, 28, 9, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 18, Owner = "7212369", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 11, 30, 0) }
+                ,new Booking(){ RoomID = 18, Owner = "0000004", StartDate = new DateTime(2015, 5, 28, 12, 0, 0), EndDate = new DateTime(2015, 5, 28, 17, 0, 0) }
+                ,new Booking(){ RoomID = 19, Owner = "0000002", StartDate = new DateTime(2015, 5, 28, 10, 30, 0), EndDate = new DateTime(2015, 5, 28, 12, 30, 0) }
+                ,new Booking(){ RoomID = 20, Owner = "0000002", StartDate = new DateTime(2015, 5, 28, 09, 00, 0), EndDate = new DateTime(2015, 5, 28, 17, 00, 0) }
             };

             bookings.ForEach(b => context.Bookings.Add(b));


Added error handling for no internet.

Added error handling for no internet.

Added try catch blocks for no internet connection/response. Added
function to output error message to user. Also made clearing the
container for a new widget a little cleaner.

--- VideoAggregator/MainWindow.cs
+++ VideoAggregator/MainWindow.cs
@@ -1,6 +1,7 @@
 using System;
 using Gtk;
 using System.Collections.Generic;
+using System.Net;

 namespace VideoAggregator
 {
@@ -8,62 +9,92 @@
 	{
 		private Gtk.Widget embeddedWidget;
 		private Stack<Gtk.Widget> previousWidgets;
+		private Gtk.Label errorLabel;
 		public MainWindow () : base (Gtk.WindowType.Toplevel)
 		{
 			this.Build ();
-			List<Show> shows = GuideBoxAPIWrapper.getTVShowIds (0, 25, Source.All);
-			embeddedWidget = new ShowResultsWidget (this, shows);
-			this.container.Add (embeddedWidget);
+			previousWidgets = new Stack<Gtk.Widget> ();
+			errorLabel = new Gtk.Label ();
+			try{
+				List<Show> shows = GuideBoxAPIWrapper.getTVShowIds (0, 25, Source.All);
+				embeddedWidget = new ShowResultsWidget (this, shows);
+				this.container.Add (embeddedWidget);
+
+			}catch(WebException e){
+				outputError (e.Message);
+			}
+
 			this.ShowAll ();
-
-			previousWidgets = new Stack<Gtk.Widget> ();
-
-
 		}

-		protected void OnDeleteEvent (object sender, DeleteEventArgs a)
-		{

+
+		//clears whatever is in the lower part of the container
+		//if it's the embeddedWidget then it pushes it to stack
+		private void clearContainer(){
+			if (container.Children.Length == 2) {
+				if (container.Children [1] == embeddedWidget) {
+					previousWidgets.Push (embeddedWidget);
+				}
+				container.Remove (container.Children [1]);
+			} else if (container.Children.Length > 2) {
+				Console.WriteLine ("Somethings wrong");
+			}
+		}
+
+		//puts a label with error message in container
+		public void outputError(string errorMessage){
+			clearContainer ();
+
+			errorLabel.Text = errorMessage;
+			this.container.Add (errorLabel);
+			this.ShowAll ();
+		}
+
+		protected void OnDeleteEvent (object sender, DeleteEventArgs a){
 			Application.Quit ();
 			a.RetVal = true;
 		}

+		public void showSelected(Show show){
+			clearContainer ();
+			try{
+				show.numOfSeasons = GuideBoxAPIWrapper.getTVShowSeasons (show.id);
+				embeddedWidget = new SeasonResultsWidget (this, show);
+				this.container.Add (embeddedWidget);

-		public void showSelected(Show show){
-			this.container.Remove(embeddedWidget);
-
-			previousWidgets.Push (embeddedWidget);
-
-			show.numOfSeasons = GuideBoxAPIWrapper.getTVShowSeasons (show.id);
-			embeddedWidget = new SeasonResultsWidget (this, show);
-
-			this.container.Add (embeddedWidget);
+			}catch(WebException e){
+				outputError (e.Message);
+			}
 		}

 		public void seasonSelected(Show show, int s){
-			this.container.Remove(embeddedWidget);
+			clearContainer ();
+			try{
+				Season season = new Season(s.ToString());
+				season.episodes = GuideBoxAPIWrapper.getTVShowEpisodes (show.id, s.ToString());
+				embeddedWidget = new EpisodeResultsWidget (this, season);

-			previousWidgets.Push (embeddedWidget);
+				this.container.Add (embeddedWidget);

-			Season season = new Season(s.ToString());
-			season.episodes = GuideBoxAPIWrapper.getTVShowEpisodes (show.id, s.ToString());
-			embeddedWidget = new EpisodeResultsWidget (this, season);
-
-
-			this.container.Add (embeddedWidget);
+			}catch(WebException e){
+				outputError (e.Message);
+			}
 		}

 		public void episodeSelected(Episode episode){
-			this.container.Remove(embeddedWidget);
+			clearContainer ();
+			try{
+				Dictionary<string, List<string> > sources = GuideBoxAPIWrapper.getEpisodeLinks (episode.id);
+				embeddedWidget = new SourcesWidget (this, sources);

-			previousWidgets.Push (embeddedWidget);
+				this.container.Add (embeddedWidget);

-			Dictionary<string, List<string> > sources = GuideBoxAPIWrapper.getEpisodeLinks (episode.id);
-			embeddedWidget = new SourcesWidget (this, sources);
-
-			this.container.Add (embeddedWidget);
+			}catch(WebException e){
+				outputError (e.Message);
+			}
 		}

 		public void sourceSelected(string source, List<string> urls){
@@ -94,37 +125,32 @@
 		protected void OnBackButtonClicked (object sender, EventArgs e)
 		{
 			if (previousWidgets.Count != 0) {
-				this.container.Remove (embeddedWidget);
+				if (container.Children.Length == 2)
+					container.Remove (container.Children[1]);

 				embeddedWidget = previousWidgets.Pop ();

-				this.container.Add (embeddedWidget);
+				container.Add (embeddedWidget);
 			}
 		}

+
+
 		protected void OnSearchButtonClicked (object sender, EventArgs e)
 		{
-			this.container.Remove(embeddedWidget);
+			string searchText = searchEntry.Text;

-			previousWidgets.Push (embeddedWidget);
+			if (searchText != null && searchText != "") {
+				clearContainer ();
+				try{
+					List<Show> shows = GuideBoxAPIWrapper.getTVShowIds (searchText);
+					embeddedWidget = new ShowResultsWidget (this, shows);
+					this.container.Add (embeddedWidget);

-			string searchText = null;
-			searchText = searchEntry.Text;
-
-			//if (searchText != null) {
-				List<Show> shows = GuideBoxAPIWrapper.getTVShowIds (searchText);
-				embeddedWidget = new ShowResultsWidget (this, shows);
-				this.container.Add (embeddedWidget);
-
-			//} else
-			//{
-			//	this.Build ();
-			//	List<Show> shows = GuideBoxAPIWrapper.getTVShowIds (0, 25, Source.All);
-			//	embeddedWidget = new ShowResultsWidget (this, shows);
-			//	this.container.Add (embeddedWidget);
-			//	this.ShowAll ();
-
-			//}
+				}catch(WebException exception){
+					outputError (exception.Message);
+				}
+			}

 		}
 	}


add more explanation about reinstall logic on the website docs

--- Web/InstallingPackages.cshtml
+++ Web/InstallingPackages.cshtml
@@ -22,6 +22,9 @@
 Install-BoxstarterPackage -PackageName "MyPackage1","MyPackage2" -DisableReboots

Since no reboot will be performed, the credential is unnecessary.

+
+
Reinstall Logic

+
If you are familiar with Chocolatey, you know that chocolatey will check if a package has been previously installed and will skip the installation if there is already a install for that same package. Boxstarter changes this logic just a bit depending on whether or not one or multiple packages are provided to Install-BoxstarterPackage or the Boxstarter URL. If just one package is provided, Boxstarter will always attempt to redownload and install the package regardless of whether it had been previously installed. Its important to note this only applies to the "outer" package. If your package includes calls to CINST, those packages will abide by the normal Chocolatey install rules and will not be installed if they already exist in the chocolatey lib folder. Furthermore, when you supply multiple packages to Boxstarter's commandline or URL, it will skip installation for packages already installed.

Installing a package without a package

As mentioned previously on Creating Packages, you may not need to create a package. If your install script is limited to a single script file, you can use a file path or URL to a script and Boxstarter will create a package on the fly using this script as the ChocolateyInstall.ps1.


updated default avatar dimensions

updated default avatar dimensions

--- yafsrc/YAF.Configuration/BoardSettings.cs
+++ yafsrc/YAF.Configuration/BoardSettings.cs
@@ -706,7 +706,7 @@
         /// </summary>
         public int AvatarWidth
         {
-            get => this.Registry.GetValue("AvatarWidth", 50);
+            get => this.Registry.GetValue("AvatarWidth", 200);

             set => this.Registry.SetValue("AvatarWidth", value);
         }
@@ -716,7 +716,7 @@
         /// </summary>
         public int AvatarHeight
         {
-            get => this.Registry.GetValue("AvatarHeight", 80);
+            get => this.Registry.GetValue("AvatarHeight", 100);

             set => this.Registry.SetValue("AvatarHeight", value);
         }


[WinRT] Setting ActivityIdicator color works now (#479)

--- Xamarin.Forms.Platform.WinRT/ActivityIndicatorRenderer.cs
+++ Xamarin.Forms.Platform.WinRT/ActivityIndicatorRenderer.cs
@@ -1,4 +1,5 @@
-using System.ComponentModel;
+using System;
+using System.ComponentModel;
 using Windows.UI.Xaml;

 #if WINDOWS_UWP
@@ -11,6 +12,9 @@
 {
 	public class ActivityIndicatorRenderer : ViewRenderer<ActivityIndicator, Windows.UI.Xaml.Controls.ProgressBar>
 	{
+#if !WINDOWS_UWP
+		Windows.UI.Xaml.Media.SolidColorBrush _resourceBrush;
+#endif
 		object _foregroundDefault;

 		protected override void OnElementChanged(ElementChangedEventArgs<ActivityIndicator> e)
@@ -43,20 +47,34 @@

 		void OnControlLoaded(object sender, RoutedEventArgs routedEventArgs)
 		{
+#if !WINDOWS_UWP
+			_resourceBrush = (Control.Resources["ProgressBarIndeterminateForegroundThemeBrush"] as Windows.UI.Xaml.Media.SolidColorBrush);
+			_foregroundDefault = _resourceBrush.Color;
+#else
 			_foregroundDefault = Control.GetForegroundCache();
+#endif
 			UpdateColor();
 		}

 		void UpdateColor()
 		{
 			Color color = Element.Color;
+
 			if (color.IsDefault)
 			{
+#if !WINDOWS_UWP
+				_resourceBrush.Color = (Windows.UI.Color) _foregroundDefault;
+#else
 				Control.RestoreForegroundCache(_foregroundDefault);
+#endif
 			}
 			else
 			{
+#if !WINDOWS_UWP
+				_resourceBrush.Color = color.ToWindowsColor();
+#else
 				Control.Foreground = color.ToBrush();
+#endif
 			}
 		}


CP-17099: Do the double probe for iSCSI

CP-17099: Do the double probe for iSCSI

When we scan the LUN to see if there are any existing SRs, we need to do an additional probe if the probe for the desired type didn't find any SRs.
E.g. if  GFS2 is selected and no GFS2 SR was found on the LUN, then we need to also check if there is a LVM over iSCSI SR, and if there is one we will offer to reattach it (as LVM over iSCSI) or format it as GFS2

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs
+++ XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs
@@ -150,17 +150,91 @@
                 return;
             }

+            List<SR.SRInfo> srs;
+
             // Start probe
             SrProbeAction IscsiProbeAction = new SrProbeAction(Connection, master, SrType, dconf);
-            using (var dialog = new ActionProgressDialog(IscsiProbeAction, ProgressBarStyle.Marquee))
+            bool success = RunProbe(IscsiProbeAction, out srs);
+
+            if (!success)
+            {
+                cancel = iscsiProbeError = true;
+                return;
+            }
+
+            var performSecondProbe = Helpers.KolkataOrGreater(Connection) &&
+                                     !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled);
+            if (performSecondProbe && srs.Count == 0)
+            {
+                // Start second probe
+                var secondSrType = SrType == SR.SRTypes.gfs2 ? SR.SRTypes.lvmoiscsi : SR.SRTypes.gfs2;
+                dconf = GetDeviceConfig(secondSrType);
+                IscsiProbeAction = new SrProbeAction(Connection, master, secondSrType, dconf);
+                success = RunProbe(IscsiProbeAction, out srs);
+
+                if (!success)
+                {
+                    cancel = iscsiProbeError = true;
+                    return;
+                }
+            }
+
+            // Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel.
+            // Will return false on cancel
+            cancel = iscsiProbeError = !ExamineIscsiProbeResults(IscsiProbeAction, srs);
+        }
+
+        private bool RunProbe(SrProbeAction action, out List<SR.SRInfo> srs)
+        {
+            using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
             {
                 dialog.ShowCancel = true;
                 dialog.ShowDialog(this);
             }
-            // Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel.
-            // Will return false on cancel
-            cancel = !ExamineIscsiProbeResults(IscsiProbeAction);
-            iscsiProbeError = cancel;
+
+            srs = null;
+            _srToIntroduce = null;
+            if (action.Succeeded)
+            {
+                try
+                {
+                    srs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result);
+                    return true;
+                }
+                catch (Exception)
+                {
+                    return false;
+                }
+            }
+
+            DoOnProbeFailure(action);
+            return false;
+        }
+
+        private void DoOnProbeFailure(SrProbeAction action)
+        {
+            if (action.Succeeded)
+                return;
+
+            Exception exn = action.Exception;
+            log.Warn(exn, exn);
+            Failure failure = exn as Failure;
+            if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140")
+            {
+                errorIconAtHostOrIP.Visible = true;
+                errorLabelAtHostname.Visible = true;
+                errorLabelAtHostname.Text = Messages.INVALID_HOST;
+                textBoxIscsiHost.Focus();
+            }
+            else if (failure != null)
+            {
+                errorIconAtHostOrIP.Visible = true;
+                errorLabelAtHostname.Visible = true;
+                errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2
+                    ? failure.ErrorDescription[2]
+                    : failure.ErrorDescription[0];
+                textBoxIscsiHost.Focus();
+            }
         }

         bool iscsiProbeError = false;
@@ -702,42 +776,22 @@
         /// Whether to continue or not - wheter to format or not is stored in
         /// iScsiFormatLUN.
         /// </returns>
-        private bool ExamineIscsiProbeResults(SrProbeAction action)
+        private bool ExamineIscsiProbeResults(SrProbeAction action, List<SR.SRInfo> srs)
         {
             _srToIntroduce = null;

-            if (!action.Succeeded)
-            {
-                Exception exn = action.Exception;
-                log.Warn(exn, exn);
-                Failure failure = exn as Failure;
-                if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140")
-                {
-                    errorIconAtHostOrIP.Visible = true;
-                    errorLabelAtHostname.Visible = true;
-                    errorLabelAtHostname.Text = Messages.INVALID_HOST;
-                    textBoxIscsiHost.Focus();
-                }
-                else if (failure != null)
-                {
-                    errorIconAtHostOrIP.Visible = true;
-                    errorLabelAtHostname.Visible = true;
-                    errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2 ? failure.ErrorDescription[2] : failure.ErrorDescription[0];
-                    textBoxIscsiHost.Focus();
-                }
+            if (!action.Succeeded || srs == null)
                 return false;
-            }
-
+
             try
             {
-                List<SR.SRInfo> SRs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result);
-
                 if (!String.IsNullOrEmpty(SrWizardType.UUID))
                 {
                     // Check LUN contains correct SR
-                    if (SRs.Count == 1 && SRs[0].UUID == SrWizardType.UUID)
+                    if (srs.Count == 1 && srs[0].UUID == SrWizardType.UUID)
                     {
-                        _srToIntroduce = SRs[0];
+                        _srToIntroduce = srs[0];
+                        SrType = action.SrType; // the type of the existing SR
                         return true;
                     }

@@ -747,7 +801,7 @@

                     return false;
                 }
-                else if (SRs.Count == 0)
+                else if (srs.Count == 0)
                 {
                     // No existing SRs were found on this LUN. If allowed to create new SR, ask the user if they want to proceed and format.
                     if (!SrWizardType.AllowToCreateNewSr)
@@ -777,11 +831,11 @@
                 else
                 {
                     // There should be 0 or 1 SRs on the LUN
-                    System.Diagnostics.Trace.Assert(SRs.Count == 1);
+                    System.Diagnostics.Trace.Assert(srs.Count == 1);

                     // CA-17230
                     // Check this isn't a detached SR
-                    SR.SRInfo info = SRs[0];
+                    SR.SRInfo info = srs[0];
                     SR sr = SrWizardHelpers.SrInUse(info.UUID);
                     if (sr != null)
                     {
@@ -798,6 +852,7 @@
                             return false;

                         _srToIntroduce = info;
+                        SrType = action.SrType; // the type of the existing SR
                         return true;
                     }

@@ -810,7 +865,8 @@
                     {
                         case DialogResult.Yes:
                             // Reattach
-                            _srToIntroduce = SRs[0];
+                            _srToIntroduce = srs[0];
+                            SrType = action.SrType; // the type of the existing SR
                             return true;

                         case DialogResult.No:


CA-12164: Server Status Report wizard: Add option to upload the server status report to CIS

In the CallHomeAuthenticationAction.SetUploadTokenSecret() check if the tokenKey is null (public static, may be reused later).

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenModel/Actions/CallHome/CallHomeAuthenticationAction.cs
+++ XenModel/Actions/CallHome/CallHomeAuthenticationAction.cs
@@ -95,6 +95,9 @@

         public static void SetTokenSecret(IXenConnection connection, Dictionary<string, string> config, string tokenKey, string tokenValue)
         {
+            if (string.IsNullOrEmpty(tokenKey))
+                return;
+
             if (tokenValue == null)
             {
                 config.Remove(tokenKey);


Bug fix * We now load properties for list and list item.

--- Commands/InvokeAction/InvokeWebAction.cs
+++ Commands/InvokeAction/InvokeWebAction.cs
@@ -177,7 +177,9 @@
 					for (int listIndex = 0; listIndex < listCount; listIndex++)
 					{
 						List currentList = lists[listIndex];
-						WriteIterationProgress(ListProgressBarId, WebProgressBarId, "Counting list", GetTitle(currentList), listIndex, listCount);
+                        currentList.LoadProperties(_listActions.Properties);
+
+                        WriteIterationProgress(ListProgressBarId, WebProgressBarId, "Counting list", GetTitle(currentList), listIndex, listCount);

 						if ((_isListNameSpecified && currentList.Title.Equals(_listName, StringComparison.CurrentCultureIgnoreCase)) || _listActions.ShouldProcessAnyAction(currentList))
 						{
@@ -225,8 +227,9 @@
 					for (int listIndex = 0; listIndex < listCount; listIndex++)
 					{
 						List currentList = lists[listIndex];
-
-						if (_isListNameSpecified && !currentList.Title.Equals(_listName, StringComparison.CurrentCultureIgnoreCase))
+                        currentList.LoadProperties(_listActions.Properties);
+
+                        if (_isListNameSpecified && !currentList.Title.Equals(_listName, StringComparison.CurrentCultureIgnoreCase))
 							continue;

 						UpdateWebProgressBar(webs, webIndex, webCount, listIndex, _totalExecutionTimeStopWatch);
@@ -250,7 +253,9 @@
 							{
 								ListItem currentListItem = listItems[listItemIndex];

-								WriteIterationProgress(ListItemProgressBarId, ListProgressBarId, "Iterating list items", GetTitle(currentListItem), listItemIndex, listItemCount, CalculateRemainingTimeForListItems(listItemCount, listItemIndex));
+                                currentListItem.LoadProperties(_listItemActions.Properties);
+
+                                WriteIterationProgress(ListItemProgressBarId, ListProgressBarId, "Iterating list items", GetTitle(currentListItem), listItemIndex, listItemCount, CalculateRemainingTimeForListItems(listItemCount, listItemIndex));

 								ProcessAction(currentListItem, GetTitle, _listItemActions.Properties, _listItemActions.ShouldProcessAction, _listItemActions.Action, ref _currentListItemsProcessed, ref _averageListItemTime, ref _averageShouldProcessListItemTime);
 							}


changed output oredr for sample app for test

--- Common.DataProvider.SampleApp/Program.cs
+++ Common.DataProvider.SampleApp/Program.cs
@@ -16,6 +16,21 @@

             Stopwatch timer = new Stopwatch();

+
+            //DataTable only
+            timer.Restart();
+            using (var dal = new DatabaseAccess(ConfigurationManager.ConnectionStrings["db.connection"].ToString()))
+            {
+                var result = dal.ExecuteDataTable(
+                "Orders_GetAll",
+                new Dictionary<String, IConvertible> {
+                    { "@Country",null }
+                });//.ToModels<Order>().ToList();
+
+            }
+            timer.Stop();
+            Console.WriteLine("Miliseonds: {0}", timer.ElapsedMilliseconds);
+
             ////SqlDataReader reading to models
             timer.Start();
             using (var dal = new DatabaseAccess(ConfigurationManager.ConnectionStrings["db.connection"].ToString()))
@@ -30,6 +45,7 @@
             timer.Stop();
             Console.WriteLine("Miliseonds: {0}", timer.ElapsedMilliseconds);

+
             //DataTable to model
             timer.Restart();
             using (var dal = new DatabaseAccess(ConfigurationManager.ConnectionStrings["db.connection"].ToString()))
@@ -38,12 +54,14 @@
                 "Orders_GetAll",
                 new Dictionary<String, IConvertible> {
                     { "@Country",null }
-                });//.ToModels<Order>().ToList();
+                }).ToModels<Order>().ToList();

             }
             timer.Stop();
             Console.WriteLine("Miliseonds: {0}", timer.ElapsedMilliseconds);

+
+
             Console.ReadLine();
         }
     }


Fix TestBrowser regression.

Fix TestBrowser regression.

--- osu.Framework/GameModes/Testing/TestBrowser.cs
+++ osu.Framework/GameModes/Testing/TestBrowser.cs
@@ -29,6 +29,16 @@
         private DrawVisualiser drawVis;

         public int TestCount => testCases.Count;
+
+        private List<TestCase> tests = new List<TestCase>();
+
+        public TestBrowser()
+        {
+            //we want to build the lists here because we're interested in the assembly we were *created* on.
+            Assembly asm = Assembly.GetCallingAssembly();
+            foreach (Type type in asm.GetLoadableTypes().Where(t => t.IsSubclassOf(typeof(TestCase))))
+                tests.Add((TestCase)Activator.CreateInstance(type));
+        }

         public override void Load()
         {
@@ -72,12 +82,6 @@
                 RelativeSizeAxes = Axes.Both,
                 Size = new Vector2(0.25f, 1)
             });
-
-            List<TestCase> tests = new List<TestCase>();
-
-            Assembly asm = Assembly.GetCallingAssembly();
-            foreach (Type type in asm.GetLoadableTypes().Where(t => t.IsSubclassOf(typeof(TestCase))))
-                tests.Add((TestCase)Activator.CreateInstance(type));

             tests.Sort((a, b) => a.DisplayOrder.CompareTo(b.DisplayOrder));
             foreach (var testCase in tests)


Fix null-refing testcase

Fix null-refing testcase

This would also be fixed with BDL loading children after we're fully loaded ;).

--- osu.Game.Tests/Visual/TestCaseEditorCompose.cs
+++ osu.Game.Tests/Visual/TestCaseEditorCompose.cs
@@ -1,51 +1,28 @@
 // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

-using System;
 using NUnit.Framework;
 using osu.Framework.Allocation;
 using osu.Framework.Timing;
-using osu.Game.Beatmaps;
+using osu.Game.Rulesets.Osu;
 using osu.Game.Screens.Edit.Screens.Compose;
+using osu.Game.Tests.Beatmaps;

 namespace osu.Game.Tests.Visual
 {
     [TestFixture]
     public class TestCaseEditorCompose : OsuTestCase
     {
-        private readonly Random random;
-        private readonly Compose compose;
-
-        public TestCaseEditorCompose()
+        [BackgroundDependencyLoader]
+        private void load(OsuGameBase osuGame)
         {
-            random = new Random(1337);
+            osuGame.Beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);

             var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
+            var compose = new Compose(clock, clock);
+            compose.Beatmap.BindTo(osuGame.Beatmap);

-            Add(compose = new Compose(clock, clock));
-            AddStep("Next beatmap", nextBeatmap);
-        }
-
-        private OsuGameBase osuGame;
-        private BeatmapManager beatmaps;
-
-        [BackgroundDependencyLoader]
-        private void load(OsuGameBase osuGame, BeatmapManager beatmaps)
-        {
-            this.osuGame = osuGame;
-            this.beatmaps = beatmaps;
-
-            compose.Beatmap.BindTo(osuGame.Beatmap);
-        }
-
-        private void nextBeatmap()
-        {
-            var sets = beatmaps.GetAllUsableBeatmapSets();
-            if (sets.Count == 0)
-                return;
-
-            var b = sets[random.Next(0, sets.Count)].Beatmaps[0];
-            osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(b);
+            Child = compose;
         }
     }
 }


Add pitch randomisation to HoverSounds on-hover sample playback

--- osu.Game/Graphics/UserInterface/HoverSounds.cs
+++ osu.Game/Graphics/UserInterface/HoverSounds.cs
@@ -11,6 +11,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Input.Events;
 using osu.Game.Configuration;
+using osu.Framework.Utils;

 namespace osu.Game.Graphics.UserInterface
 {
@@ -49,9 +50,11 @@
         {
             bool enoughTimePassedSinceLastPlayback = !lastPlaybackTime.Value.HasValue || Time.Current - lastPlaybackTime.Value >= HoverDebounceTime;

-            if (enoughTimePassedSinceLastPlayback)
+            if (enoughTimePassedSinceLastPlayback && sampleHover != null)
             {
-                sampleHover?.Play();
+                sampleHover.Frequency.Value = 0.96 + RNG.NextDouble(0.08);
+                sampleHover.Play();
+
                 lastPlaybackTime.Value = Time.Current;
             }


Update the MVC sample to exclude the security stamp from the access/identity tokens

--- samples/Mvc.Server/Controllers/AuthorizationController.cs
+++ samples/Mvc.Server/Controllers/AuthorizationController.cs
@@ -4,6 +4,7 @@
  * the license and the contributors participating to this project.
  */

+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using System.Threading.Tasks;
@@ -12,9 +13,11 @@
 using AspNet.Security.OpenIdConnect.Server;
 using Microsoft.AspNetCore.Authentication;
 using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http.Authentication;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
 using Mvc.Server.Helpers;
 using Mvc.Server.Models;
 using Mvc.Server.ViewModels.Authorization;
@@ -27,15 +30,18 @@
     public class AuthorizationController : Controller
     {
         private readonly OpenIddictApplicationManager<OpenIddictApplication> _applicationManager;
+        private readonly IOptions<IdentityOptions> _identityOptions;
         private readonly SignInManager<ApplicationUser> _signInManager;
         private readonly UserManager<ApplicationUser> _userManager;

         public AuthorizationController(
             OpenIddictApplicationManager<OpenIddictApplication> applicationManager,
+            IOptions<IdentityOptions> identityOptions,
             SignInManager<ApplicationUser> signInManager,
             UserManager<ApplicationUser> userManager)
         {
             _applicationManager = applicationManager;
+            _identityOptions = identityOptions;
             _signInManager = signInManager;
             _userManager = userManager;
         }
@@ -267,19 +273,6 @@
             // Create a new ClaimsPrincipal containing the claims that
             // will be used to create an id_token, a token or a code.
             var principal = await _signInManager.CreateUserPrincipalAsync(user);
-
-            // Note: by default, claims are NOT automatically included in the access and identity tokens.
-            // To allow OpenIddict to serialize them, you must attach them a destination, that specifies
-            // whether they should be included in access tokens, in identity tokens or in both.
-
-            foreach (var claim in principal.Claims)
-            {
-                // In this sample, every claim is serialized in both the access and the identity tokens.
-                // In a real world application, you'd probably want to exclude confidential claims
-                // or apply a claims policy based on the scopes requested by the client application.
-                claim.SetDestinations(OpenIdConnectConstants.Destinations.AccessToken,
-                                      OpenIdConnectConstants.Destinations.IdentityToken);
-            }

             // Create a new authentication ticket holding the user identity.
             var ticket = new AuthenticationTicket(principal, properties,
@@ -302,6 +295,35 @@

             ticket.SetResources("resource_server");

+            // Note: by default, claims are NOT automatically included in the access and identity tokens.
+            // To allow OpenIddict to serialize them, you must attach them a destination, that specifies
+            // whether they should be included in access tokens, in identity tokens or in both.
+
+            foreach (var claim in ticket.Principal.Claims)
+            {
+                // Never include the security stamp in the access and identity tokens, as it's a secret value.
+                if (claim.Type == _identityOptions.Value.ClaimsIdentity.SecurityStampClaimType)
+                {
+                    continue;
+                }
+
+                var destinations = new List<string>
+                {
+                    OpenIdConnectConstants.Destinations.AccessToken
+                };
+
+                // Only add the iterated claim to the id_token if the corresponding scope was granted to the client application.
+                // The other claims will only be added to the access_token, which is encrypted when using the default format.
+                if ((claim.Type == OpenIdConnectConstants.Claims.Name && ticket.HasScope(OpenIdConnectConstants.Scopes.Profile)) ||
+                    (claim.Type == OpenIdConnectConstants.Claims.Email && ticket.HasScope(OpenIdConnectConstants.Scopes.Email)) ||
+                    (claim.Type == OpenIdConnectConstants.Claims.Role && ticket.HasScope(OpenIddictConstants.Claims.Roles)))
+                {
+                    destinations.Add(OpenIdConnectConstants.Destinations.IdentityToken);
+                }
+
+                claim.SetDestinations(destinations);
+            }
+
             return ticket;
         }
     }


Added leading space test for translator

Added leading space test for translator

--- test/SimpleGoogleTranslate.Tests/GoogleTranslator_Tests.cs
+++ test/SimpleGoogleTranslate.Tests/GoogleTranslator_Tests.cs
@@ -15,7 +15,23 @@
             var translator = new GoogleTranslator();

             // Act
-            actual = translator.Translate("en", "no", input, true);
+            actual = translator.Translate("en", "no", input);
+
+            // Assert
+            Assert.AreEqual(expected, actual);
+        }
+
+        [Test]
+        public void Is_Space_left_on_at_end_of_string()
+        {
+            // Arrange
+            const string input = "Some Stuff ";
+            const string expected = "noen Stuff ";
+            string actual = "";
+            var translator = new GoogleTranslator();
+
+            // Act
+            actual = translator.Translate("en", "no", input);

             // Assert
             Assert.AreEqual(expected, actual);


Use separate folders for different cases of a theory

(cherry picked from commit 4ccf1b690280e40fe8e79291603f02e454ff14f4)

--- test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs
+++ test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs
@@ -661,7 +661,7 @@
         [InlineData("nonexistingframeworkname")]
         public void WhenFrameworkSwitchIsNotMatchingAnyOfTargetedFrameworksItPrintsError(string framework)
         {
-            var setup = Setup();
+            var setup = Setup(framework);
             var lib = new ProjDir(setup.LibDir);
             var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib"));


Properly handle EXPUNGE notifications during a FETCH

Fixes issue #850

--- MailKit/Net/Imap/ImapFolderFetch.cs
+++ MailKit/Net/Imap/ImapFolderFetch.cs
@@ -107,6 +107,9 @@
 			{
 				int index = BinarySearch (args.Index, true);

+				if (index >= Messages.Count)
+					return;
+
 				if (Messages[index].Index == args.Index)
 					Messages.RemoveAt (index);


removed deadcode

removed deadcode

--- WinServiceLauncher/Program.cs
+++ WinServiceLauncher/Program.cs
@@ -62,23 +62,5 @@

 			}
 		}
-
-		/*
-		public static void Uninstall()
-		{
-			try
-			{
-				Progress.Message = "Stopping Service";
-				ServiceHelper.TryStop("WinServiceLauncher");
-
-				Progress.Message = "Uninstall Service";
-				ManagedInstallerClass.InstallHelper(new string[] { "/u", Assembly.GetExecutingAssembly().Location });
-			}
-			catch (Exception ex)
-			{
-				ConsoleHelper.WriteException(ex);
-			}
-		}
-		 */
 	}
 }


removed debug statements (oops...)

removed debug statements (oops...)

--- Core/System/Numerics/BigInteger.net35.cs
+++ Core/System/Numerics/BigInteger.net35.cs
@@ -315,6 +315,7 @@
                 return value._sign == -1 ? float.NegativeInfinity : float.PositiveInfinity;
             }
         }
+
         [CLSCompliantAttribute(false)]
         public static explicit operator ushort(BigInteger value)
         {
@@ -361,6 +362,7 @@
             }
             return -((((long)high) << 32) | (long)low);
         }
+
         public static explicit operator short(BigInteger value)
         {
             int val = (int)value;
@@ -370,6 +372,7 @@
             }
             return (short)val;
         }
+
         [CLSCompliantAttribute(false)]
         public static explicit operator sbyte(BigInteger value)
         {
@@ -380,6 +383,7 @@
             }
             return (sbyte)val;
         }
+
         public static BigInteger GreatestCommonDivisor(BigInteger left, BigInteger right)
         {
             if (left._sign != 0 && left._data.Length == 1 && left._data[0] == 1)
@@ -2315,10 +2319,6 @@
                         }
                         difference = word - borrow;
                         borrow = (uint)(difference >> 32) & 0x1u;
-                        Console.WriteLine(difference);
-                        Console.WriteLine(difference >> 32);
-                        Console.WriteLine((uint)(difference >> 32));
-                        Console.WriteLine((uint)(difference >> 32) & 0x1u);
                         _data[lastDataIndex] = ~(uint)difference & mask;
                     }
                 }


Added a test with an around advice on a generic method

--- tests/AspectInjector.Tests.Runtime/Advices/GenericTests.cs
+++ tests/AspectInjector.Tests.Runtime/Advices/GenericTests.cs
@@ -1,5 +1,6 @@
 using AspectInjector.Broker;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;

 namespace AspectInjector.Tests.Advices
 {
@@ -39,6 +40,16 @@
             _openGenericTarget.TestMethod();
             Assert.IsTrue(Checker.Passed);
         }
+
+        [TestMethod]
+        public void Advices_InjectAroundMethod_GenericMethod()
+        {
+            Checker.Passed = false;
+            var target = new GenericAroundTests_Target();
+            target.TestMethod<string>(string.Empty);
+            Assert.IsTrue(Checker.Passed);
+        }
+
     }

     [Inject(typeof(GenericTests_Aspect))]
@@ -79,4 +90,25 @@
         [Advice(Advice.Type.Before, Advice.Target.Method)]
         public void BeforeMethod() { Checker.Passed = true; }
     }
+
+    [Inject(typeof(GenericAroundTests_Aspect))]
+    internal class GenericAroundTests_Target
+    {
+        public void TestMethod<T>(T value)
+        {
+        }
+    }
+
+    [Aspect(Aspect.Scope.Global)]
+    internal class GenericAroundTests_Aspect
+    {
+        [Advice(Advice.Type.Around, Advice.Target.Method)]
+        public object AroundAdvice([Advice.Argument(Advice.Argument.Source.Target)] Func<object[], object> target,
+            [Advice.Argument(Advice.Argument.Source.Arguments)] object[] arguments)
+        {
+            Checker.Passed = true;
+            return target(arguments);
+        }
+    }
+
 }


Refactor

Refactor

--- src/reni2/Compiler.cs
+++ src/reni2/Compiler.cs
@@ -31,7 +31,7 @@
         {
             Tracer.Assert(fileName != null);
             var moduleName = ModuleNameFromFileName(fileName);
-            return new Compiler(new Source(new SmbFileSourceProvider(fileName)), moduleName, parameters);
+            return new Compiler(new Source(fileName.ToSmbFile()), moduleName, parameters);
         }

         public static Compiler FromText
@@ -373,27 +373,4 @@
         void AddData(string text);
         void AddLog(string text);
     }
-
-    public sealed class SmbFileSourceProvider : ISourceProvider
-    {
-        readonly ValueCache<string> DataCache;
-        readonly SmbFile File;
-
-        public SmbFileSourceProvider(string fileName)
-            : this(fileName.ToSmbFile())
-        {
-        }
-
-
-        SmbFileSourceProvider(SmbFile file, bool useCache = true)
-        {
-            File = file;
-            if (useCache)
-                DataCache = new ValueCache<string>(() => File.String);
-        }
-
-        string ISourceProvider.Data => DataCache?.Value ?? File.String;
-        bool ISourceProvider.IsPersistent => false;
-    }
-
 }


Changed start direction and made wolf move to end when warm enough

--- Winter/Assets/Scripts/wolf.cs
+++ Winter/Assets/Scripts/wolf.cs
@@ -10,6 +10,7 @@
 	private bool gameOver;
 	private NavMeshAgent agent;
 	private float sniffCooldown;
+	private bool movingToEnd;

 	enum CharacterState {
@@ -38,65 +39,72 @@
 		agent = GetComponent<NavMeshAgent>();
 		sniffCooldown = 5f;

-		Vector3 movVec = new Vector3(250,0,415);
+		Vector3 movVec = new Vector3(190,0,475);
 		agent.SetDestination(movVec);
+
+		movingToEnd = false;
 	}

 	void Update () {
-		float tempDistance;     //Player distance from wolf, but maxes out at 30
-
-		//Find distance from player
-		tempDistance = distanceFromPlayer = PlayerDistance(playerTransform.position);
-		if(tempDistance > maxCoolingDistance) {
-			tempDistance = maxCoolingDistance;
-		}
-
-		//Adjust temperature based on player distance
-		temperature +=  (warmingDistance - tempDistance) * Time.deltaTime * warmingSpeed;
-
-		//Check bounds on Temperature
-		if(temperature > maxTemp) {
-			temperature = maxTemp;
-		}
-		if(temperature < 0) {
-			temperature = 0;
-		}
-
-		//Manage Velocity
-		if(charState == CharacterState.Walking && temperature > 2) {
-			velocity = .7f * maxVelocity * temperature / maxTemp + .3f * maxVelocity;
-		}
-		else {
-			velocity = 0;
-		}
-
-		agent.speed = velocity;
-
-		//Manage Sniffing
-		if(sniffCooldown <= 0) {
-			if(charState != CharacterState.Sniffing) {
-				charState = CharacterState.Sniffing;
+		if (movingToEnd == false) {
+			float tempDistance;     //Player distance from wolf, but maxes out at 30
+
+			//Find distance from player
+			tempDistance = distanceFromPlayer = PlayerDistance(playerTransform.position);
+			if(tempDistance > maxCoolingDistance) {
+				tempDistance = maxCoolingDistance;
+			}
+
+			//Adjust temperature based on player distance
+			temperature +=  (warmingDistance - tempDistance) * Time.deltaTime * warmingSpeed;
+
+			//Check bounds on Temperature
+			if(temperature > maxTemp) {
+				temperature = maxTemp;
+			}
+			if(temperature < 0) {
+				temperature = 0;
+			}
+
+			//Manage Velocity
+			if(charState == CharacterState.Walking && temperature > 2) {
+				velocity = .7f * maxVelocity * temperature / maxTemp + .3f * maxVelocity;
 			}
 			else {
-				sniffCooldown -= Time.deltaTime;
-				if(sniffCooldown <= -5) {
-					charState = CharacterState.Walking;
-					sniffCooldown = UnityEngine.Random.Range(-10f,10f) + 10 + 15 * (temperature / maxTemp);
-
-					Vector3 newLocation = new Vector3(UnityEngine.Random.Range(180f,725f),5,UnityEngine.Random.Range(213f,840f));
-					agent.SetDestination(newLocation);
-
+				velocity = 0;
+			}
+
+			agent.speed = velocity;
+
+			//Manage Sniffing
+			if(sniffCooldown <= 0) {
+				if(charState != CharacterState.Sniffing) {
+					charState = CharacterState.Sniffing;
+				}
+				else {
+					sniffCooldown -= Time.deltaTime;
+					if(sniffCooldown <= -5) {
+						charState = CharacterState.Walking;
+						sniffCooldown = UnityEngine.Random.Range(-10f,10f) + 10 + 15 * (temperature / maxTemp);
+
+						Vector3 newLocation = new Vector3(UnityEngine.Random.Range(180f,725f),100,UnityEngine.Random.Range(213f,840f));
+						agent.SetDestination(newLocation);
+
+					}
 				}
 			}
+
+			if(temperature > 2) {
+				sniffCooldown -= Time.deltaTime;
+			}
+
+			if(temperature == 100f) {
+				movingToEnd = true;
+				Vector3 newLocation = new Vector3(125f,1f,245f);
+				agent.SetDestination (newLocation);
+			}
 		}
-
-		if(temperature > 2) {
-			sniffCooldown -= Time.deltaTime;
-		}
-
-
-
 	}

 	int PlayerDistance(Vector3 player_position) {


Fix commit 1d3574ad39f7dceb1f27063df92561492869aedf

--- Messages/ProcessSuspendedMessage.cs
+++ Messages/ProcessSuspendedMessage.cs
@@ -1,14 +1,28 @@
 namespace StockSharp.Messages
 {
+	using System;
+	using System.Runtime.Serialization;
+
 	/// <summary>
 	/// Process suspended action.
 	/// </summary>
+	[DataContract]
+	[Serializable]
 	public class ProcessSuspendedMessage : Message
 	{
 		/// <summary>
 		/// Additional argument.
 		/// </summary>
+		[DataMember]
 		public object Arg { get; }
+
+		/// <summary>
+		/// Initializes a new instance of the <see cref="ProcessSuspendedMessage"/>.
+		/// </summary>
+		public ProcessSuspendedMessage()
+			: base(MessageTypes.ProcessSuspended)
+		{
+		}

 		/// <summary>
 		/// Initializes a new instance of the <see cref="ProcessSuspendedMessage"/>.
@@ -16,7 +30,7 @@
 		/// <param name="adapter">Adapter.</param>
 		/// <param name="arg">Additional argument.</param>
 		public ProcessSuspendedMessage(IMessageAdapter adapter, object arg = default)
-			: base(MessageTypes.ProcessSuspended)
+			: this()
 		{
 			this.LoopBack(adapter);
 			Arg = arg;


DataGridEx: use DependencyObjectExtensionMethods.AddPropertyChanged()

--- WpfUtility/DataGridEx.xaml.cs
+++ WpfUtility/DataGridEx.xaml.cs
@@ -39,8 +39,9 @@
         public DataGridEx()
             : base() {

-            DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGridEx))
-                .AddValueChanged(this, (sender, e) => {
+            this.AddPropertyChanged(
+                ItemsControl.ItemsSourceProperty,
+                (sender, e) => {
                     var dataGridEx = sender as DataGridEx;
                     if (dataGridEx == null || dataGridEx.ItemsSource == null) {
                         return;
@@ -49,7 +50,8 @@
                     _collectionView = CollectionViewSource.GetDefaultView(dataGridEx.ItemsSource) as ListCollectionView;
                     ((INotifyCollectionChanged)_collectionView).CollectionChanged += OnUpdateItems;
                     _collectionView.Filter = PredicateAutoFilter;
-                });
+                }
+            );
             AutoGeneratingColumn += OnAutoGeneratingColumn;
         }


Feature: Device Lost/Stolen Sub Types

Feature: Device Lost/Stolen Sub Types

As requested in #1

--- Disco.Data/Repository/DiscoDataSeeder.cs
+++ Disco.Data/Repository/DiscoDataSeeder.cs
@@ -208,6 +208,15 @@
                 context.JobSubTypes.Add(new JobSubType { Id = "BezelCaseBottomCover", JobTypeId = JobType.JobTypeIds.HWar, Description = "Bezel - Case Bottom Load Cover" });
             #endregion
             // End Feature Request
+
+            // Feature Request https://github.com/garysharp/Disco/issues/1
+            #region "Device Stolen/Lost"
+            if (context.JobSubTypes.Count(jst => jst.JobTypeId == JobType.JobTypeIds.HNWar && jst.Id == "DeviceStolen") == 0)
+                context.JobSubTypes.Add(new JobSubType { Id = "DeviceStolen", JobTypeId = JobType.JobTypeIds.HNWar, Description = "Device Stolen" });
+            if (context.JobSubTypes.Count(jst => jst.JobTypeId == JobType.JobTypeIds.HNWar && jst.Id == "DeviceLost") == 0)
+                context.JobSubTypes.Add(new JobSubType { Id = "DeviceLost", JobTypeId = JobType.JobTypeIds.HNWar, Description = "Device Lost" });
+            #endregion
+            // End Feature Request
         }

         private static void UpdateDeviceModelConfiguration(this DiscoDataContext context)


ut fix

ut fix

--- tests_netcore/Plivo.NetCore.Test/Resources/TestCampaign.cs
+++ tests_netcore/Plivo.NetCore.Test/Resources/TestCampaign.cs
@@ -69,7 +69,7 @@
             var request =
                 new PlivoRequest(
                     "GET",
-                    "Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Campaign/"+campaignID+"/Number",
+                    "Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Campaign/"+campaignID+"/Number/",
                     "",
                     data);

@@ -95,7 +95,7 @@
             var request =
                 new PlivoRequest(
                     "GET",
-                    "Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Campaign/"+campaignID+"/Number/"+number,
+                    "Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Campaign/"+campaignID+"/Number/"+number+"/",
                     "",
                     data);


Fix StaticCached.AlwaysStale grinding the game to a halt again.

--- osu.Framework/Graphics/Containers/Container_AutoSize.cs
+++ osu.Framework/Graphics/Containers/Container_AutoSize.cs
@@ -19,7 +19,7 @@
         {
             get
             {
-                if (!isComputingAutosize && (AutoSizeAxes & Axes.X) > 0)
+                if (!StaticCached.AlwaysStale && !isComputingAutosize && (AutoSizeAxes & Axes.X) > 0)
                     updateAutoSize();
                 return base.Width;
             }
@@ -35,7 +35,7 @@
         {
             get
             {
-                if (!isComputingAutosize && (AutoSizeAxes & Axes.Y) > 0)
+                if (!StaticCached.AlwaysStale && !isComputingAutosize && (AutoSizeAxes & Axes.Y) > 0)
                     updateAutoSize();
                 return base.Height;
             }
@@ -52,7 +52,7 @@
         {
             get
             {
-                if (!isComputingAutosize && AutoSizeAxes != Axes.None)
+                if (!StaticCached.AlwaysStale && !isComputingAutosize && AutoSizeAxes != Axes.None)
                     updateAutoSize();
                 return base.Size;
             }


Add braces to clear up operator precedence

--- osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs
+++ osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs
@@ -33,7 +33,7 @@
         [BackgroundDependencyLoader]
         private void load(ISkinSource source, DrawableHitObject drawableObject)
         {
-            spinnerBlink = !source.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value ?? true;
+            spinnerBlink = !(source.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value) ?? true;

             drawableSpinner = (DrawableSpinner)drawableObject;


Fix nullability issue

Fix nullability issue

--- osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs
+++ osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs
@@ -159,7 +159,7 @@
             {
                 case ArmedState.Hit:
                     using (BeginAbsoluteSequence(drawableHitObject.HitStateUpdateTime))
-                        flashBox?.FadeTo(0.9f).FadeOut(300);
+                        flashBox.FadeTo(0.9f).FadeOut(300);
                     break;
             }
         }


Correctly redirect `BPM` from API to interface

--- osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs
+++ osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs
@@ -164,7 +164,7 @@
         IEnumerable<INamedFileUsage> IBeatmapSetInfo.Files => throw new NotImplementedException();
         double IBeatmapSetInfo.MaxStarDifficulty => throw new NotImplementedException();
         double IBeatmapSetInfo.MaxLength => throw new NotImplementedException();
-        double IBeatmapSetInfo.MaxBPM => throw new NotImplementedException();
+        double IBeatmapSetInfo.MaxBPM => BPM;

         #endregion
     }


Increase delay for changing background on returning to main menu

--- osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs
+++ osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs
@@ -95,7 +95,7 @@
             nextTask = Scheduler.AddDelayed(() =>
             {
                 LoadComponentAsync(nextBackground, displayNext, cancellationTokenSource.Token);
-            }, 100);
+            }, 500);

             return true;
         }


Fix potential nullref in `ContextMenuItems`

--- osu.Game/Screens/OnlinePlay/DrawableRoomPlaylistItem.cs
+++ osu.Game/Screens/OnlinePlay/DrawableRoomPlaylistItem.cs
@@ -8,6 +8,7 @@
 using System.Diagnostics;
 using System.Linq;
 using System.Threading.Tasks;
+using JetBrains.Annotations;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
 using osu.Framework.Graphics;
@@ -94,6 +95,7 @@
         private PanelBackground panelBackground;
         private FillFlowContainer mainFillFlow;

+        [CanBeNull]
         private BeatmapDownloadTracker downloadTracker;

         [Resolved]
@@ -503,7 +505,7 @@
                 if (beatmapOverlay != null)
                     items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => beatmapOverlay.FetchAndShowBeatmap(Item.Beatmap.OnlineID)));

-                if (beatmap != null && collectionManager != null && downloadTracker.State.Value == DownloadState.LocallyAvailable)
+                if (beatmap != null && collectionManager != null && downloadTracker?.State.Value == DownloadState.LocallyAvailable)
                 {
                     var collectionItems = collectionManager.Collections.Select(c => new CollectionToggleMenuItem(c, beatmap)).Cast<OsuMenuItem>().ToList();
                     if (manageCollectionsDialog != null)


TSI-3689 : Updated description

TSI-3689 : Updated description

--- webapp-net/DynamicDocumentation/Properties/AssemblyInfo.cs
+++ webapp-net/DynamicDocumentation/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
 using System.Reflection;

-[assembly: AssemblyTitle("SDL DXA DD Web App Module")]
+[assembly: AssemblyTitle("SDL DXA Dynamic Documentation Module")]

 // NOTE: Common Assembly Info is generated by the build in CommonAssemblyInfo.cs


Adjust tests to MySqlConnector 1.4.0-beta.4.

--- test/EFCore.MySql.FunctionalTests/TwoDatabasesMySqlTest.cs
+++ test/EFCore.MySql.FunctionalTests/TwoDatabasesMySqlTest.cs
@@ -24,6 +24,6 @@
         protected override TwoDatabasesWithDataContext CreateBackingContext(string databaseName)
             => new TwoDatabasesWithDataContext(Fixture.CreateOptions(MySqlTestStore.Create(databaseName)));

-        protected override string DummyConnectionString { get; } = "Server=localhost;Database=DoesNotExist;AllowUserVariables=True;Use Affected Rows=False";
+        protected override string DummyConnectionString { get; } = "Server=localhost;Database=DoesNotExist;Allow User Variables=True;Use Affected Rows=False";
     }
 }


Fix broken tests

Fix broken tests

Always run them first kids!

--- test/Stubble.Extensions.SystemData.Tests/SystemDataTest.cs
+++ test/Stubble.Extensions.SystemData.Tests/SystemDataTest.cs
@@ -51,13 +51,13 @@
         [Fact]
         public void It_Should_Return_Null_On_Incorrect_Type_DataRow()
         {
-            Assert.Equal(1, SystemData.DataRowGetter(10, "IntColumn", false));
+            Assert.Null(SystemData.DataRowGetter(10, "IntColumn", false));
         }

         [Fact]
         public void It_Should_Return_Null_On_Incorrect_Type_DataSet()
         {
-            Assert.Equal(1, SystemData.DataSetGetter(10, "IntColumn", false));
+            Assert.Null(SystemData.DataSetGetter(10, "IntColumn", false));
         }

         [Fact]


update to api

update to api

--- resharper/src/resharper-unity/Rider/UnityPluginProtocolController.cs
+++ resharper/src/resharper-unity/Rider/UnityPluginProtocolController.cs
@@ -137,12 +137,9 @@
             {
                 myLogger.Info("Create protocol...");
                 var lifetime = SessionLifetimes.Next();
-                myProtocol = new Protocol(new Serializers(), new Identities(IdKind.DynamicClient), myDispatcher,
-                    creatingProtocol =>
-                    {
-                        myLogger.Info("Creating SocketWire with port = {0}", port);
-                        return new SocketWire.Client(lifetime, creatingProtocol, port, "UnityClient");
-                    });
+                myLogger.Info("Creating SocketWire with port = {0}", port);
+                var wire = new SocketWire.Client(lifetime, myDispatcher, port, "UnityClient");
+                myProtocol = new Protocol(new Serializers(), new Identities(IdKind.Client), myDispatcher, wire);
                 UnityModel = new UnityModel(lifetime, myProtocol);
                 UnityModel.IsClientConnected.Set(rdVoid => true);
                 UnityModel.RiderProcessId.SetValue(Process.GetCurrentProcess().Id);


SVG fix - null exception

SVG fix - null exception

--- source/FFImageLoading.Svg.Shared/SkSvg.cs
+++ source/FFImageLoading.Svg.Shared/SkSvg.cs
@@ -991,7 +991,7 @@
                     if (ColorHelper.TryParse(stroke, out SKColor color))
                     {
                         // preserve alpha
-                        if (color.Alpha == 255 && fillPaint.Color.Alpha > 0)
+                        if (color.Alpha == 255 && (fillPaint == null || fillPaint.Color.Alpha > 0))
                             strokePaint.Color = color.WithAlpha(strokePaint.Color.Alpha);
                         else
                             strokePaint.Color = color;
@@ -1132,7 +1132,7 @@
                     if (ColorHelper.TryParse(fill, out SKColor color))
                     {
                         // preserve alpha
-                        if (color.Alpha == 255 && fillPaint.Color.Alpha > 0)
+                        if (color.Alpha == 255 && (fillPaint == null || fillPaint.Color.Alpha > 0))
                             fillPaint.Color = color.WithAlpha(fillPaint.Color.Alpha);
                         else
                             fillPaint.Color = color;


refactor(logging): ♻ simplify HostRunner return type

--- services/SharedKernel/FilterLists.SharedKernel.Logging/HostRunner.cs
+++ services/SharedKernel/FilterLists.SharedKernel.Logging/HostRunner.cs
@@ -8,7 +8,7 @@
 {
     public static class HostRunner
     {
-        public static async Task<int> TryRunWithLoggingAsync(this IHost host, Func<Task>? runPreHostAsync = default)
+        public static async Task TryRunWithLoggingAsync(this IHost host, Func<Task>? runPreHostAsync = default)
         {
             _ = host ?? throw new ArgumentNullException(nameof(host));

@@ -27,7 +27,6 @@

                 Log.Information("Initializing host");
                 await host.RunAsync();
-                return 0;
             }
             catch (Exception ex)
             {


Add IncludeEmailInRedirect to ticket integration test

--- tests/Auth0.ManagementApi.IntegrationTests/TicketsTests.cs
+++ tests/Auth0.ManagementApi.IntegrationTests/TicketsTests.cs
@@ -62,7 +62,8 @@
             {
                 UserId = _user.UserId,
                 ResultUrl = "http://www.nonexistingdomain.aaa/success",
-                MarkEmailAsVerified = true
+                MarkEmailAsVerified = true,
+                IncludeEmailInRedirect = true
             };
             var changeTicketRsponse = await _apiClient.Tickets.CreatePasswordChangeTicketAsync(changeTicketRequest);
             changeTicketRsponse.Should().NotBeNull();


Improves unit tests for S3BlobAdapter.

Improves unit tests for S3BlobAdapter.

--- tests/Estranged.Lfs.Tests/Adapter.S3/S3BlobAdapterTests.cs
+++ tests/Estranged.Lfs.Tests/Adapter.S3/S3BlobAdapterTests.cs
@@ -22,13 +22,20 @@
         {
             var mockClient = mockRepository.Create<IAmazonS3>();

-            mockClient.Setup(x => x.GetObjectMetadataAsync("my-bucket", "d53de494a038b6a8ede0aea08c38bde00244b155924bf4c463d1de208faecee8", CancellationToken.None))
+            mockClient.Setup(x => x.GetObjectMetadataAsync("my-bucket", "prefix/d53de494a038b6a8ede0aea08c38bde00244b155924bf4c463d1de208faecee8", CancellationToken.None))
                       .ReturnsAsync(new GetObjectMetadataResponse{ContentLength = 19961});

             mockClient.Setup(x => x.GetPreSignedURL(It.IsAny<GetPreSignedUrlRequest>()))
+                      .Callback<GetPreSignedUrlRequest>(request =>
+                      {
+                          Assert.Equal("prefix/d53de494a038b6a8ede0aea08c38bde00244b155924bf4c463d1de208faecee8", request.Key);
+                          Assert.Equal("my-bucket", request.BucketName);
+                          Assert.Equal(HttpVerb.GET, request.Verb);
+                          Assert.Equal(Protocol.HTTPS, request.Protocol);
+                      })
                       .Returns("https://www.example.com/");

-            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket" });
+            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket", KeyPrefix = "prefix/" });

             var signedBlob = await adapter.UriForDownload("d53de494a038b6a8ede0aea08c38bde00244b155924bf4c463d1de208faecee8", CancellationToken.None);

@@ -43,10 +50,10 @@
         {
             var mockClient = mockRepository.Create<IAmazonS3>();

-            mockClient.Setup(x => x.GetObjectMetadataAsync("my-bucket", "wibble", CancellationToken.None))
+            mockClient.Setup(x => x.GetObjectMetadataAsync("my-bucket", "prefix/wibble", CancellationToken.None))
                       .ThrowsAsync(new AmazonS3Exception("Error making request with Error Code NotFound and Http Status Code NotFound. No further error information was returned by the service.", ErrorType.Sender, "NotFound", "requestId", HttpStatusCode.NotFound));

-            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket" });
+            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket", KeyPrefix = "prefix/" });

             var signedBlob = await adapter.UriForDownload("wibble", CancellationToken.None);

@@ -60,9 +67,16 @@
             var mockClient = mockRepository.Create<IAmazonS3>();

             mockClient.Setup(x => x.GetPreSignedURL(It.IsAny<GetPreSignedUrlRequest>()))
+                      .Callback<GetPreSignedUrlRequest>(request =>
+                      {
+                          Assert.Equal("prefix/wibble", request.Key);
+                          Assert.Equal("my-bucket", request.BucketName);
+                          Assert.Equal(HttpVerb.PUT, request.Verb);
+                          Assert.Equal(Protocol.HTTPS, request.Protocol);
+                      })
                       .Returns("https://www.example.com/");

-            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket" });
+            var adapter = new S3BlobAdapter(mockClient.Object, new S3BlobAdapterConfig { Bucket = "my-bucket", KeyPrefix = "prefix/" });

             var signedBlob = await adapter.UriForUpload("wibble", 10, CancellationToken.None);


Minor code format tweaks.

Minor code format tweaks.

--- tests/System.Text.Formatting.Tests/CustomTypeFormatting.cs
+++ tests/System.Text.Formatting.Tests/CustomTypeFormatting.cs
@@ -21,8 +21,10 @@

         public bool TryFormat(Span<byte> buffer, out int bytesWritten, TextFormat format, EncodingData encoding)
         {
-            if (!PrimitiveFormatter.TryFormat(_age, buffer, out bytesWritten, format, encoding)) return false;
-
+            if (!PrimitiveFormatter.TryFormat(_age, buffer, out bytesWritten, format, encoding))
+            {
+                return false;
+            }

             char symbol = _inMonths ? 'm' : 'y';
             int consumed;
@@ -31,7 +33,10 @@
             unsafe
             {
                 ReadOnlySpan<char> symbolSpan = new ReadOnlySpan<char>(&symbol, 1);
-                if (!encoding.TextEncoder.TryEncode(symbolSpan, buffer.Slice(bytesWritten), out consumed, out symbolBytes)) return false;
+                if (!encoding.TextEncoder.TryEncode(symbolSpan, buffer.Slice(bytesWritten), out consumed, out symbolBytes))
+                {
+                    return false;
+                }
             }

             bytesWritten += symbolBytes;
@@ -53,7 +58,8 @@
         {
             byte[] buffer = new byte[1024];
             MemoryStream stream = new MemoryStream(buffer);
-            using(var writer = new StreamFormatter(stream, pool)) {
+            using (var writer = new StreamFormatter(stream, pool))
+            {
                 writer.Append(new Age(56));
                 writer.Append(new Age(14, inMonths: true));

@@ -67,7 +73,8 @@
         {
             byte[] buffer = new byte[1024];
             MemoryStream stream = new MemoryStream(buffer);
-            using(var writer = new StreamFormatter(stream, EncodingData.InvariantUtf8, pool)) {
+            using (var writer = new StreamFormatter(stream, EncodingData.InvariantUtf8, pool))
+            {
                 writer.Append(new Age(56));
                 writer.Append(new Age(14, inMonths: true));
                 var writtenText = Encoding.UTF8.GetString(buffer, 0, (int)stream.Position);


fix unit test after previous commit :(

fix unit test after previous commit :(

--- src/BizTalk.Dsl.Tests/Dsl/Binding/OrchestrationBindingBaseFixture.cs
+++ src/BizTalk.Dsl.Tests/Dsl/Binding/OrchestrationBindingBaseFixture.cs
@@ -180,8 +180,8 @@
 			var orchestrationBinding = (IOrchestrationBinding) assembly.CreateInstance(typeof(Process).FullName + "OrchestrationBinding");
 			// ReSharper disable once PossibleNullReferenceException
 			orchestrationBinding.Host = "Host";
-			Reflector.SetProperty(orchestrationBinding, "ReceivePort", new ReceivePort(rp => { }));
-			Reflector.SetProperty(orchestrationBinding, "SendPort", new SendPort(sp => { }));
+			Reflector.SetProperty(orchestrationBinding, "ReceivePort", new Mock<ReceivePort>().Object);
+			Reflector.SetProperty(orchestrationBinding, "SendPort", new Mock<SendPort>().Object);

 			Assert.That(
 				() => ((ISupportValidation) orchestrationBinding).Validate(),


Fix comment in test.

Fix comment in test.

--- src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs
+++ src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs
@@ -210,12 +210,12 @@
             var compilation = CreateCompilation(source, options: TestOptions.DebugExe);
             compilation.VerifyDiagnostics(
                 // (10,13): error CS8117: Invalid operand for pattern match; value required, but found '<null>'.
-                //         if (null is dynamic t) { } // null not allowed
+                //         if (null is dynamic t2) { } // null not allowed
                 Diagnostic(ErrorCode.ERR_BadPatternExpression, "null").WithArguments("<null>").WithLocation(10, 13),
                 // (11,18): error CS8116: It is not legal to use nullable type 'int?' in a pattern; use the underlying type 'int' instead.
                 //         if (s is NullableInt x) { } // error: cannot use nullable type
                 Diagnostic(ErrorCode.ERR_PatternNullableType, "NullableInt").WithArguments("int?", "int").WithLocation(11, 18),
-                // (12,18): error CS8121: An expression of type string cannot be handled by a pattern of type long.
+                // (12,18): error CS8121: An expression of type 'string' cannot be handled by a pattern of type 'long'.
                 //         if (s is long l) { } // error: cannot convert string to long
                 Diagnostic(ErrorCode.ERR_PatternWrongType, "long").WithArguments("string", "long").WithLocation(12, 18),
                 // (13,18): error CS0031: Constant value '1000' cannot be converted to a 'byte'


Correct test with number to string conversion.

--- sources/HDocument.Tests/HContainerTest.cs
+++ sources/HDocument.Tests/HContainerTest.cs
@@ -22,20 +22,21 @@
             Assert.Equal(0, container.Nodes().Count());

             container.Add(123.45);
+            String s = (123.45).ToString();
             Assert.Equal(1, container.Nodes().Count());
-            Assert.Equal("
123,45
", container.ToString());
+            Assert.Equal("
" + s + "
", container.ToString());

             container.Add(null);
             Assert.Equal(1, container.Nodes().Count());
-            Assert.Equal("
123,45
", container.ToString());
+            Assert.Equal("
" + s + "
", container.ToString());

             container.Add("Other Content");
             Assert.Equal(1, container.Nodes().Count());
-            Assert.Equal("
123,45Other Content
", container.ToString());
+            Assert.Equal("
" + s + "Other Content
", container.ToString());

             container.Add(new HElement("span", "SPAN"));
             Assert.Equal(2, container.Nodes().Count());
-            Assert.Equal("
123,45Other ContentSPAN
", container.ToString());
+            Assert.Equal("
" + s + "Other ContentSPAN
", container.ToString());

         }


Code cleanup.

Code cleanup.

--- source/Cosmos.Build.Common/ExtensionMethods.cs
+++ source/Cosmos.Build.Common/ExtensionMethods.cs
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Cosmos.Build.Common
-{
-	public static class ExtensionMethods
-	{
-		public static uint Sum(this IEnumerable<uint> source)
-		{
-			if (source == null)
-			{
-				throw new ArgumentNullException("source");
-			}
-			ulong sum = 0Lu;
-			foreach (uint val in source)
-			{
-				sum += val;
-			}
-			return (uint)sum;
-		}
-	}
-}