add callback for pir sensor on the main page. add early speech synthesis

--- Ouay-HackZurich/Sensors/PIR.cs
+++ Ouay-HackZurich/Sensors/PIR.cs
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.Devices.Gpio;
-
-namespace Ouay_HackZurich.Sensors
-{
-    class PIR
-    {
-        static GpioPin pinPIR;
-        GpioPinValue pinPIRValue;
-        public event EventHandler MotionDetected;
-
-        public PIR()
-        {
-            pinPIR.DebounceTimeout = TimeSpan.FromMinutes(1);
-            pinPIR.ValueChanged += PinPIR_ValueChanged;
-            MotionDetected += PIR_MotionDetected;
-        }
-        private void PinPIR_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
-        {
-            pinPIRValue = pinPIR.Read();
-            if (pinPIRValue == GpioPinValue.High)
-            {
-                Debug.WriteLine("Motion detected! grand'pa is alive!" + pinPIRValue);
-                OnMotionDetected(EventArgs.Empty);
-            }
-
-        }
-
-        protected void OnMotionDetected(EventArgs e)
-        {
-            if (MotionDetected != null)
-            {
-                MotionDetected(this, e);
-            }
-        }
-
-        private void PIR_MotionDetected(object sender, EventArgs e)
-        {
-            // do some stuff with the pir sensor
-            Debug.WriteLine("event called and handeled");
-        }
-
-        /*initialise GPIO pins*/
-        public static void InitGPIO_PIR()
-        {
-            var gpio = GpioController.GetDefault();
-            if (gpio == null)
-            {
-                pinPIR = null;
-            }
-
-            /* open the pins using the gpio controller */
-            pinPIR = gpio.OpenPin(20);
-
-            /* pins as input */
-            pinPIR.SetDriveMode(GpioPinDriveMode.Input);
-
-        }
-
-    }
-}


Added TilteScreenState Default references

--- src/Rs317.Library.Client/Client.cs
+++ src/Rs317.Library.Client/Client.cs
@@ -4984,7 +4984,7 @@
 			titleBoxImage.draw(0, 0);
 			int x = 360;
 			int y = 200;
-			if(loginScreenState == 0)
+			if(loginScreenState == TitleScreenState.Default)
 			{
 				int _y = y / 2 + 80;
 				fontSmall.drawCentredTextWithPotentialShadow(onDemandFetcher.statusString, x / 2, _y, 0x75A9A9, true);
@@ -8810,7 +8810,7 @@

 			socket = null;
 			LoggedIn.Update(false);
-			loginScreenState = 0;
+			loginScreenState = TitleScreenState.Default;
 			// myUsername = "";
 			// myPassword = "";
 			resetModelCaches();
@@ -10334,7 +10334,7 @@

 		private void updateLogin()
 		{
-			if(loginScreenState == 0)
+			if(loginScreenState == TitleScreenState.Default)
 			{
 				int x = base.width / 2 - 80;
 				int y = base.height / 2 + 20;
@@ -10389,7 +10389,7 @@
 					if(base.clickType == 1 && base.clickX >= x - 75 && base.clickX <= x + 75 && base.clickY >= _y - 20
 						&& base.clickY <= _y + 20)
 					{
-						loginScreenState = 0;
+						loginScreenState = TitleScreenState.Default;
 						// myUsername = "";
 						// myPassword = "";
 					}
@@ -10443,7 +10443,7 @@
 					y += 20;
 					if(base.clickType == 1 && base.clickX >= x - 75 && base.clickX <= x + 75 && base.clickY >= y - 20
 						&& base.clickY <= y + 20)
-						loginScreenState = 0;
+						loginScreenState = TitleScreenState.Default;
 				}
 			}
 		}


ScadaServer: sort usings

ScadaServer: sort usings

--- ScadaServer/ScadaServerSvc/Comm.cs
+++ ScadaServer/ScadaServerSvc/Comm.cs
@@ -23,6 +23,10 @@
  * Modified : 2017
  */

+using Scada.Data.Configuration;
+using Scada.Data.Models;
+using Scada.Data.Tables;
+using Scada.Server.Modules;
 using System;
 using System.Collections.Generic;
 using System.DirectoryServices;
@@ -32,10 +36,6 @@
 using System.Text;
 using System.Threading;
 using Utils;
-using Scada.Data.Models;
-using Scada.Data.Tables;
-using Scada.Server.Modules;
-using Scada.Data.Configuration;

 namespace Scada.Server.Svc
 {


Fixed missing brace

Fixed missing brace

--- PInvoke/SearchApi/SearchApi.cs
+++ PInvoke/SearchApi/SearchApi.cs
@@ -4475,7 +4475,6 @@
 			[DispId(0x60010014)]
 			string Password { [param: In, MarshalAs(UnmanagedType.LPWStr)] set; [return: MarshalAs(UnmanagedType.LPWStr)] get; }
 		}
-	}

 		/// <summary>Provides methods to define scope rules for crawling and indexing.</summary>
 		/// <remarks>


Handling custom types and enums for initializers

--- src/SME.VHDL/RenderStateProcess.cs
+++ src/SME.VHDL/RenderStateProcess.cs
@@ -737,6 +737,10 @@
 			{
 				return ((bool)e.Value) ? "'1'" : "'0'";
 			}
+			else if (e.SourceResultType.Resolve().IsEnum)
+			{
+				return Naming.ToValidName(e.SourceResultType.FullName + "_" + e.Value.ToString());
+			}
 			else
 			{
 				return e.Value.ToString();
@@ -938,6 +942,8 @@

 				if (n.Any(x => exp.Right.SourceResultType.IsSameTypeReference(x)))
 					Parent.TypeLookup[exp.Right] = VHDLTypes.INTEGER;
+				else if (element.DefaultValue != null && !element.DefaultValue.GetType().IsEnum && element.DefaultValue.GetType() != typeof(bool))
+					Parent.TypeLookup[exp.Right] = VHDLTypes.INTEGER;
 			}

 			res.UpdateParents();


* Database.NewQuery() is introduced.

* Database.NewQuery() is introduced.

--- Tasslehoff.Library/DataAccess/Database.cs
+++ Tasslehoff.Library/DataAccess/Database.cs
@@ -239,5 +239,14 @@

             return result;
         }
+
+        /// <summary>
+        /// Creates a new DataQuery instance.
+        /// </summary>
+        /// <returns>A new data query instance.</returns>
+        public DataQuery NewQuery()
+        {
+            return new DataQuery(this);
+        }
     }
 }


sqlquery test for distinct and cross join with from

--- Serenity.Test/Sql/SqlQueryTests.cs
+++ Serenity.Test/Sql/SqlQueryTests.cs
@@ -6,15 +6,61 @@
     public partial class SqlQueryTests
     {
         [Fact]
+        public void DistinctAddsKeyword()
+        {
+            var query = new SqlQuery()
+                .Distinct(true)
+                .Select("TestColumn")
+                .From("TestTable");
+
+            Assert.Equal(
+                TestSqlHelper.Normalize(
+                    "SELECT DISTINCT TestColumn FROM TestTable"),
+                TestSqlHelper.Normalize(
+                    query.ToString()));
+        }
+
+        [Fact]
+        public void DistinctCanBeTurnedOff()
+        {
+            var query = new SqlQuery()
+                .Distinct(true)
+                .Select("TestColumn")
+                .From("TestTable")
+                .Distinct(false);
+
+            Assert.Equal(
+                TestSqlHelper.Normalize(
+                    "SELECT TestColumn FROM TestTable"),
+                TestSqlHelper.Normalize(
+                    query.ToString()));
+        }
+
+        [Fact]
+        public void FromMultipleCallsDoesCrossJoin()
+        {
+            var query = new SqlQuery()
+                .From("TestTable1")
+                .From("TestTable2")
+                .Select("TestColumn");
+
+            Assert.Equal(
+                TestSqlHelper.Normalize(
+                    "SELECT TestColumn FROM TestTable1, TestTable2"),
+                TestSqlHelper.Normalize(
+                    query.ToString()));
+        }
+
+        [Fact]
         public void SubQueryShouldBeEnclosedInParen()
         {
             var sub = new SqlQuery().SubQuery()
-                .Select("SampleColumn")
-                .From("SampleTable");
+                .Select("TestColumn")
+                .From("TestTable");

             Assert.Equal(
                 TestSqlHelper.Normalize(
-                    "(SELECT SampleColumn FROM SampleTable)"),
+                    "(SELECT TestColumn FROM TestTable)"),
                 TestSqlHelper.Normalize(
                     sub.ToString()));
         }


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.16.0";
-				ClientTag = "dotnet:20-01-30";
+				ClientTag = "dotnet:20-01-31";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.0.0";
-				ClientTag = "dotnet:19-05-23";
+				ClientTag = "dotnet:19-05-24";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "14.1.0";
-				ClientTag = "dotnet:18-06-26";
+				ClientTag = "dotnet:18-06-27";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "18.13.0";
-				ClientTag = "dotnet:22-09-05";
+				ClientTag = "dotnet:22-09-06";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "14.19.0";
-				ClientTag = "dotnet:19-04-26";
+				ClientTag = "dotnet:19-04-27";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "17.2.0";
-				ClientTag = "dotnet:21-06-10";
+				ClientTag = "dotnet:21-06-11";
 		}

 		#region Properties


Refresh layer preview after paste image action without adding extra history items

--- Pinta.Core/Classes/Document.cs
+++ Pinta.Core/Classes/Document.cs
@@ -837,11 +837,10 @@
 			Selection.SelectionPath = p;
 			Selection.SelectionPolygons.Clear();
 			ShowSelection = true;
-			PintaCore.Layers.FinishSelection();

 			Workspace.Invalidate ();
-
 			paste_action.Push (new PasteHistoryItem (cbImage, old_selection, old_show_selection));
+			RedrawLayerPreview (paste_action);
 			History.PushNewItem (paste_action);
 		}

@@ -912,6 +911,20 @@
 		private void RaiseLayerPropertyChangedEvent (object sender, PropertyChangedEventArgs e)
 		{
 			PintaCore.Layers.RaiseLayerPropertyChangedEvent (sender, e);
+		}
+
+		private void RedrawLayerPreview (CompoundHistoryItem compoundAction)
+		{
+			FinishPixelsHistoryItem hist = new FinishPixelsHistoryItem ();
+			hist.TakeSnapshot ();
+
+			Layer layer = SelectionLayer;
+			using (Cairo.Context g = new Cairo.Context (CurrentUserLayer.Surface)) {
+				layer.Draw (g);
+			}
+			DestroySelectionLayer ();
+
+			compoundAction.Push (hist);
 		}
 		#endregion


Добавлен эхо-тест

Добавлен эхо-тест

