Rewrite with ?: operator.

Rewrite with ?: operator.

--- Nodes/BaseHexCommentNode.cs
+++ Nodes/BaseHexCommentNode.cs
@@ -19,14 +19,7 @@
 			}
 			if (view.Settings.ShowCommentInteger)
 			{
-				if (ivalue == IntPtr.Zero)
-				{
-					x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, "(0)");
-				}
-				else
-				{
-					x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, $"({ivalue.ToInt64()}|0x{uvalue.ToUInt64():X})");
-				}
+				x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, ivalue == IntPtr.Zero ? "(0)" : $"({ivalue.ToInt64()}|0x{uvalue.ToUInt64():X})");
 			}

 			var namedAddress = view.Memory.Process.GetNamedAddress(ivalue);


Added conversion methods

Added conversion methods

--- PInvoke/Kernel32/HeapApi.cs
+++ PInvoke/Kernel32/HeapApi.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Security;
@@ -1172,6 +1173,40 @@
 				if (disposing && mm.HeapHandle != GetProcessHeap())
 					mm.HeapHandle.DangerousRelease();
 			}
+
+			/// Represents a NULL memory pointer.
+			public static SafeHeapBlock Null => new SafeHeapBlock(IntPtr.Zero, 0, false);
+
+			/// Converts an <see cref="IntPtr"/> to a <see cref="SafeHeapBlock"/> where it owns the reference.
+			/// <param name="ptr">The <see cref="IntPtr"/>.</param>
+			/// <returns>The result of the conversion.</returns>
+			public static implicit operator SafeHeapBlock(IntPtr ptr) => new SafeHeapBlock(ptr, 0, true);
+
+			/// Allocates from unmanaged memory sufficient memory to hold an object of type T.
+			/// <typeparam name="T">Native type</typeparam>
+			/// <param name="value">The value.</param>
+			/// <returns><see cref="SafeHeapBlock"/> object to an native (unmanaged) memory block the size of T.</returns>
+			public static SafeHeapBlock CreateFromStructure<T>(T value = default) => new SafeHeapBlock(InteropExtensions.StructureToPtr(value, new CoTaskMemoryMethods().AllocMem, out int s), s);
+
+			///
+			/// Allocates from unmanaged memory to represent a structure with a variable length array at the end and marshal these structure elements. It is the
+			/// callers responsibility to marshal what precedes the trailing array into the unmanaged memory. ONLY structures with attribute StructLayout of
+			/// LayoutKind.Sequential are supported.
+			///
+			/// <typeparam name="T">Type of the trailing array of structures</typeparam>
+			/// <param name="values">Collection of structure objects</param>
+			/// <param name="count">Number of items in <paramref name="values"/>. Setting this value to -1 will cause the method to get the count by iterating through <paramref name="values"/>.</param>
+			/// <param name="prefixBytes">Number of bytes preceding the trailing array of structures</param>
+			/// <returns><see cref="SafeHeapBlock"/> object to an native (unmanaged) structure with a trail array of structures</returns>
+			public static SafeHeapBlock CreateFromList<T>(IEnumerable<T> values, int count = -1, int prefixBytes = 0) => new SafeHeapBlock(InteropExtensions.MarshalToPtr(values, new CoTaskMemoryMethods().AllocMem, out int s, prefixBytes), s);
+
+			/// Allocates from unmanaged memory sufficient memory to hold an array of strings.
+			/// <param name="values">The list of strings.</param>
+			/// <param name="packing">The packing type for the strings.</param>
+			/// <param name="charSet">The character set to use for the strings.</param>
+			/// <param name="prefixBytes">Number of bytes preceding the trailing strings.</param>
+			/// <returns><see cref="SafeHeapBlock"/> object to an native (unmanaged) array of strings stored using the <paramref name="packing"/> model and the character set defined by <paramref name="charSet"/>.</returns>
+			public static SafeHeapBlock CreateFromStringList(IEnumerable<string> values, StringListPackMethod packing = StringListPackMethod.Concatenated, CharSet charSet = CharSet.Auto, int prefixBytes = 0) => new SafeHeapBlock(InteropExtensions.MarshalToPtr(values, packing, new CoTaskMemoryMethods().AllocMem, out int s, charSet, prefixBytes), s);
 		}

 		/// Provides a <see cref="SafeHandle"/> to a that releases a created HHEAP instance at disposal using HeapDestroy.


exposed the appsession instantiating as protected virtual  method

--- SocketBase/AppServerBase.cs
+++ SocketBase/AppServerBase.cs
@@ -1555,11 +1555,21 @@
             if (!ExecuteConnectionFilters(socketSession.RemoteEndPoint))
                 return NullAppSession;

-            var appSession = new TAppSession();
+            var appSession = CreateAppSession(socketSession);

             appSession.Initialize(this, socketSession);

             return appSession;
+        }
+
+        /// <summary>
+        /// create a new TAppSession instance, you can override it to create the session instance in your own way
+        /// </summary>
+        /// <param name="socketSession">the socket session.</param>
+        /// <returns>the new created session instance</returns>
+        protected virtual TAppSession CreateAppSession(ISocketSession socketSession)
+        {
+            return new TAppSession();
         }

         /// <summary>


Turned paging back on

Turned paging back on

--- Source/HelloWorld/Kernel.cs
+++ Source/HelloWorld/Kernel.cs
@@ -48,7 +48,7 @@
 			PageFrameAllocator.Setup();
 			Screen.SetCursor(24, 6);
 			Screen.Write('7');
-			//PageTable.Setup();
+			PageTable.Setup();
 			Screen.SetCursor(24, 6);
 			Screen.Write('8');


Watson integration

Watson integration

--- Src/Kit.UWP/HockeyClient.cs
+++ Src/Kit.UWP/HockeyClient.cs
@@ -25,6 +25,7 @@
         public void Configure(string appId, string endpointAddress = null)
         {
             WindowsAppInitializer.InitializeAsync(appId, WindowsCollectors.Metadata | WindowsCollectors.Session | WindowsCollectors.UnhandledException, endpointAddress);
+            Watson.WatsonIntegration.Integrate(appId);
         }
     }
 }


Update dig' implementation (Thanks, @JuEeHa!)

--- StackStream.Lib/Executor.cs
+++ StackStream.Lib/Executor.cs
@@ -42,7 +42,7 @@
         {
             "{ dup 1 dive swap { drop } { while } elseif } 'while def",
             "{ swap dup 2 dig = } 'compare def",
-            "{ dup dup -1 * swap 1 + bury { dup 2 dig bury } dive } 'dig' def",
+            "{ dup 2 + dig dup 2 dig 1 + bury } 'dig' def",
             "{ stack-count swap 1 dive stack-count = assert } 'stack-check def",
             "{ 1 - swap dup 2 dive swap dup { drop drop } { repeat } elseif } 'repeat def",
         };


updated AudioRecorder class

updated AudioRecorder class

--- StroopTest/AudioRecorder.cs
+++ StroopTest/AudioRecorder.cs
@@ -10,36 +10,35 @@
 {
     class AudioRecorder
     {
-        private WaveIn waveSource = null;
-        public WaveFileWriter waveFile = null;
+        private WaveIn waveSource = null; // entrada de áudio
+        public WaveFileWriter waveFile = null; // arquivo salvar áudio
         private string path;
         private string user;
         private string program;
+
+        private void startRecordingAudio(StroopProgram program)
+        {
+            int waveInDevices = WaveIn.DeviceCount;
+            if (waveInDevices != 0)
+            {
+                string now = program.InitialDate.Day + "." + program.InitialDate.Month + "_" + DateTime.Now.Hour.ToString() + "h" + DateTime.Now.Minute.ToString() + "." + DateTime.Now.Second.ToString();

-        public AudioRecorder(string usrName, string prgName, string dataFolderPath)
-        {
-            path = dataFolderPath;
-            user = usrName;
-            program = prgName;
+                waveSource = new WaveIn();
+                waveSource.WaveFormat = new WaveFormat(44100, 1);

-            startRecordingAudio();
-        }
+                waveSource.DataAvailable += new EventHandler<WaveInEventArgs>(waveSource_DataAvailable);
+                waveSource.RecordingStopped += new EventHandler<StoppedEventArgs>(waveSource_RecordingStopped);

-        public void startRecordingAudio()
-        {
-            string now = DateTime.Now.ToString("h:mm:ss");
-            waveSource = new WaveIn();
-            waveSource.WaveFormat = new WaveFormat(44100, 1);
-            waveSource.DataAvailable += new EventHandler<WaveInEventArgs>(waveSource_DataAvailable);
-            waveSource.RecordingStopped += new EventHandler<StoppedEventArgs>(waveSource_RecordingStopped);
-            waveFile = new WaveFileWriter(path + "/audio_" + user + "_" + program + "_" + now + ".wav", waveSource.WaveFormat);
-            waveSource.StartRecording();
-        }
+                waveFile = new WaveFileWriter(path + "/data" + "/audio_" + program.UserName + "_" + program.ProgramName + "_" + now + ".wav", waveSource.WaveFormat);

-        public void stopRecordingAudio()
+                waveSource.StartRecording();
+            }
+        } // inicia gravação de áudio
+
+        private void stopRecordingAudio()
         {
             waveSource.StopRecording();
-        }
+        } // para gravação de áudio

         void waveSource_DataAvailable(object sender, WaveInEventArgs e)
         {
@@ -63,6 +62,6 @@
                 waveFile = null;
             }
         }
-
+
     }
 }


Adds the webclient command to the command line

--- TGCommandLine/DDCommands.cs
+++ TGCommandLine/DDCommands.cs
@@ -9,7 +9,7 @@
 		public DDCommand()
 		{
 			Keyword = "dd";
-			Children = new Command[] { new DDStartCommand(), new DDStopCommand(), new DDRestartCommand(), new DDStatusCommand(), new DDAutostartCommand(), new DDPortCommand(), new DDSecurityCommand(), new DDWorldAnnounceCommand() };
+			Children = new Command[] { new DDStartCommand(), new DDStopCommand(), new DDRestartCommand(), new DDStatusCommand(), new DDAutostartCommand(), new DDPortCommand(), new DDSecurityCommand(), new DDWorldAnnounceCommand(), new DDWebclientCommand() };
 		}
 		public override string GetHelpText()
 		{
@@ -191,6 +191,45 @@
 			return "Change or check autostarting of the game server with the service";
 		}
 	}
