Closes rds1983/Myra#205

Closes rds1983/Myra#205

--- src/Myra/Graphics2D/UI/Window.cs
+++ src/Myra/Graphics2D/UI/Window.cs
@@ -18,449 +18,454 @@

 namespace Myra.Graphics2D.UI
 {
-	public class WindowClosingEventArgs : EventArgs
-	{
-		public bool Cancel { get; set; }
-
-		public WindowClosingEventArgs()
-		{
-		}
-	}
-
-	public class Window : SingleItemContainer<VerticalStackPanel>, IContent
-	{
-		private Point? _startPos;
-		private readonly Label _titleLabel;
-		private Widget _content;
-		private Widget _previousMouseWheelFocus;
-
-		[Category("Appearance")]
-		public string Title
-		{
-			get
-			{
-				return _titleLabel.Text;
-			}
-
-			set
-			{
-				_titleLabel.Text = value;
-			}
-		}
-
-		[Category("Appearance")]
-		[StylePropertyPath("TitleStyle/TextColor")]
-		public Color TitleTextColor
-		{
-			get
-			{
-				return _titleLabel.TextColor;
-			}
-			set
-			{
-				_titleLabel.TextColor = value;
-			}
-		}
-
-		[Category("Appearance")]
-		public SpriteFont TitleFont
-		{
-			get
-			{
-				return _titleLabel.Font;
-			}
-			set
-			{
-				_titleLabel.Font = value;
-			}
-		}
-
-		[Browsable(false)]
-		[XmlIgnore]
-		public Grid TitleGrid { get; private set; }
-
-		[Browsable(false)]
-		[XmlIgnore]
-		public ImageButton CloseButton { get; private set; }
-
-		[Browsable(false)]
-		[Content]
-		public Widget Content
-		{
-			get
-			{
-				return _content;
-			}
-
-			set
-			{
-				if (value == Content)
-				{
-					return;
-				}
-
-				// Remove existing
-				if (_content != null)
-				{
-					InternalChild.Widgets.Remove(_content);
-				}
-
-				if (value != null)
-				{
-					InternalChild.Widgets.Insert(1, value);
-				}
-
-				_content = value;
-			}
-		}
-
-		[Browsable(false)]
-		[XmlIgnore]
-		public bool Result
-		{
-			get; set;
-		}
-
-		[DefaultValue(HorizontalAlignment.Left)]
-		public override HorizontalAlignment HorizontalAlignment
-		{
-			get
-			{
-				return base.HorizontalAlignment;
-			}
-			set
-			{
-				base.HorizontalAlignment = value;
-			}
-		}
-
-		[DefaultValue(VerticalAlignment.Top)]
-		public override VerticalAlignment VerticalAlignment
-		{
-			get
-			{
-				return base.VerticalAlignment;
-			}
-			set
-			{
-				base.VerticalAlignment = value;
-			}
-		}
-
-		private bool IsWindowPlaced
-		{
-			get; set;
-		}
-
-		public override bool IsPlaced
-		{
-			get
-			{
-				return base.IsPlaced;
-			}
-
-			internal set
-			{
-				if (IsPlaced)
-				{
-					if (Parent != null)
-					{
-						Parent.TouchMoved -= DesktopOnTouchMoved;
-						Parent.TouchUp -= DesktopTouchUp;
-					}
-					else
-					{
-						Desktop.TouchMoved -= DesktopOnTouchMoved;
-						Desktop.TouchUp -= DesktopTouchUp;
-					}
-				}
-
-				base.IsPlaced = value;
-
-				if (IsPlaced)
-				{
-					if (Parent != null)
-					{
-						Parent.TouchMoved += DesktopOnTouchMoved;
-						Parent.TouchUp += DesktopTouchUp;
-					}
-					else
-					{
-						Desktop.TouchMoved += DesktopOnTouchMoved;
-						Desktop.TouchUp += DesktopTouchUp;
-					}
-				}
-			}
-		}
-
-		public event EventHandler<WindowClosingEventArgs> Closing;
-		public event EventHandler Closed;
-
-		public Window(string styleName = Stylesheet.DefaultStyleName)
-		{
-			IsModal = true;
-
-			InternalChild = new VerticalStackPanel();
-
-			Result = false;
-			HorizontalAlignment = HorizontalAlignment.Left;
-			VerticalAlignment = VerticalAlignment.Top;
-
-			InternalChild.Spacing = 8;
-
-			InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));
-			InternalChild.Proportions.Add(new Proportion(ProportionType.Fill));
-
-			TitleGrid = new Grid
-			{
-				ColumnSpacing = 8
-			};
-
-			TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Fill));
-			TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Auto));
-
-			_titleLabel = new Label();
-			TitleGrid.Widgets.Add(_titleLabel);
-
-			CloseButton = new ImageButton
-			{
-				GridColumn = 1
-			};
-
-			CloseButton.Click += (sender, args) =>
-			{
-				Close();
-			};
-
-			TitleGrid.Widgets.Add(CloseButton);
-
-			InternalChild.Widgets.Add(TitleGrid);
-
-			SetStyle(styleName);
-		}
-
-		public override void UpdateLayout()
-		{
-			base.UpdateLayout();
-
-			if (!IsWindowPlaced)
-			{
-				CenterOnDesktop();
-				IsWindowPlaced = true;
-			}
-		}
-
-		public void CenterOnDesktop()
-		{
-			var size = Bounds.Size();
-			Left = (ContainerBounds.Width - size.X) / 2;
-			Top = (ContainerBounds.Height - size.Y) / 2;
-		}
-
-		private void DesktopOnTouchMoved(object sender, EventArgs args)
-		{
-			if (_startPos == null)
-			{
-				return;
-			}
-
-			var position = new Point(Desktop.TouchPosition.X - _startPos.Value.X,
-				Desktop.TouchPosition.Y - _startPos.Value.Y);
-
-			if (position.X < 0)
-			{
-				position.X = 0;
-			}
-
-			if (Parent != null)
-			{
-				if (position.X + Bounds.Width > Parent.Bounds.Right)
-				{
-					position.X = Parent.Bounds.Right - Bounds.Width;
-				}
-			}
-			else
-			{
-				if (position.X + Bounds.Width > Desktop.InternalBounds.Right)
-				{
-					position.X = Desktop.InternalBounds.Right - Bounds.Width;
-				}
-			}
-
-			if (position.Y < 0)
-			{
-				position.Y = 0;
-			}
-
-			if (Parent != null)
-			{
-				if (position.Y + Bounds.Height > Parent.Bounds.Bottom)
-				{
-					position.Y = Parent.Bounds.Bottom - Bounds.Height;
-				}
-			}
-			else
-			{
-				if (position.Y + Bounds.Height > Desktop.InternalBounds.Bottom)
-				{
-					position.Y = Desktop.InternalBounds.Bottom - Bounds.Height;
-				}
-			}
-
-			Left = position.X;
-			Top = position.Y;
-		}
-
-		private void DesktopTouchUp(object sender, EventArgs args)
-		{
-			_startPos = null;
-		}
-
-		private void UpdateActiveWindow()
-		{
-			var widgets = Desktop.ChildrenCopy;
-			var lastWidget = widgets[widgets.Count - 1];
-			if (lastWidget != this)
-			{
-				// Make active window top
-				var activeIndex = widgets.IndexOf(this);
-				var lastIndex = widgets.IndexOf(lastWidget);
-
-				for (var i = activeIndex; i < lastIndex; ++i)
-				{
-					widgets[i] = widgets[i + 1];
-				}
-
-				widgets[lastIndex] = this;
-			}
-		}
-
-		public override void OnTouchUp()
-		{
-			base.OnTouchUp();
-
-			_startPos = null;
-		}
-
-		public override void OnTouchDown()
-		{
-			UpdateActiveWindow();
-
-			base.OnTouchDown();
-
-			var x = Bounds.X;
-			var y = Bounds.Y;
-			var bounds = new Rectangle(x, y,
-				TitleGrid.Bounds.Right - x,
-				TitleGrid.Bounds.Bottom - y);
-			var touchPos = Desktop.TouchPosition;
-
-			if (CloseButton.Visible && CloseButton.Bounds.Contains(touchPos))
-			{
-				return;
-			}
-
-			if (bounds.Contains(touchPos))
-			{
-				_startPos = new Point(touchPos.X - ActualBounds.Location.X,
-					touchPos.Y - ActualBounds.Location.Y);
-			}
-		}
-
-		public override void OnKeyDown(Keys k)
-		{
-			base.OnKeyDown(k);
-
-			switch (k)
-			{
-				case Keys.Escape:
-					if (CloseButton.Visible)
-					{
-						Close();
-					}
-					break;
-			}
-		}
-
-		public void ApplyWindowStyle(WindowStyle style)
-		{
-			ApplyWidgetStyle(style);
-
-			if (style.TitleStyle != null)
-			{
-				_titleLabel.ApplyLabelStyle(style.TitleStyle);
-			}
-
-			if (style.CloseButtonStyle != null)
-			{
-				CloseButton.ApplyImageButtonStyle(style.CloseButtonStyle);
-			}
-		}
-
-		private void InternalShow(Point? position = null)
-		{
-			Desktop.Widgets.Add(this);
-
-			// Force mouse wheel focused to be set to the first appropriate widget in the next Desktop.UpdateLayout
-			Desktop.FocusedMouseWheelWidget = null;
-
-			if (position != null)
-			{
-				Left = position.Value.X;
-				Top = position.Value.Y;
-				IsWindowPlaced = true;
-			}
-		}
-
-		public void Show(Point? position = null)
-		{
-			IsModal = false;
-			InternalShow(position);
-		}
-
-		public void ShowModal(Point? position = null)
-		{
-			IsModal = true;
-			_previousMouseWheelFocus = Desktop.FocusedMouseWheelWidget;
-
-			InternalShow(position);
-		}
-
-		public virtual void Close()
-		{
-			var ev = Closing;
-			if (ev != null)
-			{
-				var args = new WindowClosingEventArgs();
-				ev(this, args);
-				if (args.Cancel)
-				{
-					return;
-				}
-			}
-
-			if (Desktop.FocusedKeyboardWidget == this)
-			{
-				Desktop.FocusedKeyboardWidget = null;
-			}
-
-			if (Desktop.Widgets.Contains(this))
-			{
-				Desktop.Widgets.Remove(this);
-				Desktop.FocusedMouseWheelWidget = _previousMouseWheelFocus;
-			}
-			else
-			{
-				//todo fix remove error. DONE
-				Parent.RemoveChild(this);
-			}
-
-			Closed.Invoke(this);
-		}
-
-		protected override void InternalSetStyle(Stylesheet stylesheet, string name)
-		{
-			ApplyWindowStyle(stylesheet.WindowStyles[name]);
-		}
-	}
+    public class WindowClosingEventArgs : EventArgs
+    {
+        public bool Cancel { get; set; }
+
+        public WindowClosingEventArgs()
+        {
+        }
+    }
+
+    public class Window : SingleItemContainer<VerticalStackPanel>, IContent
+    {
+        private Point? _startPos;
+        private readonly Label _titleLabel;
+        private Widget _content;
+        private Widget _previousMouseWheelFocus;
+        private bool _isMovable = true;
+
+        [Category("Appearance")]
+        public string Title
+        {
+            get
+            {
+                return _titleLabel.Text;
+            }
+
+            set
+            {
+                _titleLabel.Text = value;
+            }
+        }
+
+        [Category("Appearance")]
+        [StylePropertyPath("TitleStyle/TextColor")]
+        public Color TitleTextColor
+        {
+            get
+            {
+                return _titleLabel.TextColor;
+            }
+            set
+            {
+                _titleLabel.TextColor = value;
+            }
+        }
+
+        [Category("Appearance")]
+        public SpriteFont TitleFont
+        {
+            get
+            {
+                return _titleLabel.Font;
+            }
+            set
+            {
+                _titleLabel.Font = value;
+            }
+        }
+
+        [Category("Appearance")]
+        [DefaultValue(true)]
+        public bool IsMovable { get => _isMovable; set => _isMovable = value; }
+
+        [Browsable(false)]
+        [XmlIgnore]
+        public Grid TitleGrid { get; private set; }
+
+        [Browsable(false)]
+        [XmlIgnore]
+        public ImageButton CloseButton { get; private set; }
+
+        [Browsable(false)]
+        [Content]
+        public Widget Content
+        {
+            get
+            {
+                return _content;
+            }
+
+            set
+            {
+                if (value == Content)
+                {
+                    return;
+                }
+
+                // Remove existing
+                if (_content != null)
+                {
+                    InternalChild.Widgets.Remove(_content);
+                }
+
+                if (value != null)
+                {
+                    InternalChild.Widgets.Insert(1, value);
+                }
+
+                _content = value;
+            }
+        }
+
+        [Browsable(false)]
+        [XmlIgnore]
+        public bool Result
+        {
+            get; set;
+        }
+
+        [DefaultValue(HorizontalAlignment.Left)]
+        public override HorizontalAlignment HorizontalAlignment
+        {
+            get
+            {
+                return base.HorizontalAlignment;
+            }
+            set
+            {
+                base.HorizontalAlignment = value;
+            }
+        }
+
+        [DefaultValue(VerticalAlignment.Top)]
+        public override VerticalAlignment VerticalAlignment
+        {
+            get
+            {
+                return base.VerticalAlignment;
+            }
+            set
+            {
+                base.VerticalAlignment = value;
+            }
+        }
+
+        private bool IsWindowPlaced
+        {
+            get; set;
+        }
+
+        public override bool IsPlaced
+        {
+            get
+            {
+                return base.IsPlaced;
+            }
+
+            internal set
+            {
+                if (IsPlaced)
+                {
+                    if (Parent != null)
+                    {
+                        Parent.TouchMoved -= DesktopOnTouchMoved;
+                        Parent.TouchUp -= DesktopTouchUp;
+                    }
+                    else
+                    {
+                        Desktop.TouchMoved -= DesktopOnTouchMoved;
+                        Desktop.TouchUp -= DesktopTouchUp;
+                    }
+                }
+
+                base.IsPlaced = value;
+
+                if (IsPlaced)
+                {
+                    if (Parent != null)
+                    {
+                        Parent.TouchMoved += DesktopOnTouchMoved;
+                        Parent.TouchUp += DesktopTouchUp;
+                    }
+                    else
+                    {
+                        Desktop.TouchMoved += DesktopOnTouchMoved;
+                        Desktop.TouchUp += DesktopTouchUp;
+                    }
+                }
+            }
+        }
+
+        public event EventHandler<WindowClosingEventArgs> Closing;
+        public event EventHandler Closed;
+
+        public Window(string styleName = Stylesheet.DefaultStyleName)
+        {
+            IsModal = true;
+
+            InternalChild = new VerticalStackPanel();
+
+            Result = false;
+            HorizontalAlignment = HorizontalAlignment.Left;
+            VerticalAlignment = VerticalAlignment.Top;
+
+            InternalChild.Spacing = 8;
+
+            InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));
+            InternalChild.Proportions.Add(new Proportion(ProportionType.Fill));
+
+            TitleGrid = new Grid
+            {
+                ColumnSpacing = 8
+            };
+
+            TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Fill));
+            TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Auto));
+
+            _titleLabel = new Label();
+            TitleGrid.Widgets.Add(_titleLabel);
+
+            CloseButton = new ImageButton
+            {
+                GridColumn = 1
+            };
+
+            CloseButton.Click += (sender, args) =>
+            {
+                Close();
+            };
+
+            TitleGrid.Widgets.Add(CloseButton);
+
+            InternalChild.Widgets.Add(TitleGrid);
+
+            SetStyle(styleName);
+        }
+
+        public override void UpdateLayout()
+        {
+            base.UpdateLayout();
+
+            if (!IsWindowPlaced)
+            {
+                CenterOnDesktop();
+                IsWindowPlaced = true;
+            }
+        }
+
+        public void CenterOnDesktop()
+        {
+            var size = Bounds.Size();
+            Left = (ContainerBounds.Width - size.X) / 2;
+            Top = (ContainerBounds.Height - size.Y) / 2;
+        }
+
+        private void DesktopOnTouchMoved(object sender, EventArgs args)
+        {
+            if (_startPos == null || !IsMovable)
+            {
+                return;
+            }
+
+            var position = new Point(Desktop.TouchPosition.X - _startPos.Value.X,
+                Desktop.TouchPosition.Y - _startPos.Value.Y);
+
+            if (position.X < 0)
+            {
+                position.X = 0;
+            }
+
+            if (Parent != null)
+            {
+                if (position.X + Bounds.Width > Parent.Bounds.Right)
+                {
+                    position.X = Parent.Bounds.Right - Bounds.Width;
+                }
+            }
+            else
+            {
+                if (position.X + Bounds.Width > Desktop.InternalBounds.Right)
+                {
+                    position.X = Desktop.InternalBounds.Right - Bounds.Width;
+                }
+            }
+
+            if (position.Y < 0)
+            {
+                position.Y = 0;
+            }
+
+            if (Parent != null)
+            {
+                if (position.Y + Bounds.Height > Parent.Bounds.Bottom)
+                {
+                    position.Y = Parent.Bounds.Bottom - Bounds.Height;
+                }
+            }
+            else
+            {
+                if (position.Y + Bounds.Height > Desktop.InternalBounds.Bottom)
+                {
+                    position.Y = Desktop.InternalBounds.Bottom - Bounds.Height;
+                }
+            }
+
+            Left = position.X;
+            Top = position.Y;
+        }
+
+        private void DesktopTouchUp(object sender, EventArgs args)
+        {
+            _startPos = null;
+        }
+
+        private void UpdateActiveWindow()
+        {
+            var widgets = Desktop.ChildrenCopy;
+            var lastWidget = widgets[widgets.Count - 1];
+            if (lastWidget != this)
+            {
+                // Make active window top
+                var activeIndex = widgets.IndexOf(this);
+                var lastIndex = widgets.IndexOf(lastWidget);
+
+                for (var i = activeIndex; i < lastIndex; ++i)
+                {
+                    widgets[i] = widgets[i + 1];
+                }
+
+                widgets[lastIndex] = this;
+            }
+        }
+
+        public override void OnTouchUp()
+        {
+            base.OnTouchUp();
+
+            _startPos = null;
+        }
+
+        public override void OnTouchDown()
+        {
+            UpdateActiveWindow();
+
+            base.OnTouchDown();
+
+            var x = Bounds.X;
+            var y = Bounds.Y;
+            var bounds = new Rectangle(x, y,
+                TitleGrid.Bounds.Right - x,
+                TitleGrid.Bounds.Bottom - y);
+            var touchPos = Desktop.TouchPosition;
+
+            if (CloseButton.Visible && CloseButton.Bounds.Contains(touchPos))
+            {
+                return;
+            }
+
+            if (bounds.Contains(touchPos))
+            {
+                _startPos = new Point(touchPos.X - ActualBounds.Location.X,
+                    touchPos.Y - ActualBounds.Location.Y);
+            }
+        }
+
+        public override void OnKeyDown(Keys k)
+        {
+            base.OnKeyDown(k);
+
+            switch (k)
+            {
+                case Keys.Escape:
+                    if (CloseButton.Visible)
+                    {
+                        Close();
+                    }
+                    break;
+            }
+        }
+
+        public void ApplyWindowStyle(WindowStyle style)
+        {
+            ApplyWidgetStyle(style);
+
+            if (style.TitleStyle != null)
+            {
+                _titleLabel.ApplyLabelStyle(style.TitleStyle);
+            }
+
+            if (style.CloseButtonStyle != null)
+            {
+                CloseButton.ApplyImageButtonStyle(style.CloseButtonStyle);
+            }
+        }
+
+        private void InternalShow(Point? position = null)
+        {
+            Desktop.Widgets.Add(this);
+
+            // Force mouse wheel focused to be set to the first appropriate widget in the next Desktop.UpdateLayout
+            Desktop.FocusedMouseWheelWidget = null;
+
+            if (position != null)
+            {
+                Left = position.Value.X;
+                Top = position.Value.Y;
+                IsWindowPlaced = true;
+            }
+        }
+
+        public void Show(Point? position = null)
+        {
+            IsModal = false;
+            InternalShow(position);
+        }
+
+        public void ShowModal(Point? position = null)
+        {
+            IsModal = true;
+            _previousMouseWheelFocus = Desktop.FocusedMouseWheelWidget;
+
+            InternalShow(position);
+        }
+
+        public virtual void Close()
+        {
+            var ev = Closing;
+            if (ev != null)
+            {
+                var args = new WindowClosingEventArgs();
+                ev(this, args);
+                if (args.Cancel)
+                {
+                    return;
+                }
+            }
+
+            if (Desktop.FocusedKeyboardWidget == this)
+            {
+                Desktop.FocusedKeyboardWidget = null;
+            }
+
+            if (Desktop.Widgets.Contains(this))
+            {
+                Desktop.Widgets.Remove(this);
+                Desktop.FocusedMouseWheelWidget = _previousMouseWheelFocus;
+            }
+            else
+            {
+                //todo fix remove error. DONE
+                Parent.RemoveChild(this);
+            }
+
+            Closed.Invoke(this);
+        }
+
+        protected override void InternalSetStyle(Stylesheet stylesheet, string name)
+        {
+            ApplyWindowStyle(stylesheet.WindowStyles[name]);
+        }
+    }
 }