--- test-soap/Program.cs
+++ test-soap/Program.cs
@@ -75,6 +75,32 @@
 			Console.WriteLine ("The DoOp result is '{0}', Op return is '{1}'", result, OpParam.AsString());
 		}

+		public void TestEchoService ()
+		{
+			var def = new DefinitionsImpl ("http://vm21297.hv8.ru:10080/httpservice/ws/echo.1cws?wsdl");
+			var proxy = ProxyImpl.Constructor (def, "http://dmpas/echo", "EchoService", "EchoServiceSoap");
+
+			decimal testValue = Decimal.Divide (152, 10);
+
+			var calls = new Dictionary<string, IValue> ();
+			calls ["Number"] = ValueFactory.Create (testValue);
+			calls ["Float"] = ValueFactory.Create (testValue);
+			calls ["String"] = ValueFactory.Create ("<&>");
+			calls ["DateTime"] = ValueFactory.Create (DateTime.Now);
+			calls ["Bool"] = ValueFactory.Create (false);
+			calls ["Fault"] = ValueFactory.Create ("123");
+
+
+			foreach (var callData in calls) {
+				int methodIndex = proxy.FindMethod ("Echo" + callData.Key);
+
+				IValue result;
+				proxy.CallAsFunction (methodIndex, new IValue [] { callData.Value }, out result);
+
+				Console.WriteLine ("Result for Echo{0} is {1}", callData.Key, result.AsString());
+			}
+		}
+
 		private void StartEngine ()
 		{
 			var engine = new ScriptEngine.HostedScript.HostedScriptEngine ();
@@ -95,6 +121,7 @@

 			TestXdto ();

+			TestEchoService ();
 			TestWsdlNoAuth ();
 		}


Minor tweak to string append code

Minor tweak to string append code

git-svn-id: 7230453ef4d2e9c957b80d4737114f575fc9f7f8@312135 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/RollingFileAppender.cs
+++ src/Appender/RollingFileAppender.cs
@@ -635,7 +635,7 @@
 		/// <returns></returns>
 		private static string GetWildcardPatternForFile(string baseFileName)
 		{
-			return baseFileName + "*";
+			return baseFileName + '*';
 		}

 		/// <summary>


LOG4NET-378 fixed a problem where rolled log files get overwritten when the application is restarted

The cause is that InitializeFromOneFile() does not succesfully detect the filenames.

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@1486596 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/RollingFileAppender.cs
+++ src/Appender/RollingFileAppender.cs
@@ -904,7 +904,10 @@
 			// Only look for files in the current roll point
 			if (m_rollDate && !m_staticLogFileName)
 			{
-				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo))))
+				string date = m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo);
+				string prefix = m_preserveLogFileNameExtension ? Path.GetFileNameWithoutExtension(baseFile) + date : baseFile + date;
+				string suffix = m_preserveLogFileNameExtension ? Path.GetExtension(baseFile) : "";
+				if (!curFileName.StartsWith(prefix) || !curFileName.EndsWith(suffix))
 				{
 					LogLog.Debug(declaringType, "Ignoring file ["+curFileName+"] because it is from a different date period");
 					return;


Observe exceptions in AttemptReconnection (#225)

The observed exceptions are silenced, since they will be already logged
by AttemptReconnection

--- src/Cassandra/HostConnectionPool.cs
+++ src/Cassandra/HostConnectionPool.cs
@@ -212,6 +212,13 @@
                 {
                     t.Exception.Handle(e => true);
                     ex = t.Exception.InnerException;
+                    //This makes sure that the exception is observed, but still sets _creationTcs' exception
+                    //for MaybeCreateFirstConnection
+                    tcs.Task.ContinueWith(x =>
+                    {
+                        if (x.Exception != null)
+                            x.Exception.Handle(_ => true);
+                    });
                 }
                 TransitionCreationTask(tcs, EmptyConnectionsArray, ex);
                 _host.SetDown(failedReconnection: true);


fix selection rendering issue when anchor was above caret and anchor column larger than caret column

--- src/CodeEditor.Text.UI/Selection.cs
+++ src/CodeEditor.Text.UI/Selection.cs
@@ -17,9 +17,17 @@
 		{
 			get
 			{
+				int column;
+				if (Anchor.Row == Caret.Row)
+					column = Math.Min(Anchor.Column, Caret.Column);
+				else if (Anchor.Row < Caret.Row)
+					column = Anchor.Column;
+				else
+					column = Caret.Column;
+
 				return new Position (
 					Anchor.Row < Caret.Row ? Anchor.Row : Caret.Row,
-					(Anchor.Row < Caret.Row || Anchor.Column < Caret.Column) ? Anchor.Column : Caret.Column
+					column
 					);
 			}
 		}
@@ -28,9 +36,17 @@
 		{
 			get
 			{
+				int column;
+				if (Anchor.Row == Caret.Row)
+					column = Math.Max(Anchor.Column, Caret.Column);
+				else if (Anchor.Row < Caret.Row)
+					column = Caret.Column;
+				else
+					column = Anchor.Column;
+
 				return new Position(
 					Caret.Row > Anchor.Row ? Caret.Row : Anchor.Row,
-					(Caret.Row > Anchor.Row  || Anchor.Column < Caret.Column) ? Caret.Column : Anchor.Column
+					column
 					);
 			}
 		}
@@ -53,7 +69,7 @@

 		public override string ToString ()
 		{
-			return string.Format ("{0} -> {1}", BeginDrawPos, EndDrawPos);
+			return string.Format ("{0} -> {1}, Anchor: {2}, Caret {3},{4}", BeginDrawPos, EndDrawPos, Anchor, Caret.Row, Caret.Column);
 		}

 	}


Document type detection improvement and functionalization

--- LF2.IDE/DocumentForm.cs
+++ LF2.IDE/DocumentForm.cs
@@ -189,31 +189,7 @@
 				ToolTipText = _filePath = saveFileDialog.FileName;
 				TabText = Path.GetFileName(_filePath);

-				switch (Path.GetExtension(TabText))
-				{
-					case ".dat":
-						SetLanguage("dat");
-						break;
-					case ".txt":
-						SetLanguage("txt");
-						break;
-					case ".as":
-						SetLanguage("as");
-						break;
-					case ".xml":
-						SetLanguage("xml");
-						break;
-					case ".html":
-					case ".htm":
-						SetLanguage("html");
-						break;
-					case ".cs":
-						SetLanguage("cs");
-						break;
-					default:
-						SetLanguage("default");
-						break;
-				}
+				SetLanguage();

 				return Save(_filePath);
 			}
@@ -244,32 +220,8 @@

 		void DocumentFormLoad(object sender, EventArgs e)
 		{
-			ToolTipText = _filePath == null ? TabText : _filePath;
-			switch (Path.GetExtension(TabText.TrimEnd(' ', '*')))
-			{
-				case ".dat":
-					SetLanguage("dat");
-					break;
-				case ".txt":
-					SetLanguage("txt");
-					break;
-				case ".as":
-					SetLanguage("as");
-					break;
-				case ".xml":
-					SetLanguage("xml");
-					break;
-				case ".html":
-				case ".htm":
-					SetLanguage("html");
-					break;
-				case ".cs":
-					SetLanguage("cs");
-					break;
-				default:
-					SetLanguage("default");
-					break;
-			}
+			ToolTipText = _filePath ?? TabText;
+			SetLanguage();
 			scintilla.NativeInterface.SendMessageDirect(2516, true);
 			SetMarginAuto();

@@ -342,6 +294,40 @@

 		bool auto = false, smart = false;

+		public void SetLanguage()
+		{
+			SetLanguageByExtension(Path.GetExtension(TabText.TrimEnd('*', ' ')));
+		}
+
+		public void SetLanguageByExtension(string ext)
+		{
+			switch (ext)
+			{
+				case ".dat":
+					SetLanguage("dat");
+					break;
+				case ".txt":
+					SetLanguage("txt");
+					break;
+				case ".as":
+					SetLanguage("as");
+					break;
+				case ".xml":
+					SetLanguage("xml");
+					break;
+				case ".html":
+				case ".htm":
+					SetLanguage("html");
+					break;
+				case ".cs":
+					SetLanguage("cs");
+					break;
+				default:
+					SetLanguage("default");
+					break;
+			}
+		}
+
 		public void SetLanguage(string language)
 		{
 			language = language.ToLowerInvariant();
@@ -360,7 +346,7 @@
 							this.Scintilla.ConfigurationManager.Language = "stage_dat";
 							documentType = DocumentType.StageData;
 						}
-						else if (Scintilla.Text.Contains("layer:"))
+						else if (Scintilla.Text.Contains("zboundary:"))
 						{
 							Scintilla.Indentation.TabWidth = 2;
 							this.Scintilla.ConfigurationManager.Language = "bg_dat";
@@ -383,7 +369,7 @@
 						if (TabText.TrimEnd(' ', '*') != "data.txt")
 							goto default;
 						Scintilla.Indentation.UseTabs = false;
-						Scintilla.Indentation.TabWidth = 1;
+						Scintilla.Indentation.TabWidth = 4;
 						Scintilla.EndOfLine.Mode = EndOfLineMode.Crlf;
 						this.Icon = Properties.Resources.DocumentDAT;
 						auto = true;


Renamed variable

Renamed variable

--- samples/Nancy.Serialization.ProtoBuf.Demo/MainModule.cs
+++ samples/Nancy.Serialization.ProtoBuf.Demo/MainModule.cs
@@ -7,7 +7,7 @@
     {
         public MainModule()
         {
-            Post("/postProtoBuf", BuildManagerHostUnloadEventArgs =>
+            Post("/postProtoBuf", args =>
             {
                 User data = this.Bind();
                 return Negotiate.WithModel(data);
@@ -20,4 +20,4 @@
             });
         }
     }
-}+}


Deleted test logging

Deleted test logging

--- ShaderEditorApp/MainWindow.xaml.cs
+++ ShaderEditorApp/MainWindow.xaml.cs
@@ -44,17 +44,6 @@
 			// Must create output window VM first as other stuff might need to log to it.
 			var outputWindowVM = new OutputWindowViewModel();
 			CompositeLoggerFactory.Instance.AddFactory(outputWindowVM);
-
-			// TEMP HACK
-			var logger = CompositeLoggerFactory.Instance.CreateLogger("Log");
-			Task.Run(async () =>
-			{
-				for (int i = 0; ; i++)
-				{
-					logger.LogLine($"Message {i}");
-					await Task.Delay(1000);
-				}
-			});

 			// Initialise D3D device.
 			_renderDevice = new RenderDevice();


Introduced DataContext.GetIDbCommand() to improve mocking possibilities

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1130 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Data/Linq/DataContext.cs
+++ src/DbLinq/Data/Linq/DataContext.cs
@@ -1107,6 +1107,16 @@
         [DbLinqToDo]
         public DbCommand GetCommand(IQueryable query)
         {
+            DbCommand dbCommand = GetIDbCommand(query) as DbCommand;
+            if (dbCommand == null)
+                throw new InvalidOperationException();
+
+            return dbCommand;
+        }
+
+        [DBLinqExtended]
+        public IDbCommand GetIDbCommand(IQueryable query)
+        {
             if (query == null)
                 throw new ArgumentNullException("query");

@@ -1117,11 +1127,7 @@
             if (qp.ExpressionChain.Expressions.Count == 0)
                 qp.ExpressionChain.Expressions.Add(CreateDefaultQuery(query));

-            IDbCommand dbCommand = qp.GetQuery(null).GetCommand().Command;
-            if (!(dbCommand is DbCommand))
-                throw new InvalidOperationException();
-
-            return (DbCommand)dbCommand;
+            return qp.GetQuery(null).GetCommand().Command;
         }

         private Expression CreateDefaultQuery(IQueryable query)


Better Cleanup

Better Cleanup

--- Skylines-EnhancedBuildPanel/Mod.cs
+++ Skylines-EnhancedBuildPanel/Mod.cs
@@ -30,7 +30,7 @@

         public override void OnLevelLoaded(LoadMode mode)
         {
-            Debug.Log("Now Monitoring Panels ... ");
+            Debug.Log("v1.2 - Now Monitoring Panels ... ");
             var uiView = GameObject.FindObjectOfType<UIView>();
             improvedBuildPanel = uiView.gameObject.AddComponent<ImprovedBuildPanel>();
         }
@@ -39,6 +39,15 @@
         {
             Debug.Log("Monitoring shutting down ... ");
             GameObject.Destroy(improvedBuildPanel);
+            GameObject.DestroyObject(improvedBuildPanel);
+            if (improvedBuildPanel == null)
+            {
+                Debug.Log("improvedBuildPanel was destroyed");
+            }
+            else
+            {
+                Debug.Log("improvedBuildPanel was NOT destoryed");
+            }
         }
     }