+	class DDWebclientCommand : Command
+	{
+		public DDWebclientCommand()
+		{
+			Keyword = "webclient";
+			RequiredParameters = 1;
+		}
+
+		protected override ExitCode Run(IList<string> parameters)
+		{
+			var DD = Server.GetComponent<ITGDreamDaemon>();
+			switch (parameters[0].ToLower())
+			{
+				case "on":
+					DD.SetWebclient(true);
+					break;
+				case "off":
+					DD.SetWebclient(false);
+					break;
+				case "check":
+					OutputProc("Webclient is: " + (DD.Webclient() ? "Enabled" : "Disabled"));
+					break;
+				default:
+					OutputProc("Invalid parameter: " + parameters[0]);
+					return ExitCode.BadCommand;
+			}
+			return ExitCode.Normal;
+		}
+
+		public override string GetArgumentString()
+		{
+			return "<on|off|check>";
+		}
+		public override string GetHelpText()
+		{
+			return "Change or check if the BYOND webclient is enabled for the game server";
+		}
+	}
+
 	class DDPortCommand : Command
 	{
 		public DDPortCommand()


Removed redundant type specification

Removed redundant type specification

--- Tests/ParallelTestHelper.cs
+++ Tests/ParallelTestHelper.cs
@@ -37,7 +37,7 @@
         public static void ParallelAdder(IProducerConsumerCollection<int> collection, int numThread)
         {
             var startIndex = -10;
-            ParallelStressTest(collection, (IProducerConsumerCollection<int> c) =>
+            ParallelStressTest(collection, c =>
             {
                 var start = Interlocked.Add(ref startIndex, 10);
                 for (var i = start; i < start + 10; i++)
@@ -50,7 +50,7 @@
         public static void ParallelRemover(IProducerConsumerCollection<int> collection, int numThread, int times)
         {
             var t = -1;
-            ParallelStressTest(collection, (IProducerConsumerCollection<int> c) =>
+            ParallelStressTest(collection, c =>
             {
                 var num = Interlocked.Increment(ref t);
                 if (num < times)


Disable checking path to pointer in generated serialization.

--- Tests/SerializationTests.cs
+++ Tests/SerializationTests.cs
@@ -73,6 +73,7 @@
     {
         public SerializationTests(bool useGeneratedSerializer, bool useGeneratedDeserializer, bool treatCollectionsAsUserObjects, bool supportForISerializable, bool useTypeStamping) : base(useGeneratedSerializer, useGeneratedDeserializer, treatCollectionsAsUserObjects, supportForISerializable, false, useTypeStamping)
         {
+            useGeneratedSerialization = useGeneratedSerializer;
         }

         [Test]
@@ -877,9 +878,12 @@
             {
                 exception = e;
             }
-            Assert.IsTrue(exception.Message.Contains(toClone.GetType().Name));
-            Assert.IsTrue(exception.Message.Contains(toClone.Element.GetType().Name));
-            Assert.IsTrue(exception.Message.Contains(toClone.Element.WithIntPtr.GetType().Name));
+            if(!useGeneratedSerialization)
+            {
+                Assert.IsTrue(exception.Message.Contains(toClone.GetType().Name));
+                Assert.IsTrue(exception.Message.Contains(toClone.Element.GetType().Name));
+                Assert.IsTrue(exception.Message.Contains(toClone.Element.WithIntPtr.GetType().Name));
+            }
         }

         [Test]
@@ -1736,6 +1740,8 @@
                 Invoked = true;
             }
         }
+
+        private readonly bool useGeneratedSerialization;
     }

     public static class CompanionExtensions


updated grammar to better support - class.

--- Omnia/Compiller/Grammar.cs
+++ Omnia/Compiller/Grammar.cs
@@ -20,12 +20,16 @@
             var dot = ToTerm(".");
             var colon = ToTerm(":");
             var funcGlyph = ToTerm("->");
+            var piping = ToTerm("|>");
             var fun = ToTerm("fun");
+            var CLASS = ToTerm("class");

             // 2. Non-terminals
             var OpenExpr = new NonTerminal("OpenExpr");
             var OpenArg = new NonTerminal("OpenArg");
-            var OpenArgList = new NonTerminal("OpenArgList");
+            var OpenArgExtStmt = new NonTerminal("OpenArgExtStmt");
+            var OpenArgStmtList = new NonTerminal("OpenArgStmtList");
+            var OpenArgBlock = new NonTerminal("OpenArgBlock");

             var Expr = new NonTerminal("Expr");
             var Term = new NonTerminal("Term");
@@ -51,15 +55,22 @@
             var LamdaDef = new NonTerminal("LamdaDef");
             var LamdaArg = new NonTerminal("LamdaArg");
             var FunctionCall = new NonTerminal("FunctionCall");
+            var PipeFunctionCall = new NonTerminal("PipeFunctionCall");
+            var PipeCall = new NonTerminal("PipeCall");
+            var Class = new NonTerminal("Class");
+            var OptionParamStart = ToTerm("(") | Empty;
+            var OptionParamEnd = ToTerm(")") | Empty;

             // 3. BNF rules
-            OpenExpr.Rule = ToTerm("open") + "(" + OpenArgList + ")" + Eos;
-            OpenArg.Rule = MakeListRule(OpenArg, dot, identifier);
-            OpenArgList.Rule = MakeListRule(OpenArgList, comma, OpenArg);
+            OpenExpr.Rule = ToTerm("open") + OpenArgExtStmt | ToTerm("open") + OpenArg + Eos + OpenArgBlock;
+            OpenArg.Rule = MakePlusRule(OpenArg, dot, identifier);
+            OpenArgExtStmt.Rule = OpenArg + Eos;
+            OpenArgStmtList.Rule = MakePlusRule(OpenArgStmtList, OpenArgExtStmt);
+            OpenArgBlock.Rule = Indent + OpenArgStmtList + Dedent;

             Expr.Rule = UnExpr | BinExpr | ObjExpr;
             Term.Rule = number | identifier;
-            Obj.Rule = Term | FunctionCall;
+            Obj.Rule = Term | FunctionCall | PipeFunctionCall | PipeCall;
             ObjExpr.Rule = MakeListRule(ObjExpr, dot, Obj);
             UnExpr.Rule = UnOp + Term;
             UnOp.Rule = ToTerm("+") | "-";
@@ -69,10 +80,10 @@
             Assignment.Rule = identifier + "=" + Expr;
             Stmt.Rule = Assignment | Expr | ReturnStmt | Empty;
             ReturnStmt.Rule = "return" + Expr;
-            ExtStmt.Rule = FunctionDef | Stmt + Eos;
+            ExtStmt.Rule = Class | FunctionDef | Stmt + Eos;
             StmtList.Rule = MakePlusRule(StmtList, ExtStmt);
             Block.Rule = Indent + StmtList + Dedent;
-            Program.Rule = OpenExpr | OpenExpr + StmtList;
+            Program.Rule = StmtList | OpenExpr + StmtList;

             ParamList.Rule = MakeStarRule(ParamList, comma, identifier);

@@ -86,6 +97,13 @@
             FunctionDef.Rule = identifier + "=" + LamdaDef;

             FunctionCall.Rule = identifier + "(" + ArgList + ")";
+
+            PipeFunctionCall.Rule = Term + piping + FunctionCall;
+
+            PipeCall.Rule = Term + piping + identifier;
+
+            Class.Rule = CLASS + identifier + Eos + Block
+                         | CLASS + identifier + "(" + ParamList + ")" + Eos + Block;

             Root = Program;       // Set grammar root

@@ -101,7 +119,7 @@
             // 6. Miscellaneous: punctuation, braces, transient nodes
             MarkPunctuation("(", ")", ":");
             RegisterBracePair("(", ")");
-            MarkTransient(Term, Obj, Expr, Stmt, ExtStmt, UnOp, BinOp, ExtStmt, Block);
+            MarkTransient(OpenArgExtStmt, Term, Obj, Expr, Stmt, ExtStmt, UnOp, BinOp, ExtStmt, Block);

             // 7. Error recovery rule
             ExtStmt.ErrorRule = SyntaxError + Eos;


BL-1233 Improve reporting of download problems

Cleanup some repetitious code;
Made message a bit more friendly;
Added new case about timeouts.

--- src/BloomExe/WebLibraryIntegration/BookTransfer.cs
+++ src/BloomExe/WebLibraryIntegration/BookTransfer.cs
@@ -109,32 +109,31 @@
 				LastBookDownloadedPath = destinationPath;

 				Analytics.Track("DownloadedBook-Success",
-					new Dictionary<string, string>() {{"url", url}, {"title",title}});
+					new Dictionary<string, string>() {{"url", url}, {"title", title}});
 				return destinationPath;
 			}
-			catch (WebException e)
-			{
-				DisplayNetworkDownloadProblem(e);
-				Analytics.Track("DownloadedBook-Failure",
-					new Dictionary<string, string>() { { "url", url }, { "title", title } });
-				Analytics.ReportException(e);
-				return "";
-			}
-			catch (AmazonServiceException e)
-			{
-				DisplayNetworkDownloadProblem(e);
-				Analytics.Track("DownloadedBook-Failure",
-					new Dictionary<string, string>() { { "url", url }, { "title", title } });
-				Analytics.ReportException(e);
-				return "";
-			}
 			catch (Exception e)
 			{
-				DisplayProblem(e, LocalizationManager.GetString("PublishTab.Upload.DownloadProblem",
-					"There was a problem downloading your book. You may need to restart Bloom or get technical help."));
-				Analytics.Track("DownloadedBook-Failure",
-					new Dictionary<string, string>() { { "url", url }, { "title", title } });
-				Analytics.ReportException(e);
+				try
+				{
+					// We want to try this before we give a report that may terminate the program. But if something
+					// more goes wrong, ignore it.
+					Analytics.Track("DownloadedBook-Failure",
+						new Dictionary<string, string>() { { "url", url }, { "title", title } });
+					Analytics.ReportException(e);
+				}
+				catch (Exception)
+				{
+				}
+				var message = LocalizationManager.GetString("PublishTab.Upload.DownloadProblem",
+					"There was a problem downloading your book. You may need to restart Bloom or get technical help.");
+				if (e is TimeoutException) // BL-1233, we've seen what appear to be timeout exceptions, can't confirm the actual Exception subclass though.
+					message = LocalizationManager.GetString("PublishTab.Upload.TimeoutDownloadProblem",
+					"There was a problem downloading your book: something took too long. Possibly there is a problem with your network connection. It may work if you try again a bit later.");
+				if (e is AmazonServiceException || e is WebException) // Network problems, not an internal error, less alarming message called for
+					message = LocalizationManager.GetString("Download.GenericDownloadProblemNotice",
+						"There was a problem downloading your book.  It may work if you try again a bit later.");
+				DisplayProblem(e, message);
 				return "";
 			}
 		}
@@ -147,12 +146,6 @@
 					shellWindow.Invoke(action);
 				else
 					action.Invoke();
-		}
-
-		private static void DisplayNetworkDownloadProblem(Exception e)
-		{
-			DisplayProblem(e, LocalizationManager.GetString("Download.GenericDownloadProblemNotice",
-				"There was a problem downloading your book."));
 		}

 		private static void DisplayNetworkUploadProblem(Exception e, IProgress progress)
@@ -203,11 +196,11 @@
 				if (_progressDialog.ProgressStateResult != null &&
 					_progressDialog.ProgressStateResult.ExceptionThatWasEncountered != null)
 				{
-					Palaso.Reporting.ErrorReport.ReportFatalException(
-						_progressDialog.ProgressStateResult.ExceptionThatWasEncountered);
-				}
-			}
-		}
+						Palaso.Reporting.ErrorReport.ReportFatalException(
+							_progressDialog.ProgressStateResult.ExceptionThatWasEncountered);
+					}
+				}
+			}

 		/// <summary>
 		/// this runs in a worker thread


Lock books downloaded

Lock books downloaded

Books downloaded from Bloom library should be editable
in localize mode, not author mode, even if they were
accidentally uploaded unlocked.

--- src/BloomExe/WebLibraryIntegration/BookTransfer.cs
+++ src/BloomExe/WebLibraryIntegration/BookTransfer.cs
@@ -110,6 +110,15 @@

 				Analytics.Track("DownloadedBook-Success",
 					new Dictionary<string, string>() {{"url", url}, {"title",title}});
+				// Try to lock it. What we want to do is Book.RecordedAsLockedDown = true; Book.Save().
+				// But all kinds of things have to be set up before we can create a Book. So we duplicate a few bits of code.
+				var htmlFile = BookStorage.FindBookHtmlInFolder(destinationPath);
+				if (htmlFile == "")
+					return destinationPath; //argh! we can't lock it.
+				var xmlDomFromHtmlFile = XmlHtmlConverter.GetXmlDomFromHtmlFile(htmlFile, false);
+				var dom = new HtmlDom(xmlDomFromHtmlFile);
+				dom.UpdateMetaElement("lockedDownAsShell", "true");
+				XmlHtmlConverter.SaveDOMAsHtml5(dom.RawDom, htmlFile);
 				return destinationPath;
 			}
 			catch (WebException e)