Fix XamarinForms StyleService

Fix XamarinForms StyleService

--- XamlCSS.XamarinForms/StyleService.cs
+++ XamlCSS.XamarinForms/StyleService.cs
@@ -54,14 +54,14 @@
                 nativeTrigger.Property = bindableProperty;
                 nativeTrigger.Value = dependencyService.GetBindablePropertyValue(targetType, nativeTrigger.Property, propertyTrigger.Value);

-                foreach (var i in propertyTrigger.StyleDeclaraionBlock)
+                foreach (var styleDeclaration in propertyTrigger.StyleDeclaraionBlock)
                 {
-                    var property = dependencyService.GetBindableProperty(targetType, i.Property);
+                    var property = typeNameResolver.GetDependencyProperty(styleSheet.Namespaces, targetType, styleDeclaration.Property);
                     if (property == null)
                     {
                         continue;
                     }
-                    var value = dependencyService.GetBindablePropertyValue(targetType, property, i.Value);
+                    var value = typeNameResolver.GetPropertyValue(targetType, null, styleDeclaration.Value, property);

                     nativeTrigger.Setters.Add(new Setter { Property = property, Value = value });
                 }
@@ -80,14 +80,14 @@

                 nativeTrigger.Value = GetBasicValue(dataTrigger);

-                foreach (var i in dataTrigger.StyleDeclarationBlock)
+                foreach (var styleDeclaration in dataTrigger.StyleDeclarationBlock)
                 {
-                    var property = dependencyService.GetBindableProperty(targetType, i.Property);
+                    var property = typeNameResolver.GetDependencyProperty(styleSheet.Namespaces, targetType, styleDeclaration.Property);
                     if (property == null)
                     {
                         continue;
                     }
-                    var value = dependencyService.GetBindablePropertyValue(targetType, property, i.Value);
+                    var value = typeNameResolver.GetPropertyValue(targetType, null, styleDeclaration.Value, property);

                     nativeTrigger.Setters.Add(new Setter { Property = property, Value = value });
                 }