Fix #142 CCSprite: Setting TextureRectInPixels incorrectly resets ContentSize

--- src/sprite_nodes/CCSprite.cs
+++ src/sprite_nodes/CCSprite.cs
@@ -246,7 +246,8 @@
                 if(textureRectInPixels != value)
                 {
                     textureRectInPixels = value;
-                    ContentSize = textureRectInPixels.Size / DefaultTexelToContentSizeRatios;
+                    if(ContentSize == CCSize.Zero)
+                        ContentSize = textureRectInPixels.Size / DefaultTexelToContentSizeRatios;

                     UpdateSpriteTextureQuads();
                 }


Check for empty DBI stream

Check for empty DBI stream

--- src/DotNet/Pdb/Managed/PdbReader.cs
+++ src/DotNet/Pdb/Managed/PdbReader.cs
@@ -221,6 +221,9 @@

 		ushort? ReadModules() {
 			ref var stream = ref streams[STREAM_DBI].Content;
+			modules = new List<DbiModule>();
+			if (stream.Length == 0)
+				return null;
 			stream.Position = 20;
 			ushort symrecStream = stream.ReadUInt16();
 			stream.Position += 2;
@@ -235,7 +238,6 @@
 			otherSize += ReadSizeField(ref stream); // ecinfoSize
 			stream.Position += 8;

-			modules = new List<DbiModule>();
 			var moduleStream = stream.Slice(stream.Position, gpmodiSize);
 			while (moduleStream.Position < moduleStream.Length) {
 				var module = new DbiModule();


description is not valid on stripe tokens (according to stripe)

--- src/Stripe/Entities/StripeToken.cs
+++ src/Stripe/Entities/StripeToken.cs
@@ -60,7 +60,7 @@
         [JsonProperty("card")]
         public StripeCard StripeCard { get; set; }

-        // todo: waiting to here from Stripe if this is still valid
+        [Obsolete("This property is not valid on tokens and will be removed in a later version.")]
         [JsonProperty("description")]
         public string Description { get; set; }
     }


add tests for assemblyhelper

add tests for assemblyhelper

--- src/Test.II/AssemblyHelperTests.cs
+++ src/Test.II/AssemblyHelperTests.cs
@@ -6,10 +6,26 @@

 using NUnit.Framework;

+using PPWCode.Util.OddsAndEnds.II.AssemblyHelpers;
+
 namespace PPWCode.Util.OddsAndEnds.Test.II
 {
     [TestFixture]
     public class AssemblyHelperTests
     {
+        [Test]
+        public void LoadAssemblyNotNullTest()
+        {
+            var assembly = AssemblyHelper.LoadAssembly("PPWCode.Util.OddsAndEnds.II.dll");
+            Assert.IsNotNull(assembly);
+        }
+
+        [Test]
+        public void CreateInstanceOfSequenceGeneratorIsNotNull()
+        {
+            var assembly = AssemblyHelper.LoadAssembly("PPWCode.Util.OddsAndEnds.II.dll");
+            var adSearch = AssemblyHelper.CreateInstanceOf(assembly, "PPWCode.Util.OddsAndEnds.II.UnitTestHelpers.SequenceGenerator");// "AdSearch");
+            Assert.IsNotNull(adSearch);
+        }
     }
 }


Avoid boxing enum in DoneAddingSamples (Array.Sort)

--- src/TraceEvent/TraceEventStacks.cs
+++ src/TraceEvent/TraceEventStacks.cs
@@ -636,7 +636,7 @@
                 {
                     int res = x.TimeRelativeMSec.CompareTo(y.TimeRelativeMSec);
                     if (res != 0) return res;
-                    else return x.StackIndex.CompareTo(y.StackIndex);
+                    else return ((int)(x.StackIndex)).CompareTo((int)(y.StackIndex));
                 });
             for (int i = 0; i < m_samples.Count; i++)
                 m_samples[i].SampleIndex = (StackSourceSampleIndex)i;


HelloWorld: Pimp up the FreeBSD daemon to have colors.

Basically pay full respects to the original console screen-saver.


Add missing IDisposable to class.

Add missing IDisposable to class.

Added IDisposable to use existing Dispose method.
Normalized newlines between methods.

--- FileSystemSafeWatcher.cs
+++ FileSystemSafeWatcher.cs
@@ -9,7 +9,6 @@

 namespace menelabs.core
 {
-
     /// <summary>
     /// This class wraps FileSystemEventArgs and RenamedEventArgs objects and detection of duplicate events.
     /// </summary>
@@ -86,7 +85,7 @@
     /// cause some events not be fired at all since the last event will become the first event and
     /// it won't fire a if a new similar event arrives imediately afterwards).
     /// </summary>
-    public class FileSystemSafeWatcher
+    public class FileSystemSafeWatcher : IDisposable
     {
         private readonly FileSystemWatcher _fileSystemWatcher;

@@ -143,6 +142,7 @@
                 }
             }
         }
+
         /// <summary>
         /// Gets or sets the filter string, used to determine what files are monitored in a directory.
         /// </summary>
@@ -158,6 +158,7 @@
                 _fileSystemWatcher.Filter = value;
             }
         }
+
         /// <summary>
         /// Gets or sets a value indicating whether subdirectories within the specified path should be monitored.
         /// </summary>
@@ -173,6 +174,7 @@
                 _fileSystemWatcher.IncludeSubdirectories = value;
             }
         }
+
         /// <summary>
         /// Gets or sets the size of the internal buffer.
         /// </summary>
@@ -188,6 +190,7 @@
                 _fileSystemWatcher.InternalBufferSize = value;
             }
         }
+
         /// <summary>
         /// Gets or sets the type of changes to watch for.
         /// </summary>
@@ -204,6 +207,7 @@
                 _fileSystemWatcher.NotifyFilter = value;
             }
         }
+
         /// <summary>
         /// Gets or sets the path of the directory to watch.
         /// </summary>
@@ -220,6 +224,7 @@
                 _fileSystemWatcher.Path = value;
             }
         }
+
         /// <summary>
         /// Gets or sets the object used to marshal the event handler calls issued as a result of a directory change.
         /// </summary>
@@ -235,22 +240,27 @@
                 _fileSystemWatcher.SynchronizingObject = value;
             }
         }
+
         /// <summary>
         /// Occurs when a file or directory in the specified System.IO.FileSystemWatcher.Path is changed.
         /// </summary>
         public event FileSystemEventHandler Changed;
+
         /// <summary>
         /// Occurs when a file or directory in the specified System.IO.FileSystemWatcher.Path is created.
         /// </summary>
         public event FileSystemEventHandler Created;
+
         /// <summary>
         /// Occurs when a file or directory in the specified System.IO.FileSystemWatcher.Path is deleted.
         /// </summary>
         public event FileSystemEventHandler Deleted;
+
         /// <summary>
         /// Occurs when the internal buffer overflows.
         /// </summary>
         public event ErrorEventHandler Error;
+
         /// <summary>
         /// Occurs when a file or directory in the specified System.IO.FileSystemWatcher.Path is renamed.
         /// </summary>
@@ -263,6 +273,7 @@
         {
             _fileSystemWatcher.BeginInit();
         }
+
         /// <summary>
         /// Releases the unmanaged resources used by the System.IO.FileSystemWatcher and optionally releases the managed resources.
         /// </summary>
@@ -270,6 +281,7 @@
         {
             Uninitialize();
         }
+
         /// <summary>
         /// Ends the initialization of a System.IO.FileSystemWatcher used on a form or used by another component. The initialization occurs at run time.
         /// </summary>
@@ -277,6 +289,7 @@
         {
             _fileSystemWatcher.EndInit();
         }
+
         /// <summary>
         /// Raises the System.IO.FileSystemWatcher.Changed event.
         /// </summary>
@@ -286,6 +299,7 @@
             if (Changed != null)
                 Changed(this, e);
         }
+
         /// <summary>
         /// Raises the System.IO.FileSystemWatcher.Created event.
         /// </summary>
@@ -295,6 +309,7 @@
             if (Created != null)
                 Created(this, e);
         }
+
         /// <summary>
         /// Raises the System.IO.FileSystemWatcher.Deleted event.
         /// </summary>
@@ -304,6 +319,7 @@
             if (Deleted != null)
                 Deleted(this, e);
         }
+
         /// <summary>
         /// Raises the System.IO.FileSystemWatcher.Error event.
         /// </summary>
@@ -313,6 +329,7 @@
             if (Error != null)
                 Error(this, e);
         }
+
         /// <summary>
         /// Raises the System.IO.FileSystemWatcher.Renamed event.
         /// </summary>
@@ -322,6 +339,7 @@
             if (Renamed != null)
                 Renamed(this, e);
         }
+
         /// <summary>
         /// A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor.
         /// </summary>
@@ -332,6 +350,7 @@
             //TODO
             throw new NotImplementedException();
         }
+
         /// <summary>
         /// A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor
         /// and the time (in milliseconds) to wait before timing out.