Add some extra sanity checks when restring inventory from cache
* Don't restore folders that are not in the skeleton
* Don't restore items that belong to changed folders

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3278 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/Inventory.cs
+++ OpenMetaverse/Inventory.cs
@@ -411,6 +411,7 @@

             item_count = 0;
             List<InventoryNode> del_nodes = new List<InventoryNode>(); //nodes that we have processed and will delete
+            List<UUID> dirty_folders = new List<UUID>(); // Tainted folders that we will not restore items into

             // Because we could get child nodes before parents we must itterate around and only add nodes who have
             // a parent already in the list because we must update both child and parent to link together
@@ -441,6 +442,7 @@
                             {
                                 Logger.DebugLog("Inventory Cache/Server version mismatch on "+node.Data.Name+" "+cache_folder.Version.ToString()+" vs "+server_folder.Version.ToString());
                                 pnode.NeedsUpdate = true;
+                                dirty_folders.Add(node.Data.UUID);
                             }
                             del_nodes.Add(node);
                         }
@@ -449,9 +451,16 @@
                     {
                         if (node.Data != null)
                         {
+                            // If node is folder, and it does not exist in skeleton, mark it as
+                            // dirty and don't process nodes that belong to it
+                            if (node.Data is InventoryFolder && !(Items.ContainsKey(node.Data.UUID)))
+                            {
+                                dirty_folders.Add(node.Data.UUID);
+                            }
+
                             //Only add new items, this is most likely to be run at login time before any inventory
-                            //nodes other than the root are populated.
-                            if (!Items.ContainsKey(node.Data.UUID))
+                            //nodes other than the root are populated. Don't add non existing folders.
+                            if (!Items.ContainsKey(node.Data.UUID) && !dirty_folders.Contains(pnode.Data.UUID) && !(node.Data is InventoryFolder))
                             {
                                 Items.Add(node.Data.UUID, node);
                                 node.Parent = pnode; //Update this node with its parent


Make content in response have length matching content-length (#26932)

See #26754

--- src/Common/tests/System/Net/Http/LoopbackServer.cs
+++ src/Common/tests/System/Net/Http/LoopbackServer.cs
@@ -256,7 +256,7 @@
                 }
                 else
                 {
-                    await writer.WriteAsync($"{content}\r\n").ConfigureAwait(false);
+                    await writer.WriteAsync($"{content}").ConfigureAwait(false);
                 }

                 return null;


Add key length validation to DAMap.Add(KeyValuePair<string, OSDMap> kvp) to match Add(string key, OSDMap store)

--- OpenSim/Framework/DAMap.cs
+++ OpenSim/Framework/DAMap.cs
@@ -188,7 +188,8 @@
         }

         public void Add(KeyValuePair<string, OSDMap> kvp)
-        {
+        {
+            ValidateKey(kvp.Key);
             lock (this)
                 m_map.Add(kvp.Key, kvp.Value);
         }


Ensured reminder registered prior to state persistence.

--- Orleans.Sagas/SagaGrain.cs
+++ Orleans.Sagas/SagaGrain.cs
@@ -52,8 +52,8 @@
             {
                 State.Activities = activities.ToList();
                 State.Status = SagaStatus.Executing;
+                await RegisterReminder();
                 await WriteStateAsync();
-                await RegisterReminder();
             }

             await Resume();


Change params on SHGetValue and added overload

--- PInvoke/ShlwApi/Shlwapi.cs
+++ PInvoke/ShlwApi/Shlwapi.cs
@@ -3174,7 +3174,59 @@
 		// pszSubKey, LPCSTR pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData );
 		[DllImport(Lib.Shlwapi, SetLastError = false, CharSet = CharSet.Auto)]
 		[PInvokeData("shlwapi.h", MSDNShortId = "8cca6bfe-d365-4d10-bc8d-f3bebefaad02")]
-		public static extern Win32Error SHGetValue(HKEY hkey, string pszSubKey, string pszValue, ref uint pdwType, IntPtr pvData, ref uint pcbData);
+		public static extern Win32Error SHGetValue(HKEY hkey, string pszSubKey, string pszValue, out uint pdwType, IntPtr pvData, ref uint pcbData);
+
+		/// <summary>
+		/// <para>Retrieves a registry value.</para>
+		/// </summary>
+		/// <param name="hkey">
+		/// <para>Type: <c>HKEY</c></para>
+		/// <para>A handle to the currently open key, or any of the following predefined values.</para>
+		/// <para>HKEY_CLASSES_ROOT</para>
+		/// <para>HKEY_CURRENT_CONFIG</para>
+		/// <para>HKEY_CURRENT_USER</para>
+		/// <para>HKEY_LOCAL_MACHINE</para>
+		/// <para>HKEY_PERFORMANCE_DATA</para>
+		/// <para>HKEY_USERS</para>
+		/// </param>
+		/// <param name="pszSubKey">
+		/// <para>Type: <c>LPCTSTR</c></para>
+		/// <para>The address of a null-terminated string that specifies the name of the subkey from which to retrieve the value.</para>
+		/// </param>
+		/// <param name="pszValue">
+		/// <para>Type: <c>LPCTSTR</c></para>
+		/// <para>The address of the value.</para>
+		/// </param>
+		/// <param name="pdwType">
+		/// <para>Type: <c>LPDWORD</c></para>
+		/// <para>The type of value. For more information, see Registry Data Types.</para>
+		/// </param>
+		/// <param name="pvData">
+		/// <para>Type: <c>LPVOID</c></para>
+		/// <para>The address of the destination data buffer.</para>
+		/// </param>
+		/// <param name="pcbData">
+		/// <para>Type: <c>LPDWORD</c></para>
+		/// <para>The size of the destination data buffer.</para>
+		/// </param>
+		/// <returns>
+		/// <para>Type: <c>LSTATUS</c></para>
+		/// <para>
+		/// Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage
+		/// function with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.
+		/// </para>
+		/// </returns>
+		/// <remarks>
+		/// <para>
+		/// If your application must set/retrieve a series of values in the same key, it is better to open the key once and set/retrieve the
+		/// values with the regular Microsoft Win32 registry functions rather than use this function repeatedly.
+		/// </para>
+		/// </remarks>
+		// https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-shgetvaluea LSTATUS SHGetValueA( HKEY hkey, LPCSTR
+		// pszSubKey, LPCSTR pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData );
+		[DllImport(Lib.Shlwapi, SetLastError = false, CharSet = CharSet.Auto)]
+		[PInvokeData("shlwapi.h", MSDNShortId = "8cca6bfe-d365-4d10-bc8d-f3bebefaad02")]
+		public static extern Win32Error SHGetValue(HKEY hkey, string pszSubKey, string pszValue, out uint pdwType, SafeAllocatedMemoryHandle pvData, ref uint pcbData);

 		/// <summary>
 		/// <para>


Update assembly version.

Update assembly version.

--- Tools/CommonAssemblyInfo.cs
+++ Tools/CommonAssemblyInfo.cs
@@ -6,5 +6,5 @@
 [assembly: AssemblyProduct("EntityFramework.Functions")]
 [assembly: AssemblyCopyright("Dixin Yan https://weblogs.asp.net/dixin")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("1.3.0.0")]
-[assembly: AssemblyFileVersion("1.3.0.0")]
+[assembly: AssemblyVersion("1.3.1.0")]
+[assembly: AssemblyFileVersion("1.3.1.0")]


Fix a few

Fix a few

--- websocket-sharp/Net/Cookie.cs
+++ websocket-sharp/Net/Cookie.cs
@@ -41,9 +41,8 @@
 #endregion

 using System;
+using System.Globalization;
 using System.Text;
-using System.Globalization;
-using System.Collections;

 namespace WebSocketSharp.Net
 {


Improved test coverage for MethodDiscoverer's treatment of IDisposable.Dispose().

--- src/Fixie.Tests/Execution/MethodDiscovererTests.cs
+++ src/Fixie.Tests/Execution/MethodDiscovererTests.cs
@@ -16,10 +16,32 @@

             DiscoveredTestMethods<Sample>(customConvention)
                 .ShouldEqual(
-                    "PublicInstanceNoArgsVoid",
-                    "PublicInstanceNoArgsWithReturn",
-                    "PublicInstanceWithArgsVoid",
-                    "PublicInstanceWithArgsWithReturn");
+                    "PublicInstanceNoArgsVoid()",
+                    "PublicInstanceNoArgsWithReturn()",
+                    "PublicInstanceWithArgsVoid(x)",
+                    "PublicInstanceWithArgsWithReturn(x)");
+        }
+
+        public void ShouldNotConsiderIDisposableDisposeMethod()
+        {
+            var customConvention = new Convention();
+
+            DiscoveredTestMethods<DisposableSample>(customConvention)
+                .ShouldEqual(
+                    "Dispose(disposing)",
+                    "NotNamedDispose()");
+
+            DiscoveredTestMethods<NonDisposableSample>(customConvention)
+                .ShouldEqual(
+                    "Dispose()",
+                    "Dispose(disposing)",
+                    "NotNamedDispose()");
+
+            DiscoveredTestMethods<NonDisposableByReturnTypeSample>(customConvention)
+                .ShouldEqual(
+                    "Dispose()",
+                    "Dispose(disposing)",
+                    "NotNamedDispose()");
         }

         public void ShouldDiscoverMethodsSatisfyingAllSpecifiedConditions()
@@ -32,7 +54,7 @@
                 .Where(method => method.Name.Contains("No"));

             DiscoveredTestMethods<Sample>(customConvention)
-                .ShouldEqual("PublicInstanceNoArgsVoid");
+                .ShouldEqual("PublicInstanceNoArgsVoid()");
         }

         public void CanDiscoverMethodsByNonInheritedAttributes()
@@ -44,7 +66,7 @@
                 .Has<SampleAttribute>();

             DiscoveredTestMethods<Sample>(customConvention)
-                .ShouldEqual("PublicInstanceWithArgsWithReturn");
+                .ShouldEqual("PublicInstanceWithArgsWithReturn(x)");
         }

         public void CanDiscoverMethodsByInheritedAttributes()
@@ -57,8 +79,8 @@

             DiscoveredTestMethods<Sample>(customConvention)
                 .ShouldEqual(
-                    "PublicInstanceNoArgsWithReturn",
-                    "PublicInstanceWithArgsWithReturn");
+                    "PublicInstanceNoArgsWithReturn()",
+                    "PublicInstanceWithArgsWithReturn(x)");
         }

         public void TheDefaultConventionShouldDiscoverSynchronousPublicInstanceVoidMethods()
@@ -67,8 +89,8 @@

             DiscoveredTestMethods<Sample>(defaultConvention)
                 .ShouldEqual(
-                    "PublicInstanceNoArgsVoid",
-                    "PublicInstanceWithArgsVoid");
+                    "PublicInstanceNoArgsVoid()",
+                    "PublicInstanceWithArgsVoid(x)");
         }

         public void TheDefaultConventionShouldDiscoverAsyncPublicInstanceMethods()
@@ -77,10 +99,10 @@

             DiscoveredTestMethods<AsyncSample>(defaultConvention)
                 .ShouldEqual(
-                    "PublicInstanceNoArgsVoid",
-                    "PublicInstanceNoArgsWithReturn",
-                    "PublicInstanceWithArgsVoid",
-                    "PublicInstanceWithArgsWithReturn");
+                    "PublicInstanceNoArgsVoid()",
+                    "PublicInstanceNoArgsWithReturn()",
+                    "PublicInstanceWithArgsVoid(x)",
+                    "PublicInstanceWithArgsWithReturn(x)");
         }

         public void ShouldFailWithClearExplanationWhenAnyGivenConditionThrows()