[Xwt] Remember to set `IsReallocating` to false...

--- Xwt.Gtk/Xwt.GtkBackend/BoxBackend.cs
+++ Xwt.Gtk/Xwt.GtkBackend/BoxBackend.cs
@@ -142,7 +142,7 @@
 			try {
 				IsReallocating = true;
 				OnReallocate ();
-			} catch {
+			} finally {
 				IsReallocating = false;
 			}
 			foreach (var cr in children.ToArray()) {


Quoted workingDir to handle paths with spaces

#187

--- src/NetSparkle/SparkleUpdater.cs
+++ src/NetSparkle/SparkleUpdater.cs
@@ -1319,7 +1319,7 @@
                     if (RelaunchAfterUpdate)
                     {
                         relaunchAfterUpdate = $@"
-                        cd {workingDir}
+                        cd ""{workingDir}""
                         {executableName}";
                     }


finfo::file() 1st argument mandatory

finfo::file() 1st argument mandatory

--- src/Peachpie.Library/FileInfo.cs
+++ src/Peachpie.Library/FileInfo.cs
@@ -77,7 +77,17 @@
         /// Detect MIME Content-type for a file.
         /// </summary>
         [return: CastToFalse]
-        public static string mime_content_type(Context ctx, string filename) => string.IsNullOrEmpty(filename) ? null : new finfo(ctx).file(filename);
+        public static string mime_content_type(Context ctx, string filename)
+        {
+            if (string.IsNullOrEmpty(filename))
+            {
+                PhpException.ArgumentNull(nameof(filename));
+                return null; // FALSE
+            }
+
+            //
+            return new finfo(ctx).file(filename);
+        }
     }

     /// <summary>
@@ -399,7 +409,7 @@
         }

         [return: CastToFalse]
-        public virtual string file(string file_name = null, int options = PhpFileInfo.FILEINFO_NONE, PhpResource context = null)
+        public virtual string file(string file_name, int options = PhpFileInfo.FILEINFO_NONE, PhpResource context = null)
         {
             byte[] bytes;


Fixed issue https://github.com/Perspex/Perspex/issues/169

--- src/Perspex.Layout/Layoutable.cs
+++ src/Perspex.Layout/Layoutable.cs
@@ -549,6 +549,7 @@
                 switch (HorizontalAlignment)
                 {
                     case HorizontalAlignment.Center:
+                    case HorizontalAlignment.Stretch:
                         originX += (sizeMinusMargins.Width - size.Width) / 2;
                         break;
                     case HorizontalAlignment.Right:
@@ -559,6 +560,7 @@
                 switch (VerticalAlignment)
                 {
                     case VerticalAlignment.Center:
+                    case VerticalAlignment.Stretch:
                         originY += (sizeMinusMargins.Height - size.Height) / 2;
                         break;
                     case VerticalAlignment.Bottom:


Duplicate explicit property implementation removed (what's reason for it to exist?)

--- src/RecurrentTasks/TaskRunner.cs
+++ src/RecurrentTasks/TaskRunner.cs
@@ -39,12 +39,7 @@
         /// <inheritdoc />
         public event EventHandler<ServiceProviderEventArgs> AfterRunSuccess;

-        TaskRunStatus ITask.RunStatus
-        {
-            get { return RunStatus; }
-        }
-
-        /// <inheritdoc cref="ITask.RunStatus" />
+        /// <inheritdoc />
         public TaskRunStatus RunStatus { get; protected set; }

         /// <inheritdoc />


Found another Shouldly exception type that might show up in the call stack

--- tests/FixieSpec.Tests/SelfTestConvention.cs
+++ tests/FixieSpec.Tests/SelfTestConvention.cs
@@ -26,7 +26,8 @@
                 .Add<InputAttributeParameterSource>();

             HideExceptionDetails
-                        .For<ShouldAssertException>();
+                        .For<ShouldAssertException>()
+                        .For<ShouldCompleteInException>();
         }
     }
 }


test(text): remove superfluous test content

--- tests/Yaapii.Atoms.Tests/Text/SyncedTest.cs
+++ tests/Yaapii.Atoms.Tests/Text/SyncedTest.cs
@@ -44,13 +44,6 @@
             Assert.Equal(
                 max, check
             );
-
-
-            Assert.True(
-                new Lower(
-                    new LiveText("HelLo!")
-                ).AsString() == "hello!"
-            );
         }
     }
 }