@@ -508,5 +527,4 @@
         }
         #endregion
     }
-
 }


Get logger to output as same file as old Log4Net and in same format (only diff currently is the log level type in the log file) Ensures we use the calling type in the Umbraco ILogger and passes it onto Serilog

--- src/Umbraco.Core/Logging/Logger.cs
+++ src/Umbraco.Core/Logging/Logger.cs
@@ -1,14 +1,12 @@
 using System;
-using System.Diagnostics;
-using System.Globalization;
 using System.IO;
-using System.Linq;
 using System.Reflection;
 using System.Threading;
 using System.Web;
 using Umbraco.Core.Configuration;
 using Umbraco.Core.Diagnostics;
 using Serilog;
+using Serilog.Events;

 namespace Umbraco.Core.Logging
 {
@@ -37,7 +35,11 @@
                 .Enrich.WithThreadId()
                 .Enrich.WithProperty("AppDomainId", AppDomain.CurrentDomain.Id)
                 .Enrich.WithProperty("AppDomainAppId", HttpRuntime.AppDomainAppId.ReplaceNonAlphanumericChars(string.Empty))
-                .WriteTo.File(AppDomain.CurrentDomain.BaseDirectory + "\\logs\\warren.txt", rollingInterval: RollingInterval.Day)
+                .WriteTo.File(AppDomain.CurrentDomain.BaseDirectory + @"\App_Data\Logs\UmbracoTraceLog.txt", //Our main app Logfile
+                    rollingInterval: RollingInterval.Day,
+                    restrictedToMinimumLevel: LogEventLevel.Debug,
+                    retainedFileCountLimit: null, //Setting to null means we keep all files - default is 31 days
+                    outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss,fff} [P{ProcessId}/D{AppDomainId}/T{ThreadId}] {Level:u4}  {Message:lj}{NewLine}{Exception}")
                 .CreateLogger();
         }

@@ -146,14 +148,14 @@
         public void Warn(Type reporting, Exception exception, string message)
         {
             var logger = Log.Logger;
-            logger?.Warning(message, exception);
+            logger?.ForContext(reporting).Warning(message, exception);
         }

         /// <inheritdoc/>
         public void Warn(Type reporting, Exception exception, Func<string> messageBuilder)
         {
             var logger = Log.Logger;
-            logger?.Warning(messageBuilder(), exception);
+            logger?.ForContext(reporting).Warning(messageBuilder(), exception);
         }

         ///// <inheritdoc/>
@@ -182,14 +184,14 @@
         public void Info(Type reporting, string message)
         {
             var logger = Log.Logger;
-            logger?.Information(message);
+            logger?.ForContext(reporting).Information(message);
         }

         /// <inheritdoc/>
         public void Info(Type reporting, Func<string> generateMessage)
         {
             var logger = Log.Logger;
-            logger?.Information(generateMessage());
+            logger?.ForContext(reporting).Information(generateMessage());
         }

         ///// <inheritdoc/>
@@ -212,14 +214,14 @@
         public void Debug(Type reporting, string message)
         {
             var logger = Log.Logger;
-            logger?.Debug(message);
+            logger?.ForContext(reporting).Debug(message);
         }

         /// <inheritdoc/>
         public void Debug(Type reporting, Func<string> messageBuilder)
         {
             var logger = Log.Logger;
-            logger?.Debug(messageBuilder());
+            logger?.ForContext(reporting).Debug(messageBuilder());
         }

         ///// <inheritdoc/>


Copy collection before iterating since it can be modified

--- GitTfs/Commands/Fetch.cs
+++ GitTfs/Commands/Fetch.cs
@@ -104,7 +104,8 @@
             if (!FetchAll && IgnoreBranches)
                 globals.Repository.SetConfig(GitTfsConstants.IgnoreBranches, true.ToString());

-            foreach (var remote in GetRemotesToFetch(args))
+            var remotesToFetch = GetRemotesToFetch(args).ToList();
+            foreach (var remote in remotesToFetch)
             {
                 FetchRemote(stopOnFailMergeCommit, remote);
             }


Remove custom word splitting logic, add localisation support.

--- osu.Game/Overlays/Music/PlaylistItem.cs
+++ osu.Game/Overlays/Music/PlaylistItem.cs
@@ -12,16 +12,18 @@
 using osu.Game.Graphics.Sprites;
 using OpenTK;
 using OpenTK.Graphics;
+using osu.Framework.Localisation;

 namespace osu.Game.Overlays.Music
 {
     internal class PlaylistItem : Container
     {
         private const float fade_duration = 100;
-        private Color4 currentColour;

-        private readonly TextAwesome icon;
-        private readonly IEnumerable<OsuSpriteText> title, artist;
+        private Color4 hoverColour;
+
+        private TextAwesome handle;
+        private OsuSpriteText title;

         public readonly BeatmapSetInfo BeatmapSetInfo;

@@ -37,8 +39,7 @@
                 selected = value;

                 Flush(true);
-                foreach (OsuSpriteText t in title)
-                    t.FadeColour(Selected ? currentColour : Color4.White, fade_duration);
+                title.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
             }
         }

@@ -49,72 +50,65 @@
             RelativeSizeAxes = Axes.X;
             AutoSizeAxes = Axes.Y;
             Padding = new MarginPadding { Top = 3, Bottom = 3 };
+        }

-            FillFlowContainer<OsuSpriteText> textContainer = new FillFlowContainer<OsuSpriteText>
-            {
-                RelativeSizeAxes = Axes.X,
-                AutoSizeAxes = Axes.Y,
-                Padding = new MarginPadding { Left = 20 },
-                Spacing = new Vector2(5f, 0f),
-            };
+        [BackgroundDependencyLoader]
+        private void load(OsuColour colours, LocalisationEngine localisation)
+        {
+            BeatmapMetadata metadata = BeatmapSetInfo.Metadata;

             Children = new Drawable[]
             {
-                icon = new TextAwesome
+                handle = new TextAwesome
                 {
                     Anchor = Anchor.TopLeft,
                     Origin = Anchor.TopLeft,
                     TextSize = 12,
+                    Colour = colours.Gray5,
                     Icon = FontAwesome.fa_bars,
                     Alpha = 0f,
                     Margin = new MarginPadding { Left = 5 },
                     Padding = new MarginPadding { Top = 2 },
                 },
-                textContainer,
+                new FillFlowContainer<OsuSpriteText>
+                {
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
+                    Padding = new MarginPadding { Left = 20 },
+                    Spacing = new Vector2(5f, 0f),
+                    Children = new []
+                    {
+                        title = new OsuSpriteText
+                        {
+                            TextSize = 16,
+                            Font = @"Exo2.0-Regular",
+                            Current = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title),
+                        },
+                        new OsuSpriteText
+                        {
+                            TextSize = 14,
+                            Font = @"Exo2.0-Bold",
+                            Colour = colours.Gray9,
+                            Padding = new MarginPadding { Top = 1 },
+                            Current = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist),
+                        }
+                    }
+                },
             };

-            textContainer.Add(title = splitText(BeatmapSetInfo.Metadata.Title, 16, @"Exo2.0-Regular", new MarginPadding(0)));
-            textContainer.Add(artist = splitText(BeatmapSetInfo.Metadata.Artist, 14, @"Exo2.0-Bold", new MarginPadding { Top = 1 }));
-        }
-
-        private IEnumerable<OsuSpriteText> splitText(string text, int textSize, string font, MarginPadding padding)
-        {
-            List<OsuSpriteText> sprites = new List<OsuSpriteText>();
-
-            foreach (string w in text.Split(' '))
-            {
-                sprites.Add(new OsuSpriteText
-                {
-                    TextSize = textSize,
-                    Font = font,
-                    Text = w,
-                    Padding = padding,
-                });
-            }
-
-            return sprites;
-        }
-
-        [BackgroundDependencyLoader]
-        private void load(OsuColour colours)
-        {
-            foreach (OsuSpriteText t in artist)
-                t.Colour = colours.Gray9;
-
-            icon.Colour = colours.Gray5;
-            currentColour = colours.Yellow;
+            hoverColour = colours.Yellow;
         }

         protected override bool OnHover(Framework.Input.InputState state)
         {
-            icon.FadeIn(fade_duration);
+            handle.FadeIn(fade_duration);

             return base.OnHover(state);
         }

         protected override void OnHoverLost(Framework.Input.InputState state)
         {
-            icon.FadeOut(fade_duration);
+            handle.FadeOut(fade_duration);
         }

         protected override bool OnClick(Framework.Input.InputState state)


Implement IAggregateAudioAdjustments properties for FallbackSampleStore

--- osu.Game/Rulesets/UI/DrawableRuleset.cs
+++ osu.Game/Rulesets/UI/DrawableRuleset.cs
@@ -517,6 +517,12 @@

         public BindableDouble Frequency => throw new NotImplementedException();

+        public IBindable<double> AggregateVolume => throw new NotImplementedException();
+
+        public IBindable<double> AggregateBalance => throw new NotImplementedException();
+
+        public IBindable<double> AggregateFrequency => throw new NotImplementedException();
+
         public int PlaybackConcurrency
         {
             get => throw new NotImplementedException();


Fix test screen loading

Fix test screen loading

--- osu.Game/Tests/Visual/ScreenTestCase.cs
+++ osu.Game/Tests/Visual/ScreenTestCase.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using osu.Framework.Graphics;
 using osu.Framework.Screens;
 using osu.Game.Screens;

@@ -11,38 +12,21 @@
     /// </summary>
     public abstract class ScreenTestCase : OsuTestCase
     {
-        private readonly TestOsuScreen baseScreen;
+        private readonly ScreenStack stack;

         protected ScreenTestCase()
         {
-            Add(baseScreen = new TestOsuScreen());
+            Add(stack = new ScreenStack
+            {
+                RelativeSizeAxes = Axes.Both,
+            });
         }

-        protected void LoadScreen(OsuScreen screen) => baseScreen.LoadScreen(screen);
-
-        public class TestOsuScreen : OsuScreen
+        protected void LoadScreen(OsuScreen screen)
         {
-            private OsuScreen nextScreen;
-
-            public void LoadScreen(OsuScreen screen) => Schedule(() =>
-            {
-                nextScreen = screen;
-
-                if (this.IsCurrentScreen())
-                {
-                   this.Push(screen);
-                    nextScreen = null;
-                }
-                else
-                    this.MakeCurrent();
-            });
-
-            public override void OnResuming(IScreen last)
-            {
-                base.OnResuming(last);
-                if (nextScreen != null)
-                    LoadScreen(nextScreen);
-            }
+            if (stack.CurrentScreen != null)
+                stack.Exit();
+            stack.Push(screen);
         }
     }
 }


Removed unused prop

Removed unused prop