@@ -104,8 +126,8 @@
         {
             return new MethodDiscoverer(convention)
                 .TestMethods(typeof(TTestClass))
-                .OrderBy(method => method.Name, StringComparer.Ordinal)
-                .Select(method => method.Name);
+                .Select(method => $"{method.Name}({String.Join(", ", method.GetParameters().Select(x => x.Name))})")
+                .OrderBy(name => name, StringComparer.Ordinal);
         }

         class SampleAttribute : Attribute { }
@@ -169,5 +191,26 @@
                 return Task.Run(() => 0);
             }
         }
+
+        class DisposableSample : IDisposable
+        {
+            public void Dispose(bool disposing) { }
+            public void Dispose() { }
+            public void NotNamedDispose() { }
+        }
+
+        class NonDisposableSample
+        {
+            public void Dispose(bool disposing) { }
+            public void Dispose() { }
+            public void NotNamedDispose() { }
+        }
+
+        class NonDisposableByReturnTypeSample
+        {
+            public void Dispose(bool disposing) { }
+            public int Dispose() => 0;
+            public void NotNamedDispose() { }
+        }
     }
 }


[Modify] Replace it

[Modify] Replace it

--- websocket-sharp/Net/Cookie.cs
+++ websocket-sharp/Net/Cookie.cs
@@ -141,10 +141,8 @@
     ///   </para>
     /// </exception>
     public Cookie (string name, string value)