fixed NullReferenceException for protected properties (#104)

* - fixed NullReferenceException for protected properties

* - replaced tabs with whitespace

--- Assets/FullSerializer/Source/Reflection/fsMetaType.cs
+++ Assets/FullSerializer/Source/Reflection/fsMetaType.cs
@@ -157,8 +157,8 @@

             // Depending on the configuration options, check whether the property is automatic
             // and if it has a public setter to determine whether it should be serialized
-            if ((config.SerializeNonAutoProperties || IsAutoProperty(property, members)) &&
-                (publicGetMethod != null && (config.SerializeNonPublicSetProperties || publicSetMethod != null))) {
+            if ((publicGetMethod != null && (config.SerializeNonPublicSetProperties || publicSetMethod != null)) &&
+                (config.SerializeNonAutoProperties || IsAutoProperty(property, members))) {
                 return true;
             }


Update UnityProjectInfo to avoid the build break

--- Assets/MRTK/Tools/MSBuild/Scripts/UnityProjectInfo.cs
+++ Assets/MRTK/Tools/MSBuild/Scripts/UnityProjectInfo.cs
@@ -23,7 +23,17 @@
         /// </summary>
         private static readonly HashSet<string> ExcludedPackageReferences = new HashSet<string>()
         {
-            "Windows.UI.Input.Spatial"
+            "Windows.UI.Input.Spatial",
+        };
+
+        /// <summary>
+        /// Any packages that take a direct dependency on any of these packages will not be included
+        /// in the final output
+        /// </summary>
+        private static readonly HashSet<string> ExcludedReferenceChains = new HashSet<string>()
+        {
+            "Oculus.VR",
+            "Oculus.VR.Editor",
         };

         /// <summary>
@@ -170,6 +180,12 @@

             foreach (string reference in toReturn.AssemblyDefinitionInfo.References)
             {
+                if (ExcludedReferenceChains.Contains(reference))
+                {
+                    Debug.LogWarning($"Ignoring {reference} for {toReturn.Name}, as it's marked as having an excluded dependency chain.");
+                    projectsMap.Remove(projectKey);
+                    return null;
+                }
                 if (ExcludedPackageReferences.Contains(reference))
                 {
                     Debug.LogWarning($"Skipping processing {reference} for {toReturn.Name}, as it's marked as excluded.");


Added navigation link to Moderation menu

--- BoardGames/BoardGames.Web/Views/Shared/_Layout.cshtml
+++ BoardGames/BoardGames.Web/Views/Shared/_Layout.cshtml
@@ -40,9 +40,9 @@

@Html.ActionLink("Admin", "Index", "User", new { area = "Administration" }, null)

                     }

-                    @*@if (User.IsInRole("Moderator")) {
-
@Html.ActionLink("Admin", "Index", "User", new { area = "Administration" }, null)

-                    }*@
+                    @if (User.IsInRole("Moderator")) {
+
@Html.ActionLink("Moderator", "Index", "RoomModeration", new { area = "Moderation" }, null)

+                    }

                 @Html.Partial("_LoginPartial")


Solution 001: Tightened limit on loop.

Solution 001: Tightened limit on loop.

--- CSharp/CSharp/Problems_001-050/P001-Multiples3and3.cs
+++ CSharp/CSharp/Problems_001-050/P001-Multiples3and3.cs
@@ -10,7 +10,7 @@
         int Total(int range)
         {
             var total = 0;
-            while (--range > 0)
+            while (--range > 2)
             {
                 if ((range % 3) == 0 || (range % 5) == 0)
                 {


Cache hash code of value objects

Cache hash code of value objects

--- CSharpFunctionalExtensions/ValueObject/ValueObject.cs
+++ CSharpFunctionalExtensions/ValueObject/ValueObject.cs
@@ -12,6 +12,8 @@
     public abstract class ValueObject<T>
         where T : ValueObject<T>
     {
+        private int? _cachedHashCode;
+
         public override bool Equals(object obj)
         {
             var valueObject = obj as T;
@@ -29,7 +31,12 @@

         public override int GetHashCode()
         {
-            return GetHashCodeCore();
+            if (!_cachedHashCode.HasValue)
+            {
+                _cachedHashCode = GetHashCodeCore();
+            }
+
+            return _cachedHashCode.Value;
         }

         protected abstract int GetHashCodeCore();
@@ -54,6 +61,8 @@
     [Serializable]
     public abstract class ValueObject
     {
+        private int? _cachedHashCode;
+
         protected abstract IEnumerable<object> GetEqualityComponents();

         public override bool Equals(object obj)
@@ -71,14 +80,19 @@

         public override int GetHashCode()
         {
-            return GetEqualityComponents()
-                .Aggregate(1, (current, obj) =>
-                {
-                    unchecked
+            if (!_cachedHashCode.HasValue)
+            {
+                _cachedHashCode = GetEqualityComponents()
+                    .Aggregate(1, (current, obj) =>
                     {
-                        return (current * 23) + (obj?.GetHashCode() ?? 0);
-                    }
-                });
+                        unchecked
+                        {
+                            return (current * 23) + (obj?.GetHashCode() ?? 0);
+                        }
+                    });
+            }
+
+            return _cachedHashCode.Value;
         }

         public static bool operator ==(ValueObject a, ValueObject b)


Fixing the broken ArgumentNullException.

--- eFormCore/Core.cs
+++ eFormCore/Core.cs
@@ -607,7 +607,7 @@
                 if (Running())
                 {
                     if (mainElement == null)
-                        throw new ArgumentNullException("mainElement", "mainElement not allowed to be null");
+                        throw new ArgumentNullException(nameof(mainElement), "mainElement not allowed to be null");

                     List<string> errorLst = new List<string>();
@@ -713,7 +713,7 @@
         public MainElement TemplateUploadData(MainElement mainElement)
         {
             if (mainElement == null)
-                throw new ArgumentNullException("mainElement not allowed to be null");
+                throw new ArgumentNullException(nameof(mainElement), "mainElement not allowed to be null");

             string methodName = t.GetMethodName("Core");
             try
@@ -792,7 +792,7 @@
         public int TemplateCreate(MainElement mainElement)
         {
             if (mainElement == null)
-                throw new ArgumentNullException("mainElement not allowed to be null");
+                throw new ArgumentNullException(nameof(mainElement), "mainElement not allowed to be null");

             string methodName = t.GetMethodName("Core");
             try


Add rich text to system field types

Add rich text to system field types

--- Contentful.Core/Models/Management/SystemFieldTypes.cs
+++ Contentful.Core/Models/Management/SystemFieldTypes.cs
@@ -59,5 +59,10 @@
         /// </summary>
         public const string Object = "Object";

+        /// <summary>
+        /// An rich text document.
+        /// </summary>
+        public const string RichText = "RichText";
+
     }
 }


Hidden IsAlive and Value

Hidden IsAlive and Value

- IsAlive is always flase
- Value always throws an exception

--- Core/Theraot/Threading/Needles/EmptyReadOnlyNeedle.cs
+++ Core/Theraot/Threading/Needles/EmptyReadOnlyNeedle.cs
@@ -17,7 +17,7 @@
             }
         }

-        public bool IsAlive
+        bool IReadOnlyNeedle<T>.IsAlive
         {
             get
             {
@@ -25,7 +25,7 @@
             }
         }

-        public T Value
+        T IReadOnlyNeedle<T>.Value
         {
             get
             {


updated links

updated links

--- DataAnnotationsExtensions.Web/Views/Home/Index.cshtml
+++ DataAnnotationsExtensions.Web/Views/Home/Index.cshtml
@@ -7,5 +7,8 @@
     This site is a work in progress.

-    To learn more about DataAnnotationsExtensions visit the project site.
+    To learn more about DataAnnotationsExtensions please look at the demos, source code or wiki.
+

+

+    The GitHub project repository can be found here.


Switched to more appropriate Dictionary on a string/object impl.

--- DotJEM.Web.Host/Providers/Pipeline/PipelineContext.cs
+++ DotJEM.Web.Host/Providers/Pipeline/PipelineContext.cs
@@ -9,19 +9,19 @@
 {
     public class PipelineContext
     {
-        private readonly Hashtable inner = new Hashtable();
+        private readonly IDictionary<string, object> inner = new Dictionary<string, object>();

-        public void Add(object key, object value)
+        public void Add(string key, object value)
         {
             inner.Add(key, value);
         }

-        public object this[object key]
+        public object this[string key]
         {
             get { return inner[key]; }
             set { inner[key] = value; }
         }

-        public ICollection Keys => inner.Keys;
+        public ICollection<string> Keys => inner.Keys;
     }
 }


Schedules needs to be Equals when they have the same name, group, start and end. otherwise, do not merge them.

--- Ets.Mobile/Ets.Mobile.Entities/Signets/SchedulesVm.cs
+++ Ets.Mobile/Ets.Mobile.Entities/Signets/SchedulesVm.cs
@@ -15,7 +15,10 @@

         public bool Equals(ScheduleVm x, ScheduleVm y)
         {
-            return x.Name == y.Name;
+            return x.Name == y.Name
+                && x.StartDate == y.StartDate
+                && x.EndDate == y.EndDate
+                && x.CourseAndGroup == y.CourseAndGroup;
         }

         public int GetHashCode(ScheduleVm obj)


Revert "Fixed race condition in ObservableSelect."

This reverts commit 50cd3d080376d1795dbe8633774be8a96be436b7.

--- Expressions/Expressions.Linq/Linq/ObservableSelect.cs
+++ Expressions/Expressions.Linq/Linq/ObservableSelect.cs
@@ -141,9 +141,6 @@
                 }
             }

-            if (added.Count == 0 && removed.Count == 0 && replaceAdded.Count == 0 && replaceRemoved.Count == 0)
-                return UnchangedNotificationResult.Instance;
-
             OnRemoveItems(removed);
             OnAddItems(added);
             OnReplaceItems(replaceRemoved, replaceAdded);
@@ -156,17 +153,14 @@
             {
                 if (item != null)
                 {
-                    TaggedObservableValue<TResult, int> lambdaResult;
-                    if (lambdaInstances.TryGetValue(item, out lambdaResult))
+                    var lambdaResult = lambdaInstances[item];
+                    lambdaResult.Tag--;
+                    if (lambdaResult.Tag == 0)
                     {
-                        lambdaResult.Tag--;
-                        if (lambdaResult.Tag == 0)
-                        {
-                            lambdaInstances.Remove(item);
-                            lambdaResult.Successors.Unset(this);
-                        }
-                        removed.Add(lambdaResult.Value);
+                        lambdaInstances.Remove(item);
+                        lambdaResult.Successors.Unset(this);
                     }
+                    removed.Add(lambdaResult.Value);
                 }
                 else if (nullLambda != null)
                 {


Improved performance of ExecutionContext.

--- Expressions/Expressions/Execution/ExecutionContext.cs
+++ Expressions/Expressions/Execution/ExecutionContext.cs
@@ -14,7 +14,7 @@
         private static readonly ExecutionContext instance = new ExecutionContext();
         public static ExecutionContext Instance => instance;

-        private readonly Dictionary<INotifyCollectionChanged, CollectionChangeTracker> collectionChanges = new Dictionary<INotifyCollectionChanged, CollectionChangeTracker>();
+        private readonly List<CollectionChangeTracker> collectionChanges = new List<CollectionChangeTracker>();
         private readonly Dictionary<INotifyPropertyChanged, HashSet<string>> propertyChanges = new Dictionary<INotifyPropertyChanged, HashSet<string>>();

         private readonly Dictionary<INotifyCollectionChanged, Collection<INotifiable>> collectionSubscribers = new Dictionary<INotifyCollectionChanged, Collection<INotifiable>>();
@@ -36,13 +36,16 @@
             }
             propertyChanges.Clear();

-            foreach (var kvp in collectionChanges)
-            {
-                var result = kvp.Value.GetResult();
-                foreach (var subscriber in collectionSubscribers[kvp.Key])
-                {
-                    results.Add(subscriber);
-                    subscriber.ExecutionMetaData.Sources.Add(result);
+            foreach (var tracker in collectionChanges)
+            {
+                if (tracker.HasChanges())
+                {
+                    var result = tracker.GetResult();
+                    foreach (var subscriber in collectionSubscribers[tracker.Collection])
+                    {
+                        results.Add(subscriber);
+                        subscriber.ExecutionMetaData.Sources.Add(result);
+                    }
                 }
             }
             collectionChanges.Clear();
@@ -131,7 +134,7 @@
             {
                 collection.CollectionChanged -= OnCollectionChanged;
                 collectionSubscribers.Remove(collection);
-                collectionChanges.Remove(collection);
+                collectionChanges.RemoveAll(t => t.Collection == collection);
             }
         }

@@ -144,11 +147,11 @@

         private void TrackCollectionChanges(INotifyCollectionChanged collection, NotifyCollectionChangedEventArgs args)
         {
-            CollectionChangeTracker tracker;
-            if (!collectionChanges.TryGetValue(collection, out tracker))
-            {
-                tracker = new CollectionChangeTracker();
-                collectionChanges[collection] = tracker;
+            var tracker = collectionChanges.Find(t => t.Collection == collection);
+            if (tracker == null)
+            {
+                tracker = new CollectionChangeTracker(collection);
+                collectionChanges.Add(tracker);
             }

             switch (args.Action)
@@ -177,77 +180,81 @@
         private class CollectionChangeTracker
         {
             private bool _isReset;
-            private readonly List<object> _addedItems = new List<object>();
-            private readonly List<object> _removedItems = new List<object>();
-            private readonly List<object> _movedItems = new List<object>();
-            private readonly List<object> _replaceAddedItems = new List<object>();
-            private readonly List<object> _replaceRemovedItems = new List<object>();
-
-            public CollectionChangeTracker()
-            {
-            }
-
-            public CollectionChangeTracker(bool isReset)
-            {
-                _isReset = isReset;
+            private List<object> _addedItems;
+            private List<object> _removedItems;
+            private List<object> _movedItems;
+            private List<object> _replaceAddedItems;
+            private List<object> _replaceRemovedItems;
+
+            public INotifyCollectionChanged Collection { get; private set; }
+
+            public CollectionChangeTracker(INotifyCollectionChanged collection)
+            {
+                Collection = collection;
             }

             public void TrackAddAction(IEnumerable addedItems)
             {
-                if (_isReset) return;
+                if (_isReset)
+                    return;
                 foreach (var item in addedItems)
                 {
-                    if (_removedItems.Contains(item))
-                        _removedItems.Remove(item);
-                    else if (_replaceRemovedItems.Contains(item))
-                        _replaceRemovedItems.Remove(item);
-                    else
+                    if ((!_removedItems?.Remove(item) ?? false) && (!_replaceRemovedItems?.Remove(item) ?? false))
+                    {
+                        if (_addedItems == null)
+                            _addedItems = new List<object>();
                         _addedItems.Add(item);
+                    }
                 }
             }

             public void TrackRemoveAction(IEnumerable removedItems)
             {
-                if (_isReset) return;
+                if (_isReset)
+                    return;
                 foreach (var item in removedItems)
                 {
-                    if (_addedItems.Contains(item))
-                        _addedItems.Remove(item);
-                    else if (_replaceAddedItems.Contains(item))
-                        _replaceAddedItems.Remove(item);
-                    else
+                    if ((!_addedItems?.Remove(item) ?? false) && (!_replaceAddedItems?.Remove(item) ?? false))
+                    {
+                        if (_removedItems == null)
+                            _removedItems = new List<object>();
                         _removedItems.Add(item);
+                    }
                 }
             }

             public void TrackMoveAction(IEnumerable movedItems)
             {
-                if (_isReset) return;
+                if (_isReset)
+                    return;
+                if (_movedItems == null)
+                    _movedItems = new List<object>();
                 foreach (var item in movedItems)
                     _movedItems.Add(item);
             }

             public void TrackReplaceAction(IEnumerable replacedItems, IEnumerable replacingItems)
             {
-                if (_isReset) return;
+                if (_isReset)
+                    return;
                 foreach (var item in replacingItems)
                 {
-                    if (_removedItems.Contains(item))
-                        _removedItems.Remove(item);
-                    else if (_replaceRemovedItems.Contains(item))
-                        _replaceRemovedItems.Remove(item);
-                    else
+                    if ((!_removedItems?.Remove(item) ?? false) && (!_replaceRemovedItems?.Remove(item) ?? false))
+                    {
+                        if (_replaceAddedItems == null)
+                            _replaceAddedItems = new List<object>();
                         _replaceAddedItems.Add(item);
+                    }
                 }

                 foreach (var item in replacedItems)
                 {
-                    if (_addedItems.Contains(item))
-                        _addedItems.Remove(item);
-                    else if (_replaceAddedItems.Contains(item))
-                        _replaceAddedItems.Remove(item);
-                    else
+                    if ((!_addedItems?.Remove(item) ?? false) && (!_replaceAddedItems?.Remove(item) ?? false))
+                    {
+                        if (_replaceRemovedItems == null)
+                            _replaceRemovedItems = new List<object>();
                         _replaceRemovedItems.Add(item);
+                    }
                 }
             }

@@ -276,11 +283,11 @@
             {
                 return
                     _isReset ||
-                    _addedItems.Count > 0 ||
-                    _removedItems.Count > 0 ||
-                    _movedItems.Count > 0 ||
-                    _replaceAddedItems.Count > 0 ||
-                    _replaceRemovedItems.Count > 0;
+                    _addedItems?.Count > 0 ||
+                    _removedItems?.Count > 0 ||
+                    _movedItems?.Count > 0 ||
+                    _replaceAddedItems?.Count > 0 ||
+                    _replaceRemovedItems?.Count > 0;
             }
         }


Fixed broken build

Fixed broken build

--- Framework/Akka.Net/Cqrs.Akka/Domain/AkkaRepository.cs
+++ Framework/Akka.Net/Cqrs.Akka/Domain/AkkaRepository.cs
@@ -8,9 +8,8 @@

 using System;
 using System.Collections.Generic;
-using System.Linq;
+using cdmdotnet.Logging;
 using Cqrs.Domain;
-using Cqrs.Domain.Exceptions;
 using Cqrs.Domain.Factories;
 using Cqrs.Events;

@@ -18,8 +17,8 @@
 {
 	public class AkkaRepository<TAuthenticationToken> : Repository<TAuthenticationToken>
 	{
-		public AkkaRepository(IAggregateFactory aggregateFactory, IEventStore<TAuthenticationToken> eventStore, IEventPublisher<TAuthenticationToken> publisher)
-			: base(aggregateFactory, eventStore, publisher)
+		public AkkaRepository(IAggregateFactory aggregateFactory, IEventStore<TAuthenticationToken> eventStore, IEventPublisher<TAuthenticationToken> publisher, ICorrelationIdHelper correlationIdHelper)
+			: base(aggregateFactory, eventStore, publisher, correlationIdHelper)
 		{
 		}


Added bonus animation.

Added bonus animation.

--- FrbDemoDuckHunt/FrbDemoDuckHunt/Screens/GameScreen.cs
+++ FrbDemoDuckHunt/FrbDemoDuckHunt/Screens/GameScreen.cs
@@ -194,7 +194,7 @@
                     {
                         DogInstance.ShortWalkingSniffingThenDiving(() => CurrentState = VariableState.StartDucks);
                     }
-                    GameInterfaceInstance.ShowDialog("ROUND \n" + _state.Round);
+                    GameInterfaceInstance.ShowDialog("ROUND \n\n" + _state.Round);

                     CurrentState = VariableState.Intro;
                     break;
@@ -349,14 +349,34 @@
                         GlobalContent.DuckHuntEndofRound.Play();
                         DuckInstance.Call(() =>
                         {
-                            CurrentState = VariableState.StartIntro;
-                            _state.Round++;
-                            _state.DuckFlight = 0;
-                            for (var i = 0; i < 10; i++)
+                            var waitTime = 0f;
+
+                            if (hits == 10)
                             {
-                                GameInterfaceInstance.SetDuckDisplay(i, GameInterface.DuckDisplayType.Missed);
+                                waitTime = 1.2f;
+                                GameInterfaceInstance.ShowDialog("PERFECT!! \n\n" + _state.GetBonus());
+                                _state.Score += _state.GetBonus();
+                                GlobalContent.PerfectScoreSoundEffect.Play();
+                                for (var i = 0; i < 10; i++)
+                                {
+                                    GameInterfaceInstance.SetDuckDisplay(i, GameInterface.DuckDisplayType.Hit);
+                                }
                             }
-                        }).After(5);
+
+                            DuckInstance.Call(() =>
+                                {
+                                    GameInterfaceInstance.HideDialog();
+                                    CurrentState = VariableState.StartIntro;
+                                    _state.Round++;
+                                    _state.DuckFlight = 0;
+                                    for (var i = 0; i < 10; i++)
+                                    {
+                                        GameInterfaceInstance.SetDuckDisplay(i, GameInterface.DuckDisplayType.Missed);
+                                    }
+                                }).After(waitTime);
+
+
+                        }).After(4.2);
                     }
                     else
                     {
@@ -365,8 +385,8 @@
                         DuckInstance.Call(() =>
                         {
                             GlobalContent.DuckHuntThemeSong.Play();
-                            DogInstance.EndGame(() => {
-                                //Go To Menu
+                            DogInstance.EndGame(() => {
+                                MoveToScreen(this.GetType());
                             });
                         }).After(2);
                     }


Implemented IsFilled

Implemented IsFilled

--- HashCodePractice2016/HashCodePractice2016/Solution.cs
+++ HashCodePractice2016/HashCodePractice2016/Solution.cs
@@ -6,7 +6,7 @@

 namespace HashCodePractice2016
 {
-    class Solution
+    public class Solution
     {
         public enum CommandType
         {
@@ -56,7 +56,32 @@

         public bool IsFilled(int x, int y)
         {
-            // TODO
+            for (int i = commands.Count - 1; i >= 0; --i)
+            {
+                var command = commands[i];
+
+                switch (command.type)
+                {
+                    case CommandType.Clear:
+                        if (command.x == x && command.y == y) return false;
+                        break;
+                    case CommandType.HorizontalLine:
+                        if (command.x <= x && command.x + command.len > x && command.y == y) return true;
+                        break;
+                    case CommandType.VerticalLine:
+                        if (command.y <= y && command.y + command.len > y && command.x == x) return true;
+                        break;
+                    case CommandType.Square:
+                        int dist = command.len / 2; // truncate
+                        if (Math.Abs(command.x - x) <= dist && Math.Abs(command.y - y) <= dist)
+                        {
+                            return true;
+                        }
+
+                        break;
+                }
+            }
+
             return false;
         }
     }


fix event order test

fix event order test

--- Hazelcast.Test/Hazelcast.Client.Test/ClientMapTest.cs
+++ Hazelcast.Test/Hazelcast.Client.Test/ClientMapTest.cs
@@ -819,6 +819,7 @@
         [Test]
         public void testListenerEventOrder()
         {
+            const int maxSize = 10000;
             var map2 = client.GetMap<int, int>(Name);
             map2.Put(1, 0);

@@ -832,10 +833,15 @@

             string reg1 = map2.AddEntryListener(listener, true);

-            for (int i = 1; i < 10000; i++)
+            for (int i = 1; i < maxSize; i++)
             {
                 map2.Put(1, i);
             }
+            while (eventDataReceived.Count != maxSize-1)
+            {
+                Thread.Sleep(100);
+            }
+            Assert.AreEqual(maxSize - 1, eventDataReceived.Count);

             int oldEventData = -1;
             foreach (var eventData in eventDataReceived)


attempt to fix appveyor

attempt to fix appveyor

--- HealthMonitoring.UnitTests/Properties/AssemblyInfo.cs
+++ HealthMonitoring.UnitTests/Properties/AssemblyInfo.cs
@@ -1,5 +1,6 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
+using Xunit;

 [assembly: AssemblyTitle("HealthMonitoring.UnitTests")]
 [assembly: AssemblyDescription("")]
@@ -12,3 +13,5 @@
 [assembly: ComVisible(false)]
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
+//Appveyor
+[assembly: CollectionBehavior(DisableTestParallelization = true)]


Seed method updated for users, user roles and issue states.

--- IssueTracker/IssueTracker/Migrations/Configuration.cs
+++ IssueTracker/IssueTracker/Migrations/Configuration.cs
@@ -4,6 +4,9 @@
     using System.Data.Entity;
     using System.Data.Entity.Migrations;
     using System.Linq;
+    using Models;
+    using Microsoft.AspNet.Identity;
+    using Microsoft.AspNet.Identity.EntityFramework;

     internal sealed class Configuration : DbMigrationsConfiguration<IssueTracker.Models.AppDbContext>
     {
@@ -15,18 +18,86 @@

         protected override void Seed(IssueTracker.Models.AppDbContext context)
         {
-            //  This method will be called after migrating to the latest version.
+            if (!context.IssueStates.Any())
+            {
+                context.IssueStates.Add(new IssueState { State = "New"});
+                context.IssueStates.Add(new IssueState { State = "Open"});
+                context.IssueStates.Add(new IssueState { State = "Fixed"});
+                context.IssueStates.Add(new IssueState { State = "Closed"});
+                context.SaveChanges();
+            }

-            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
-            //  to avoid creating duplicate seed data. E.g.
-            //
-            //    context.People.AddOrUpdate(
-            //      p => p.FullName,
-            //      new Person { FullName = "Andrew Peters" },
-            //      new Person { FullName = "Brice Lambson" },
-            //      new Person { FullName = "Rowan Miller" }
-            //    );
-            //
+            if (!context.Roles.Any())
+            {
+                this.CreateRole("Admin", context);
+                this.CreateRole("Reviewer", context);
+                this.CreateRole("EndUser", context);
+            }
+
+            if (!context.Users.Any())
+            {
+                this.CreateUser("admin@gmail.com", "Admin", "123", context);
+                this.SetUserRole("admin@gmail.com", "Admin", context);
+
+                this.CreateUser("vasko@gmail.com", "Vasil Radoykov", "1", context);
+                this.SetUserRole("vasko@gmail.com", "Reviewer", context);
+                this.SetUserRole("vasko@gmail.com", "EndUser", context);
+            }
+        }
+
+        private void CreateRole(string roleName, AppDbContext context)
+        {
+            var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));
+
+            var result = roleManager.Create(new IdentityRole(roleName));
+
+            if (!result.Succeeded)
+            {
+                throw new Exception(string.Join(",", result.Errors));
+            }
+        }
+
+        private void SetUserRole(string email, string role, AppDbContext context)
+        {
+            var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
+
+            var userId = context.Users.FirstOrDefault(u => u.Email.Equals(email)).Id;
+
+            var result = userManager.AddToRole(userId, role);
+
+            if (!result.Succeeded)
+            {
+                throw new Exception(string.Join(",", result.Errors));
+            }
+
+        }
+
+        private void CreateUser(string email, string fullName, string pass, AppDbContext context)
+        {
+            var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
+
+            userManager.PasswordValidator = new PasswordValidator
+            {
+                RequireDigit = false,
+                RequiredLength = 1,
+                RequireLowercase = false,
+                RequireNonLetterOrDigit = false,
+                RequireUppercase = false
+            };
+
+            var user = new ApplicationUser()
+            {
+                Email = email,
+                FullName = fullName,
+                UserName = email
+            };
+
+            var result = userManager.Create(user, pass);
+            if (!result.Succeeded)
+            {
+                throw new Exception(string.Join(",", result.Errors));
+            }
+
         }
     }
 }


don't adjust drop probability for burglar's ring

The resulting probability was misleading; since you only see the % chance for an item that wasn't selected by the first roll, the base probability applies.

--- LookupAnything/Framework/Subjects/CharacterSubject.cs
+++ LookupAnything/Framework/Subjects/CharacterSubject.cs
@@ -9,7 +9,6 @@
 using StardewValley;
 using StardewValley.Characters;
 using StardewValley.Monsters;
-using StardewValley.Objects;
 using Object = StardewValley.Object;

 namespace Pathoschild.LookupAnything.Framework.Subjects
@@ -110,11 +109,10 @@
             int[] drops = monster.objectsToDrop.ToArray();
             ItemDropData[] possibleDrops = DataParser.GetMonsters().First(p => p.Name == monster.getName()).Drops;

-            float chanceMultiplier = Game1.player.isWearingRing(Ring.burglarsRing) ? 2 : 1;
             return (
                 from possibleDrop in possibleDrops
                 let isGuaranteed = drops.Contains(possibleDrop.ItemID)
-                select new ItemDropData(possibleDrop.ItemID, possibleDrop.MaxDrop, isGuaranteed ? 1 : possibleDrop.Probability * chanceMultiplier)
+                select new ItemDropData(possibleDrop.ItemID, possibleDrop.MaxDrop, isGuaranteed ? 1 : possibleDrop.Probability)
             );
         }


Effort.CsvTool version: 1.2

Effort.CsvTool version: 1.2

--- Main/Source/Effort.CsvTool/Properties/AssemblyInfo.cs
+++ Main/Source/Effort.CsvTool/Properties/AssemblyInfo.cs
@@ -76,4 +76,4 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]


Add null reference guard

Add null reference guard

--- MatterControlLib/PartPreviewWindow/PopupMenuButton.cs
+++ MatterControlLib/PartPreviewWindow/PopupMenuButton.cs
@@ -110,8 +110,11 @@

 		public override void OnBoundsChanged(EventArgs e)
 		{
-			var bounds = this.Children.First().LocalBounds;
-			dropButtonBounds = new RectangleDouble(bounds.Right, 0, this.Width, this.Height);
+			if (this.Children.FirstOrDefault() is GuiWidget firstChild)
+			{
+				var bounds = firstChild.LocalBounds;
+				dropButtonBounds = new RectangleDouble(bounds.Right, 0, this.Width, this.Height);
+			}

 			base.OnBoundsChanged(e);
 		}
@@ -121,7 +124,8 @@
 		{
 			base.OnDraw(graphics2D);

-			if (this.FirstWidgetUnderMouse)
+			if (this.FirstWidgetUnderMouse
+				&& dropButtonBounds != RectangleDouble.ZeroIntersection)
 			{
 				graphics2D.FillRectangle(dropButtonBounds, theme.SlightShade);
 			}


Update ISession.cs

Update ISession.cs

--- Modules/HtcSharp.HttpModule/Http.Features/ISession.cs
+++ Modules/HtcSharp.HttpModule/Http.Features/ISession.cs
@@ -34,43 +34,6 @@
         /// Store the session in the data store. This may throw if the data store is unavailable.
         /// </summary>
         /// <returns></returns>
-        Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken));
-
-        /// <summary>
-        /// Retrieve the value of the given key, if present.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        bool TryGetValue<T>(string key, out T value);
-
-        /// <summary>
-        /// Set the given key and value in the current session. This will throw if the session
-        /// was not established prior to sending the response.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        void Set<T>(string key, T value);
-
-        /// <summary>
-        /// Set the given key and value in the current session. This will throw if the session
-        /// was not established prior to sending the response.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <param name="expireSpan"></param>
-        void Set<T>(string key, T value, TimeSpan expireSpan);
-
-        /// <summary>
-        /// Remove the given key from the session if present.
-        /// </summary>
-        /// <param name="key"></param>
-        void Remove(string key);
-
-        /// <summary>
-        /// Remove all entries from the current session, if any.
-        /// The session cookie is not removed.
-        /// </summary>
-        void Clear();
+        Task CreateAsync(CancellationToken cancellationToken = default(CancellationToken));
     }
 }


Delete touched file before we move

Delete touched file before we move

--- MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
+++ MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
@@ -155,10 +155,12 @@

 		private void MoveFile (Uri url)
 		{
+			string moveTo = GetLocalPath (this.path);
 			if (url.Scheme == "file")
 			{
 				string filename = url.Path;
-				File.Move (filename, this.path.EncodedPath);
+				File.Delete (moveTo);
+				File.Move (filename, moveTo);
 			}
 			else
 			{
@@ -169,7 +171,8 @@
 					if (cursor != null && cursor.MoveToFirst())
 					{
 						string filename = cursor.GetString (cursor.GetColumnIndex (MediaStore.Video.Media.InterfaceConsts.Data));
-						File.Move (filename, this.path.EncodedPath);
+						File.Delete (moveTo);
+						File.Move (filename, moveTo);
 						ContentResolver.Delete (url, null, null);
 					}
 				}


Added some missing types to jsonconfig.

Added some missing types to jsonconfig.

--- Naos.MessageBus.Domain/MessageBusJsonConfiguration.cs
+++ Naos.MessageBus.Domain/MessageBusJsonConfiguration.cs
@@ -24,6 +24,8 @@
             typeof(IChannel),
             typeof(TopicBase),
             typeof(TopicStatusReport),
+            typeof(MessageBusConnectionConfiguration),
+            typeof(MessageBusLaunchConfiguration),
         };

         /// <inheritdoc />


Fix bug in SoundModule.PlayAttachedSound() where every sound update to an avatar would base its gain calculation on the previous avatar's gain, instead of the original input gain

This is similar to commit d89faa which fixed the same kind of bug in TriggerSound()

--- OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -85,13 +85,15 @@
                         dis = 0;
                 }

+                float thisSpGain;
+
                 // Scale by distance
                 if (radius == 0)
-                    gain = (float)((double)gain * ((100.0 - dis) / 100.0));
+                    thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
                 else
-                    gain = (float)((double)gain * ((radius - dis) / radius));
+                    thisSpGain = (float)((double)gain * ((radius - dis) / radius));

-                sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
+                sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags);
             });
         }


E&M citizen states tests changed so that they work

--- PART/Source/CprBroker/E_M.Tests/CitizenStatesTests.cs
+++ PART/Source/CprBroker/E_M.Tests/CitizenStatesTests.cs
@@ -19,7 +19,7 @@
         [SetUp]
         public void InitializeTestCitizens()
         {
-            TestCitizen = new Citizen() { CitizenStatusCode = 1, CitizenStatusTimestamp = DateTime.Today, CitizenStatusTimestampUncertainty = 'T', MaritalStatus = 'U', MaritalStatusTimestamp = DateTime.Today, MaritalStatusTimestampUncertainty = 'T' };
+            TestCitizen = new Citizen() { CitizenStatusCode = 1, CitizenStatusTimestamp = DateTime.Today, CitizenStatusTimestampUncertainty = ' ', MaritalStatus = 'U', MaritalStatusTimestamp = DateTime.Today, MaritalStatusTimestampUncertainty = ' ', Birthdate = DateTime.Today, BirthdateUncertainty = ' ' };
             TestCitizens = new Citizen[] { TestCitizen };
         }


#2024 Starting mixed-mode debugging with F5 can sometimes lock the debuggee

Don't try to inject DebuggerHelper DLL into the debuggee if it is already being injected.

--- Python/Product/Debugger/DkmDebugger/LocalComponent.cs
+++ Python/Product/Debugger/DkmDebugger/LocalComponent.cs
@@ -65,11 +65,20 @@
             }.SendLower(process);
         }

-        private class SuspendedThreadHolder : DkmDataItem {
-            public DkmThread Thread { get; set; }
+        private class HelperDllInjectionDataHolder : DkmDataItem {
+            public DkmThread SuspendedThread { get; set; }
         }

         private static void InjectHelperDll(DkmProcess process) {
+            var injectionData = process.GetDataItem<HelperDllInjectionDataHolder>();
+            if (injectionData != null) {
+                // Injection is already in progress.
+                return;
+            }
+
+            injectionData = new HelperDllInjectionDataHolder();
+            process.SetDataItem(DkmDataCreationDisposition.CreateNew, injectionData);
+
             var pyrtInfo = process.GetPythonRuntimeInfo();

             // Loading the helper is done via CreateRemoteThread(LoadLibrary), which is inherently asynchronous.
@@ -96,7 +105,7 @@
                     makePendingCallsBP.Close();
                     if (process.GetPythonRuntimeInstance() == null) {
                         thread.Suspend(true);
-                        thread.Process.SetDataItem(DkmDataCreationDisposition.CreateNew, new SuspendedThreadHolder { Thread = thread });
+                        injectionData.SuspendedThread = thread;
                     }
                 });
                 makePendingCallsBP.Enable();
@@ -116,9 +125,9 @@
             }

             // If there was a suspended thread, resume it.