--- UnitTests/FaqSystemTest/FaqSystemTests.cs
+++ UnitTests/FaqSystemTest/FaqSystemTests.cs
@@ -12,7 +12,6 @@
     {
         private FaqSystem _faqSystem;
         private MongoClient _mongo;
-        private ulong TestChannel => 336769094902611968;
         private static ulong TestGuild => 173334405438242816;
         private static ulong TestUser => 206813496585748480;


Moved connection code to Singleton creation

--- Unity/Assets/Scripts/MoCap/MoCapClient.cs
+++ Unity/Assets/Scripts/MoCap/MoCapClient.cs
@@ -35,8 +35,28 @@
 		clientMutex.WaitOne();
 		if ( client == null )
 		{
-			client = new NatNetClient(clientAppName, clientAppVersion);
-		}
+            // create singleton
+            client = new NatNetClient(clientAppName, clientAppVersion);
+
+            // build list of server addresses
+            ICollection<IPAddress> serverAddresses = GetServerAddresses();
+
+            // run through the list
+            foreach (IPAddress address in serverAddresses)
+            {
+                if (client.Connect(address))
+                {
+                    Debug.Log("MoCap client connected to MotionServer '" + client.GetServerName() + "' on " + address + ".");
+                    break;
+                }
+            }
+
+            // nope, can't find it
+            if (!client.IsConnected())
+            {
+                Debug.LogWarning("Could not connect to any MotionServer.");
+            }
+        }
 		clientMutex.ReleaseMutex();
 		return client;
 	}
@@ -49,28 +69,6 @@
 	public void Start()
 	{
 		GetClient(); // trigger creation of singleton (if not already happened)
-
-		// build list of server addresses
-		ICollection<IPAddress> serverAddresses = GetServerAddresses();
-
-		clientMutex.WaitOne();
-		// run through the list
-		foreach (IPAddress address in serverAddresses)
-		{
-
-			if (client.Connect(address))
-			{
-				Debug.Log("MoCap client connected to MotionServer '" + client.GetServerName() + "' on " + address + ".");
-				break;
-			}
-		}
-
-		// nope, can't find it
-		if (!client.IsConnected())
-		{
-			Debug.LogWarning("Could not connect to any MotionServer.");
-		}
-		clientMutex.WaitOne();
 	}


Adjusted BGimage of AddContactForm

Adjusted BGimage of AddContactForm

--- source/Todo.Forms/AddContactForm.Designer.cs
+++ source/Todo.Forms/AddContactForm.Designer.cs
@@ -264,7 +264,8 @@
 			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
 			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
 			this.BackgroundImage = global::Todo.Forms.Properties.Resources.BGAddContactFormDark;
-			this.ClientSize = new System.Drawing.Size(544, 441);
+			this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+			this.ClientSize = new System.Drawing.Size(539, 581);
 			this.Controls.Add(this.generateRandomContactButton);
 			this.Controls.Add(this.saveContactButton);
 			this.Controls.Add(this.departmentTextBox);


Fix incorrect use of vaproxy

Fix incorrect use of vaproxy

--- VoiceAttackResponder/VoiceAttackPlugin.cs
+++ VoiceAttackResponder/VoiceAttackPlugin.cs
@@ -884,7 +884,7 @@
         private static void setBodyValues(Body body, string prefix, dynamic vaProxy)
         {
             Logging.Debug("Setting body information (" + prefix + ")");
-            vaProxy.SetString(prefix + " stellar class", body == null ? null : body.stellarclass);
+            vaProxy.SetText(prefix + " stellar class", body == null ? null : body.stellarclass);
             vaProxy.SetInt(prefix + " age", body == null ? null : body.age);
             Logging.Debug("Set body information (" + prefix + ")");
         }


Make pin to tray optional through dependency property

--- WPFTrayWindow/WPFTrayWindow/TrayWindow.cs
+++ WPFTrayWindow/WPFTrayWindow/TrayWindow.cs
@@ -25,6 +25,17 @@
             this.Visibility = Visibility.Hidden;
         }

+
+
+        private static readonly DependencyProperty PinToTrayProperty = DependencyProperty.Register("PinToTray", typeof(bool), typeof(TrayWindow), new UIPropertyMetadata(false));
+        public bool PinToTray
+        {
+            get { return (bool)this.GetValue(PinToTrayProperty); }
+            set
+            {
+                this.SetValue(PinToTrayProperty, value);
+            }
+        }

         private static readonly DependencyProperty TrayIconProperty = DependencyProperty.Register("TrayIcon", typeof(string), typeof(TrayWindow), new UIPropertyMetadata("",TrayIconPropertyChanged));
         /// <summary>
@@ -95,7 +106,8 @@
             }
             else
             {
-                PinToTray();
+                if(this.PinToTray)
+                    AttachToTray();
                 this.Show();
                 this.Activate();
             }
@@ -108,7 +120,7 @@
         /// <summary>
         /// Position the window adjacent to the natification tray
         /// </summary>
-        public void PinToTray()
+        public void AttachToTray()
         {
             TaskbarPosition trayposition = TaskBar.Position;


# UI Improvement for ALL: - Main Menu for PSNP View

--- Web/Views/Shared/NewTheme_MainMenu.cshtml
+++ Web/Views/Shared/NewTheme_MainMenu.cshtml
@@ -474,62 +474,61 @@

                             break;
                         case (int)UserType.CASETEAM.PSNP:
-

-

-

-                                @Html.Translate2(PAGE_NAME, " Plans")
-

+
+

+                                @Html.Translate2(PAGE_NAME, " Plans")
+

                                     @*

-                                            @Html.PSNPOperationMenuItem(@Html.Translate("Plan"),
-                                                            @Url.Action("Index", "Plan", new { Area = "EarlyWarning" }),
-                                                            PsnpConstants.Operation.View__plan_menu_item)
-
*@
+                @Html.PSNPOperationMenuItem(@Html.Translate("Plan"),
+                                @Url.Action("Index", "Plan", new { Area = "EarlyWarning" }),
+                                PsnpConstants.Operation.View__plan_menu_item)
+
*@

                                         @Html.PSNPOperationMenuItem(@Html.Translate("PSNP Plan"),
-                                                @Url.Action("Index", "RegionalPSNPPlan", new { Area = "PSNP" }),
-                                                PsnpConstants.Operation.View_PSNP_plan_menu_item)
+                                            @Url.Action("Index", "RegionalPSNPPlan", new { Area = "PSNP" }),
+                                            PsnpConstants.Operation.View_PSNP_plan_menu_item)

                                     @*
@Html.Translate2(PAGE_NAME, "Plan")
*@

-

-                                @Html.Translate2(PAGE_NAME, " Requests")
-

-

-                                        @Html.PSNPOperationMenuItem(@Html.Translate("Requests"),
+

+    @Html.Translate2(PAGE_NAME, " Requests")
+

+

+            @Html.PSNPOperationMenuItem(@Html.Translate("Requests"),
                                                 @Url.Action("Index", "Request", new { Area = "EarlyWarning" }),
                                                 PsnpConstants.Operation.View_requests_menu_item)
-

-

-                                        @Html.PSNPOperationMenuItem(@Html.Translate("New Request"),
+

+

+            @Html.PSNPOperationMenuItem(@Html.Translate("New Request"),
                                                 @Url.Action("New", "Request", new { Area = "EarlyWarning" }),
                                                 PsnpConstants.Operation.View_requests_menu_item)
-

-                                    @*
@Html.Translate("New Request ")
*@
-

-

-
-

-                                @Html.Translate2(PAGE_NAME, " Requisition")
-

-

-                                        @Html.PSNPOperationMenuItem(@Html.Translate("Requisitions"), @Url.Action("Index", "ReliefRequisition", new { Area = "EarlyWarning" }),
+

+        @*
@Html.Translate("New Request ")
*@
+

+

+
+

+    @Html.Translate2(PAGE_NAME, " Requisition")
+

+

+            @Html.PSNPOperationMenuItem(@Html.Translate("Requisitions"), @Url.Action("Index", "ReliefRequisition", new { Area = "EarlyWarning" }),
                                                 PsnpConstants.Operation.View_Requisitions)
-

-

-

-
-

-                                @Html.Translate2(PAGE_NAME, " Ration")
-

-

-                                        @Html.PSNPOperationMenuItem(@Html.Translate("Rations"), @Url.Action("Index", "Ration", new { Area = "EarlyWarning" }),
+

+

+

+
+

+    @Html.Translate2(PAGE_NAME, " Ration")
+

+

+            @Html.PSNPOperationMenuItem(@Html.Translate("Rations"), @Url.Action("Index", "Ration", new { Area = "EarlyWarning" }),
                                                 PsnpConstants.Operation.View_ration_menu_item)
-

-

-

+

+

+

                             @*

@@ -538,8 +537,7 @@

@Html.Translate("Reports")

*@
-

-

+
                             break;
                         case (int)UserType.CASETEAM.LOGISTICS:

@@ -817,7 +815,7 @@

-
+

                         @Html.GetUserName()


# UI Improvement for All: - Logistics Main menu View

--- Web/Views/Shared/NewTheme_MainMenu.cshtml
+++ Web/Views/Shared/NewTheme_MainMenu.cshtml
@@ -541,141 +541,139 @@

                             break;
                         case (int)UserType.CASETEAM.LOGISTICS:
-

-

-

-                                    @Html.Translate2(PAGE_NAME, "Dispatch")
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Dispatch Allocation"),
-                                                @Url.Action("Index", "DispatchAllocation", new { Area = "Logistics" }),
-                                                LogisticsConstants.Operation.View_dispatch_allocation_menu_item)
-

-

-

-
-

-                                    @Html.Translate2(PAGE_NAME, " Transport")
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Transport Requisition"),
+
+

+                                @Html.Translate2(PAGE_NAME, "Dispatch")
+

+

+                                        @Html.LogisticOperationMenuItem(@Html.Translate("Dispatch Allocation"),
+                                            @Url.Action("Index", "DispatchAllocation", new {Area = "Logistics"}),
+                                            LogisticsConstants.Operation.View_dispatch_allocation_menu_item)
+

+

+

+
+

+                            @Html.Translate2(PAGE_NAME, " Transport")
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Transport Requisition"),
                                                 @Url.Action("Index", "TransportRequisition", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_transport_requisition_menu_item)
-

-
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Transporter Performance"),
+

+
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Transporter Performance"),
                                                 @Url.Action("Index", "TransporterPerformance", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_transporter_performance_menu_item)
-

-
-                                        @*
Transporter Performance
*@
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Transport Order"),
+

+
+                                @*
Transporter Performance
*@
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Transport Order"),
                                                 @Url.Action("Index", "TransportOrder", new { Area = "Procurement" }),
                                                 LogisticsConstants.Operation.View_transport_order_menu_item)
-

-
-                                        @*

-                                                @Html.LogisticOperationMenuItem(@Html.Translate("Contract Admin"),
-                                                                       @Url.Action("BidWinningTransporters", "BidWinner", new { Area = "Procurement" }),
-                                                                       LogisticsConstants.Operation.View_contract_Admin_menu_item)
-
*@
-

-

-
-

-                                    @Html.Translate2(PAGE_NAME, " Reciept Plan")
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Local Purchase"),
+

+
+                                @*

+                                        @Html.LogisticOperationMenuItem(@Html.Translate("Contract Admin"),
+                                                               @Url.Action("BidWinningTransporters", "BidWinner", new { Area = "Procurement" }),
+                                                               LogisticsConstants.Operation.View_contract_Admin_menu_item)
+
*@
+

+

+
+

+                            @Html.Translate2(PAGE_NAME, " Reciept Plan")
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Local Purchase"),
                                                 @Url.Action("Index", "LocalPurchase", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_local_purchase_menu_item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Transfer"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Transfer"),
                                                 @Url.Action("Index", "Transfer", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_transfer_menu_item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Donation"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Donation"),
                                                 @Url.Action("Index", "Donation", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_donation_menu_item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Loan"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Loan"),
                                                 @Url.Action("Index", "ReciptPlanForLoan", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_Loan_Menu_Item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Swap"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Swap"),
                                                 @Url.Action("Index", "Swap", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_Loan_Menu_Item)
-

-
-                                        @*
Local Purchase

-
Transfer

-
-
Donation

-
Loan
*@
-
-

-

-
-

-                                    @Html.Translate2(PAGE_NAME, " Contracts")
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Bid Planning"),
+

+
+                                @*
Local Purchase

+
Transfer

+
+
Donation

+
Loan
*@
+
+

+

+
+

+                            @Html.Translate2(PAGE_NAME, " Contracts")
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Bid Planning"),
                                                 @Url.Action("Index", "TransportBidPlan", new { Area = "Procurement" }),
                                                 LogisticsConstants.Operation.View_bid_planning_menu_item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Contract Admin"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Contract Admin"),
                                                 @Url.Action("BidWinningTransporters", "BidWinner", new { Area = "Procurement" }),
                                                 LogisticsConstants.Operation.View_contract_Admin_menu_item)