-      : this ()
-    {
-      Name = name;
-      Value = value;
+      : this (name, value, String.Empty, String.Empty)
+    {
     }

     /// <summary>


Make BindingPathUtilities static

Make BindingPathUtilities static

--- src/GitHub.Exports/Helpers/BindingPathUtilities.cs
+++ src/GitHub.Exports/Helpers/BindingPathUtilities.cs
@@ -8,9 +8,9 @@

 namespace GitHub.Helpers
 {
-    public class BindingPathUtilities
+    public static class BindingPathUtilities
     {
-        static readonly ILogger log = LogManager.ForContext<BindingPathUtilities>();
+        static readonly ILogger log = LogManager.ForContext(typeof(BindingPathUtilities));

         public static void RationalizeBindingPaths(string assemblyLocation, List<string> bindingPaths = null)
         {


Made the AppConfiguration public in ConfigurationBase

--- src/Kephas.Core/Configuration/ConfigurationBase.cs
+++ src/Kephas.Core/Configuration/ConfigurationBase.cs
@@ -9,6 +9,7 @@

 namespace Kephas.Configuration
 {
+    using Kephas.Diagnostics.Contracts;
     using Kephas.Dynamic;
     using Kephas.Reflection;

@@ -20,11 +21,6 @@
         where TSettings : class
     {
         /// <summary>
-        /// The application configuration.
-        /// </summary>
-        private readonly IAppConfiguration appConfiguration;
-
-        /// <summary>
         /// The settings.
         /// </summary>
         private TSettings settings;
@@ -35,8 +31,15 @@
         /// <param name="appConfiguration">The application configuration.</param>
         protected ConfigurationBase(IAppConfiguration appConfiguration)
         {
-            this.appConfiguration = appConfiguration;
+            Requires.NotNull(appConfiguration, nameof(appConfiguration));
+
+            this.AppConfiguration = appConfiguration;
         }
+
+        /// <summary>
+        /// Gets the application configuration.
+        /// </summary>
+        public IAppConfiguration AppConfiguration { get; }

         /// <summary>
         /// Gets the settings associated to this configuration.
@@ -44,7 +47,7 @@
         /// <value>
         /// The settings.
         /// </value>
-        public TSettings Settings => this.settings ?? (this.settings = (TSettings)this.appConfiguration.GetSettings(this.GetSettingsPattern(), typeof(TSettings)));
+        public TSettings Settings => this.settings ?? (this.settings = (TSettings)this.AppConfiguration.GetSettings(this.GetSettingsPattern(), typeof(TSettings)));

         /// <summary>
         /// Gets the settings pattern.


Lucene.Net.Core.Index.BufferedUpdatesStream refactor: renamed private/protected fields camelCase

--- src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
+++ src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
@@ -48,23 +48,23 @@
     internal class BufferedUpdatesStream
     {
         // TODO: maybe linked list?
-        private readonly IList<FrozenBufferedUpdates> Updates = new List<FrozenBufferedUpdates>();
+        private readonly IList<FrozenBufferedUpdates> updates = new List<FrozenBufferedUpdates>();

         // Starts at 1 so that SegmentInfos that have never had
         // deletes applied (whose bufferedDelGen defaults to 0)
         // will be correct:
-        private long NextGen_Renamed = 1;
+        private long nextGen = 1;

         // used only by assert
-        private Term LastDeleteTerm;
-
-        private readonly InfoStream InfoStream;
+        private Term lastDeleteTerm;
+
+        private readonly InfoStream infoStream;
         private readonly AtomicLong bytesUsed = new AtomicLong();
         private readonly AtomicInteger numTerms = new AtomicInteger();

         public BufferedUpdatesStream(InfoStream infoStream)
         {
-            this.InfoStream = infoStream;
+            this.infoStream = infoStream;
         }

         // Appends a new packet of buffered deletes to the stream,
@@ -80,17 +80,17 @@
                  * updates. If the pushed packets get our of order would loose documents
                  * since deletes are applied to the wrong segments.
                  */
-                packet.DelGen = NextGen_Renamed++;
+                packet.DelGen = nextGen++;
                 Debug.Assert(packet.Any());
                 Debug.Assert(CheckDeleteStats());
-                Debug.Assert(packet.DelGen < NextGen_Renamed);
-                Debug.Assert(Updates.Count == 0 || Updates[Updates.Count - 1].DelGen < packet.DelGen, "Delete packets must be in order");
-                Updates.Add(packet);
+                Debug.Assert(packet.DelGen < nextGen);
+                Debug.Assert(updates.Count == 0 || updates[updates.Count - 1].DelGen < packet.DelGen, "Delete packets must be in order");
+                updates.Add(packet);
                 numTerms.AddAndGet(packet.NumTermDeletes);
                 bytesUsed.AddAndGet(packet.BytesUsed);
-                if (InfoStream.IsEnabled("BD"))
-                {
-                    InfoStream.Message("BD", "push deletes " + packet + " delGen=" + packet.DelGen + " packetCount=" + Updates.Count + " totBytesUsed=" + bytesUsed.Get());
+                if (infoStream.IsEnabled("BD"))
+                {
+                    infoStream.Message("BD", "push deletes " + packet + " delGen=" + packet.DelGen + " packetCount=" + updates.Count + " totBytesUsed=" + bytesUsed.Get());
                 }
                 Debug.Assert(CheckDeleteStats());
                 return packet.DelGen;
@@ -101,8 +101,8 @@
         {
             lock (this)
             {
-                Updates.Clear();
-                NextGen_Renamed = 1;
+                updates.Clear();
+                nextGen = 1;
                 numTerms.Set(0);
                 bytesUsed.Set(0);
             }
@@ -182,26 +182,26 @@

                 if (infos.Count == 0)
                 {
-                    return new ApplyDeletesResult(false, NextGen_Renamed++, null);
+                    return new ApplyDeletesResult(false, nextGen++, null);
                 }

                 Debug.Assert(CheckDeleteStats());

                 if (!Any())
                 {
-                    if (InfoStream.IsEnabled("BD"))
-                    {
-                        InfoStream.Message("BD", "applyDeletes: no deletes; skipping");
-                    }
-                    return new ApplyDeletesResult(false, NextGen_Renamed++, null);
-                }
-
-                if (InfoStream.IsEnabled("BD"))
-                {
-                    InfoStream.Message("BD", "applyDeletes: infos=" + infos + " packetCount=" + Updates.Count);
-                }
-
-                long gen = NextGen_Renamed++;
+                    if (infoStream.IsEnabled("BD"))
+                    {
+                        infoStream.Message("BD", "applyDeletes: no deletes; skipping");
+                    }
+                    return new ApplyDeletesResult(false, nextGen++, null);
+                }
+
+                if (infoStream.IsEnabled("BD"))
+                {
+                    infoStream.Message("BD", "applyDeletes: infos=" + infos + " packetCount=" + updates.Count);
+                }
+
+                long gen = nextGen++;

                 List<SegmentCommitInfo> infos2 = new List<SegmentCommitInfo>();
                 infos2.AddRange(infos);
@@ -211,7 +211,7 @@
                 bool anyNewDeletes = false;

                 int infosIDX = infos2.Count - 1;
-                int delIDX = Updates.Count - 1;
+                int delIDX = updates.Count - 1;

                 IList<SegmentCommitInfo> allDeleted = null;

@@ -219,7 +219,7 @@
                 {
                     //System.out.println("BD: cycle delIDX=" + delIDX + " infoIDX=" + infosIDX);

-                    FrozenBufferedUpdates packet = delIDX >= 0 ? Updates[delIDX] : null;
+                    FrozenBufferedUpdates packet = delIDX >= 0 ? updates[delIDX] : null;
                     SegmentCommitInfo info = infos2[infosIDX];
                     long segGen = info.BufferedDeletesGen;

@@ -296,9 +296,9 @@
                             allDeleted.Add(info);
                         }

-                        if (InfoStream.IsEnabled("BD"))
-                        {
-                            InfoStream.Message("BD", "seg=" + info + " segGen=" + segGen + " segDeletes=[" + packet + "]; coalesced deletes=[" + (coalescedUpdates == null ? "null" : coalescedUpdates.ToString()) + "] newDelCount=" + delCount + (segAllDeletes ? " 100% deleted" : ""));
+                        if (infoStream.IsEnabled("BD"))
+                        {
+                            infoStream.Message("BD", "seg=" + info + " segGen=" + segGen + " segDeletes=[" + packet + "]; coalesced deletes=[" + (coalescedUpdates == null ? "null" : coalescedUpdates.ToString()) + "] newDelCount=" + delCount + (segAllDeletes ? " 100% deleted" : ""));
                         }

                         if (coalescedUpdates == null)
@@ -358,9 +358,9 @@
                                 allDeleted.Add(info);
                             }

-                            if (InfoStream.IsEnabled("BD"))
-                            {
-                                InfoStream.Message("BD", "seg=" + info + " segGen=" + segGen + " coalesced deletes=[" + coalescedUpdates + "] newDelCount=" + delCount + (segAllDeletes ? " 100% deleted" : ""));
+                            if (infoStream.IsEnabled("BD"))
+                            {
+                                infoStream.Message("BD", "seg=" + info + " segGen=" + segGen + " coalesced deletes=[" + coalescedUpdates + "] newDelCount=" + delCount + (segAllDeletes ? " 100% deleted" : ""));
                             }
                         }
                         info.SetBufferedDeletesGen(gen);
@@ -370,9 +370,9 @@
                 }

                 Debug.Assert(CheckDeleteStats());
-                if (InfoStream.IsEnabled("BD"))
-                {
-                    InfoStream.Message("BD", "applyDeletes took " + (Environment.TickCount - t0) + " msec");
+                if (infoStream.IsEnabled("BD"))
+                {
+                    infoStream.Message("BD", "applyDeletes took " + (Environment.TickCount - t0) + " msec");
                 }
                 // assert infos != segmentInfos || !any() : "infos=" + infos + " segmentInfos=" + segmentInfos + " any=" + any;

@@ -384,7 +384,7 @@
         {
             lock (this)
             {
-                return NextGen_Renamed++;
+                return nextGen++;
             }
         }

@@ -404,14 +404,14 @@
                     minGen = Math.Min(info.BufferedDeletesGen, minGen);
                 }

-                if (InfoStream.IsEnabled("BD"))
-                {
-                    InfoStream.Message("BD", "prune sis=" + segmentInfos + " minGen=" + minGen + " packetCount=" + Updates.Count);
-                }
-                int limit = Updates.Count;
+                if (infoStream.IsEnabled("BD"))
+                {
+                    infoStream.Message("BD", "prune sis=" + segmentInfos + " minGen=" + minGen + " packetCount=" + updates.Count);
+                }
+                int limit = updates.Count;
                 for (int delIDX = 0; delIDX < limit; delIDX++)
                 {
-                    if (Updates[delIDX].DelGen >= minGen)
+                    if (updates[delIDX].DelGen >= minGen)
                     {
                         Prune(delIDX);
                         Debug.Assert(CheckDeleteStats());
@@ -432,19 +432,19 @@
             {
                 if (count > 0)
                 {
-                    if (InfoStream.IsEnabled("BD"))
-                    {
-                        InfoStream.Message("BD", "pruneDeletes: prune " + count + " packets; " + (Updates.Count - count) + " packets remain");
+                    if (infoStream.IsEnabled("BD"))
+                    {
+                        infoStream.Message("BD", "pruneDeletes: prune " + count + " packets; " + (updates.Count - count) + " packets remain");
                     }
                     for (int delIDX = 0; delIDX < count; delIDX++)
                     {
-                        FrozenBufferedUpdates packet = Updates[delIDX];
+                        FrozenBufferedUpdates packet = updates[delIDX];
                         numTerms.AddAndGet(-packet.NumTermDeletes);
                         Debug.Assert(numTerms.Get() >= 0);
                         bytesUsed.AddAndGet(-packet.BytesUsed);
                         Debug.Assert(bytesUsed.Get() >= 0);
                     }
-                    Updates.SubList(0, count).Clear();
+                    updates.SubList(0, count).Clear();
                 }
             }
         }
@@ -690,10 +690,10 @@
         {
             if (term != null)
             {
-                Debug.Assert(LastDeleteTerm == null || term.CompareTo(LastDeleteTerm) > 0, "lastTerm=" + LastDeleteTerm + " vs term=" + term);
+                Debug.Assert(lastDeleteTerm == null || term.CompareTo(lastDeleteTerm) > 0, "lastTerm=" + lastDeleteTerm + " vs term=" + term);
             }
             // TODO: we re-use term now in our merged iterable, but we shouldn't clone, instead copy for this assert
-            LastDeleteTerm = term == null ? null : new Term(term.Field, BytesRef.DeepCopyOf(term.Bytes));
+            lastDeleteTerm = term == null ? null : new Term(term.Field, BytesRef.DeepCopyOf(term.Bytes));
             return true;
         }

@@ -702,7 +702,7 @@
         {
             int numTerms2 = 0;
             long bytesUsed2 = 0;
-            foreach (FrozenBufferedUpdates packet in Updates)
+            foreach (FrozenBufferedUpdates packet in updates)
             {
                 numTerms2 += packet.NumTermDeletes;
                 bytesUsed2 += packet.BytesUsed;


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.19.0";
-				ClientTag = "dotnet:20-03-26";
+				ClientTag = "dotnet:20-03-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 = "3.3.0";
-				ClientTag = "dotnet:17-07-29";
+				ClientTag = "dotnet:17-07-30";
 		}

 		#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.14.0";
-				ClientTag = "dotnet:19-02-18";
+				ClientTag = "dotnet:19-02-19";
 		}

 		#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.16.0";
-				ClientTag = "dotnet:21-12-20";
+				ClientTag = "dotnet:21-12-21";
 		}

 		#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.1.0";
-				ClientTag = "dotnet:22-03-12";
+				ClientTag = "dotnet:22-03-13";
 		}

 		#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.6.0";
-				ClientTag = "dotnet:18-10-11";
+				ClientTag = "dotnet:18-10-12";
 		}

 		#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.6.0";
-				ClientTag = "dotnet:18-09-23";
+				ClientTag = "dotnet:18-09-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 = "3.3.0";
-				ClientTag = "dotnet:18-03-18";
+				ClientTag = "dotnet:18-03-19";
 		}

 		#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.1.0";
-				ClientTag = "dotnet:19-06-22";
+				ClientTag = "dotnet:19-06-23";
 		}

 		#region Properties


removed tools

removed tools

--- TribalWars.API/Src/Tools.cs
+++ TribalWars.API/Src/Tools.cs
@@ -1,135 +0,0 @@
-/***************************************************************************
- * Copyright 2016 Arif Gencosmanoglu
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
-
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
-
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- **************************************************************************/
-
-using System.Linq;
-using System.Windows.Forms;
-using HtmlAgilityPack;
-
-namespace TribalWars.API
-{
-    static class Tools
-    {
-        public static string GetBetween(string strSource, string strStart, string strEnd)
-        {
-            if (strSource.Contains(strStart) && strSource.Contains(strEnd))
-            {
-                var start = strSource.IndexOf(strStart, 0) + strStart.Length;
-                var end = strSource.IndexOf(strEnd, start);
-                return strSource.Substring(start, end - start);
-            }
-
-            return null;
-        }
-
-        public static string SetPageData(WebBrowser browser, string pageData)
-        {
-            pageData = browser.DocumentText;
-            pageData = pageData.Replace(" ", "");
-            pageData = pageData.Replace("\n", "");
-            pageData = pageData.Replace("\r", "");
-
-            return pageData;
-        }
-
-        public static int GetNumSubstringOccurrences(string source, string key)
-        {
-            var num = 0;
-            var pos = 0;
-
-            if (string.IsNullOrEmpty(source) || string.IsNullOrEmpty(key)) return num;
-
-            while ((pos = source.IndexOf(key, pos)) > -1)
-            {
-                num ++;
-                pos += key.Length;
-            }
-            return num;
-        }
-
-        public static HtmlElement FindSpanContains(WebBrowser browser, string key)
-        {
-            // Get all the elements of the current url
-            var elements = browser.Document.GetElementsByTagName("span");
-
-            // within each elements find the element that we are looking for
-            foreach (HtmlElement element in elements)
-                if (element.InnerHtml != null && element.InnerHtml.Contains(key))
-                    return element;
-
-            return null; // if not found return null
-        }
-
-        public static HtmlElement FindElement(WebBrowser browser, string attribute ,string key)
-        {
-            foreach (HtmlElement element in browser.Document.Body.All)
-            {
-                if (element.GetAttribute(attribute) == key)
-                {
-                    return element;
-                }
-            }
-            return null;
-        }
-
-        public static void SetValue(WebBrowser browser, string fieldName, string value)
-        {
-            browser.Document.GetElementById(fieldName).SetAttribute("value", value);
-        }
-
-        public static void Click(HtmlElement element)
-        {
-            element.InvokeMember("click");
-        }
-
-        public static string UsageAP(WebBrowser wb)
-        {
-            var html = new HtmlAgilityPack.HtmlDocument();
-            html.LoadHtml(wb.DocumentText);
-            var root = html.DocumentNode;
-            var p = root
-                .Descendants()
-                .Single(n => n.GetAttributeValue("class", "").Equals("module-profile-recognition"))
-                .Descendants("p")
-                .Single();
-            var content = p.InnerText;
-            return content;
-        }
-
-        public static HtmlNode FindNode(WebBrowser wb, string definition, string key)
-        {
-            HtmlNode p = null;
-
-            var html = new HtmlAgilityPack.HtmlDocument();
-            html.LoadHtml(wb.DocumentText);
-            var root = html.DocumentNode;
-
-            try
-            {
-                p = root
-                    .Descendants()
-                    .Single(n => n.GetAttributeValue(definition, "").Equals(key));
-            }
-            catch
-            {
-                // no node is founded
-            }
-
-            return p;
-        }
-    }
-}


Change to use ScriptLinkCore.Objects namespace

--- Helpers.cs
+++ Helpers.cs
@@ -3,7 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using NTST.ScriptLinkService.Objects;
+using ScriptLinkCore.Objects;

 namespace ScriptLinkCore
 {


fixed index error issue in tab control

fixed index error issue in tab control

--- UI/Controls/YaTabControl.cs
+++ UI/Controls/YaTabControl.cs
@@ -395,11 +395,19 @@
             {
                 if (value < 0 && Controls.Count > 0)
                 {
-                    throw new ArgumentException("Tried to set the property SelectedIndex to a negative number.");
+                    // set the index to the first tab
+                    yaSelectedIndex = 0;
+                    //throw new ArgumentException("Tried to set the property SelectedIndex to a negative number.");
                 }
                 else if (value >= Controls.Count)
                 {
-                    throw new IndexOutOfRangeException("Tried to set the property of the SelectedIndex to a value greater than the number of controls.");
+                    // set the index to the last tab
+                    yaSelectedIndex = Controls.Count - 1;
+                    //throw new IndexOutOfRangeException("Tried to set the property of the SelectedIndex to a value greater than the number of controls.");
+                }
+                else
+                {
+                    yaSelectedIndex = value;
                 }
                 TabChangingEventArgs tcea = new TabChangingEventArgs(yaSelectedIndex, value);
                 OnTabChanging(tcea);
@@ -407,14 +415,13 @@
                 {
                     return;
                 }
-                yaSelectedIndex = value;
                 if (Controls.Count > 0)
                 {
                     foreach (Control ctrl in this.Controls)
                     {
                         ctrl.Visible = false;
                     }
-                    yaSelectedTab = (YaTabPage)Controls[value];
+                    yaSelectedTab = (YaTabPage)Controls[yaSelectedIndex];
                     yaSelectedTab.Visible = true;
                     PerformLayout();
                     InU();


type column filter fix

type column filter fix

--- ParserClasses/TableNode.cs
+++ ParserClasses/TableNode.cs
@@ -93,32 +93,27 @@
             }

             //content = content.Replace("[[columns]]","");
-            copyContent = content;
-            var r = Regex.Match(content, @"\[\[(column )\w+\]\]");
-            var re = Regex.Match(content, @"\[\[\/(column )\w+\]\]");
-            while (content.IndexOf(re.Groups[0].Value) >= 0)
-            {
-
-                int head = r.Index + r.Groups[0].Value.Length;
-                int tail = re.Index;
-
-                copyContent = content.Substring(head, tail - head);
-
-                int replaceHead = r.Index;
-                int replaceTail = re.Index + re.Groups[0].Value.Length;
-
-                content = ReplaceFirst(content, content.Substring(replaceHead, replaceTail - replaceHead), "[[columns]]");
-                this.Scheme = content;
-                //Console.WriteLine(content);
-                string type = r.Groups[0].Value.Split(' ')[1].Replace("[[", "").Replace("]]", "");
-
-                ColumnNode columnNode = new ColumnNode();
-                columnNode.Create(copyContent, type);
-                this.ColumnNodes.Add(columnNode);
-                //TableNodes.Add(content.Substring(head, content.Length - head));
-            }
-
-
+            copyContent = content;
+            string originalContent = content;
+            foreach (Match r in Regex.Matches(originalContent, @"\[\[(column )\w+\]\]"))
+            {
+                string type = r.Value.Split(' ')[1].Replace("[[", "").Replace("]]", "");
+                var re = Regex.Match(originalContent, @"\[\[\/(column "+type+@")+\]\]");
+                int head = r.Index + r.Value.Length;
+                int tail = re.Index;
+
+                copyContent = originalContent.Substring(head, tail - head);
+
+                int replaceHead = r.Index;
+                int replaceTail = re.Index + re.Groups[0].Value.Length;
+
+                content = ReplaceFirst(content, originalContent.Substring(replaceHead, replaceTail - replaceHead), "[[columns]]");
+                this.Scheme = content;
+
+                ColumnNode columnNode = new ColumnNode();
+                columnNode.Create(copyContent, type);
+                this.ColumnNodes.Add(columnNode);
+            }
         }

         public string GetAllColums()


Reverting IconEntry back to a DependencyObject now that I understand how they work.

--- UIconEdit.Core/IconEntry.cs
+++ UIconEdit.Core/IconEntry.cs
@@ -51,7 +51,7 @@
     /// <summary>
     /// Represents a single entry in an icon.
     /// </summary>
-    public class IconEntry : INotifyPropertyChanged, IDisposable
+    public class IconEntry : DependencyObject, IDisposable
     {
         /// <summary>
         /// The default <see cref="AlphaThreshold"/> value.
@@ -113,8 +113,8 @@
             _depth = bitDepth;
             _width = width;
             _height = height;
-            _baseImage = baseImage;
-            _alphaThreshold = alphaThreshold;
+            BaseImage = baseImage;
+            AlphaThreshold = alphaThreshold;
             HotspotX = hotspotX;
             HotspotY = hotspotY;
         }
@@ -215,11 +215,11 @@
                 throw new ArgumentException("The image size is out of the supported range.", "baseImage");
             if (!_validateBitDepth(bitDepth))
                 throw new InvalidEnumArgumentException("bitDepth", (int)bitDepth, typeof(IconBitDepth));
-            _baseImage = baseImage;
+            BaseImage = baseImage;
             _depth = bitDepth;
             _width = (short)baseImage.PixelWidth;
             _height = (short)baseImage.PixelHeight;
-            _alphaThreshold = alphaThreshold;
+            AlphaThreshold = alphaThreshold;
             HotspotX = hotspotX;
             HotspotY = hotspotY;
         }
@@ -290,14 +290,14 @@

         internal IconEntry(BitmapSource baseImage, BitmapSource alphaImage, IconBitDepth bitDepth, int hotspotX, int hotspotY)
         {
-            _baseImage = baseImage;
-            _alphaImage = alphaImage;
+            BaseImage = baseImage;
+            AlphaImage = alphaImage;
             _depth = bitDepth;
             _width = baseImage.PixelWidth;
             _height = baseImage.PixelHeight;
             HotspotX = hotspotX;
             HotspotY = hotspotY;
-            _isQuantized = true;
+            SetValue(IsQuantizedPropertyKey, true);
         }

         internal IconEntry(BitmapSource baseImage, BitmapSource alphaImage, IconBitDepth bitDepth)
@@ -329,19 +329,42 @@
         internal static readonly BitmapPalette AlphaPalette = new BitmapPalette(new Color[] { Colors.White, Colors.Black });

         #region IsQuantized
-        private bool _isQuantized;
+        private static readonly DependencyPropertyKey IsQuantizedPropertyKey = DependencyProperty.RegisterReadOnly("IsQuantized", typeof(bool), typeof(IconEntry),
+            new PropertyMetadata(false));
+        /// <summary>
+        /// The dependency property for the read-only <see cref="IsQuantized"/> property.
+        /// </summary>
+        public static readonly DependencyProperty IsQuantizedProperty = IsQuantizedPropertyKey.DependencyProperty;
+
         /// <summary>
         /// Gets a value indicating whether <see cref="BaseImage"/> and <see cref="AlphaImage"/> are known to be already quantized.
         /// </summary>
-        public bool IsQuantized
-        {
-            get { return _isQuantized; }
-            private set { _changeValue(value, ref _isQuantized, "IsQuantized"); }
-        }
+        public bool IsQuantized { get { return (bool)GetValue(IsQuantizedProperty); } }
         #endregion

         #region BaseImage
-        private BitmapSource _baseImage;
+        /// <summary>
+        /// The dependency property for the <see cref="BaseImage"/> property.
+        /// </summary>
+        public static readonly DependencyProperty BaseImageProperty = DependencyProperty.Register("BaseImage", typeof(BitmapSource), typeof(IconEntry),
+            new PropertyMetadata(new WriteableBitmap(1, 1, 0, 0, PixelFormats.Indexed1, AlphaPalette), BaseImageChanged, BaseImageCoerce), BaseImageValidate);
+
+        private static object BaseImageCoerce(DependencyObject d, object baseValue)
+        {
+            if (((IconEntry)d)._isDisposed) throw new ObjectDisposedException(null);
+            return baseValue;
+        }
+
+        private static void BaseImageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            d.SetValue(IsQuantizedPropertyKey, false);
+        }
+
+        private static bool BaseImageValidate(object value)
+        {
+            return value != null;
+        }
+
         /// <summary>
         /// Gets and sets the image associated with the current instance.
         /// </summary>
@@ -351,44 +374,44 @@
         /// <exception cref="ArgumentNullException">
         /// In a set operation, the specified value is <c>null</c>.
         /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
         public BitmapSource BaseImage
         {
             get
             {
                 if (_isDisposed) throw new ObjectDisposedException(null);
-                return _baseImage;
+                return (BitmapSource)GetValue(BaseImageProperty);
             }
             set
             {
+                if (_isDisposed) throw new ObjectDisposedException(null);
                 if (value == null) throw new ArgumentNullException();
-                _changeObject(value, ref _baseImage, "BaseImage");
-                IsQuantized = false;
+                SetValue(BaseImageProperty, value);
             }
         }
         #endregion

         #region AlphaImage
-        private BitmapSource _alphaImage;
+        /// <summary>
+        /// The dependency property for the <see cref="AlphaImage"/> property.
+        /// </summary>
+        public static readonly DependencyProperty AlphaImageProperty = DependencyProperty.Register("AlphaImage", typeof(BitmapSource), typeof(IconEntry),
+            new PropertyMetadata(null, BaseImageChanged, BaseImageCoerce));
+
         /// <summary>
         /// Gets and sets an image to be used as the alpha mask, or <c>null</c> to derive the alpha mask from <see cref="BaseImage"/>.
         /// Black pixels are transparent; white pixels are opaque.
         /// </summary>
-        /// <exception cref="ObjectDisposedException">
-        /// The current instance is disposed.
-        /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
         public BitmapSource AlphaImage
         {
             get
             {
                 if (_isDisposed) throw new ObjectDisposedException(null);
-                return _alphaImage;
+                return (BitmapSource)GetValue(AlphaImageProperty);
             }
             set
             {
-                _changeObject(value, ref _alphaImage, "AlphaImage");
-                IsQuantized = false;
+                if (_isDisposed) throw new ObjectDisposedException(null);
+                SetValue(AlphaImageProperty, value);
             }
         }
         #endregion
@@ -402,8 +425,8 @@
             get
             {
                 if (_depth == IconBitDepth.Depth32BitsPerPixel)
-                    return _width > MaxBmp32 || _height > MaxBmp32;
-                return _width > MaxBmp || _height > MaxBmp;
+                    return _width > 96 || _height > 96;
+                return _width > MaxBmp32 || _height > MaxBmp32;
             }
         }

@@ -413,7 +436,6 @@
         [Bindable(true, BindingDirection.OneWay)]
         public IconEntryKey EntryKey { get { return new IconEntryKey(_width, _height, _depth); } }

-        #region Width
         private readonly int _width;
         /// <summary>
         /// Gets the resampled width of the icon.
@@ -423,9 +445,7 @@
         {
             get { return _width; }
         }
-        #endregion
-
-        #region Height
+
         private readonly int _height;
         /// <summary>
         /// Gets the resampled height of the icon.
@@ -435,7 +455,6 @@
         {
             get { return _height; }
         }
-        #endregion

         #region BitDepth
         private readonly IconBitDepth _depth;
@@ -450,99 +469,115 @@
         #endregion

         #region AlphaThreshold
-        private byte _alphaThreshold;
+        /// <summary>
+        /// The dependency property for the <see cref="AlphaThreshold"/> property.
+        /// </summary>
+        public static readonly DependencyProperty AlphaThresholdProperty = DependencyProperty.Register("AlphaThreshold", typeof(byte), typeof(BitmapImage));
+
         /// <summary>
         /// Gets and sets a value indicating the threshold of alpha values at <see cref="BitDepth"/>s below <see cref="IconBitDepth.Depth32BitsPerPixel"/>.
         /// Alpha values less than this value will be fully transparent; alpha values greater than or equal to this value will be fully opaque.
         /// </summary>
-        /// <exception cref="ObjectDisposedException">
-        /// In a set operation, the current instance is disposed.
-        /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
         public byte AlphaThreshold
         {
-            get { return _alphaThreshold; }
-            set { _changeValue(value, ref _alphaThreshold, "AlphaThreshold"); }
+            get { return (byte)GetValue(AlphaThresholdProperty); }
+            set { SetValue(AlphaThresholdProperty, value); }
         }
         #endregion

-        private int _clamp(int dimension, int value)
-        {
-            if (value < 0) return 0;
-            if (value > dimension) return dimension;
-            return value;
-        }
-
         #region HotspotX
-        private int _hotspotX;
+        /// <summary>
+        /// The dependency property for the <see cref="HotspotX"/> property.
+        /// </summary>
+        public static readonly DependencyProperty HotspotXProperty = DependencyProperty.Register("HotspotX", typeof(int), typeof(IconEntry),
+            new PropertyMetadata(0, null, HotspotXCoerce));
+
+        private static object HotspotXCoerce(DependencyObject d, object baseValue)
+        {
+            IconEntry i = (IconEntry)d;
+
+            int value = (int)baseValue;
+            if (value > i._width) return (int)i._width;
+
+            return baseValue;
+        }
+
         /// <summary>
         /// In a cursor, gets the horizontal offset in pixels of the cursor's hotspot from the left side.
         /// Constrained to greater than or equal to 0 and less than or equal to <see cref="Width"/>.
         /// </summary>
-        /// <exception cref="ObjectDisposedException">
-        /// In a set operation, the current instance is disposed.
-        /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
         public int HotspotX
         {
-            get { return _hotspotX; }
-            set { _changeValue(_clamp(_width, value), ref _hotspotX, "HotspotX"); }
+            get { return (int)GetValue(HotspotXProperty); }
+            set { SetValue(HotspotXProperty, value); }
         }
         #endregion

         #region HotspotY
-        private int _hotspotY;
+        /// <summary>
+        /// The dependency property for the <see cref="HotspotY"/> property.
+        /// </summary>
+        public static readonly DependencyProperty HotspotYProperty = DependencyProperty.Register("HotspotY", typeof(int), typeof(IconEntry),
+            new PropertyMetadata(0, null, HotspotYCoerce));
+
+        private static object HotspotYCoerce(DependencyObject d, object baseValue)
+        {
+            IconEntry e = (IconEntry)d;
+
+            int value = (int)baseValue;
+            if (value > e._height) return (int)e._height;
+
+            return baseValue;
+        }
+
         /// <summary>
         /// In a cursor, gets the vertical offset in pixels of the cursor's hotspot from the top side.
         /// Constrained to greater than or equal to 0 and less than or equal to <see cref="Height"/>.
         /// </summary>
-        /// <exception cref="ObjectDisposedException">
-        /// In a set operation, the current instance is disposed.
-        /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
         public int HotspotY
         {
-            get { return _hotspotY; }
-            set { _changeValue(_clamp(_height, value), ref _hotspotY, "HotspotY"); }
+            get { return (int)GetValue(HotspotYProperty); }
+            set { SetValue(HotspotYProperty, value); }
         }
         #endregion

         #region ScalingFilter
-        private static bool ScalingFilterValidate(IconScalingFilter value)
-        {
-            switch (value)
-            {
-                case IconScalingFilter.Matrix:
-                case IconScalingFilter.Bicubic:
-                case IconScalingFilter.Bilinear:
-                case IconScalingFilter.HighQualityBicubic:
-                case IconScalingFilter.HighQualityBilinear:
-                case IconScalingFilter.NearestNeighbor:
+        /// <summary>
+        /// The dependency property for the <see cref="ScalingFilter"/> property.
+        /// </summary>
+        public static readonly DependencyProperty ScalingFilterProperty = DependencyProperty.Register("ScalingFilter", typeof(ScalingFilter), typeof(IconEntry),
+            new PropertyMetadata(ScalingFilter.Matrix), ScalingFilterValidate);
+
+        private static bool ScalingFilterValidate(object value)
+        {
+            switch ((ScalingFilter)value)
+            {
+                case ScalingFilter.Matrix:
+                case ScalingFilter.Bicubic:
+                case ScalingFilter.Bilinear:
+                case ScalingFilter.HighQualityBicubic:
+                case ScalingFilter.HighQualityBilinear:
+                case ScalingFilter.NearestNeighbor:
                     return true;
                 default:
                     return false;
             }
         }

-        private IconScalingFilter _scaleFilter;
         /// <summary>
         /// Gets and sets the scaling mode used to resize <see cref="BaseImage"/> and <see cref="AlphaImage"/> when quantizing.
         /// </summary>
-        /// <exception cref="ObjectDisposedException">
-        /// In a set operation, the current instance is disposed.
-        /// </exception>
         /// <exception cref="InvalidEnumArgumentException">
-        /// In a set operation, the specified value is not a valid <see cref="IconScalingFilter"/> value.
-        /// </exception>
-        [Bindable(true, BindingDirection.TwoWay)]
-        public IconScalingFilter ScalingFilter
-        {
-            get { return _scaleFilter; }
+        /// In a set operation, the specified value is not a valid <see cref="UIconEdit.ScalingFilter"/> value.
+        /// </exception>
+        public ScalingFilter ScalingFilter
+        {
+            get { return (ScalingFilter)GetValue(ScalingFilterProperty); }
             set
             {
                 if (!ScalingFilterValidate(value))
-                    throw new InvalidEnumArgumentException(null, (int)value, typeof(IconScalingFilter));
-                _changeValue(value, ref _scaleFilter, "ScalingFilter");
+                    throw new InvalidEnumArgumentException(null, (int)value, typeof(ScalingFilter));
+                SetValue(ScalingFilterProperty, value);
             }
         }
         #endregion
@@ -700,21 +735,33 @@

         internal IconFileBase File;

+        private static readonly Dictionary<string, DependencyPropertyKey> propertyKeys =
+            typeof(IconEntry).GetFields(BindingFlags.Static | BindingFlags.NonPublic).Where(i => i.FieldType == typeof(DependencyPropertyKey))
+            .ToDictionary(k => k.Name, v => (DependencyPropertyKey)v.GetValue(null));
+
         /// <summary>
         /// Returns a duplicate of the current instance.
         /// </summary>
         /// <returns>A duplicate of the current instance, with its own clone of <see cref="BaseImage"/>.</returns>
-        /// <exception cref="ObjectDisposedException">
-        /// The current instance is dipsosed.
-        /// </exception>
         public IconEntry Clone()
         {
-            if (_isDisposed) throw new ObjectDisposedException(null);
             IconEntry copy = (IconEntry)MemberwiseClone();

-            copy._baseImage = _baseImage.Clone();
-            if (_alphaImage != null) copy._alphaImage = _alphaImage.Clone();
-            copy.PropertyChanged = null;
+            LocalValueEnumerator enumerator = GetLocalValueEnumerator();
+            while (enumerator.MoveNext())
+            {
+                LocalValueEntry curEntry = enumerator.Current;
+
+                object value = curEntry.Value;
+                ICloneable cloneable = value as ICloneable;
+                if (cloneable != null) value = cloneable.Clone();
+
+                DependencyPropertyKey key;
+                if (propertyKeys.TryGetValue(curEntry.Property.Name + "PropertyKey", out key))
+                    copy.SetValue(key, value);
+                else
+                    copy.SetValue(curEntry.Property, value);
+            }

             copy.File = null;
             return copy;
@@ -742,7 +789,7 @@
             BitmapSource alphaMask, baseImage = GetQuantized(isPng, out alphaMask);
             BaseImage = baseImage;
             AlphaImage = alphaMask;
-            IsQuantized = true;
+            SetValue(IsQuantizedPropertyKey, true);
         }

         /// <summary>
@@ -786,7 +833,7 @@
                 return new WriteableBitmap(BaseImage);
             }

-            IconScalingFilter scaleMode = ScalingFilter;
+            ScalingFilter scaleMode = ScalingFilter;

             uint[] pixels = _scaleBitmap(scaleMode, BaseImage);
             const uint opaqueAlpha = 0xFF000000u;
@@ -835,7 +882,7 @@
             {
                 if (alphaImage.PixelWidth != _width || alphaImage.PixelHeight != _height)
                 {
-                    if (scaleMode == IconScalingFilter.Matrix)
+                    if (scaleMode == ScalingFilter.Matrix)
                     {
                         alphaImage = new TransformedBitmap(alphaImage, new ScaleTransform((double)_width / alphaImage.PixelWidth,
                             (double)_height / alphaImage.PixelHeight));
@@ -902,7 +949,7 @@
             return GetBitmap(_width, _height, pixels);
         }

-        private uint[] _scaleBitmap(IconScalingFilter scaleMode, BitmapSource image)
+        private uint[] _scaleBitmap(ScalingFilter scaleMode, BitmapSource image)
         {
             uint[] pixels = new uint[_width * _height];
             FormatConvertedBitmap formatBmp = new FormatConvertedBitmap(image, PixelFormats.Bgra32, null, 0);
@@ -910,7 +957,7 @@
             {
                 formatBmp.CopyPixels(pixels, _width * sizeof(uint), 0);
             }
-            else if (scaleMode == IconScalingFilter.Matrix)
+            else if (scaleMode == ScalingFilter.Matrix)
             {
                 TransformedBitmap transBmp = new TransformedBitmap(formatBmp, new ScaleTransform((double)_width / formatBmp.PixelWidth,
                     (double)_height / formatBmp.PixelHeight));
@@ -921,7 +968,7 @@
             return pixels;
         }

-        private void _scaleBitmap(IconScalingFilter scaleMode, FormatConvertedBitmap image, uint[] pixels)
+        private void _scaleBitmap(ScalingFilter scaleMode, FormatConvertedBitmap image, uint[] pixels)
         {
             using (DBitmap dBitmap = new DBitmap(image.PixelWidth, image.PixelHeight, DPixelFormat.Format32bppArgb))
             {
@@ -940,19 +987,19 @@

                         switch (scaleMode)
                         {
-                            case IconScalingFilter.Bicubic:
+                            case ScalingFilter.Bicubic:
                                 g.InterpolationMode = InterpolationMode.Bicubic;
                                 break;
-                            case IconScalingFilter.Bilinear:
+                            case ScalingFilter.Bilinear:
                                 g.InterpolationMode = InterpolationMode.Bilinear;
                                 break;
-                            case IconScalingFilter.HighQualityBicubic:
+                            case ScalingFilter.HighQualityBicubic:
                                 g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                                 break;
-                            case IconScalingFilter.HighQualityBilinear:
+                            case ScalingFilter.HighQualityBilinear:
                                 g.InterpolationMode = InterpolationMode.HighQualityBilinear;
                                 break;
-                            case IconScalingFilter.NearestNeighbor:
+                            case ScalingFilter.NearestNeighbor:
                                 g.InterpolationMode = InterpolationMode.NearestNeighbor;
                                 break;
                         }
@@ -1114,36 +1161,6 @@
             return string.Format("{0}, BaseImage:{1}", EntryKey, BaseImage);
         }

-        /// <summary>
-        /// Called when a property on the current instance changes.
-        /// </summary>
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        private void _onPropertyChanged(bool changed, string propertyName)
-        {
-            if (changed && PropertyChanged != null)
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-        }
-
-        private void _changeObject<T>(T value, ref T curValue, string propertyName)
-            where T : class
-        {
-            if (_isDisposed) throw new ObjectDisposedException(null);
-            object oldValue = curValue;
-            curValue = value;
-
-            _onPropertyChanged(!ReferenceEquals(oldValue, value) && (value == null || oldValue == null || !value.Equals(oldValue)), propertyName);
-        }
-
-        private void _changeValue<T>(T value, ref T curValue, string propertyName)
-            where T : struct
-        {
-            if (_isDisposed) throw new ObjectDisposedException(null);
-            T oldValue = curValue;
-            curValue = value;
-            _onPropertyChanged(value.Equals(oldValue), propertyName);
-        }
-
         #region Disposal
         private bool _isDisposed;
         /// <summary>
@@ -1153,7 +1170,7 @@
         public bool IsDisposed
         {
             get { return _isDisposed; }
-            protected set { _changeValue(value | _isDisposed, ref _isDisposed, "IsDisposed"); }
+            protected set { _isDisposed |= value; }
         }

         /// <summary>
@@ -1171,9 +1188,18 @@
         public virtual void Dispose(bool disposing)
         {
             if (_isDisposed) return;
-            _changeObject(null, ref _baseImage, "BaseImage");
-            AlphaImage = null;
-            _isDisposed = true;
+            try
+            {
+                SetValue(BaseImageProperty, BaseImageProperty.DefaultMetadata.DefaultValue);
+                SetValue(AlphaImageProperty, null);
+            }
+            catch (Exception) //Should only happen if you dispose in the wrong thread
+            {
+            }
+            finally
+            {
+                _isDisposed = true;
+            }
         }

         /// <summary>
@@ -1477,7 +1503,7 @@
         /// Returns an invalid <see cref="IconEntryKey"/> with all values equal to 0.
         /// </summary>
         public static readonly IconEntry Empty;
-
+
         internal bool IsValid { get { return Width >= IconEntry.MinDimension && Height >= IconEntry.MinDimension && _isValid(BitDepth); } }

         /// <summary>
@@ -1659,7 +1685,7 @@
     /// <summary>
     /// Indicates options for resizing <see cref="IconEntry.BaseImage"/> and <see cref="IconEntry.AlphaImage"/> when quantizing.
     /// </summary>
-    public enum IconScalingFilter
+    public enum ScalingFilter
     {
         /// <summary>
         /// Resizes using a transformation matrix.


Ajustes Form

Ajustes Form

--- Form1.Designer.cs
+++ Form1.Designer.cs
@@ -46,7 +46,7 @@
             // lblInput
             //
             this.lblInput.AutoSize = true;
-            this.lblInput.Location = new System.Drawing.Point(12, 57);
+            this.lblInput.Location = new System.Drawing.Point(9, 57);
             this.lblInput.Name = "lblInput";
             this.lblInput.Size = new System.Drawing.Size(44, 13);
             this.lblInput.TabIndex = 1;
@@ -55,7 +55,7 @@
             // lblOutput
             //
             this.lblOutput.AutoSize = true;
-            this.lblOutput.Location = new System.Drawing.Point(433, 57);
+            this.lblOutput.Location = new System.Drawing.Point(306, 57);
             this.lblOutput.Name = "lblOutput";
             this.lblOutput.Size = new System.Drawing.Size(36, 13);
             this.lblOutput.TabIndex = 3;
@@ -83,7 +83,7 @@
             //
             // btnReset
             //
-            this.btnReset.Location = new System.Drawing.Point(751, 187);
+            this.btnReset.Location = new System.Drawing.Point(525, 187);
             this.btnReset.Name = "btnReset";
             this.btnReset.Size = new System.Drawing.Size(75, 23);
             this.btnReset.TabIndex = 6;
@@ -94,7 +94,7 @@
             // lblRotorIStart
             //
             this.lblRotorIStart.AutoSize = true;
-            this.lblRotorIStart.Location = new System.Drawing.Point(12, 17);
+            this.lblRotorIStart.Location = new System.Drawing.Point(9, 17);
             this.lblRotorIStart.Name = "lblRotorIStart";
             this.lblRotorIStart.Size = new System.Drawing.Size(47, 13);
             this.lblRotorIStart.TabIndex = 9;
@@ -112,7 +112,7 @@
             // lblRotorIIIStart
             //
             this.lblRotorIIIStart.AutoSize = true;
-            this.lblRotorIIIStart.Location = new System.Drawing.Point(111, 17);
+            this.lblRotorIIIStart.Location = new System.Drawing.Point(115, 17);
             this.lblRotorIIIStart.Name = "lblRotorIIIStart";
             this.lblRotorIIIStart.Size = new System.Drawing.Size(47, 13);
             this.lblRotorIIIStart.TabIndex = 11;
@@ -120,7 +120,7 @@
             //
             // txtRotorIStart
             //
-            this.txtRotorIStart.Location = new System.Drawing.Point(15, 33);
+            this.txtRotorIStart.Location = new System.Drawing.Point(12, 33);
             this.txtRotorIStart.Name = "txtRotorIStart";
             this.txtRotorIStart.Size = new System.Drawing.Size(32, 20);
             this.txtRotorIStart.TabIndex = 12;
@@ -134,16 +134,16 @@
             //
             // txtRotorIIIStart
             //
-            this.txtRotorIIIStart.Location = new System.Drawing.Point(114, 33);
+            this.txtRotorIIIStart.Location = new System.Drawing.Point(118, 33);
             this.txtRotorIIIStart.Name = "txtRotorIIIStart";
             this.txtRotorIIIStart.Size = new System.Drawing.Size(32, 20);
             this.txtRotorIIIStart.TabIndex = 14;
             //
             // rxtOutput
             //
-            this.rxtOutput.Location = new System.Drawing.Point(436, 73);
+            this.rxtOutput.Location = new System.Drawing.Point(309, 73);
             this.rxtOutput.Name = "rxtOutput";
-            this.rxtOutput.Size = new System.Drawing.Size(390, 108);
+            this.rxtOutput.Size = new System.Drawing.Size(291, 108);
             this.rxtOutput.TabIndex = 15;
             this.rxtOutput.Text = "";
             //
@@ -151,7 +151,7 @@
             //
             this.rxtInput.Location = new System.Drawing.Point(12, 73);
             this.rxtInput.Name = "rxtInput";
-            this.rxtInput.Size = new System.Drawing.Size(390, 108);
+            this.rxtInput.Size = new System.Drawing.Size(291, 108);
             this.rxtInput.TabIndex = 16;
             this.rxtInput.Text = "";
             this.rxtInput.TextChanged += new System.EventHandler(this.rxtInput_TextChanged);
@@ -160,7 +160,7 @@
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(838, 218);
+            this.ClientSize = new System.Drawing.Size(612, 216);
             this.Controls.Add(this.rxtInput);
             this.Controls.Add(this.rxtOutput);
             this.Controls.Add(this.txtRotorIIIStart);


fix class

fix class

--- Views/Shared/_Layout.cshtml
+++ Views/Shared/_Layout.cshtml
@@ -25,8 +25,8 @@
             <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
         </environment>
         <style>
-            .layout-transparent {
-                background: url('/images/scheduler_banner.jpg') center / cover;
+            .intro {
+                background: url('/images/scheduler_banner.jpg') center no-repeat;
             }
         </style>
     </head>


update version

update version

--- Properties/AssemblyInfo.cs
+++ Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.1.19")]
-[assembly: AssemblyFileVersion("0.0.1.19")]
+[assembly: AssemblyVersion("0.0.1.20")]
+[assembly: AssemblyFileVersion("0.0.1.20")]
 [assembly: NeutralResourcesLanguageAttribute("ko-KR")]


Updated MvvmCross integration with code analysis

Also localized the exception messages in MvvmCross integration; fixed
mismatched dependency version issues; and finished the XML API
documentation.

Includes update so all assemblies mark themselves as CLSCompliant where
possible. This is hard to enforce as downstream dependencies are no
longer maintaining this so integration fails. Same thing for APTCA -
some integrations (SignalR, MvvmCross) can't include it.

--- Properties/AssemblyInfo.cs
+++ Properties/AssemblyInfo.cs
@@ -4,4 +4,6 @@

 [assembly: AssemblyTitle("Autofac.Integration.SignalR")]
 [assembly: ComVisible(false)]
+
+// SignalR is not marked CLS compliant.
 [assembly: CLSCompliant(false)]


0.3.0.0

--- Properties/AssemblyInfo.cs
+++ Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
 // 既定値にすることができます:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly:              AssemblyVersion("0.2.0.0")]
-[assembly:          AssemblyFileVersion("0.2.0.0")]
-[assembly: AssemblyInformationalVersion("0.2.0.0")]+[assembly:              AssemblyVersion("0.3.0.0")]
+[assembly:          AssemblyFileVersion("0.3.0.0")]
+[assembly: AssemblyInformationalVersion("0.3.0.0")]


Updating Version

Updating Version

--- Properties/AssemblyInfo.cs
+++ Properties/AssemblyInfo.cs
@@ -8,7 +8,7 @@
 [assembly: AssemblyTitle("Hydrate")]
 [assembly: AssemblyDescription("This utility improves your overall fitness and health by reminding you to drink water at regular intervals")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Phodu")]
+[assembly: AssemblyCompany("Ashish Kumar Shah")]
 [assembly: AssemblyProduct("Hydrate")]
 [assembly: AssemblyCopyright("Copyright © 2016. All Rights reserved.")]
 [assembly: AssemblyTrademark("")]
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]


version has been updated to 0.0.5

version has been updated to 0.0.5

--- Properties/AssemblyInfo.cs
+++ Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.4")]
-[assembly: AssemblyFileVersion("0.0.4.0")]
+[assembly: AssemblyVersion("0.0.5")]
+[assembly: AssemblyFileVersion("0.0.5.0")]


Fixing memory leak due to local memories not being popped when a function returned a value

--- ZScript/Runtime/ZRuntime.cs
+++ ZScript/Runtime/ZRuntime.cs
@@ -144,15 +144,16 @@
             _localMemoriesStack.Push(localMemory);

             FunctionVM vm = new FunctionVM(funcDef.Tokens, new VmContext(mapper, _globalAddressedMemory, this));
-
             vm.Execute();

+            _localMemoriesStack.Pop();
+
+            mapper.Clear();
+
             if (vm.HasReturnValue)
             {
                 return vm.ReturnValue;
             }
-
-            _localMemoriesStack.Pop();

             // Disabling this exception for now because it may interfere with function calls that do not expect a return value anyways
             /*throw new Exception("The function called did not return any value because it did not execute a 'return' statement with a value specified.");*/


(NEW) Added method for unreification of graph triples;

--- RDFSharp/Model/RDFGraph.cs
+++ RDFSharp/Model/RDFGraph.cs
@@ -270,6 +270,57 @@
             this.Triples.Clear();
             this.GraphIndex.ClearIndex();
             this.GraphMetadata.ClearMetadata();
+            return this;
+        }
+
+        /// <summary>
+        /// Compacts the reified triples by removing their 4 standard statements
+        /// </summary>
+        public RDFGraph UnReifyTriples() {
+
+            //Create SPARQL SELECT query for detecting reified triples
+            var T = new RDFVariable("T", true);
+            var S = new RDFVariable("S", true);
+            var P = new RDFVariable("P", true);
+            var O = new RDFVariable("O", true);
+            var Q = new RDFSelectQuery()
+                            .AddPatternGroup(new RDFPatternGroup("UnreifyTriples")
+                                .AddPattern(new RDFPattern(T, RDFVocabulary.RDF.TYPE, RDFVocabulary.RDF.STATEMENT))
+                                .AddPattern(new RDFPattern(T, RDFVocabulary.RDF.SUBJECT, S))
+                                .AddPattern(new RDFPattern(T, RDFVocabulary.RDF.PREDICATE, P))
+                                .AddPattern(new RDFPattern(T, RDFVocabulary.RDF.OBJECT, O)));
+
+            //Apply it to the graph
+            var R = Q.ApplyToGraph(this);
+
+            //Iterate results
+            var reifiedTriples = R.SelectResults.Rows.GetEnumerator();
+            while (reifiedTriples.MoveNext()) {
+
+                //Get reification data (T, S, P, O)
+                var tRepresent = RDFQueryUtilities.ParseRDFPatternMember(((DataRow)reifiedTriples.Current)["?T"].ToString());
+                var tSubject   = RDFQueryUtilities.ParseRDFPatternMember(((DataRow)reifiedTriples.Current)["?S"].ToString());
+                var tPredicate = RDFQueryUtilities.ParseRDFPatternMember(((DataRow)reifiedTriples.Current)["?P"].ToString());
+                var tObject    = RDFQueryUtilities.ParseRDFPatternMember(((DataRow)reifiedTriples.Current)["?O"].ToString());
+
+                //Cleanup graph from detected reifications
+                if (tObject   is RDFResource) {
+                    this.AddTriple(new RDFTriple((RDFResource)tSubject, (RDFResource)tPredicate, (RDFResource)tObject));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.TYPE, RDFVocabulary.RDF.STATEMENT));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.SUBJECT, (RDFResource)tSubject));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.PREDICATE, (RDFResource)tPredicate));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.OBJECT, (RDFResource)tObject));
+                }
+                else {
+                    this.AddTriple(new RDFTriple((RDFResource)tSubject, (RDFResource)tPredicate, (RDFLiteral)tObject));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.TYPE, RDFVocabulary.RDF.STATEMENT));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.SUBJECT, (RDFResource)tSubject));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.PREDICATE, (RDFResource)tPredicate));
+                    this.RemoveTriple(new RDFTriple((RDFResource)tRepresent, RDFVocabulary.RDF.OBJECT, (RDFLiteral)tObject));
+                }
+
+            }
+
             return this;
         }
         #endregion


Code cleanup.

Code cleanup.

--- src/MsgPack/Serialization/MessagePackSerializer.cs
+++ src/MsgPack/Serialization/MessagePackSerializer.cs
@@ -26,7 +26,6 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Globalization;
-using System.Linq;
 using System.Runtime.Serialization;

 using MsgPack.Serialization.ReflectionSerializers;


Exception handling

Exception handling

--- src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs
@@ -132,10 +132,10 @@
             }
             catch (Exception ex)
             {
-                //if (ex.MustBeRethrown())
-                //{
-                //    throw;
-                //}
+                if (ex.MustBeRethrown())
+                {
+                    throw;
+                }
             }

             string value = null;


Improve warning in VariableLayoutRenderer (#3462)

--- src/NLog/LayoutRenderers/VariableLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/VariableLayoutRenderer.cs
@@ -77,7 +77,7 @@
                     }
                     else
                     {
-                        InternalLogger.Warn("${{var={0}}} is not thread safe. Caution when updating in multithread environment", Name);
+                        InternalLogger.Warn("${{var={0}}} is not thread safe. This could lead to unexpected results when two targets use the same layout", Name);
                     }
                 }
             }