-            var suspendedThreadHolder = process.GetDataItem<SuspendedThreadHolder>();
-            if (suspendedThreadHolder != null) {
-                suspendedThreadHolder.Thread.Resume(true);
+            var injectionData = process.GetDataItem<HelperDllInjectionDataHolder>();
+            if (injectionData != null && injectionData.SuspendedThread != null) {
+                injectionData.SuspendedThread.Resume(true);
             }
         }


タグのhtml特殊文字対策 #11

タグのhtml特殊文字対策 #11

--- SRNicoNico/Models/NicoNicoWrapper/NicoNicoWatchApi.cs
+++ SRNicoNico/Models/NicoNicoWrapper/NicoNicoWatchApi.cs
@@ -136,7 +136,7 @@
                 NicoNicoTag entry = new NicoNicoTag() {

                     Id = tag.id,
-                    Tag = tag.tag,
+                    Tag = HttpUtility.HtmlDecode(tag.tag),
                     Dic = tag.dic(),
                     Lck = tag.lck == "1" ? true : false,
                     Cat = tag.cat()


fix(?)

fix(?)

--- SS.Integration.Adapter.Diagnostics/SupervisorProxy.cs
+++ SS.Integration.Adapter.Diagnostics/SupervisorProxy.cs
@@ -134,7 +134,7 @@
             var getFixturesMsg = new GetFixturesMsg();
             var fixtures = _supervisorActor.Ask<IEnumerable<FixtureOverview>>(getFixturesMsg).Result
                 .Where(f => !(f.ListenerOverview.IsDeleted.GetValueOrDefault() ||
-                              f.ListenerOverview.MatchStatus.HasValue));
+                              f.ListenerOverview.MatchStatus.HasValue && (int)f.ListenerOverview.MatchStatus <= (int)MatchStatus.MatchOverUnConfirmed));
             return fixtures.Any()
                 ? fixtures.Select(f => f.ToServiceModel<ServiceModel.FixtureOverview>())
                 : Enumerable.Empty<ServiceModel.FixtureOverview>();