-

-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Payment Request"),
+

+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Payment Request"),
                                                 @Url.Action("Index", "TransporterPaymentRequest", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_Payment_Requests)
-

-

-

-
-

-                                    @Html.Translate2(PAGE_NAME, "Stock Status")
-

-
-                                        @*
@Html.Translate("Free Stock Status")
*@
-
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Free Stock Status"),
+

+

+

+
+

+                            @Html.Translate2(PAGE_NAME, "Stock Status")
+

+
+                                @*
@Html.Translate("Free Stock Status")
*@
+
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Free Stock Status"),
                                                 @Url.Action("Index", "LogisticsStockStatus", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_free_stock_report)
-

-
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Commodity Received Stock"),
+

+
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Commodity Received Stock"),
                                                 @Url.Action("ReceivedCommodity", "LogisticsStockStatus", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_commodity_recied_status_report)
-

-
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Carry Over Stock"),
+

+
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Carry Over Stock"),
                                                 @Url.Action("CarryOverStock", "LogisticsStockStatus", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_carry_over_stock_report)
-

-
-

-                                            @Html.LogisticOperationMenuItem(@Html.Translate("Transferred Stock"),
+

+
+

+                                    @Html.LogisticOperationMenuItem(@Html.Translate("Transferred Stock"),
                                                 @Url.Action("TransferredStock", "LogisticsStockStatus", new { Area = "Logistics" }),
                                                 LogisticsConstants.Operation.View_transfereed_stock_staus_report)
-

-

-

-

-

+

+

+

+

                             break;
                         case (int)UserType.CASETEAM.PROCUREMENT:


Introduce LineClient.GetContentAsync()

Introduce LineClient.GetContentAsync()

--- LineSharp/LineClient.cs
+++ LineSharp/LineClient.cs
@@ -185,6 +185,22 @@
             }
         }

+        public async Task<byte[]> GetAsyncAsByteArray(string url)
+        {
+            using (var client = HttpClientFactory.Create(HttpHandlers.ToArray()))
+            {
+                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ChannelAccessToken);
+                var res = await client.GetAsync($"{ApiUrlPrefix}{url}").ConfigureAwait(false);
+                if (!res.IsSuccessStatusCode)
+                {
+                    var body = await res.Content.ReadAsAsync<ErrorResponse>();
+                    throw new LineException(body.Message, body);
+                }
+
+                return await res.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
+            }
+        }
+
         public Task PushMessageAsync(string to, SendMessageBase msg)
         {
             var p = new PushMessage
@@ -221,5 +237,10 @@
         {
             return GetAsync<UserObject>($"profile/{userId}");
         }
+
+        public Task<byte[]> GetContentAsync(string messageId)
+        {
+            return GetAsyncAsByteArray($"message/{messageId}/content");
+        }
     }
 }


[WPF] ValuesContainer.cs header

[WPF] ValuesContainer.cs header

--- Xwt.WPF/Xwt.WPFBackend/ValuesContainer.cs
+++ Xwt.WPF/Xwt.WPFBackend/ValuesContainer.cs
@@ -1,4 +1,30 @@
-using System;
+//
+// ValuesContainer.cs
+//
+// Author:
+//       Eric Maupin <ermau@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
 using System.ComponentModel;

 namespace Xwt.WPFBackend


(Mac) Fix NPE when no URL on clipboard but there is text on clipboard

--- Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs
+++ Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs
@@ -146,7 +146,7 @@
 			// Url as text!
 			if (type == TransferDataType.Text) {
 				NSUrl url = NSUrl.FromPasteboard(NSPasteboard.GeneralPasteboard);
-				if(url.IsFileUrl) {
+				if(url != null && url.IsFileUrl) {
 					return "file://" + new Uri(url.Path).AbsolutePath;
 				}
 			}


Refactor: new C# features used

Refactor: new C# features used

--- src/reni2/Code/LocalVariableAccess.cs
+++ src/reni2/Code/LocalVariableAccess.cs
@@ -32,17 +32,13 @@
             StopByObjectId(-7);
         }

-        protected override string GetNodeDump()
-        {
-            return base.GetNodeDump()
-                + " Holder=" + Holder
-                + " Offset=" + Offset
-                + " DataSize=" + DataSize
-                ;
-        }
+        protected override string GetNodeDump() => base.GetNodeDump()
+            + " Holder=" + Holder
+            + " Offset=" + Offset
+            + " DataSize=" + DataSize;

-        protected override Size GetSize() { return _size; }
-        internal override void Visit(IVisitor visitor) { visitor.LocalVariableAccess(Holder, Offset, Size, DataSize); }
-        protected override CodeBase TryToCombine(FiberItem subsequentElement) { return subsequentElement.TryToCombineBack(this); }
+        protected override Size GetSize() => _size;
+        internal override void Visit(IVisitor visitor) => visitor.LocalVariableAccess(Holder, Offset, Size, DataSize);
+        protected override CodeBase TryToCombine(FiberItem subsequentElement) => subsequentElement.TryToCombineBack(this);
     }
 }


add clean color test

add clean color test

--- src/GraphicObjects/GraphicObject.cs
+++ src/GraphicObjects/GraphicObject.cs
@@ -850,16 +850,16 @@
 		protected virtual void UpdateCache(Context ctx){
 			Rectangle rb = Slot + Parent.ClientRectangle.Position;
 			using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
-				//					//TODO:improve equality test for basic color and Fill
-				//					if (this.Background is SolidColor) {
-				//						if ((this.Background as SolidColor).Equals (Color.Clear)) {
-				//							ctx.Save ();
-				//							ctx.Operator = Operator.Clear;
-				//							ctx.Rectangle (rb);
-				//							ctx.Fill ();
-				//							ctx.Restore ();
-				//						}
-				//					}
+				//TODO:improve equality test for basic color and Fill
+				if (this.Background is SolidColor) {
+					if ((this.Background as SolidColor).Equals (Color.Clear)) {
+						ctx.Save ();
+						ctx.Operator = Operator.Clear;
+						ctx.Rectangle (rb);
+						ctx.Fill ();
+						ctx.Restore ();
+					}
+				}
 				ctx.SetSourceSurface (cache, rb.X, rb.Y);
 				ctx.Paint ();
 			}


added some asserts to input manager

added some asserts to input manager

--- Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs
+++ Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs
@@ -168,11 +168,11 @@
                 return;
             }

+            Debug.Assert(eventData != null);
             var baseInputEventData = ExecuteEvents.ValidateEventData<BaseInputEventData>(eventData);
-
             Debug.Assert(baseInputEventData != null);
+            Debug.Assert(baseInputEventData.InputSource != null, $"Failed to find an input source for {baseInputEventData}");
             Debug.Assert(!baseInputEventData.used);
-            Debug.Assert(eventData != null);

             GameObject focusedObject = FocusProvider?.GetFocusedObject(baseInputEventData);


Fix binding leased to bindable throwing exceptions

--- osu.Framework/Bindables/LeasedBindable.cs
+++ osu.Framework/Bindables/LeasedBindable.cs
@@ -73,6 +73,20 @@
             }
         }

+        public override T Default
+        {
+            get => base.Default;
+            set
+            {
+                if (source != null)
+                    checkValid();
+
+                if (EqualityComparer<T>.Default.Equals(Default, value)) return;
+
+                SetValue(base.Default, value, true);
+            }
+        }
+
         public override bool Disabled
         {
             get => base.Disabled;


Area Name can be populate from private const string

--- src/Hosting/PreferenceController.cs
+++ src/Hosting/PreferenceController.cs
@@ -4,10 +4,11 @@

 namespace Wangkanai.Detection.Hosting
 {
-    [Area("Detection")]
+    [Area(AreaName)]
     public class PreferenceController : Controller
     {
         private readonly IPreferenceService _preferenceService;
+        private const    string             AreaName = "Detection";

         public PreferenceController(IPreferenceService preferenceService)
             => _preferenceService = preferenceService;


Save on disposal

Save on disposal

--- osu.Game/Collections/CollectionManager.cs
+++ osu.Game/Collections/CollectionManager.cs
@@ -176,6 +176,12 @@
                 return false;
             }
         }
+
+        protected override void Dispose(bool isDisposing)
+        {
+            base.Dispose(isDisposing);
+            save();
+        }
     }

     public class BeatmapCollection


Refactor: Separate tokenizing from brace matching

--- AutoScaleFormulaLanguageService/AutoScaleFormulaLanguageService.cs
+++ AutoScaleFormulaLanguageService/AutoScaleFormulaLanguageService.cs
@@ -70,7 +70,7 @@
             switch (req.Reason)
             {
                 case ParseReason.MatchBraces:
-                    ParseEntireFile(req);
+                    MatchBraces(req);
                     break;
             }

@@ -79,7 +79,13 @@

         #endregion LanguageService Methods

-        private void ParseEntireFile(ParseRequest req)
+        private void MatchBraces(ParseRequest req)
+        {
+            var tokens = TokenizeFile(req);
+            FindMatchedPairs(tokens);
+        }
+
+        private IEnumerable<Token> TokenizeFile(ParseRequest req)
         {
             string[] lines = req.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None);

@@ -107,10 +113,10 @@
                 ++lineNumber;
             }

-            FindMatchedPairs(tokens);
+            return tokens;
         }

-        private void FindMatchedPairs(List<Token> tokens)
+        private void FindMatchedPairs(IEnumerable<Token> tokens)
         {
             var parenStack = new Stack<Token>();


spelling corrections

spelling corrections

--- src/IdentityServer4Empty/Startup.cs
+++ src/IdentityServer4Empty/Startup.cs
@@ -20,7 +20,7 @@

         public void ConfigureServices(IServiceCollection services)
         {
-            // uncomment, if you wan to add an MVC-based UI
+            // uncomment, if you want to add an MVC-based UI
             //services.AddMvc().SetCompatibilityVersion(Microsoft.AspNetCore.Mvc.CompatibilityVersion.Version_2_1);

             var builder = services.AddIdentityServer()
@@ -50,8 +50,8 @@

             app.UseIdentityServer();

-            // uncomment, if you wan to add an MVC-based UI
+            // uncomment, if you want to add an MVC-based UI
             //app.UseMvcWithDefaultRoute();
         }
     }
-}+}


Rename method to ScrollToAndHighlightMessage

--- osu.Game/Overlays/Chat/DrawableChannel.cs
+++ osu.Game/Overlays/Chat/DrawableChannel.cs
@@ -186,7 +186,7 @@
                     var notification = new PrivateMessageNotification(message.Sender.Username, () =>
                     {
                         channelManager.CurrentChannel.Value = Channel;
-                        HighlightMessage(message);
+                        ScrollToAndHighlightMessage(message);
                     });

                     notificationOverlay?.Post(notification);
@@ -198,7 +198,7 @@
                     var notification = new MentionNotification(message.Sender.Username, () =>
                     {
                         channelManager.CurrentChannel.Value = Channel;
-                        HighlightMessage(message);
+                        ScrollToAndHighlightMessage(message);
                     });

                     notificationOverlay?.Post(notification);
@@ -214,7 +214,7 @@
                         var notification = new HighlightNotification(message.Sender.Username, matchedWord, () =>
                         {
                             channelManager.CurrentChannel.Value = Channel;
-                            HighlightMessage(message);
+                            ScrollToAndHighlightMessage(message);
                         });

                         notificationOverlay?.Post(notification);
@@ -237,7 +237,7 @@
             }
         }

-        public void HighlightMessage(Message message)
+        public void ScrollToAndHighlightMessage(Message message)
         {
             var chatLine = findChatLine(message);
             scroll.ScrollTo(chatLine);


add comments to JwtTokenRefresher, unfold Unauthorized method

--- CSharp/Library/Microsoft.Bot.Connector.Shared/JwtTokenRefresher.cs
+++ CSharp/Library/Microsoft.Bot.Connector.Shared/JwtTokenRefresher.cs
@@ -24,15 +24,23 @@
         {
             HttpResponseMessage response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);

+            // possibly a transient "token expiration" failure
             if (response.StatusCode == HttpStatusCode.Unauthorized)
             {
                 response.Dispose();
+                // this call might throw if the Microsoft login service returns an oauth failure
                 var token = await credentials.GetTokenAsync(true).ConfigureAwait(false);
+                // adds token to outgoing request
                 await credentials.ProcessHttpRequestAsync(request, cancellationToken).ConfigureAwait(false);
+                // retry request with refreshed token
                 response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
             }

-            if (this.Unauthorized(response.StatusCode))
+            // since we've ruled out transient "token expiration" failure, or we've found a permanent Forbidden failure
+            // this failure will come from a downstream system like channel connector or state service rather than the Microsoft login service
+            // then throw an exception with additional context
+            // this centralizes the handling for this StatusCode here rather than the autorest-generated clients
+            if (response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.Unauthorized)
             {
                 using (response)
                 {
@@ -51,10 +59,5 @@

             return response;
         }
-
-        private bool Unauthorized(System.Net.HttpStatusCode code)
-        {
-            return code == HttpStatusCode.Forbidden || code == HttpStatusCode.Unauthorized;
-        }
     }
 }


Added some more test cases

Added some more test cases

--- RPNCalculatorUnitTests/Test.cs
+++ RPNCalculatorUnitTests/Test.cs
@@ -38,10 +38,49 @@
 		}

 		[Test()]
-		public void TestIsEmptyOnCreation ()
+		public void IsEmptyOnCreation()
 		{
 			float result = _stack.Pop();
 			Assert.IsNaN(result);
+		}
+
+		[Test()]
+		public void TwoElementsOnStack()
+		{
+			_stack.PushValue (2);
+			_stack.PushValue (3);
+			Assert.AreEqual (_stack.Pop (), 3);
+			Assert.AreEqual (_stack.Pop (), 2);
+		}
+
+		[Test()]
+		public void SumTwoElements()
+		{
+			_stack.PushValue (2);
+			_stack.PushValue (3);
+			_stack.PushOperation (Operations.SUM);
+			Assert.AreEqual (_stack.Pop (), 5);
+		}
+
+		[Test()]
+		public void Negative()
+		{
+			_stack.PushValue (2);
+			_stack.PushOperation (Operations.UNARY_MINUS);
+			Assert.AreEqual (_stack.Pop (), -2);
+			_stack.PushValue (-100);
+			_stack.PushOperation (Operations.UNARY_MINUS);
+			Assert.AreEqual (_stack.Pop (), 100);
+		}
+
+		[Test()]
+		public void SumTwoElementsNegative()
+		{
+			_stack.PushValue (2);
+			_stack.PushValue (3);
+			_stack.PushOperation (Operations.UNARY_MINUS);
+			_stack.PushOperation (Operations.SUM);
+			Assert.AreEqual (_stack.Pop (), -1);
 		}
 	}


Dispose file streams on end of ServeStatic view

--- RailPhase/Views/ServeStatic.cs
+++ RailPhase/Views/ServeStatic.cs
@@ -34,26 +34,31 @@
             string root = Path.GetFullPath(rootDirectory);
             string relativeFilePath = Utils.MakeRelativePath(context.Request.Url.AbsolutePath, urlPrefix);
             string filePath = Path.GetFullPath(Path.Combine(rootDirectory, relativeFilePath));
-
+
             // No ../ allowed! Make sure only files inside the rootDirectory are server.
-            if(!filePath.StartsWith(root) || !File.Exists(filePath))
+            if (!filePath.StartsWith(root) || !File.Exists(filePath))
             {
                 context.Response.StatusCode = 404;
                 context.WriteResponse("
404 Not Found
");
             }
+            else
+            {
+                // Try to find the content type for this file extension
+                var extension = Path.GetExtension(filePath).ToLower();
+                extension = extension.Replace(".", "");
+                string contentType = null;
+                ContentTypesByExtension.TryGetValue(extension, out contentType);

-            // Try to find the content type for this file extension
-            var extension = Path.GetExtension(filePath).ToLower();
-            extension = extension.Replace(".", "");
-            string contentType = null;
-            ContentTypesByExtension.TryGetValue(extension, out contentType);
+                // If we found a content type for this file, add it to the HTTP response, otherwise omit it.
+                if (contentType != null)
+                    context.Response.ContentType = contentType;

-            // If we found a content type for this file, add it to the HTTP response, otherwise omit it.
-            if (contentType != null)
-                context.Response.ContentType = contentType;
-
-            // Copy the file contents to the response stream
-            File.OpenRead(filePath).CopyTo(context.ResponseStream);
+                // Copy the file contents to the response stream
+                using (var stream = File.OpenRead(filePath))
+                {
+                    stream.CopyTo(context.ResponseStream);
+                }
+            }
         }
     }
 }


same surname bug fix

same surname bug fix