Update ConfigurationSource.cs

Update ConfigurationSource.cs

--- Snippets/Snippets_5/Forwarding/ConfigurationSource.cs
+++ Snippets/Snippets_5/Forwarding/ConfigurationSource.cs
@@ -8,7 +8,7 @@
     {
         public T GetConfiguration<T>() where T : class, new()
         {
-            //To Provide FLR Config
+            //To Provide UnicastBusConfig
             if (typeof(T) == typeof(UnicastBusConfig))
             {
                 UnicastBusConfig forwardingConfig = new UnicastBusConfig


Synchrophasor: Modified ServiceInstall to add CompanyName and CompanyAcronym parameters to the configuration file only if they do not already exist.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C54204

--- Source/Applications/openPDC/openPDC/ServiceInstall.cs
+++ Source/Applications/openPDC/openPDC/ServiceInstall.cs
@@ -255,32 +255,54 @@

             try
             {
-                // Add company name and acronym to configuration file
-                string targetDir = FilePath.AddPathSuffix(Context.Parameters["DP_TargetDir"].ToString());
+                // Open the configuration file as an XML document.
+                string targetDir = FilePath.AddPathSuffix(Context.Parameters["DP_TargetDir"]);
                 string configFilePath = targetDir + "openPDC.exe.Config";
                 XmlDocument xmlDoc = new XmlDocument();
                 xmlDoc.Load(configFilePath);
                 XmlNode node = xmlDoc.SelectSingleNode("configuration/categorizedSettings/systemSettings");
-                XmlNode child = node.Attributes.GetNamedItem("CompanyName");
-
-                if (child == null)
-                {
-                    child = xmlDoc.CreateNode(XmlNodeType.Element, "add", string.Empty);
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "name", "CompanyName"));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "value", Context.Parameters["DP_CompanyName"].ToString()));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "description", "The name of the company who owns this instance of the openPDC."));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "encrypted", "false"));
-                    node.AppendChild(child);
-
-                    child = xmlDoc.CreateNode(XmlNodeType.Element, "add", string.Empty);
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "name", "CompanyAcronym"));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "value", Context.Parameters["DP_CompanyAcronym"].ToString()));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "description", "The acronym representing the company who owns this instance of the openPDC."));
-                    child.Attributes.Append(CreateAttribute(xmlDoc, "encrypted", "false"));
-                    node.AppendChild(child);
-
-                    xmlDoc.Save(configFilePath);
-                }
+                XmlNode companyName = null;
+                XmlNode companyAcronym = null;
+
+                // Find the CompanyName and CompanyAcronym parameters if they already exist.
+                foreach (XmlNode child in node.ChildNodes)
+                {
+                    if (child.Attributes["name"].Value == "CompanyName")
+                        companyName = child;
+                    else if (child.Attributes["name"].Value == "CompanyAcronym")
+                        companyAcronym = child;
+
+                    if (companyName != null && companyAcronym != null)
+                        break;
+                }
+
+                // Modify or add the CompanyName parameter.
+                if (companyName != null)
+                    companyName.Attributes["value"].Value = Context.Parameters["DP_CompanyName"];
+                else
+                {
+                    companyName = xmlDoc.CreateNode(XmlNodeType.Element, "add", string.Empty);
+                    companyName.Attributes.Append(CreateAttribute(xmlDoc, "name", "CompanyName"));
+                    companyName.Attributes.Append(CreateAttribute(xmlDoc, "value", Context.Parameters["DP_CompanyName"]));
+                    companyName.Attributes.Append(CreateAttribute(xmlDoc, "description", "The name of the company who owns this instance of the openPDC."));
+                    companyName.Attributes.Append(CreateAttribute(xmlDoc, "encrypted", "false"));
+                    node.AppendChild(companyName);
+                }
+
+                // Modify or add the CompanyAcronym parameter.
+                if (companyAcronym != null)
+                    companyAcronym.Attributes["value"].Value = Context.Parameters["DP_CompanyAcronym"];
+                else
+                {
+                    companyAcronym = xmlDoc.CreateNode(XmlNodeType.Element, "add", string.Empty);
+                    companyAcronym.Attributes.Append(CreateAttribute(xmlDoc, "name", "CompanyAcronym"));
+                    companyAcronym.Attributes.Append(CreateAttribute(xmlDoc, "value", Context.Parameters["DP_CompanyAcronym"]));
+                    companyAcronym.Attributes.Append(CreateAttribute(xmlDoc, "description", "The acronym representing the company who owns this instance of the openPDC."));
+                    companyAcronym.Attributes.Append(CreateAttribute(xmlDoc, "encrypted", "false"));
+                    node.AppendChild(companyAcronym);
+                }
+
+                xmlDoc.Save(configFilePath);

                 // Run database setup utility
                 Process databaseSetup = null;


[Toolkit.Graphics] Make SpriteFont use specified default character

--- Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteFont.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteFont.cs
@@ -94,6 +94,7 @@
         private readonly Dictionary<int, float> kerningMap;
         private readonly SpriteFontData.Glyph[] glyphs;
         private Texture2D[] textures;
+        private readonly int defaultGlyphIndex;

         // Lookup table indicates which way to move along each axis per SpriteEffects enum value.
         private static readonly Vector2[] axisDirectionTable = new[]
@@ -195,7 +196,14 @@
             // Read font properties.
             LineSpacing = spriteFontData.LineSpacing;

-            DefaultCharacter = (char)spriteFontData.DefaultCharacter;
+            if (spriteFontData.DefaultCharacter > 0)
+            {
+                DefaultCharacter = (char)spriteFontData.DefaultCharacter;
+                if (!characterMap.TryGetValue(DefaultCharacter.Value, out defaultGlyphIndex))
+                {
+                    defaultGlyphIndex = -1;
+                }
+            }

             // Read the texture data.
             textures = new Texture2D[spriteFontData.Bitmaps.Length];
@@ -307,26 +315,38 @@
                 var key = 0;
                 for (int i =  0; i < text.Length; i++)
                 {
-                    char character = text[i];
-                    key |= character;
+                    char character = text[i];

                     switch (character)
                     {
                         case '\r':
                             // Skip carriage returns.
+                            key |= character;
                             continue;

                         case '\n':
                             // New line.
                             x = 0;
                             y += LineSpacing;
+                            key |= character;
                             break;

                         default:
                             // Output this character.
                             int glyphIndex;
                             if (!characterMap.TryGetValue(character, out glyphIndex))
-                                throw new ArgumentException(string.Format("Character '{0}' is not available in the SpriteFont character map", character), "text");
+                            {
+                                if(DefaultCharacter.HasValue && defaultGlyphIndex >= 0)
+                                {
+                                    character = DefaultCharacter.Value;
+                                    glyphIndex = defaultGlyphIndex;
+                                }
+                                else
+                                {
+                                    throw new ArgumentException(string.Format("Character '{0}' is not available in the SpriteFont character map", character), "text");
+                                }
+                            }
+                            key |= character;

                             var glyph = (SpriteFontData.Glyph*) pGlyph + glyphIndex;


apel

apel

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

--- Terradue.Tep/Terradue/Tep/External/Apel/ApelServer.cs
+++ Terradue.Tep/Terradue/Tep/External/Apel/ApelServer.cs
@@ -4,6 +4,12 @@

 \defgroup Apel Apel
 @{
+
+APEL is an accounting tool that collects accounting data from sites participating in the EGI and WLCG infrastructures as well as from sites belonging to other Grid organisations that are collaborating with EGI, including OSG, NorduGrid and INFN.
+
+The accounting information is gathered from different resource providers into a central accounting database where it is processed to generate statistical summaries that are available through the reporting interface
+
+We use this system in TEP to record the usage on the different resources provider of the platform in order to provide a central accounting mechanism for the platform.

 @}


Fixed build break.

Fixed build break.

--- UFO.Commander/UFO.Commander.Proxy/AdminAccessProxy.cs
+++ UFO.Commander/UFO.Commander.Proxy/AdminAccessProxy.cs
@@ -18,7 +18,6 @@
 #endregion
 using System.Collections.Generic;
 using UFO.Server.Bll.Common;
-using VM = UFO.Commander.Domain;
 using BLL = UFO.Server.Domain;
 using WS = UFO.Services.AdminAccess;


Changed default matchRadius to 0, for matching clients by PoI only

--- Unity/POIMatchmakingDemo/Assets/POIMatchmakingDemo.cs
+++ Unity/POIMatchmakingDemo/Assets/POIMatchmakingDemo.cs
@@ -31,8 +31,8 @@
 		private List<string> dontMatchWith = new List<string>(); //the list containing all clients for this client's requirements.requireNotUuid

 		//match radius
-		private string _testMatchRadius = "500";
-		private int _matchRadius = 500; //m. The default radius for matching two clients
+		private string _testMatchRadius = "0";
+		private int _matchRadius = 0; //m. The default radius for matching two clients

 		//snap radius
 		private string _testSnapRadius = "75";


glTF spec/gloss materials support textures

Cherry-picked from TB

Change-Id: Id000b015ab401d4269fee455d8dddb37cd0c52ae

--- UnitySDK/Assets/TiltBrush/Scripts/Gltf/Gltf2Schema.cs
+++ UnitySDK/Assets/TiltBrush/Scripts/Gltf/Gltf2Schema.cs
@@ -234,6 +234,9 @@
       if (pbrMetallicRoughness != null) {
         yield return pbrMetallicRoughness.baseColorTexture;
         yield return pbrMetallicRoughness.metallicRoughnessTexture;
+      } else if (extensions?.KHR_materials_pbrSpecularGlossiness != null) {
+        var specGloss = extensions.KHR_materials_pbrSpecularGlossiness;
+        yield return specGloss.diffuseTexture;
       }
     }
   }


Massive improve the grappling hook

Massive improve the grappling hook

Playing hooky!

--- Voxalia/ServerGame/ItemSystem/CommonItems/HookItem.cs
+++ Voxalia/ServerGame/ItemSystem/CommonItems/HookItem.cs
@@ -57,9 +57,6 @@
                 pe = (PhysicsEntity)cr.HitEnt.Tag;
             }
             BaseJoint jd;
-            jd = new JointDistance(player, pe, 0.01f, len + 0.1f, player.GetCenter(), cr.Position);
-            player.TheRegion.AddJoint(jd);
-            player.Hooks.Add(new HookInfo() { Joint = jd, Hit = pe, IsBar = false });
             PhysicsEntity cent = pe;
             for (float f = 0; f < len - 1f; f += 0.5f)
             {
@@ -72,12 +69,13 @@
                 ce.SetPosition(cpos + step * 0.5);
                 ce.SetOrientation(quat);
                 player.TheRegion.SpawnEntity(ce);
-                jd = new JointBallSocket(ce, cent, cpos + step * 0.5f);
+                jd = new JointDistance(ce, cent, 0.01f, 0.5f, ce.GetPosition(), (ReferenceEquals(cent, pe) ? cr.Position: cent.GetPosition()));
+                CollisionRules.AddRule(player.Body, ce.Body, CollisionRule.NoBroadPhase);
                 player.TheRegion.AddJoint(jd);
                 player.Hooks.Add(new HookInfo() { Joint = jd, Hit = ce, IsBar = true });
                 cent = ce;
             }
-            jd = new JointBallSocket(cent, player, player.GetCenter());
+            jd = new JointDistance(cent, player, 0.01f, 1f, cent.GetPosition(), player.GetCenter());
             player.TheRegion.AddJoint(jd);
             player.Hooks.Add(new HookInfo() { Joint = jd, Hit = player, IsBar = false });
         }


MainMapObjectの表示(仮)

MainMapObjectの表示(仮)

--- WindowsDesktopView/MapObjectView/MainMapObjectView.cs
+++ WindowsDesktopView/MapObjectView/MainMapObjectView.cs
@@ -15,7 +15,7 @@

         public void Display(Graphics graphics)
         {
-            // TODO: 主人公の表示処理
+            graphics.DrawEllipse(Pens.Yellow, (float)MapObject.Left, (float)MapObject.Top, (float)(MapObject.Right - MapObject.Left), (float)(MapObject.Bottom - MapObject.Top));
         }
     }
 }


Remove unused options.

Remove unused options.

--- binder/Options.cs
+++ binder/Options.cs
@@ -11,13 +11,6 @@
         }

         public Project Project;
-
-        // General options
-        public bool ShowHelpText;
-        public bool OutputDebug;
-
-        // Parser options
-        public bool IgnoreParseErrors;

         // Generator options
         public string LibraryName;


Add a FontStyle configurable to the Lyrics script.

--- scripts/Lyrics.cs
+++ scripts/Lyrics.cs
@@ -4,6 +4,7 @@
 using StorybrewCommon.Storyboarding;
 using StorybrewCommon.Subtitles;
 using System;
+using System.Drawing;

 namespace StorybrewScripts
 {
@@ -26,6 +27,9 @@

         [Configurable]
         public Color4 FontColor = Color4.White;
+
+        [Configurable]
+        public FontStyle FontStyle = FontStyle.Regular;

         [Configurable]
         public int OutlineThickness = 3;
@@ -62,6 +66,7 @@
                 FontSize = FontSize,
                 Color = FontColor,
                 Padding = new Vector2(PaddingX, PaddingY),
+                FontStyle = FontStyle,
                 Debug = Debug,
             },
             new FontOutline()


- Improved responsiveness of the "build-type" scripting scenarios (e.g. `css -check`)

--- src/cscs/Utils/CoreExtensions.cs
+++ src/cscs/Utils/CoreExtensions.cs
@@ -80,9 +80,12 @@
                 while (count > 0)
                     try
                     {
-                        if (buildArtifact.FileExists())
+                        if (buildArtifact.FileExists() || !process.HasExited)
                             break;
-                        Thread.Sleep(timeout);
+
+                        var interval = 100;
+                        Thread.Sleep(interval);
+                        count -= interval;
                     }
                     catch { }


* make a good 'roadblock' finder for the nearest slices

--- matmill.cs
+++ matmill.cs
@@ -149,19 +149,52 @@
             return parents;
         }