--- RedmineTimeConsumer/Program.cs
+++ RedmineTimeConsumer/Program.cs
@@ -18,11 +18,11 @@
         {
             if (args.Length < 1)
             {
-                Console.WriteLine("Не указан ты");
+                Console.WriteLine("Usage: RedMineTimeConsumer <Дата yyyy-MM-dd> <Login RM>");
                 Environment.Exit(-1);
             }

-            var employeeName = args[0];
+            var login = args[0];
             string date = args.Length < 2 ? DateTime.Now.ToString("yyyy-MM-dd") : args[1];

             string host = "http://redmine.ugsk.ru";
@@ -35,13 +35,20 @@
             var parameters = new NameValueCollection { { "limit", "1000" }
                                                       ,{ "offset", "0" }
                                                     };
-            var users = manager.GetObjectList<User>(parameters).Where(e => e.LastName.Contains(employeeName)
-                                                                       && !e.FirstName.Contains("External")
+            //var users = manager.GetObjectList<User>(parameters).Where(e => e.LastName.Contains(employeeName)
+            //                                                           && !e.FirstName.Contains("External")
+            //                                                            ).OrderBy(e => e.Id);
+
+            var users = manager.GetObjectList<User>(parameters).Where(e => e.Login.Equals(login, StringComparison.InvariantCultureIgnoreCase)
                                                                         ).OrderBy(e => e.Id);
+
             int userID = 0;
+            string userName = string.Empty;
             foreach (var u in users)
             {
                 userID = u.Id;
+                userName = string.Format("{0} {1}", u.LastName, u.FirstName);
+                break; // instead of top 1 :)
             }

             // Time Entries
@@ -63,14 +70,14 @@

             var strBuilder = new StringBuilder();

-            bool isWrittenEmployeeName = false;
+            //bool isWrittenEmployeeName = false;

             //var path = Path.GetTempFileName() + ".txt";
             var pathTime = string.Format("{0}-time.txt", date);
             var pathReport = string.Format("{0}-report.txt", date);
             StringBuilder sbOut = new StringBuilder();
             double hoursSum = 0;
-            string name = string.Empty;
+            //string name = string.Empty;

             using (var swReport = new StreamWriter(pathReport, true))
             {
@@ -78,17 +85,18 @@
                 {
                     //sw.WriteLine("--------------");
                     sbOut.AppendLine("--------------");
+                    sbOut.AppendLine(userName);

                     foreach (var timeEntry in timeEntries) //
                     {

-                        if (!isWrittenEmployeeName)
-                        {
-                            //sw.Write(timeEntry.User.Name);
-                            name = timeEntry.User.Name;
-                            sbOut.AppendLine(name);
-                            isWrittenEmployeeName = true;
-                        }
+                        //if (!isWrittenEmployeeName)
+                        //{
+                        //    //sw.Write(timeEntry.User.Name);
+                        //    //name = timeEntry.User.Name;
+                        //    sbOut.AppendLine(userName);
+                        //    isWrittenEmployeeName = true;
+                        //}
                         strBuilder.Clear();
                         strBuilder.AppendFormat("{0}. {1} ({2}): ", ++i, timeEntry.Project.Name, timeEntry.Activity.Name, timeEntry.SpentOn);
                         //Issue issue=null;
@@ -121,13 +129,13 @@
                         overTime = string.Empty;
                     }

-                    if (!string.IsNullOrEmpty(name))
+                    if (hoursSum > 0)
                     {
-                        swTime.WriteLine("{0,15} [{1:0.00}] {2}", employeeName, hoursSum, overTime);
+                        swTime.WriteLine("{0,25} [{1:0.00}] {2}", userName, hoursSum, overTime);
                     }
                     else
                     {
-                        swTime.WriteLine("{0,15} [----]", employeeName);
+                        swTime.WriteLine("{0,25} [----]", userName);

                     }
                     //System.Console.WriteLine(sbOut.ToString());


Extracted a GetBaseUri helper method,

Extracted a GetBaseUri helper method,

to mirror the GetRelativeUri helper method. Now the overall flow of the
GetUri<T> method seems very readable.

--- Hyprlinkr/RouteLinker.cs
+++ Hyprlinkr/RouteLinker.cs
@@ -139,10 +139,7 @@
             var r = this.Dispatch(methodCallExp);

             var relativeUri = this.GetRelativeUri(r);
-
-            var authority =
-                this.request.RequestUri.GetLeftPart(UriPartial.Authority);
-            var baseUri = new Uri(authority);
+            var baseUri = this.GetBaseUri();
             return new Uri(baseUri, relativeUri);
         }

@@ -224,6 +221,14 @@
             return relativeUri;
         }

+        private Uri GetBaseUri()
+        {
+            var authority =
+                this.request.RequestUri.GetLeftPart(UriPartial.Authority);
+            var baseUri = new Uri(authority);
+            return baseUri;
+        }
+
         private UrlHelper CreateUrlHelper()
         {
             return this.CopyRequestWithoutRouteValues().GetUrlHelper();


initGradTexture

initGradTexture

--- Demos/CSharpGL.Demos/13SimplexNoise/SimplexNoiseRenderer.Static.cs
+++ Demos/CSharpGL.Demos/13SimplexNoise/SimplexNoiseRenderer.Static.cs
@@ -149,5 +149,48 @@
             OpenGL.GetDelegateFor<OpenGL.glActiveTexture>()(OpenGL.GL_TEXTURE0);
         }

+        /*
+ * initGradTexture(GLuint *texID) - create and load a 2D texture
+ * for a 4D gradient lookup table. This is used for 4D noise only.
+ */
+        void initGradTexture(uint[] texID)
+        {
+            // Activate a different texture unit (unit 2)
+            OpenGL.GetDelegateFor<OpenGL.glActiveTexture>()(OpenGL.GL_TEXTURE2);
+
+            // Generate a unique texture ID
+            OpenGL.GenTextures(1, texID);
+            // Bind the texture to texture unit 2
+            OpenGL.BindTexture(OpenGL.GL_TEXTURE_2D, texID[0]);
+            OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MIN_FILTER, (int)OpenGL.GL_NEAREST);
+            OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MAG_FILTER, (int)OpenGL.GL_NEAREST);
+
+            var pixels = new UnmanagedArray<byte>(256 * 256 * 4);
+            unsafe
+            {
+                var array = (byte*)pixels.Header.ToPointer();
+                for (int i = 0; i < 256; i++)
+                {
+                    for (int j = 0; j < 256; j++)
+                    {
+                        int offset = (i * 256 + j) * 4;
+                        int value = (perm[(j + perm[i]) & 0xFF]);
+                        array[offset] = (byte)(grad4[value & 0x1F][0] * 64 + 64);   // Gradient x
+                        array[offset + 1] = (byte)(grad4[value & 0x1F][1] * 64 + 64); // Gradient y
+                        array[offset + 2] = (byte)(grad4[value & 0x1F][2] * 64 + 64); // Gradient z
+                        array[offset + 3] = (byte)(grad4[value & 0x1F][3] * 64 + 64); // Gradient z
+                    }
+                }
+            }
+
+            // GLFW texture loading functions won't work here - we need GL_NEAREST lookup.
+            OpenGL.TexImage2D(OpenGL.GL_TEXTURE_2D, 0, OpenGL.GL_RGBA,
+                256, 256, 0, OpenGL.GL_RGBA, OpenGL.GL_UNSIGNED_BYTE, pixels.Header);
+            pixels.Dispose();
+
+            // Switch active texture unit back to 0 again
+            OpenGL.GetDelegateFor<OpenGL.glActiveTexture>()(OpenGL.GL_TEXTURE0);
+        }
+
     }
 }


Added New Room button

Added New Room button

--- src/LabLog/Views/Admin/Index.cshtml
+++ src/LabLog/Views/Admin/Index.cshtml
@@ -17,4 +17,6 @@

-
New Room
+<form action="./admin/AddRoom">
+    <input type="submit" value="New Room" />
+</form>


Minor fixes for error/warning messages

Minor fixes for error/warning messages

--- IceBuilderTasks/Tasks.cs
+++ IceBuilderTasks/Tasks.cs
@@ -284,7 +284,6 @@
                     s = s.Substring(WorkingDirectory.Length);
                 }

-                bool warning = false;
                 String file = "";
                 int line = 0;
                 String description = "";
@@ -335,22 +334,20 @@

                 if(description.IndexOf("warning:") == 0)
                 {
-                    description = description.Substring("warning:".Length);
                     //
                     // Don't emit warnings while parsing dependencies otherwise
                     // they will appear twices in the Error List and Output.
                     //
                     if(!Depend)
                     {
-                        Log.LogWarning("", "", "", file, line - 1, 0, 0, 0, description);
+                        Log.LogWarning("", "", "", file, line - 1, 0, 0, 0, description.Substring("warning:".Length));
                     }
                 }
                 else if (description.IndexOf("error:") == 0)
                 {
-                    description = description.Substring("error:".Length);
-                    Log.LogError("", "", "", file, line - 1, 0, 0, 0, description);
-                }
-                else
+                    Log.LogError("", "", "", file, line - 1, 0, 0, 0, description.Substring("error:".Length));
+                }
+                else if(!String.IsNullOrEmpty(description))
                 {
                     Log.LogError("", "", "", file, line - 1, 0, 0, 0, description);
                 }


Removed tuple solution.

Removed tuple solution.

--- src/Micro+/Storage/SqlDbProvider.cs
+++ src/Micro+/Storage/SqlDbProvider.cs
@@ -1,8 +1,5 @@
 using System;
-using System.Collections.Concurrent;
 using System.Data;
-using MicroORM.Base;
-using MicroORM.Query;

 namespace MicroORM.Storage
 {
@@ -39,35 +36,31 @@
             return "[" + value + "]";
         }

-        static ConcurrentDictionary<Type,Tuple<bool,bool,bool>> _meta=new ConcurrentDictionary<Type, Tuple<bool, bool, bool>>();
         public override void SetupParameter(IDbDataParameter parameter, string name, object value)
         {
             base.SetupParameter(parameter, name, value);
             if (value == null) return;

+            DealWithSpecialParameterValues(parameter, value);
+        }
+
+        private static void DealWithSpecialParameterValues(IDbDataParameter parameter, object value)
+        {
             Type valueType = value.GetType();

-            Tuple<bool, bool, bool> meta = null;
-
-            if (!_meta.TryGetValue(valueType, out meta))
-            {
-                meta = new Tuple<bool, bool, bool>(valueType == typeof(string), valueType.Name == "SqlGeography", valueType.Name == "SqlGeometry");
-                _meta.TryAdd(valueType, meta);
-            }
-
-            if (meta.Item1)
+            if (valueType == typeof(string))
             {
                 parameter.Size = Math.Max(((string)value).Length + 1, 4000);
             }
-            else if (meta.Item2) //SqlGeography is a CLR Type
+            else if (valueType.Name == "SqlGeography")
             {
-                dynamic p = parameter;
-                p.UdtTypeName = "geography";
+                dynamic param = parameter;
+                param.UdtTypeName = "geography";
             }
-            else if (meta.Item3) //SqlGeometry is a CLR Type
+            else if (valueType.Name == "SqlGeometry") //SqlGeography is a CLR Type
             {
-                dynamic p = parameter;
-                p.UdtTypeName = "geometry";
+                dynamic param = parameter;
+                param.UdtTypeName = "geometry";
             }
         }
     }


Changing location of statement log when using hilo so that the logged statement will contain the parameters

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@4485

--- src/NHibernate/Id/TableGenerator.cs
+++ src/NHibernate/Id/TableGenerator.cs
@@ -251,13 +251,14 @@
 					session.Factory.ConnectionProvider.Driver.GenerateCommand(CommandType.Text, updateSql, parameterTypes);
 				ups.Connection = conn;
 				ups.Transaction = transaction;
-				PersistentIdGeneratorParmsNames.SqlStatementLogger.LogCommand("Updating high value:", ups, FormatStyle.Basic);
-
+
 				try
 				{
 					columnType.Set(ups, result + 1, 0);
 					columnType.Set(ups, result, 1);

+					PersistentIdGeneratorParmsNames.SqlStatementLogger.LogCommand("Updating high value:", ups, FormatStyle.Basic);
+
 					rows = ups.ExecuteNonQuery();
 				}
 				catch (Exception e)


ProjectUrl based on package Id, not nuspec name.

--- src/NuGetPackager/PackageCreator.cs
+++ src/NuGetPackager/PackageCreator.cs
@@ -27,7 +27,6 @@
                 { "authors", () => "NServiceBus Ltd" },
                 { "owners", () => "NServiceBus Ltd" },
                 { "licenseUrl", () => "http://particular.net/LicenseAgreement" },
-                { "projectUrl", () => $"https://docs.particular.net/nuget/{projectName}/" },
                 { "iconUrl", () => "http://s3.amazonaws.com/nuget.images/NServiceBus_32.png" },
                 { "requireLicenseAcceptance", () => "true" },
                 { "copyright", () => $"Copyright 2010-{DateTime.UtcNow.Year} NServiceBus. All rights reserved"},
@@ -64,6 +63,7 @@
             using (var stream = File.OpenRead(nuSpec))
             {
                 var manifest = Manifest.ReadFrom(stream, p => GetPropertyValue(p), false);
+                manifest.Metadata.SetProjectUrl($"https://docs.particular.net/nuget/{manifest.Metadata.Id}/");
                 packageBuilder.Populate(manifest.Metadata);

                 if (manifest.Files != null)