-        public List<Slice> Get_first_postsplit_slices()
+        // Get all the slices blocking path (meet first) while traveling up the branch
+        // (and followind neighbour downstream subbranches)
+        public List<Slice> Get_upstream_roadblocks()
         {
             List<Slice> candidates = new List<Slice>();

+            for (Branch visited = this; visited.Parent != null; visited = visited.Parent)
+            {
+                Branch upstream = visited.Parent;
+
+                if (upstream.Children.Count != 0)
+                {
+                    foreach (Branch child in upstream.Children)
+                    {
+                        // except the path we're walking now
+                        if (child != visited)
+                            candidates.AddRange(child.Get_downstream_roadblocks());
+                    }
+                }
+
+                if (upstream.Slices.Count != 0)
+                {
+                    candidates.Add(upstream.Slices[upstream.Slices.Count - 1]);
+                    break;
+                }
+            }
+
+            return candidates;
+        }
+
+        // Get all the slices blocking path (meet first) while traveling down the branch
+        // and next subbranches
+        public List<Slice> Get_downstream_roadblocks()
+        {
+            List<Slice> candidates = new List<Slice>();
+
             if (Slices.Count != 0)
             {
                 candidates.Add(Slices[0]);
             }
             else
             {
-                foreach(Branch c in Children)
-                    candidates.AddRange(c.Get_first_postsplit_slices());
-            }
+                foreach (Branch c in Children)
+                    candidates.AddRange(c.Get_downstream_roadblocks());
+            }
+
             return candidates;
         }

@@ -492,23 +525,7 @@

         private List<Slice> find_prev_slices(Branch start)
         {
-            List<Slice> candidates = new List<Slice>();
-
-            // good candidates for prev slice is the last slice of parent
-            // and first slices his childs
-            // parent may be too short and have no slices, but childs has
-            // stop as soon as something is detected
-
-            for (Branch b = start.Parent; candidates.Count == 0 && b != null; b = b.Parent)
-            {
-                if (b.Slices.Count != 0)
-                    candidates.Add(b.Slices[b.Slices.Count - 1]);
-
-                foreach (Branch c in b.Children)
-                    candidates.AddRange(c.Get_first_postsplit_slices());
-            }
-
-            return candidates;
+            return start.Get_upstream_roadblocks();
         }

         private Slice find_prev_slice(Branch start)
@@ -731,8 +748,8 @@

             //if ((branch.Is_leaf || branch.Slices.Count == 0) && pending_slice != null)
             //if (pending_slice != null)
-            if (branch.Is_leaf && pending_slice != null && pending_slice.Max_engagement > GENERAL_TOLERANCE)
-            //if (false)
+            //if (branch.Is_leaf && pending_slice != null && pending_slice.Max_engagement > GENERAL_TOLERANCE)
+            if (false)
             {
                 pending_slice.Finalize(prev_slice, dir);
                 branch.Slices.Add(pending_slice);


implemented the basic structure of the WepApplicationPackage class, all that remains is the core methods of ExtractWapToPath and DeleteExtractedArchive.

--- aspNETserve/WebApplicationPackage.cs
+++ aspNETserve/WebApplicationPackage.cs
@@ -1,29 +1,88 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;

 namespace aspNETserve {
+    /// <summary>
+    /// Represents a WebApplicationPackage archive.
+    /// </summary>
     public class WebApplicationPackage : IDisposable {
+        private bool _isOpen;
+        private bool _ownsStream;
+        private Stream _stream;
+        private string _physicalPath;
+
+        /// <summary>
+        /// Constructs an instance of WebApplicationPackage.
+        /// This constructor assumes ownership of the stream, and will
+        /// close it when the WebApplicationPackage is disposed.
+        /// </summary>
+        /// <param name="stream">A Stream containing the WAP archive.</param>
+        public WebApplicationPackage(Stream stream) : this(stream, true) {}
+
+        /// <summary>
+        /// Constructs an instance of WebApplicationPackage.
+        /// </summary>
+        /// <param name="stream">A Stream containing the WAP archive.</param>
+        /// <param name="ownsStream">If true the stream will be closed when the
+        /// instance of WebApplicationPackage is disposed, otherwise it will be left open.
+        /// </param>
+        public WebApplicationPackage(Stream stream, bool ownsStream) {
+            _stream = stream;
+            _ownsStream = ownsStream;
+        }

         /// <summary>
         /// releases the unmanaged resources allocated by the current
         /// WebApplicationPackage instance.
         /// </summary>
-        public void Dispose(){}
+        public virtual void Dispose() {
+            if(_ownsStream)
+                _stream.Close();
+            if(IsOpen)
+                DeleteExtractedArchive();
+            IsOpen = false;
+        }

         /// <summary>
         /// Opens the WebApplicationPackage for reading.
         /// </summary>
-        public void Open(){}
+        public virtual void Open() {
+            if(IsOpen)
+                throw new Exception("Cannot open WAP, it is already opened.");
+            IsOpen = true;
+            string directory = (new Guid()).ToString();
+            _physicalPath = Path.Combine(Path.GetTempPath(), directory);
+            ExtractWapToPath(_physicalPath);
+        }

         /// <summary>
         /// Returns the path on disk to the contents
         /// of an opened WebApplicationPackage.
         /// </summary>
-        public string PhysicalPath {
+        public virtual string PhysicalPath {
             get {
-                throw new NotImplementedException();
+                if(!IsOpen)
+                    throw new Exception("The WAP is not opened yet.");
+                return _physicalPath;
             }
+        }
+
+        /// <summary>
+        /// Determines if the WebApplicationPackage has been opened
+        /// </summary>
+        public virtual bool IsOpen {
+            get { return _isOpen; }
+            protected set { _isOpen = value; }
+        }
+
+        protected virtual void ExtractWapToPath(string path) {
+            throw new NotImplementedException();
+        }
+
+        protected virtual void DeleteExtractedArchive() {
+            throw new NotImplementedException();
         }
     }
 }


Fix for missing default feed paths in blog recipe

--- src/extensions/Wyam.Blog/Blog.cs
+++ src/extensions/Wyam.Blog/Blog.cs
@@ -30,6 +30,9 @@
             engine.GlobalMetadata[BlogKeys.IncludeDateInPostPath] = false;
             engine.GlobalMetadata[BlogKeys.PostsPath] = new DirectoryPath("posts");
             engine.GlobalMetadata[BlogKeys.MetaRefreshRedirects] = true;
+            engine.GlobalMetadata[BlogKeys.RssPath] = GenerateFeeds.DefaultRssPath;
+            engine.GlobalMetadata[BlogKeys.AtomPath] = GenerateFeeds.DefaultAtomPath;
+            engine.GlobalMetadata[BlogKeys.RdfPath] = GenerateFeeds.DefaultRdfPath;

             // Get the pages first so they're available in the navbar, but don't render until last
             engine.Pipelines.Add(BlogPipelines.Pages,


[ImageView] Improved fix for #37455: * Assign navigation controller as a root view controller

--- iOS7-ui-updates/AppDelegate.cs
+++ iOS7-ui-updates/AppDelegate.cs
@@ -25,16 +25,15 @@
 		//
 		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
 		{
-			// create a new window instance based on the screen size
-			window = new UIWindow (UIScreen.MainScreen.Bounds);
-
-			viewController = new ImageViewController();
-			window.RootViewController = viewController;
+			viewController = new ImageViewController ();

 			navigationController = new UINavigationController();
 			navigationController.PushViewController (viewController, false);

-			// If you have defined a view, add it here:
+			window = new UIWindow (UIScreen.MainScreen.Bounds) {
+				RootViewController = navigationController
+			};
+
 			window.AddSubview (navigationController.View);

 			// make the window visible


Deprecate property of serializable class

(De)serialization of System.Type is bad and not supported.

--- src/Abp/Notifications/TenantNotification.cs
+++ src/Abp/Notifications/TenantNotification.cs
@@ -29,6 +29,7 @@
         /// <summary>
         /// Gets or sets the type of the entity.
         /// </summary>
+        [Obsolete("(De)serialization of System.Type is bad and not supported. See https://github.com/dotnet/corefx/issues/42712")]
         public Type EntityType { get; set; }

         /// <summary>


Add recursive insertion sort.

Add recursive insertion sort.

--- src/Algorithms.Collections/InsertionSort.cs
+++ src/Algorithms.Collections/InsertionSort.cs
@@ -23,5 +23,36 @@
 				list[insertIndex + 1] = currentItem;
 			}
 		}
+
+		// Ex 2.3-4
+		public static void SortRecursiveInPlace<T>(IList<T> list, IComparer<T> comparer)
+		{
+			SortRecursiveInPlace(list, list.Count - 1, comparer);
+		}
+
+		private static void SortRecursiveInPlace<T>(IList<T> list, int index, IComparer<T> comparer)
+		{
+			if (index <= 1)
+				return;
+
+			SortRecursiveInPlace(list, index - 1, comparer);
+
+			T value = list[index];
+			list.RemoveAt(index);
+
+			int insertionIndex = FindInsertionIndex(list, index, value, comparer);
+			list.Insert(insertionIndex, value);
+		}
+
+		private static int FindInsertionIndex<T>(IList<T> list, int startIndex, T value, IComparer<T> comparer)
+		{
+			for (int index = startIndex - 1; index > 0; index--)
+			{
+				if (comparer.Compare(list[index], value) <= 0)
+					return index;
+			}
+
+			return 0;
+		}
 	}
 }


Moved code to the new function UpdateInfoCollect()

--- src/AsimovDeploy.WinAgentUpdater/Updater.cs
+++ src/AsimovDeploy.WinAgentUpdater/Updater.cs
@@ -47,19 +47,8 @@

             try
             {
-                var regex = new Regex(@"(gs:|GS:)//(?<bucket>\S*)/");
-                var match = regex.Match(_watchFolder);
-                UpdateInfo updateInfo;
-                if (match.Success)
-                {
-                    updateInfo = new UpdateInfoCollectorGCP(_watchFolder, _port).Collect();
-
-                }
-                else
-                {
-                    updateInfo = new UpdateInfoCollector(_watchFolder, _port).Collect();
-
-                }
+                UpdateInfo updateInfo = UpdateInfoCollect();
+
                 _log.InfoFormat(updateInfo.ToString());

                 using (var service = new ServiceController("AsimovDeploy.WinAgent"))
@@ -94,6 +83,22 @@
             {
                 _timer.Change(interval, interval);
             }
+        }
+
+        private UpdateInfo UpdateInfoCollect()
+        {
+            var regex = new Regex(@"(gs:)//", RegexOptions.IgnoreCase);
+            var match = regex.Match(_watchFolder);
+            UpdateInfo updateInfo;
+            if (match.Success)
+            {
+                updateInfo = new UpdateInfoCollectorGCP(_watchFolder, _port).Collect();
+            }
+            else
+            {
+                updateInfo = new UpdateInfoCollector(_watchFolder, _port).Collect();
+            }
+            return updateInfo;
         }

         private void UpdateWinAgentConfig(AsimovConfigUpdate lastConfig)


Changed how the default row key Guid gets set (from default(Guid) to Guid.NewGuid()

--- src/AzureCloudTable.Api/CloudTableEntity.cs
+++ src/AzureCloudTable.Api/CloudTableEntity.cs
@@ -103,7 +103,7 @@
         /// <returns></returns>
         public string SetDefaultPartitionKey()
         {
-            var defaultGuid = default(Guid);
+            var defaultGuid = Guid.NewGuid();
             return defaultGuid.ToString();
         }