Improvements in syncing

Improvements in syncing

better errorhandling, added KeepOldFiles attribute, doc

--- tools/SyncProjectItems/Program.cs
+++ tools/SyncProjectItems/Program.cs
@@ -39,6 +39,9 @@
     using System.Linq;
     using System.Xml.Linq;

+    /// <summary>
+    /// Read ProjectFileInfo.xml and sync .csproj files (defined in ProjectFileInfo.xml)
+    /// </summary>
     class Program
     {
         private static XNamespace MSBuildNamespace = "http://schemas.microsoft.com/developer/msbuild/2003";
@@ -77,6 +80,8 @@
                 foreach (var itemGroup in project.Elements("ItemGroup"))
                 {
                     string itemGroupName = (string)itemGroup.Attribute("Name");
+                    var keepOldAttr = itemGroup.Attribute("KeepOldFiles");
+                    bool keepOldFiles = keepOldAttr != null && bool.Parse(keepOldAttr.Value);
                     var contents = new HashSet<string>();
                     foreach (var fileSetElement in itemGroup.Elements("FileSet"))
                     {
@@ -85,23 +90,53 @@

                         if (include != null)
                         {
-                            contents.UnionWith(filesets[include]);
+                            var fileset = GetFileset(filesets, include);
+                            contents.UnionWith(fileset);
                         }

                         if (exclude != null)
                         {
-                            contents.ExceptWith(filesets[exclude]);
+                            var fileset = GetFileset(filesets, exclude);
+                            contents.ExceptWith(fileset);
                         }
                     }

                     Console.WriteLine("  <{0}/>: {1} items", itemGroupName, contents.Count);

-                    var existingItemGroup = projectContents.Elements(MSBuildNamespace + "ItemGroup").Where(c => c.Elements(MSBuildNamespace + itemGroupName).Any()).First();
-                    existingItemGroup.Elements().Remove();
-
+                    var fullItemGroup = MSBuildNamespace + "ItemGroup";
+                    var fullItemGroupName = MSBuildNamespace + itemGroupName;
+                    var projectItemGroup = projectContents.Elements(fullItemGroup).FirstOrDefault(c => c.Elements(fullItemGroupName).Any());
+                    var groupIsEmpty = false;
+
+                    if (projectItemGroup != null)
+                    {
+                        //remove old elemens
+                        if (!keepOldFiles)
+                        {
+                            projectItemGroup.Elements().Remove();
+                            groupIsEmpty = true;
+                        }
+                    }
+                    else
+                    {
+                        //create new group
+                        projectItemGroup = new XElement(fullItemGroup);
+                        projectContents.Add(projectItemGroup);
+                        groupIsEmpty = true;
+                    }
+                    var xElementComparer = new XElementIncludeAttrComparer();
+                    //add files
                     foreach (var filename in contents.OrderBy(c => c))
                     {
-                        var item = new XElement(MSBuildNamespace + itemGroupName, new XAttribute("Include", filename));
+                        var item = new XElement(fullItemGroupName, new XAttribute("Include", filename));
+
+                        if (!groupIsEmpty)
+                        {
+                            //ignore if already there
+
+                            if (projectItemGroup.Elements().Contains(item, xElementComparer))
+                                break;
+                        }

                         foreach (var customize in projectDescriptor.Elements(MSBuildNamespace + "Customize"))
                         {
@@ -118,7 +153,7 @@
                             }
                         }

-                        existingItemGroup.Add(item);
+                        projectItemGroup.Add(item);
                     }

                 }
@@ -136,6 +171,16 @@
             }
         }

+        private static IEnumerable<string> GetFileset(Dictionary<string, HashSet<string>> filesets, string name)
+        {
+            if (!filesets.ContainsKey(name))
+            {
+                throw new Exception(string.Format("Fileset with key {0} is not found (case sensitive)", name));
+            }
+
+            return filesets[name];
+        }
+
         private static Dictionary<string, HashSet<string>> LoadFileSets(XElement projectDescriptor, string baseDirectory)
         {
             var filesets = new Dictionary<string, HashSet<string>>();
@@ -202,5 +247,51 @@
                 FindMatchingFiles(fileList, fileName, dir, prefix + baseName + "\\", add);
             }
         }
+
+        /// <summary>
+        /// Compare xelemens by inlude attr
+        /// </summary>
+        private class XElementIncludeAttrComparer : IEqualityComparer<XElement>
+        {
+
+            #region Implementation of IEqualityComparer<in XElement>
+
+            /// <summary>
+            /// Determines whether the specified objects are equal.
+            /// </summary>
+            /// <returns>
+            /// true if the specified objects are equal; otherwise, false.
+            /// </returns>
+            /// <param name="x">The first object of type <paramref name="T"/> to compare.</param><param name="y">The second object of type <paramref name="T"/> to compare.</param>
+            public bool Equals(XElement x, XElement y)
+            {
+                if (x == null) return y == null;
+
+                var includeXAttr = x.Attribute("Include");
+                var includeYAttr = y.Attribute("Include");
+
+                if (includeXAttr == null) return includeYAttr == null;
+                return  x.Name == y.Name && includeXAttr.Value == includeYAttr.Value;
+            }
+
+            /// <summary>
+            /// Returns a hash code for the specified object.
+            /// </summary>
+            /// <returns>
+            /// A hash code for the specified object.
+            /// </returns>
+            /// <param name="obj">The <see cref="T:System.Object"/> for which a hash code is to be returned.</param><exception cref="T:System.ArgumentNullException">The type of <paramref name="obj"/> is a reference type and <paramref name="obj"/> is null.</exception>
+            public int GetHashCode(XElement obj)
+            {
+                throw new NotSupportedException();
+            }
+
+            #endregion
+
+
+
+        }
     }
+
+
 }


Don't tell buildings to move

Don't tell buildings to move

--- mst-boredom-remover/mst-boredom-remover/Hud.cs
+++ mst-boredom-remover/mst-boredom-remover/Hud.cs
@@ -157,11 +157,14 @@
             {
                 if (lastButtonPressed.Equals("None"))
                 {
+                    // Hold shift to append orders
                     if (keys.IsKeyUp(Keys.LeftShift) && keys.IsKeyUp(Keys.RightShift))
                     {
                         unit.orders.Clear();
                     }
-                    if (clickedUnit == unit) // Produce units
+
+                    // Click on same unit to produce units
+                    if (clickedUnit == unit)
                     {
                         if (unit.CanProduce())
                         {
@@ -169,7 +172,8 @@
                         }
                         break;
                     }
-                    else if (clickedUnit != null) //Clicked a different unit TODO:make it so you don't attack your buddies
+                    // Click on other units to attack them
+                    else if (clickedUnit != null) // TODO: make it so you don't attack your buddies
                     {
                         if (selectedUnits.Contains(clickedUnit)) //this check makes it so that you can produce without have the other selected units attack
                         {
@@ -180,8 +184,9 @@
                             engine.OrderAttack(unit, clickedUnit);
                         }
                     }
-                    else // Move units or gather
-                    {
+                    else if (unit.CanMove()) // Move units or gather
+                    {
+                        // Click on a resource node to gather
                         var resource = engine.map.tiles[enumerator.Current.x, enumerator.Current.y].tileType.resourceType;
                         if (resource != TileType.ResourceType.None)
                         {
@@ -190,6 +195,7 @@
                             continue;
                         }

+                        // Click on an empty tile to move
                         while (engine.GetUnitAt(enumerator.Current) != null)
                         {
                             enumerator.MoveNext();


-n  [Issue #33] Added a comment to explain Command pool cleaning

--- extensions/command/impl/Command.cs
+++ extensions/command/impl/Command.cs
@@ -63,6 +63,9 @@

 		public Command ()
 		{
+			//Set to false on construction to ensure that it's not double-injected on first use.
+			//The pool will satisfy all injections on first use. The CommandBinder re-injects
+			//every time the Command is recycled.
 			IsClean = false;
 		}


-n  HOTFIX. Small change to prevent double-firing of events cross-context

--- extensions/dispatcher/eventdispatcher/impl/EventDispatcher.cs
+++ extensions/dispatcher/eventdispatcher/impl/EventDispatcher.cs
@@ -108,6 +108,7 @@
 					if (!trigger.Trigger(eventType, data))
 					{
 						continueDispatch = false;
+						break;
 					}
 				}
 				if (triggerClientRemovals != null)


comment cleanup

comment cleanup

--- contrib/Example/AttributedExample.ConsoleApplication/StateEngine.cs
+++ contrib/Example/AttributedExample.ConsoleApplication/StateEngine.cs
@@ -28,12 +28,13 @@
         {
             _stateMachine = new StateMachine<WorkflowStep, WorkflowTrigger>(WorkflowStep.New);

-            Console.WriteLine("Entering new step at {0}", DateTime.Now.ToLongTimeString());
+            Console.WriteLine("Entering New step at {0}", DateTime.Now.ToLongTimeString());

             // here, we'll filter according to the rules we are looking for.  the incorportation of rules is another reason
             // consider the filtering process to be injected and atomically testable
             foreach (var item in (from p in stateSteps where p.Metadata.DocumentType == documentType select p))
             {
+                // the following allocation is required to maintain proper state in the closure' context
                 var localItem = item;
                 var stateConfig = _stateMachine.Configure(localItem.Metadata.WorkflowStep);


wording about issue library dump

wording about issue library dump

--- ARKBreedingStats/Form1.collection.cs
+++ ARKBreedingStats/Form1.collection.cs
@@ -637,7 +637,7 @@
             Clipboard.SetFileDropList(new StringCollection { tempZipFilePath });

             // display info that debug file is in clipboard
-            SetMessageLabelText("File with the current library and the values in the extractor has been copied to the clipboard. You can add this file to an issue report.", MessageBoxIcon.Information, tempZipFilePath);
+            SetMessageLabelText("A File with the current library and the values in the extractor has been created and copied to the clipboard. You can paste this file to a folder to add it to an issue report.", MessageBoxIcon.Information, tempZipFilePath);
         }

         private bool OpenZippedLibrary(string filePath)


Minor fix to SDL_Input.

Minor fix to SDL_Input.

--- AgateLib.AgateSDL/Input/SDL_Input.cs
+++ AgateLib.AgateSDL/Input/SDL_Input.cs
@@ -98,6 +98,9 @@
 			{
 				string retval = sdl.SDL_JoystickName(joystickIndex);

+				if (retval == null)
+					return "";
+
 				return retval;
 			}
 		}


Safe Zone collision fixes.

Safe Zone collision fixes.

--- Anfloga/Anfloga/Entities/SafeZone.cs
+++ Anfloga/Anfloga/Entities/SafeZone.cs
@@ -117,10 +117,11 @@

             Collision.AddToManagers();

+            Collision.Visible = false;
 #if DEBUG
-            if(DebuggingVariables.ShowReplenishZoneCollision)
+            if (DebuggingVariables.ShowReplenishZoneCollision)
             {
-                circle.Visible = true;
+                Collision.Visible = true;
             }
 #endif

@@ -161,6 +162,14 @@
             //Activation animation?
             bubbleEmitter.Destroy();
             bubbleEmitter = null;
+
+            Collision.Visible = false;
+#if DEBUG
+            if (DebuggingVariables.ShowReplenishZoneCollision)
+            {
+                Collision.Visible = true;
+            }
+#endif
         }

         private void SetupFreeSafeZone()


Add method Open to GrammarFactory for opening grammars from file or directory

--- AntlrGrammarEditor/GrammarFactory.cs
+++ AntlrGrammarEditor/GrammarFactory.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Text;

 namespace AntlrGrammarEditor
@@ -8,13 +9,96 @@
     {
         public const string PreprocessorPostfix = "Preprocessor";

+        public static Grammar Open(string fileOrDirectoryName)
+        {
+            List<string> grammarFiles;
+            string grammarName = "";
+            string directoryName;
+            bool separatedLexerAndParser = false;
+
+            if (File.Exists(fileOrDirectoryName))
+            {
+                directoryName = Path.GetDirectoryName(fileOrDirectoryName);
+                string grammarFile = Path.GetFileName(fileOrDirectoryName);
+                grammarName = Path.GetFileNameWithoutExtension(grammarFile);
+                grammarFiles = new List<string> { grammarFile };
+            }
+            else if (Directory.Exists(fileOrDirectoryName))
+            {
+                directoryName = fileOrDirectoryName;
+                string[] g4Files = Directory.GetFiles(fileOrDirectoryName, "*.g4");
+
+                grammarFiles = new List<string>(g4Files.Length);
+
+                if (g4Files.Length == 1)
+                {
+                    string grammarFile = Path.GetFileName(g4Files[0]);
+                    grammarName = Path.GetFileNameWithoutExtension(grammarFile);
+                    grammarFiles.Add(grammarFile);
+                }
+                else if (g4Files.Length > 1)
+                {
+                    /*grammarName = Path.GetFileNameWithoutExtension(g4Files[0]).Replace(LexerPostfix, "")
+                        .Replace(ParserPostfix, "");
+
+                    grammarFiles = g4Files.Select(file => Path.GetFileName(file)).ToList();*/
+
+                    string lexerFileName =
+                        g4Files.FirstOrDefault(grammarFile => grammarFile.Contains(Grammar.LexerPostfix));
+                    if (!string.IsNullOrEmpty(lexerFileName))
+                    {
+                        grammarFiles.Add(Path.GetFileName(lexerFileName));
+                        grammarName = Path.GetFileNameWithoutExtension(lexerFileName).Replace(Grammar.LexerPostfix, "");
+                    }
+
+                    string parserFileName =
+                        g4Files.FirstOrDefault(grammarFile => grammarFile.Contains(Grammar.ParserPostfix));
+                    if (!string.IsNullOrEmpty(parserFileName))
+                    {
+                        grammarFiles.Add(Path.GetFileName(parserFileName));
+                        grammarName = Path.GetFileNameWithoutExtension(parserFileName)
+                            .Replace(Grammar.ParserPostfix, "");
+                    }
+
+                    separatedLexerAndParser = true;
+                }
+            }
+            else
+            {
+                throw new FileNotFoundException($"Not file nor directory exists at path {fileOrDirectoryName}");
+            }
+
+            string[] textFiles;
+            string examplesDir = Path.Combine(directoryName, "examples");
+            if (Directory.Exists(examplesDir))
+            {
+                textFiles = Directory.GetFiles(examplesDir, "*.*", SearchOption.AllDirectories);
+            }
+            else
+            {
+                textFiles = new string[0];
+            }
+
+            var result = new Grammar
+            {
+                Name = grammarName,
+                Directory = fileOrDirectoryName,
+                Runtimes = new HashSet<Runtime> {Runtime.Java},
+                Files = grammarFiles,
+                SeparatedLexerAndParser = separatedLexerAndParser,
+                TextFiles = textFiles.ToList()
+            };
+
+            return result;
+        }
+
         public static Grammar CreateDefault()
         {
             var result = new Grammar
             {
                 Name = "NewGrammar",
                 Root = "rootRule",
-                Runtimes = new HashSet<Runtime>() { Runtime.CSharpOptimized },
+                Runtimes = new HashSet<Runtime> { Runtime.CSharpOptimized },
                 SeparatedLexerAndParser = false,
                 CaseInsensitive = false,
                 Preprocessor = false,
@@ -30,10 +114,10 @@
             var result = new Grammar
             {
                 Name = grammarName,
-                Runtimes = new HashSet<Runtime>() { Runtime.CSharpOptimized },
-            };
-
-            result.AgeFileName = Path.Combine(directory, grammarName) + Grammar.ProjectDotExt;
+                Runtimes = new HashSet<Runtime> { Runtime.CSharpOptimized }
+            };
+
+            result.Directory = directory;
             InitFiles(result);

             foreach (var file in result.Files)
@@ -41,7 +125,6 @@
                 File.WriteAllText(Path.Combine(directory, file), grammarText);
             }

-            result.Save();
             return result;
         }

@@ -50,11 +133,11 @@
             var result = new Grammar
             {
                 Name = grammarName,
-                Runtimes = new HashSet<Runtime>() { Runtime.CSharpOptimized },
+                Runtimes = new HashSet<Runtime> { Runtime.CSharpOptimized },
                 SeparatedLexerAndParser = true,
             };

-            result.AgeFileName = Path.Combine(directory, grammarName) + Grammar.ProjectDotExt;
+            result.Directory = directory;
             InitFiles(result);

             foreach (var file in result.Files)
@@ -63,13 +146,12 @@
                 File.WriteAllText(Path.Combine(directory, file), text);
             }

-            result.Save();
             return result;
         }

         public static void FillGrammarFiles(Grammar grammar, string directory, bool overwriteFiles)
         {
-            grammar.AgeFileName = Path.Combine(directory, grammar.Name) + Grammar.ProjectDotExt;
+            grammar.Directory = directory;
             InitFiles(grammar);

             if (!Directory.Exists(directory))
@@ -127,13 +209,11 @@
             {
                 File.WriteAllText(file, "test");
             }
-
-            grammar.Save();
         }

         public static string GenerateTextFileName(Grammar grammar)
         {
-            return Path.Combine(grammar.GrammarPath, grammar.Name + "_text." + grammar.FileExtension);
+            return Path.Combine(grammar.Directory, grammar.Name + "_text." + grammar.FileExtension);
         }

         private static void InitFiles(Grammar grammar)


Update about dialog

Update about dialog

--- src/UI.Dialog/AboutDialog.cs
+++ src/UI.Dialog/AboutDialog.cs
@@ -28,6 +28,7 @@
 				"Primary Development",
 				"\tLawrence Ewing",
 				"\tStephane Delcroix",
+				"\tRuben Vermeersch",
 				"",
 				"Active Contributors to this release",
 				"\tChristian Krause",					//0.6.1.3
@@ -35,7 +36,6 @@
 				"\tIain Lane",						//0.6.1.3
 				"\tLorenzo Milesi",					//0.5.0
 				"\tMike Gem\x00fcnde",
-				"\tRuben Vermeersch",					//0.5.0, 0.6.0
 				"",
 				"Contributors",
 				"\tAaron Bockover",
@@ -92,7 +92,7 @@
 					s.Close ();
 				}
 			} catch (Exception e) {
-				Console.WriteLine (e);
+				Log.DebugException (e);
 				License = "GPL v2";
 			}
 			Logo = new Gdk.Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), "f-spot-128.png");


(DatOpener): recognize archives with different filename lengths.

--- ArcFormats/MnoViolet/ArcMnoViolet.cs
+++ ArcFormats/MnoViolet/ArcMnoViolet.cs
@@ -45,33 +45,50 @@
             Extensions = new string[] { "dat" };
         }

+        static readonly uint[] NameSizes = { 100, 68, 44 };
+        static readonly Lazy<ImageFormat> s_GraFormat = new Lazy<ImageFormat> (() => ImageFormat.FindByTag ("GRA"));
+
         public override ArcFile TryOpen (ArcView file)
         {
             int count = file.View.ReadInt32 (0);
-            if (count <= 0 || count > 0xfffff)
+            if (!IsSaneCount (count))
                 return null;
-            uint name_size = 100;
-            uint index_size = (uint)((name_size+8) * count);
-            uint first_offset = file.View.ReadUInt32 (4+name_size+4);
-            if (first_offset != (4 + index_size) || index_size > file.View.Reserve (4, index_size))
-                return null;
-            var dir = new List<Entry> (count);
-            long index_offset = 4;
-            for (int i = 0; i < count; ++i)
+            List<Entry> dir = null;
+            foreach (var name_size in NameSizes)
             {
-                string name = file.View.ReadString (index_offset, name_size);
-                if (0 == name.Length)
-                    return null;
-                index_offset += name_size;
-                uint offset = file.View.ReadUInt32 (index_offset+4);
-                var entry = AutoEntry.Create (file, offset, name);
-                entry.Size   = file.View.ReadUInt32 (index_offset);
-                if (offset <= index_size || !entry.CheckPlacement (file.MaxOffset))
-                    return null;
-                dir.Add (entry);
-                index_offset += 8;
+                uint index_size = (uint)((name_size+8) * count);
+                uint first_offset = file.View.ReadUInt32 (4+name_size+4);
+                if (first_offset == (4 + index_size) && first_offset < file.MaxOffset)
+                {
+                    if (null == dir)
+                        dir = new List<Entry> (count);
+                    long index_offset = 4;
+                    for (int i = 0; i < count; ++i)
+                    {
+                        string name = file.View.ReadString (index_offset, name_size);
+                        if (string.IsNullOrWhiteSpace (name))
+                            goto CheckNextLength;
+                        index_offset += name_size;
+                        uint offset = file.View.ReadUInt32 (index_offset+4);
+                        var entry = new AutoEntry (name, () => {
+                            uint signature = file.View.ReadUInt32 (offset);
+                            if (1 == signature)
+                                return s_GraFormat.Value;
+                            return AutoEntry.DetectFileType (signature);
+                        });
+                        entry.Offset = offset;
+                        entry.Size   = file.View.ReadUInt32 (index_offset);
+                        if (offset <= index_size || !entry.CheckPlacement (file.MaxOffset))
+                            goto CheckNextLength;
+                        dir.Add (entry);
+                        index_offset += 8;
+                    }
+                    return new ArcFile (file, this, dir);
+                }
+CheckNextLength:
+                ;
             }
-            return new ArcFile (file, this, dir);
+            return null;
         }
     }
 }


add docs

add docs

--- Assets/Fetch/IOC/ServiceContainer.cs
+++ Assets/Fetch/IOC/ServiceContainer.cs
@@ -16,13 +16,19 @@
     /// </summary>
     public class ServiceContainer : MonoBehaviour
     {
-        // IOC will persist between level loads
-        public bool persistAlways = false;
+        /// <summary>
+        /// IOC will persist between level loads
+        /// </summary>
+        public bool persistAlways;

-        // true if the service provider has been populated
-        private bool populated = false;
+        /// <summary>
+        /// true if the service provider has been populated
+        /// </summary>
+        private bool populated;

-        // list of the services that are attached to this IOC Container
+        /// <summary>
+        /// list of the services that are attached to this IOC Container
+        /// </summary>
         private List<Service> services = new List<Service>();

         /// <summary>


Car dodge game now speeds up.

Car dodge game now speeds up.

--- Assets/GetAwayGame/RoadTileScript.cs
+++ Assets/GetAwayGame/RoadTileScript.cs
@@ -18,7 +18,11 @@
     private float mLaneOffset = 1.1f;
     private float mDecorationOffset = 4.0f;

-    public const float mRoadSpeed = 12.0f;
+    public const float mStartSpeed = 12.0f;
+    public const float mEndSpeed = 30.0f;
+    public const float mSpeedupTime = 60.0f;
+    public const float mAcceleration = (mEndSpeed - mStartSpeed) / mSpeedupTime;
+    public static float mRoadSpeed = mStartSpeed;
     private float mRoadTileWidth = 0.0f;

     private List<GameObject> mObstacles = new List<GameObject>();
@@ -39,6 +43,7 @@
 	void Start ()
     {
         Random.seed = (int)System.DateTime.Now.Ticks & 0x0000FFFF;
+        mRoadSpeed = mStartSpeed;

         // Create road.
         var renderer = mRoadInstance.GetComponent<Renderer>();
@@ -66,6 +71,12 @@
             return;
         }

+        mRoadSpeed += Time.deltaTime * mAcceleration;
+        if(mRoadSpeed > mEndSpeed)
+        {
+            mRoadSpeed = mEndSpeed;
+        }
+
         float moveDistance = mRoadSpeed * Time.deltaTime;
         for(int i = 0; i < mNumRoadPieces; i++)
         {
@@ -88,7 +99,7 @@
             g.transform.position = p;

             var renderer = g.GetComponent<Renderer>();
-            if(g.transform.position.x + 2*renderer.bounds.size.x < -20)
+            if(g.transform.position.x + 2*renderer.bounds.size.x < -30)
             {
                 objectsToRemove.Add(g);
             }


add y-position

add y-position

--- Assets/JumpCommand/JumpCommandGUI.cs
+++ Assets/JumpCommand/JumpCommandGUI.cs
@@ -17,6 +17,9 @@
     int    cursorPos    = -1;
     string prompt       = "";
     GameObject lastSelection = null;
+
+    [Tooltip("value between 0 and 1. 0 meas top of screen, 1 means bottom of screen.")]
+    public float  yPos   = 0f;

     // Use this for initialization
     void Awake () {
@@ -228,10 +231,13 @@
         HandleBackspace();
         GUI.SetNextControlName("input");

+        yPos = Mathf.Clamp(yPos, 0, 1f);
+        GUILayout.BeginArea(new Rect(0, (Screen.height - 50)*yPos, Screen.width, 50));
+
         GUILayout.Label(prompt);
         String lastInput = input;
         input = GUILayout.TextField(input,GUILayout.Width(Screen.width));
-
+        GUILayout.EndArea();
         if (lastInput != input )
         {
             HandleAutoCompletion();


Update

Update

--- Assets/[0]Framework/LibMono/Actor.cs
+++ Assets/[0]Framework/LibMono/Actor.cs
@@ -271,7 +271,7 @@
 				return (T) obj;
 			}

-			return  GetComponentInChildren<T>() : null;
+			return  GetComponentInChildren<T>();
 		}

 		public T Get<T>(string path = default(string)) where T : Object


lien mana et KMManager

lien mana et KMManager

--- Assets/scripts/keyboard/KMManager.cs
+++ Assets/scripts/keyboard/KMManager.cs
@@ -215,7 +215,7 @@

-		if (Input.GetMouseButton (0) && fireball == null) {
+		if (Input.GetMouseButton (0) && fireball == null && hero.PowerQuantity > HeroConfigurator.wizardAttackCost) {
 			//Debug.Log ("mouse button down");

 			fireball = Instantiate (fireballGO);
@@ -223,25 +223,27 @@

 			fireball.transform.parent = rightHand.transform.FindChild ("HandContainer").transform;
 			fireball.transform.localPosition = new Vector3 (0f, 0.05f, 0f);
-		} else if (!Input.GetMouseButton (0) && fireball != null){
+		} else if (!Input.GetMouseButton (0) && fireball != null && fireball.transform.parent != null){

 			fireball.transform.parent = null;
 			fireball.GetComponentInChildren<CapsuleCollider>().enabled = true;
 			fireball.GetComponent<Rigidbody>().isKinematic = false;
-		}
-
-
-
-
-
-
-		if (Input.GetKey(KeyCode.Space) && vortex == null) {
+
+			hero.PowerQuantity -= HeroConfigurator.wizardAttackCost;
+		}
+
+
+
+
+
+
+		if (Input.GetKey(KeyCode.Space) && vortex == null && hero.PowerQuantity > HeroConfigurator.wizardDefenseCost) {
 			vortex = Instantiate(vortexGO);

 			vortex.transform.parent = leftHand.transform.FindChild("HandContainer").transform;
 			vortex.transform.localPosition = new Vector3(0f, 0f, 0f);

-		}else if (!Input.GetKey(KeyCode.Space) && vortex != null) {
+		}else if (!Input.GetKey(KeyCode.Space) && vortex != null && vortex.transform.parent != cam.transform) {

 			vortex.transform.parent = cam.transform; //attach to camera
 			//vortex.transform.localPosition = new Vector3(0f, 0.3f, 1.5f);
@@ -251,6 +253,8 @@
 			vortex.GetComponentInChildren<CapsuleCollider>().enabled = true;
 			//it is dropped so the size is bigger
 			vortex.GetComponent<ParticleSystem>().startSize = 0.8f;
+
+			hero.PowerQuantity -= HeroConfigurator.wizardDefenseCost;
 		}
 	}
 }


Removed old commented out implementation

--- AxBcWrapper/Query/AxQueryProvider.cs
+++ AxBcWrapper/Query/AxQueryProvider.cs
@@ -29,25 +29,7 @@

             var results = _session.Query(query, elementType);
-            //if (result.Projector != null)
-            //{
-            //    var projector = result.Projector.Compile();
-            //    return Activator.CreateInstance(
-            //        typeof(ProjectionReader<>).MakeGenericType(elementType),
-            //        BindingFlags.Instance | BindingFlags.NonPublic,
-            //        null,
-            //        new object[] { dt.CreateDataReader(), projector },
-            //        null);
-            //}
-            //else
-            //{
-            //    return Activator.CreateInstance(
-            //        typeof(ObjectReader<>).MakeGenericType(elementType),
-            //        BindingFlags.Instance | BindingFlags.NonPublic,
-            //        null,
-            //        new object[] { dt.CreateDataReader() },
-            //        null);
-            //}
+
             return results;
         }


[Core] Issue #58. ExecutionPolicyUtilities documentation

--- Bam.Core/ExecutionPolicyUtilities.cs
+++ Bam.Core/ExecutionPolicyUtilities.cs
@@ -30,7 +30,8 @@
 namespace Bam.Core
 {
     /// <summary>
-    /// Utility functions for dealing with execution policies
+    /// Utility functions instantiating build mode policy classes.
+    /// Note that the where clause specifies class, whereas T can only ever be an interface.
     /// </summary>
     public static class ExecutionPolicyUtilities<T> where T: class
     {
@@ -62,7 +63,10 @@
             return policy;
         }

-        // there is no where T: interface clause
+        /// <summary>
+        /// Create an instance of the policy class, classname, that implements policy in interface T.
+        /// </summary>
+        /// <param name="classname">Name of the class implementing policy T</param>
         public static T
         Create(
             string classname)


[Bam,Core] Display the filename of the package definition file if an exception occurs while reading it

--- Bam.Core/Package/PackageUtilities.cs
+++ Bam.Core/Package/PackageUtilities.cs
@@ -208,8 +208,15 @@
                 }

                 var definitionFile = new PackageDefinitionFile(definitionPathName, !State.ForceDefinitionFileUpdate);
-                definitionFile.Read(true);
-                id.Definition = definitionFile;
+                try
+                {
+                    definitionFile.Read(true);
+                    id.Definition = definitionFile;
+                }
+                catch (Exception ex)
+                {
+                    throw new Exception(ex, "Failed loading definition file {0}", definitionPathName);
+                }

                 if (!OSUtilities.IsCurrentPlatformSupported(definitionFile.SupportedPlatforms))
                 {


Update Rank.cs

Update Rank.cs

--- Battery-Commander.Web/Models/Rank.cs
+++ Battery-Commander.Web/Models/Rank.cs
@@ -195,11 +195,11 @@
                 case Rank.E8_MSG:
                 case Rank.E9:

-                case Rank.WO_1:
-                case Rank.WO_2:
-                case Rank.WO_3:
-                case Rank.WO_4:
-                case Rank.WO_5:
+                case Rank.WO1:
+                case Rank.WO2:
+                case Rank.WO3:
+                case Rank.WO4:
+                case Rank.WO5:

                 case Rank.O1:
                 case Rank.O2:


Select the new tab in OptionsForm when a new profile is added.

--- CalDavSynchronizer/Ui/OptionsForm.cs
+++ CalDavSynchronizer/Ui/OptionsForm.cs
@@ -179,7 +179,7 @@
       Options options = Options.CreateDefault (string.Empty, string.Empty);
       options.DisplayType = type.Value;

-      AddTabPage (options);
+      _tabControl.SelectedTab = AddTabPage (options);
     }
   }
 }


RSASHA512 + AESGCM to messages

RSASHA512 + AESGCM to messages

--- ChronosClient/Views/Messages.xaml.cs
+++ ChronosClient/Views/Messages.xaml.cs
@@ -4,7 +4,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Net.Http;
-using Windows.ApplicationModel.Core;
 using Windows.Security.Cryptography;
 using Windows.Security.Cryptography.Core;
 using Windows.Storage.Streams;
@@ -23,11 +22,71 @@
     {
         private static string message;
         private static string strAsymmetricAlgName = AsymmetricAlgorithmNames.RsaOaepSha512;
-        private string recipientEncrypted;
-        private string senderEncrypted;
-        private IBuffer encryptedMessage;
-        private IBuffer decryptedMessage;
         private string encData;
+
+        // Initialize the symmetric encryption
+        private static String strSymAlgName = SymmetricAlgorithmNames.AesGcm;
+        private static UInt32 keyLength = 64;  // Length of the key, in bytes
+
+        // encoding for symmetric message encryption
+        private BinaryStringEncoding encoding = BinaryStringEncoding.Utf8;
+        // buffer for newly generated AES key
+        private IBuffer keyMaterialSender;
+        // string from newly generated AES key buffer
+        private string keyMaterialStringSender;
+        // key from newly generated AES key
+        private CryptographicKey keySender;
+        // buffer for newly generated nonce (IV)
+        private IBuffer buffNonceSender;
+        // encrypted message data with AES key
+        private IBuffer encryptedMessageDataSender;
+        // authentication tag for AES encrypted data
+        private IBuffer authenticationTagSender;
+        // string equivalent of the buffer containing the encrypted data
+        private string encryptedMessageDataStringSender;
+        // string equivalent of the buffer containing the tag for AES encrypted data
+        private string authenticationTagStringSender;
+        // string equivalent of the buffer containing the nonce
+        private string nonceStringSender;
+        // buffer with encrypted AES key
+        private IBuffer encryptedAESKeyBuffSender;
+        // string equivalent of encrypted key
+        private string encryptedKeyStringSender;
+
+        // buffer for newly generated AES key
+        private IBuffer keyMaterialRecipient;
+        // string from newly generated AES key buffer
+        private string keyMaterialStringRecipient;
+        // key from newly generated AES key
+        private CryptographicKey keyRecipient;
+        // buffer for newly generated nonce (IV)
+        private IBuffer buffNonceRecipient;
+        // encrypted message data with AES key
+        private IBuffer encryptedMessageDataRecipient;
+        // authentication tag for AES encrypted data
+        private IBuffer authenticationTagRecipient;
+        // string equivalent of the buffer containing the encrypted data
+        private string encryptedMessageDataStringRecipient;
+        // string equivalent of the buffer containing the tag for AES encrypted data
+        private string authenticationTagStringRecipient;
+        // string equivalent of the buffer containing the nonce
+        private string nonceStringRecipient;
+        // buffer for encrypted AES key for recipient
+        private IBuffer encryptedAESKeyBuffRecipient;
+        // string equivalent for encrypted key
+        private string encryptedKeyStringRecipient;
+
+        // decrypted data contents
+        private IBuffer buffDecrypted;
+        // string representation of decrypted data contents
+        private string strDecrypted;
+
+        // Initialize a static nonce value.
+        static byte[] NonceBytes = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+
+
+

         //private object buffPublicKey;

@@ -61,10 +120,7 @@

         }

-
-
-
-
+        // fetches encrypted messages from the server
         async void GetMessages(string url)
         {
             Debug.WriteLine(url);
@@ -92,7 +148,7 @@
                         {
                             for (int i = 0; i < data.messages.Count; i++)
                             {
-
+                                //if a message was sent from the current user
                                 if (data.messages[i].user_email == DataContainer.User)
                                 {

@@ -113,13 +169,18 @@
                                     body.Foreground = new SolidColorBrush(Colors.DodgerBlue);
                                     body.TextAlignment = Windows.UI.Xaml.TextAlignment.Right;
                                     encData = data.messages[i].body2;
-                                    IBuffer userData = CryptographicBuffer.DecodeFromBase64String(encData);
-                                    asymmetricDecryptMessageBody(strAsymmetricAlgName, userData);
-                                    body.Text = message;
+                                    nonceStringSender = data.messages[i].nc2;
+                                    encryptedKeyStringSender = data.messages[i].key2;
+                                    authenticationTagStringSender = data.messages[i].tag2;
+
+                                    //decrypt data if the user sent
+                                    AuthenticatedDecryptionSender(strSymAlgName, encryptedKeyStringSender, encData, nonceStringSender, authenticationTagStringSender);
+                                    body.Text = strDecrypted;
                                     listView_Messages.Items.Add(body);
                                     listView_Messages.Items.Add(space);

                                 }
+                                //if the message was sent to the current user
                                 else if (data.messages[i].user_email == DataContainer.Recipient)
                                 {
                                     TextBlock user = new TextBlock();
@@ -140,14 +201,16 @@
                                     body.Foreground = new SolidColorBrush(Colors.DodgerBlue);
                                     body.TextAlignment = Windows.UI.Xaml.TextAlignment.Left;
                                     encData = data.messages[i].body;
-                                    IBuffer userData = CryptographicBuffer.DecodeFromBase64String(encData);
-                                    asymmetricDecryptMessageBody(strAsymmetricAlgName, userData);
-                                    body.Text = message;
+                                    nonceStringSender = data.messages[i].nc;
+                                    encryptedKeyStringSender = data.messages[i].key;
+                                    authenticationTagStringSender = data.messages[i].tag;
+
+                                    //decrypt the data sent to the user
+                                    AuthenticatedDecryptionSender(strSymAlgName, encryptedKeyStringSender, encData, nonceStringSender, authenticationTagStringSender);
+                                    body.Text = strDecrypted;
                                     listView_Messages.Items.Add(body);
                                     listView_Messages.Items.Add(space);
                                 }
-
-

                             }
                         }
@@ -186,7 +249,13 @@
             public string user_email { get; set; }
             public int conversation_id { get; set; }
             public string body { get; set; }
+            public string nc { get; set; }
+            public string tag { get; set; }
+            public string key { get; set; }
             public string body2 { get; set; }
+            public string nc2 { get; set; }
+            public string tag2 { get; set; }
+            public string key2 { get; set; }
             public string created_at { get; set; }
         }

@@ -203,50 +272,80 @@
             message = textToSend.Text;
         }

-        // method to encrypt plain text
-        public void asymemtricEncryptMessageBodyForSender(
-            String strAsymmetricAlgName)
-        {
-            // Open the algorithm provider for the specified asymmetric algorithm.
-            AsymmetricKeyAlgorithmProvider objAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);
-
-            // Import the public key from a buffer.
-            CryptographicKey publicKey = objAlgProv.ImportPublicKey(DataContainer.senderPublicKey);
-
-            IBuffer plain = CryptographicBuffer.ConvertStringToBinary(message, BinaryStringEncoding.Utf8);
-
-            // Encrypt message by using the public key.
-            encryptedMessage = CryptographicEngine.Encrypt(publicKey, plain, null);
-
-            //convert to cipher string
-             senderEncrypted = CryptographicBuffer.EncodeToBase64String(encryptedMessage);
-
-        }
-
-        // method to encrypt plain text
-        public void asymemtricEncryptMessageBodyRecipient(
-            String strAsymmetricAlgName)
-        {
-            // Open the algorithm provider for the specified asymmetric algorithm.
-            AsymmetricKeyAlgorithmProvider objAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);
-
-            // Import the public key from a buffer.
-            CryptographicKey publicKey = objAlgProv.ImportPublicKey(DataContainer.recipientPublicKey);
-
-            IBuffer plain = CryptographicBuffer.ConvertStringToBinary(message, BinaryStringEncoding.Utf8);
-
-            // Encrypt message by using the public key.
-            encryptedMessage = CryptographicEngine.Encrypt(publicKey, plain, null);
-
-            //convert to cipher string
-            recipientEncrypted = CryptographicBuffer.EncodeToBase64String(encryptedMessage);
-
-        }
-
-        // method to decrypt ciphertext
-        public async void asymmetricDecryptMessageBody(
+        // Encryption and authentication method for sender
+        private void AuthenticatedEncryptionSender(
+            String strMsg,
+            String strAlgName,
+            UInt32 keyLength)
+        {
+            // Open a SymmetricKeyAlgorithmProvider object for the specified algorithm.
+            SymmetricKeyAlgorithmProvider objAlgProv = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);
+
+            // Create a buffer that contains the data to be encrypted.
+            IBuffer buffMsg = CryptographicBuffer.ConvertStringToBinary(strMsg, encoding);
+
+            // Generate a symmetric key.
+            keyMaterialSender = CryptographicBuffer.GenerateRandom(keyLength);
+            keyMaterialStringSender = CryptographicBuffer.EncodeToBase64String(keyMaterialSender);
+            keySender = objAlgProv.CreateSymmetricKey(keyMaterialSender);
+
+            // Generate a new nonce value.
+            buffNonceSender = GetNonce();
+
+            // Encrypt and authenticate the message.
+            EncryptedAndAuthenticatedData objEncrypted = CryptographicEngine.EncryptAndAuthenticate(
+                keySender,
+                buffMsg,
+                buffNonceSender,
+                null);
+
+            encryptedMessageDataSender = objEncrypted.EncryptedData;
+            authenticationTagSender = objEncrypted.AuthenticationTag;
+            encryptedMessageDataStringSender = CryptographicBuffer.EncodeToBase64String(encryptedMessageDataSender);
+            authenticationTagStringSender = CryptographicBuffer.EncodeToBase64String(authenticationTagSender);
+            nonceStringSender = CryptographicBuffer.EncodeToBase64String(buffNonceSender);
+
+        }
+
+        // Encryption and authentication method for recipient
+        private void AuthenticatedEncryptionRecipient(
+            String strMsg,
+            String strAlgName,
+            UInt32 keyLength)
+        {
+            // Open a SymmetricKeyAlgorithmProvider object for the specified algorithm.
+            SymmetricKeyAlgorithmProvider objAlgProv = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);
+
+            // Create a buffer that contains the data to be encrypted.
+            IBuffer buffMsg = CryptographicBuffer.ConvertStringToBinary(strMsg, encoding);
+
+            // Generate a symmetric key.
+            keyMaterialRecipient = CryptographicBuffer.GenerateRandom(keyLength);
+            keyMaterialStringRecipient = CryptographicBuffer.EncodeToBase64String(keyMaterialRecipient);
+            keyRecipient = objAlgProv.CreateSymmetricKey(keyMaterialRecipient);
+
+            // Generate a new nonce value.
+            buffNonceRecipient = GetNonce();
+
+            // Encrypt and authenticate the message.
+            EncryptedAndAuthenticatedData objEncrypted = CryptographicEngine.EncryptAndAuthenticate(
+                keyRecipient,
+                buffMsg,
+                buffNonceRecipient,
+                null);
+
+            encryptedMessageDataRecipient = objEncrypted.EncryptedData;
+            authenticationTagRecipient = objEncrypted.AuthenticationTag;
+            encryptedMessageDataStringRecipient = CryptographicBuffer.EncodeToBase64String(encryptedMessageDataRecipient);
+            authenticationTagStringRecipient = CryptographicBuffer.EncodeToBase64String(authenticationTagRecipient);
+            nonceStringRecipient = CryptographicBuffer.EncodeToBase64String(buffNonceRecipient);
+
+        }
+
+        // method to decrypt ciphertext of AES key
+        public async void asymmetricDecryptAESKeySender(
     String strAsymmetricAlgName,
-    IBuffer buffEncryptedMessageBody)
+    IBuffer buffEncryptedAESKey)
         {
             // Open the algorithm provider for the specified asymmetric algorithm.
             AsymmetricKeyAlgorithmProvider objAsymmAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);
@@ -255,7 +354,7 @@
             try
             {
                 // Use the private key embedded in the key pair to decrypt the session key.
-                decryptedMessage = CryptographicEngine.Decrypt(pair, buffEncryptedMessageBody, null);
+                keyMaterialSender = CryptographicEngine.Decrypt(pair, buffEncryptedAESKey, null);
             }
             catch (System.ArgumentException ar)
             {
@@ -267,7 +366,106 @@

             //convert to string
-            message = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, decryptedMessage);
+            keyMaterialStringSender = CryptographicBuffer.EncodeToBase64String(keyMaterialSender);
+
+        }
+
+
+
+        public void AuthenticatedDecryptionSender(
+           String strAlgName, string key, string message, string nonce, string tag)
+        {
+
+            // Open a SymmetricKeyAlgorithmProvider object for the specified algorithm.
+            SymmetricKeyAlgorithmProvider objAlgProv = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);
+
+
+            IBuffer encryptedAESKey = CryptographicBuffer.DecodeFromBase64String(key);
+
+            asymmetricDecryptAESKeySender(strAsymmetricAlgName, encryptedAESKey);
+
+            IBuffer decryptedAESKeyBuff = CryptographicBuffer.DecodeFromBase64String(keyMaterialStringSender);
+            CryptographicKey keyFromEncryptedString = objAlgProv.CreateSymmetricKey(decryptedAESKeyBuff);
+
+            IBuffer encryptedDataFromStringBuff = CryptographicBuffer.DecodeFromBase64String(message);
+            IBuffer nonceFromString = CryptographicBuffer.DecodeFromBase64String(nonce);
+            IBuffer authenticationTagFromString = CryptographicBuffer.DecodeFromBase64String(tag);
+
+            // The input key must be securely shared between the sender of the encrypted message
+            // and the recipient. The nonce must also be shared but does not need to be shared
+            // in a secure manner. If the sender encodes the message string to a buffer, the
+            // binary encoding method must also be shared with the recipient.
+            // The recipient uses the DecryptAndAuthenticate() method as follows to decrypt the
+            // message, authenticate it, and verify that it has not been altered in transit.
+            buffDecrypted = CryptographicEngine.DecryptAndAuthenticate(
+                keyFromEncryptedString,
+                encryptedDataFromStringBuff,
+                nonceFromString,
+                authenticationTagFromString,
+                null);
+
+
+            strDecrypted = CryptographicBuffer.ConvertBinaryToString(encoding, buffDecrypted);
+
+
+        }
+
+        IBuffer GetNonce()
+        {
+            // Security best practises require that an ecryption operation not
+            // be called more than once with the same nonce for the same key.
+            // A nonce value can be predictable, but must be unique for each
+            // secure session.
+
+            NonceBytes[0]++;
+            for (int i = 0; i < NonceBytes.Length - 1; i++)
+            {
+                if (NonceBytes[i] == 255)
+                {
+                    NonceBytes[i + 1]++;
+                }
+            }
+
+            return CryptographicBuffer.CreateFromByteArray(NonceBytes);
+        }
+
+        // method to encrypt AES key for sender
+        public void asymemtricEncryptAESKeyforSender(
+            String strAsymmetricAlgName)
+        {
+            // Open the algorithm provider for the specified asymmetric algorithm.
+            AsymmetricKeyAlgorithmProvider objAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);
+
+            // Import the public key from a buffer.
+            CryptographicKey publicKey = objAlgProv.ImportPublicKey(DataContainer.senderPublicKey);
+
+            IBuffer plainKey = CryptographicBuffer.DecodeFromBase64String(keyMaterialStringSender);
+
+            // Encrypt message by using the public key.
+            encryptedAESKeyBuffSender = CryptographicEngine.Encrypt(publicKey, plainKey, null);
+
+            //convert to cipher string
+            encryptedKeyStringSender = CryptographicBuffer.EncodeToBase64String(encryptedAESKeyBuffSender);
+
+        }
+
+        // method to encrypt AES key for recipient
+        public void asymemtricEncryptAESKeyforRecipient(
+            String strAsymmetricAlgName)
+        {
+            // Open the algorithm provider for the specified asymmetric algorithm.
+            AsymmetricKeyAlgorithmProvider objAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);
+
+            // Import the public key from a buffer.
+            CryptographicKey publicKey = objAlgProv.ImportPublicKey(DataContainer.recipientPublicKey);
+
+            IBuffer plainKey = CryptographicBuffer.DecodeFromBase64String(keyMaterialStringRecipient);
+
+            // Encrypt message by using the public key.
+            encryptedAESKeyBuffRecipient = CryptographicEngine.Encrypt(publicKey, plainKey, null);
+
+            //convert to cipher string
+            encryptedKeyStringRecipient = CryptographicBuffer.EncodeToBase64String(encryptedAESKeyBuffRecipient);

         }

@@ -278,8 +476,24 @@
             if (message != null)
             {
                 sendMessageAsync.IsEnabled = false;
-                asymemtricEncryptMessageBodyForSender(strAsymmetricAlgName);
-                asymemtricEncryptMessageBodyRecipient(strAsymmetricAlgName);
+
+                // AES encrypt message for current user to decrypt
+                AuthenticatedEncryptionSender(
+                message,
+                strSymAlgName,
+                keyLength);
+
+                // Encrypting AES key with rsa public key of sender
+                asymemtricEncryptAESKeyforSender(strAsymmetricAlgName);
+
+                // AES encrypt message for recipient to decrypt
+                AuthenticatedEncryptionRecipient(
+                message,
+                strSymAlgName,
+                keyLength);
+
+                // Encrypting AES key with rsa public key of recipient
+                asymemtricEncryptAESKeyforRecipient(strAsymmetricAlgName);
                 try
                 {
                     string accessToken = DataContainer.Token;
@@ -287,8 +501,14 @@
                     {

                         conversation_id = DataContainer.ConversationID,
-                        body = recipientEncrypted,
-                        body2 = senderEncrypted
+                        body = encryptedMessageDataStringRecipient,
+                        body2 = encryptedMessageDataStringSender,
+                        nc = nonceStringRecipient,
+                        nc2 = nonceStringSender,
+                        tag = authenticationTagStringRecipient,
+                        tag2 = authenticationTagStringSender,
+                        key = encryptedKeyStringRecipient,
+                        key2 = encryptedKeyStringSender

                     });

@@ -347,12 +567,6 @@
                     await folder.CreateFileAsync(DataContainer.User + ".PublicKey",
                         Windows.Storage.CreationCollisionOption.ReplaceExisting);

-                // generate asymmetric keys
-                // IBuffer buffPublicKey;
-                //this.createAsymmetricKeyPair(
-                //    strAsymmetricAlgName,
-                //    asymmetricKeyLength,
-                //    out DataContainer.buffPublicKey);

                 // encode buffer into a ASCII string
                 string publicKeyEncded = encodeBuffTo64BaseString(DataContainer.senderPublicKey);
@@ -361,21 +575,6 @@
                 // write to the folder selected by user
                 await Windows.Storage.FileIO.WriteTextAsync(pubKeyFile, publicKeyEncded);

-                //// create keypair file for application use only for the user that is logged in
-                //string keyPairName = DataContainer.User + ".KeyPair";
-                //DataContainer.KeyPairFileName = keyPairName;
-                //Windows.Storage.StorageFolder localFolder =
-                //    Windows.Storage.ApplicationData.Current.LocalFolder;
-                //Windows.Storage.StorageFile keyPair =
-                //    await localFolder.CreateFileAsync((DataContainer.KeyPairFileName),
-                //        Windows.Storage.CreationCollisionOption.ReplaceExisting);
-
-                //// encode buffer into a ASCII string
-                //string keyPairEncod = encodeBuffTo64BaseString(DataContainer.buffKeyPair);
-
-                //// write to the file the app uses
-                //await Windows.Storage.FileIO.WriteTextAsync(keyPair, keyPairEncod);
-
             }

             generatePublicKey.Visibility = Windows.UI.Xaml.Visibility.Visible;


Refactored Index view to show a message when there are no articles available

--- CmsEngine.Ui/Views/Blog/Index.cshtml
+++ CmsEngine.Ui/Views/Blog/Index.cshtml
@@ -6,9 +6,16 @@

-                    @foreach (var pagedPost in Model.PagedPosts)
+                    @if (Model.PagedPosts.Count() > 0)
                     {
-                        @await Html.PartialAsync("_PagedPost", pagedPost)
+                        foreach (var pagedPost in Model.PagedPosts)
+                        {
+                            await Html.RenderPartialAsync("_PagedPost", pagedPost);
+                        }
+                    }
+                    else
+                    {
+
No articles available

                     }


Added template content to home page

Added template content to home page

--- CmsEngine.Ui/Views/Home/Index.cshtml
+++ CmsEngine.Ui/Views/Home/Index.cshtml
@@ -1,108 +1,212 @@
-@{
-    ViewData["Title"] = "Home Page";
-}
-
-

-

-

-

-

-

-

-

-

-
-

-

-                    Learn how to build ASP.NET apps that can run anywhere.
-
-                        Learn More
+
+

+

+

+

+
Bootstrap 4 Blog - A free template by Bootstrap Temple
Discover More
+

+
 Scroll Down
+

+

+
+

+

+

+

+
Some great intro here

+
Place a nice introduction here to catch reader's attention. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderi.

+

+

+

+

+

+

+
+

+

+

+

+
+
BusinessTechnology

+
Alberto Savoia Can Teach You About Interior

+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrude consectetur adipisicing elit, sed do eiusmod tempor incididunt.

+
+
+

+
John Doe

+
+
 2 months ago

+
12

+
+

+

+

+

+

+
+

+

+

+

+

+
+
BusinessTechnology

+
Alberto Savoia Can Teach You About Interior

+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrude consectetur adipisicing elit, sed do eiusmod tempor incididunt.

+
+
+

+
John Doe

+
+
 2 months ago

+
12

+
+

+

+

+

+
+

+

+

+

+
+
BusinessTechnology

+
Alberto Savoia Can Teach You About Interior

+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrude consectetur adipisicing elit, sed do eiusmod tempor incididunt.

+
+
+

+
John Doe

+
+
 2 months ago

+
12

+
+

+

+

+

+

+

+

+
+

+

+

+

+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
View More
+

+

+

+

+
+

+

+
+
Latest from the blog

+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

+
+

+

+

+

+

+
20 May | 2016

+
Business

+

+
Ways to remember your important ideas

-

-

-

-

-
-

-

-                    There are powerful new features in Visual Studio for building modern web apps.
-
-                        Learn More
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.

+

+

+

+

+

+

+
20 May | 2016

+
Technology

+

+
Diversity in Engineering: Effect on Questions

-

-

-

-

-
-

-

-                    Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
-
-                        Learn More
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.

+

+

+

+

+

+

+
20 May | 2016

+
Financial

+

+
Alberto Savoia Can Teach You About Interior

-

-

-

-

-
-

-

-                    Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
-
-                        Learn More
-
-

-

-

-

-
-
-        Previous
-
-
-
-        Next
-
-

-
-

-

-
Application uses

-

-
Sample pages using ASP.NET Core MVC

-
Bower for managing client-side libraries

-
Theming using Bootstrap

-

-

-

-
How to

-

-
Add a Controller and View

-
Manage User Secrets using Secret Manager.

-
Use logging to log a message.

-
Add packages using NuGet.

-
Add client packages using Bower.

-
Target development, staging or production environment.

-

-

-

-
Overview

-

-
Conceptual overview of what is ASP.NET Core

-
Fundamentals of ASP.NET Core such as Startup and middleware.

-
Working with Data

-
Security

-
Client side development

-
Develop on different platforms

-
Read more on the documentation site

-

-

-

-
Run & Deploy

-

-
Run your app

-
Run tools such as EF migrations and more

-
Publish to Microsoft Azure Web Apps

-

-

-

+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.

+

+

+

+

+

+
+

+

+

+

+
Subscribe to Newsletter

+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+

+

+

+                    <form action="#">
+

+                            <input type="email" name="email" id="email" placeholder="Type your email address">
+                            <button type="submit" class="submit">Subscribe</button>
+

+                    </form>
+

+

+

+

+

+
+

+

+

+

+
+
+

+
+

+

+

+

+
+
+

+
+

+

+

+

+
+
+

+
+

+

+

+

+
+
+

+
+

+

+

+


Changed assembly description

Changed assembly description

--- CodeGuard/Properties/AssemblyInfo.cs
+++ CodeGuard/Properties/AssemblyInfo.cs
@@ -6,7 +6,7 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("CodeGuard")]
-[assembly: AssemblyDescription("Guard and Validator library")]
+[assembly: AssemblyDescription("Guard and Validator library. Example: Guard.That(() => arg1).IsNotNull(); will throw when arg1 is null")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Per Ivar Seterlund")]
 [assembly: AssemblyProduct("CodeGuard")]


Fixed bug when encrypting json.

Fixed bug when encrypting json.

--- ConDep.Dsl/Config/EnvConfigParser.cs
+++ ConDep.Dsl/Config/EnvConfigParser.cs
@@ -162,7 +162,7 @@

         public void EncryptJsonConfig(dynamic config, JsonPasswordCrypto crypto)
         {
-            if (config.LoadBalancer != null & config.LoadBalancer.Password != null && !string.IsNullOrWhiteSpace(config.LoadBalancer.Password.Value))
+            if (config.LoadBalancer != null && config.LoadBalancer.Password != null && !string.IsNullOrWhiteSpace(config.LoadBalancer.Password.Value))
             {
                 EncryptJsonValue(crypto, config.LoadBalancer.Password);
             }


Fix popups moving with the viewer (#7275)

--- Content.Client/Popups/PopupSystem.cs
+++ Content.Client/Popups/PopupSystem.cs
@@ -1,5 +1,3 @@
-using System;
-using System.Collections.Generic;
 using Content.Client.Stylesheets;
 using Content.Shared.GameTicking;
 using Content.Shared.Popups;
@@ -7,10 +5,7 @@
 using Robust.Client.Input;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
-using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
 using Robust.Shared.Map;
-using Robust.Shared.Maths;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;

@@ -50,7 +45,7 @@
                 return;

             var transform = EntityManager.GetComponent<TransformComponent>(uid);
-            PopupMessage(message, _eyeManager.CoordinatesToScreen(transform.Coordinates));
+            PopupMessage(message, _eyeManager.CoordinatesToScreen(transform.Coordinates), uid);
         }

         public void PopupMessage(string message, ScreenCoordinates coordinates, EntityUid? entity = null)


Only invalidate children when padding is changed (and also encompass SizeInParentSpace).

--- osu.Framework/Graphics/Containers/Container.cs
+++ osu.Framework/Graphics/Containers/Container.cs
@@ -90,8 +90,9 @@
                 if (padding.Equals(value)) return;

                 padding = value;
-
-                Invalidate(Invalidation.Position);
+
+                foreach (Drawable c in children)
+                    c.Invalidate(Invalidation.Position | Invalidation.SizeInParentSpace);
             }
         }


null ref fix

null ref fix

--- src/Api/Controllers/TwoFactorController.cs
+++ src/Api/Controllers/TwoFactorController.cs
@@ -41,7 +41,7 @@
                 throw new UnauthorizedAccessException();
             }

-            var providers = user.GetTwoFactorProviders().Select(p => new TwoFactorProviderResponseModel(p.Key, p.Value));
+            var providers = user.GetTwoFactorProviders()?.Select(p => new TwoFactorProviderResponseModel(p.Key, p.Value));
             return new ListResponseModel<TwoFactorProviderResponseModel>(providers);
         }


Sync keyboard and joystick state to parent input manager

--- osu.Framework/Input/PassThroughInputManager.cs
+++ osu.Framework/Input/PassThroughInputManager.cs
@@ -7,12 +7,34 @@

 namespace osu.Framework.Input
 {
+    /// <summary>An <see cref="InputManager"/> with an arbirity to use parent <see cref="InputManager"/>'s input.</summary>
+    /// <remarks>
+    /// This <see cref="InputManager"/> can be used in one of two states.
+    /// When <see cref="UseParentInput"/> is false, this input manager gets inputs only from own input handlers.
+    /// When <see cref="UseParentInput"/> is true, this input manager ignore own input handlers and
+    /// gets inputs from the parent (an ancestor in the scene graph) <see cref="InputManager"/> in the following way:
+    /// For mouse input, this only considers input that is passed as events such as <see cref="OnMouseDown"/>.
+    /// For keyboard and other inputs, this input manager try to reflect parent <see cref="InputManager"/>'s <see cref="InputState"/> closely as possible.
+    /// Thus, when this is attached to the scene graph initially and when <see cref="UseParentInput"/> is changed to true from false,
+    /// multiple keyboard events is called when the parent's <see cref="InputState"/> is a state with keys pressed for example.
+    /// </remarks>
     public class PassThroughInputManager : CustomInputManager, IRequireHighFrequencyMousePosition
     {
         /// <summary>
         /// If there's an InputManager above us, decide whether we should use their available state.
         /// </summary>
-        public bool UseParentInput = true;
+        public bool UseParentInput
+        {
+            get => useParentInput;
+            set
+            {
+                if (useParentInput == value) return;
+                useParentInput = value;
+                if (UseParentInput) Sync();
+            }
+        }
+
+        private bool useParentInput = true;

         internal override bool BuildKeyboardInputQueue(List<Drawable> queue, bool allowBlocking = true)
         {
@@ -60,14 +82,24 @@
         protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
         {
             if (UseParentInput)
-                new MouseButtonInput(args.Button, true).Apply(CurrentState, this);
+            {
+                // safe-guard for edge cases.
+                if (!CurrentState.Mouse.IsPressed(args.Button))
+                    new MouseButtonInput(args.Button, true).Apply(CurrentState, this);
+            }
             return false;
         }

         protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
         {
             if (UseParentInput)
+            {
+                // safe-guard for edge cases.
+                if (!CurrentState.Mouse.IsPressed(args.Button))
+                    new MouseButtonInput(args.Button, true).Apply(CurrentState, this);
                 new MouseButtonInput(args.Button, false).Apply(CurrentState, this);
+            }
+
             return false;
         }

@@ -80,44 +112,64 @@

         protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
         {
-            if (UseParentInput)
-                new KeyboardKeyInput(args.Key, true).Apply(CurrentState, this);
+            if (UseParentInput) SyncInputState(state);
             return false;
         }

         protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
         {
-            if (UseParentInput)
-                new KeyboardKeyInput(args.Key, false).Apply(CurrentState, this);
+            if (UseParentInput) SyncInputState(state);
             return false;
         }

         protected override bool OnJoystickPress(InputState state, JoystickEventArgs args)
         {
-            if (UseParentInput)
-                new JoystickButtonInput(args.Button, true).Apply(CurrentState, this);
+            if (UseParentInput) SyncInputState(state);
             return false;
-
         }

         protected override bool OnJoystickRelease(InputState state, JoystickEventArgs args)
         {
-            if (UseParentInput)
-                new JoystickButtonInput(args.Button, false).Apply(CurrentState, this);
+            if (UseParentInput) SyncInputState(state);
             return false;
         }

+        private InputManager parentInputManager;
+
+        protected override void LoadComplete()
+        {
+            base.LoadComplete();
+            Sync();
+        }
+
+        protected override void Update()
+        {
+            base.Update();
+            // Some keyboard/joystick events are blocked. Sync every frame.
+            if (UseParentInput) Sync(true);
+        }
+
         /// <summary>
-        /// An input state which allows for transformations to state which don't affect the source state.
+        /// Sync input state to parent <see cref="InputManager"/>'s <see cref="InputState"/>.
+        /// Call this when parent <see cref="InputManager"/> changed somehow.
         /// </summary>
-        public class PassThroughInputState : InputState
+        /// <param name="useCachedParentInputManager">If this is false, assume parent input manager is unchanged from before.</param>
+        public void Sync(bool useCachedParentInputManager = false)
         {
-            public PassThroughInputState(InputState state)
-            {
-                Mouse = (state.Mouse.NativeState as MouseState)?.Clone();
-                Keyboard = (state.Keyboard as KeyboardState)?.Clone();
-                Joystick = (state.Joystick as JoystickState)?.Clone();
-            }
+            if (!UseParentInput) return;
+            if (!useCachedParentInputManager)
+                parentInputManager = GetContainingInputManager();
+            SyncInputState(parentInputManager?.CurrentState);
+        }
+
+        /// <summary>
+        /// Sync keyboard and joystick state to parent state.
+        /// </summary>
+        /// <param name="parentState">Parent's state. If this is null, it is regarded as an empty state.</param>
+        protected virtual void SyncInputState(InputState parentState)
+        {
+            new KeyboardKeyInput(parentState?.Keyboard?.Keys, CurrentState.Keyboard.Keys).Apply(CurrentState, this);
+            new JoystickButtonInput(parentState?.Joystick?.Buttons, CurrentState.Joystick.Buttons).Apply(CurrentState, this);
         }
     }
 }


Use formatted string

Use formatted string

--- src/AppHarbor/Commands/DeployAppCommand.cs
+++ src/AppHarbor/Commands/DeployAppCommand.cs
@@ -110,7 +110,7 @@
 				RequestFormat = DataFormat.Json
 			}
 				.AddUrlSegment("slug", applicationSlug)
-				.AddHeader("Authorization", "BEARER " + _accessToken)
+				.AddHeader("Authorization", string.Format("BEARER {0}", _accessToken))
 				.AddBody(new
 				{
 					UploadUrl = downloadUrl,


Change smoke quadbatch growth factor to 2 from 1.5

--- osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
+++ osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
@@ -238,9 +238,9 @@

                 quadBatch ??= renderer.CreateQuadBatch<TexturedVertex2D>(200, 4);

-                if (points.Count > quadBatch.Size * 4 && quadBatch.Size != 10922)
-                {
-                    int batchSize = Math.Min((int)(quadBatch.Size * 1.5f), 10922);
+                if (points.Count > quadBatch.Size && quadBatch.Size != IRenderer.MAX_QUADS)
+                {
+                    int batchSize = Math.Min(quadBatch.Size * 2, IRenderer.MAX_QUADS);
                     quadBatch = renderer.CreateQuadBatch<TexturedVertex2D>(batchSize, 4);
                 }


Invalidate drawnode on change

Invalidate drawnode on change

--- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
+++ osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
@@ -32,7 +32,17 @@
         private double timeOffset;
         private float time;

-        protected Anchor TrailOrigin = Anchor.Centre;
+        private Anchor trailOrigin = Anchor.Centre;
+
+        protected Anchor TrailOrigin
+        {
+            get => trailOrigin;
+            set
+            {
+                trailOrigin = value;
+                Invalidate(Invalidation.DrawNode);
+            }
+        }

         public CursorTrail()
         {


Calculate position adjustment distance in local parent space

--- osu.Game/Screens/Play/HUD/HoldForMenuButton.cs
+++ osu.Game/Screens/Play/HUD/HoldForMenuButton.cs
@@ -84,7 +84,7 @@

         protected override bool OnMouseMove(MouseMoveEvent e)
         {
-            positionalAdjust = Vector2.Distance(e.ScreenSpaceMousePosition, button.ScreenSpaceDrawQuad.Centre) / 200;
+            positionalAdjust = Vector2.Distance(e.MousePosition, button.ToSpaceOfOtherDrawable(button.DrawRectangle.Centre, Parent)) / 200;
             return base.OnMouseMove(e);
         }


Port Item Manager changes (json upgrade)

--- src/Certify.Core/Management/ItemManager.cs
+++ src/Certify.Core/Management/ItemManager.cs
@@ -59,29 +59,35 @@
             return Path.Combine(appDataPath, $"{ITEMMANAGERCONFIG}.db");
         }

+        private async Task CreateManagedItemsSchema()
+        {
+            try
+            {
+                using (var db = new SQLiteConnection(_connectionString))
+                {
+                    await db.OpenAsync();
+                    using (var cmd = new SQLiteCommand("CREATE TABLE manageditem (id TEXT NOT NULL UNIQUE PRIMARY KEY, parentid TEXT NULL, json TEXT NOT NULL)", db))
+                    {
+                        await cmd.ExecuteNonQueryAsync();
+                    }
+                }
+            }
+            catch { }
+        }
+
         /// <summary>
         /// Perform a full backup and save of the current set of managed sites
         /// </summary>
         public async Task StoreAllManagedItems()
-        {
+            {
             var watch = Stopwatch.StartNew();

             //create database if it doesn't exist
             if (!File.Exists(_dbPath))
             {
-                using (var db = new SQLiteConnection(_connectionString))
-                {
-                    await db.OpenAsync();
-                    using (var cmd = new SQLiteCommand("CREATE TABLE manageditem (id TEXT NOT NULL UNIQUE PRIMARY KEY, parentid TEXT NULL, json TEXT NOT NULL)", db))
-                    {
-                        await cmd.ExecuteNonQueryAsync();
-                    }
-                }
-            }
-            else
-            {
-
-            }
+                await this.CreateManagedItemsSchema();
+            }
+

             // save all new/modified items into settings database
             using (var db = new SQLiteConnection(_connectionString))
@@ -89,16 +95,6 @@
                 await db.OpenAsync();
                 using (var tran = db.BeginTransaction())
                 {
-                    /*foreach (var deleted in _managedCertificatesCache.Values.Where(s => s.Deleted).ToList())
-                    {
-                        using (var cmd = new SQLiteCommand("DELETE FROM manageditem WHERE id=@id", db))
-                        {
-                            cmd.Parameters.Add(new SQLiteParameter("@id", deleted.Id));
-                            await cmd.ExecuteNonQueryAsync();
-                        }
-                        _managedCertificatesCache.TryRemove(deleted.Id, out var val);
-                    }*/
-
                     foreach (var changed in _managedCertificatesCache.Values.Where(s => s.IsChanged))
                     {
                         using (var cmd = new SQLiteCommand("INSERT OR REPLACE INTO manageditem (id,parentid,json) VALUES (@id,@parentid, @json)", db))
@@ -152,7 +148,8 @@
                 }
                 catch
                 {
-                    // error checking for upgrade
+                    // error checking for upgrade, ensure table exists
+                    await CreateManagedItemsSchema();

                     return false;
                 }
@@ -262,7 +259,7 @@

                     foreach (var site in managedCertificateList)
                     {
-                        site.IsChanged = false;
+                        site.IsChanged = true;
                         _managedCertificatesCache.AddOrUpdate(site.Id, site, (key, oldValue) => site);
                     }
                 }


remove redundant Code Analysis suppression

--- src/ColoredConsole/ColorTokenExtensions.cs
+++ src/ColoredConsole/ColorTokenExtensions.cs
@@ -26,11 +26,6 @@
             return tokens.Select(token => token.Coalesce(color, backgroundColor)).ToArray();
         }

-        [SuppressMessage(
-            "Microsoft.Naming",
-            "CA1719:ParameterNamesShouldNotMatchMemberNames",
-            MessageId = "1#",
-            Justification = "By design.")]
         public static ColorToken On(this ColorToken token, ConsoleColor? backgroundColor)
         {
             return new ColorToken(token.Text, token.Color, backgroundColor);


Fixed issue in context application detection

--- src/ContinuaInit/Integration/ContinuaCi.cs
+++ src/ContinuaInit/Integration/ContinuaCi.cs
@@ -15,7 +15,9 @@
     {
         public override bool CanApplyToCurrentContext()
         {
+#if DEBUG
             return true;
+#endif

             const string KeyName = @"Software\VSoft Technologies\Continua CI Agent";


Use aliases while removing from the CommandMap

--- src/Discord.Net.Commands/Map/CommandMap.cs
+++ src/Discord.Net.Commands/Map/CommandMap.cs
@@ -36,23 +36,25 @@
         }
         public void RemoveCommand(Command command)
         {
-            string text = command.Text;
-            int nextSpace = NextWhitespace(text);
-            string name;
+            foreach (string text in command.Aliases)
+            {
+                int nextSpace = NextWhitespace(text);
+                string name;

-            if (nextSpace == -1)
-                name = command.Text;
-            else
-                name = command.Text.Substring(0, nextSpace);
+                if (nextSpace == -1)
+                    name = command.Text;
+                else
+                    name = command.Text.Substring(0, nextSpace);

-            lock (this)
-            {
-                CommandMapNode nextNode;
-                if (_nodes.TryGetValue(name, out nextNode))
+                lock (this)
                 {
-                    nextNode.AddCommand(nextSpace == -1 ? "" : text, nextSpace + 1, command);
-                    if (nextNode.IsEmpty)
-                        _nodes.TryRemove(name, out nextNode);
+                    CommandMapNode nextNode;
+                    if (_nodes.TryGetValue(name, out nextNode))
+                    {
+                        nextNode.RemoveCommand(nextSpace == -1 ? "" : text, nextSpace + 1, command);
+                        if (nextNode.IsEmpty)
+                            _nodes.TryRemove(name, out nextNode);
+                    }
                 }
             }
         }


added default value fot RouteLink.TextProperty

--- src/DotVVM.Framework/Controls/RouteLink.cs
+++ src/DotVVM.Framework/Controls/RouteLink.cs
@@ -43,7 +43,7 @@
             set { SetValue(TextProperty, value); }
         }
         public static readonly DotvvmProperty TextProperty =
-            DotvvmProperty.Register<string, RouteLink>(c => c.Text);
+            DotvvmProperty.Register<string, RouteLink>(c => c.Text, "");

         public RouteLink() : base("a")


#122 Set max-age for blob when storing file to Azure blob storage

--- src/Fan/Medias/AzureBlobStorageProvider.cs
+++ src/Fan/Medias/AzureBlobStorageProvider.cs
@@ -121,8 +121,9 @@
                 blob = _container.GetBlockBlobReference(blobName);
             }

-            // set content type
+            // set blob properties
             blob.Properties.ContentType = MimeTypeMap.GetMimeType(Path.GetExtension(fileName));
+            blob.Properties.CacheControl = "public, max-age=31536000"; // 1 yr

             return (blob: blob, blobName: blobName);
         }


Improve test to emphasize the ability to run tests multiple times, while no longer suggesting that a 'retry on failure' behavior is acceptable practice.

--- src/Fixie.Tests/TestClassLifecycleTests.cs
+++ src/Fixie.Tests/TestClassLifecycleTests.cs
@@ -1,7 +1,6 @@
 namespace Fixie.Tests
 {
     using System;
-    using System.Collections.Generic;
     using System.Threading.Tasks;
     using Fixie.Internal;

@@ -149,54 +148,19 @@
             }
         }

-        class RetryExecution : Execution
-        {
-            const int MaxAttempts = 3;
-
+        class RepeatedExecution : Execution
+        {
             public async Task RunAsync(TestClass testClass)
             {
                 foreach (var test in testClass.Tests)
-                    if (!test.Method.Name.Contains("Skip"))
-                        foreach (var parameters in Cases(test))
-                            await RunWithRetriesAsync(test, parameters);
-            }
-
-            static async Task RunWithRetriesAsync(TestMethod test, object?[] parameters)
-            {
-                var remainingAttempts = MaxAttempts;
-
-                while (remainingAttempts > 0)
                 {
-                    remainingAttempts--;
-
-                    bool attemptFailed = false;
-
-                    await test.RunAsync(parameters, failure =>
-                    {
-                        attemptFailed = true;
-                        if (remainingAttempts > 0)
-                            failure.Skip(failure.Exception?.Message + " Retrying...");
-                    });
-
-                    if (!attemptFailed)
-                        remainingAttempts = 0;
+                    if (test.Method.Name.Contains("Skip")) continue;
+
+                    await test.RunAsync(Utility.UsingInputAttributes);
+                    await test.RunAsync(Utility.UsingInputAttributes);
+                    await test.RunAsync(Utility.UsingInputAttributes);
                 }
             }
-
-            static IEnumerable<object?[]> Cases(TestMethod test)
-            {
-                if (test.HasParameters)
-                {
-                    foreach (var parameters in Utility.UsingInputAttributes(test.Method))
-                        yield return parameters;
-                }
-                else
-                {
-                    yield return EmptyParameters;
-                }
-            }
-
-            static readonly object[] EmptyParameters = {};
         }

         public async Task ShouldRunAllTestsByDefault()
@@ -459,20 +423,33 @@

         public async Task ShouldAllowRunningTestsMultipleTimesWithDistinctResultPerInvocation()
         {
-            FailDuring("Pass", occurrence: 1);
-
-            var output = await RunAsync<SampleTestClass, RetryExecution>();
-
-            output.ShouldHaveResults(
-                "SampleTestClass.Fail skipped: 'Fail' failed! Retrying...",
-                "SampleTestClass.Fail skipped: 'Fail' failed! Retrying...",
-                "SampleTestClass.Fail failed: 'Fail' failed!",
-                "SampleTestClass.Pass(1) skipped: 'Pass' failed! Retrying...",
-                "SampleTestClass.Pass(1) passed",
-                "SampleTestClass.Pass(2) passed",
-                "SampleTestClass.Skip skipped: This test did not run.");
-
-            output.ShouldHaveLifecycle("Fail", "Fail", "Fail", "Pass(1)", "Pass(1)", "Pass(2)");
+            FailDuring("Pass", occurrence: 5);
+
+            var output = await RunAsync<SampleTestClass, RepeatedExecution>();
+
+            output.ShouldHaveResults(
+                "SampleTestClass.Fail failed: 'Fail' failed!",
+                "SampleTestClass.Fail failed: 'Fail' failed!",
+                "SampleTestClass.Fail failed: 'Fail' failed!",
+
+                "SampleTestClass.Pass(1) passed",
+                "SampleTestClass.Pass(2) passed",
+
+                "SampleTestClass.Pass(1) passed",
+                "SampleTestClass.Pass(2) passed",
+
+                "SampleTestClass.Pass(1) failed: 'Pass' failed!",
+                "SampleTestClass.Pass(2) passed",
+
+                "SampleTestClass.Skip skipped: This test did not run.");
+
+            output.ShouldHaveLifecycle(
+                "Fail",
+                "Fail",
+                "Fail",
+                "Pass(1)", "Pass(2)",
+                "Pass(1)", "Pass(2)",
+                "Pass(1)", "Pass(2)");
         }

         public async Task ShouldSkipAllTestsWhenShortCircuitingTestExecution()


Implemented managed to native marshaling of template parameter types.

--- src/Generator/Generators/CLI/CLIMarshal.cs
+++ src/Generator/Generators/CLI/CLIMarshal.cs
@@ -440,7 +440,8 @@

         public override bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals)
         {
-            throw new NotImplementedException();
+            Context.Return.Write(param.Parameter.Name);
+            return true;
         }

         public override bool VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)


When nudging with arrow keys, account for selected mip

--- renderdocui/Windows/TextureViewer.cs
+++ renderdocui/Windows/TextureViewer.cs
@@ -2803,29 +2803,34 @@

             }

+            int increment = 1 << (int)m_TexDisplay.mip;
+
             if (e.KeyCode == Keys.Up && m_PickedPoint.Y > 0)
             {
-                m_PickedPoint = new Point(m_PickedPoint.X, m_PickedPoint.Y - 1);
+                m_PickedPoint = new Point(m_PickedPoint.X, m_PickedPoint.Y - increment);
                 nudged = true;
             }
             else if (e.KeyCode == Keys.Down && m_PickedPoint.Y < tex.height-1)
             {
-                m_PickedPoint = new Point(m_PickedPoint.X, m_PickedPoint.Y + 1);
+                m_PickedPoint = new Point(m_PickedPoint.X, m_PickedPoint.Y + increment);
                 nudged = true;
             }
             else if (e.KeyCode == Keys.Left && m_PickedPoint.X > 0)
             {
-                m_PickedPoint = new Point(m_PickedPoint.X - 1, m_PickedPoint.Y);
+                m_PickedPoint = new Point(m_PickedPoint.X - increment, m_PickedPoint.Y);
                 nudged = true;
             }
             else if (e.KeyCode == Keys.Right && m_PickedPoint.X < tex.width - 1)
             {
-                m_PickedPoint = new Point(m_PickedPoint.X + 1, m_PickedPoint.Y);
+                m_PickedPoint = new Point(m_PickedPoint.X + increment, m_PickedPoint.Y);
                 nudged = true;
             }

             if(nudged)
             {
+                m_PickedPoint = new Point(
+                    Helpers.Clamp(m_PickedPoint.X, 0, (int)tex.width-1),
+                    Helpers.Clamp(m_PickedPoint.Y, 0, (int)tex.height - 1));
                 e.Handled = true;

                 m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>


Minor refactor.

Minor refactor.

--- src/Magick.NET/Settings/MontageSettings.cs
+++ src/Magick.NET/Settings/MontageSettings.cs
@@ -98,14 +98,6 @@
         /// </summary>
         public IMagickColor<QuantumType>? TransparentColor { get; set; }

-        private static string? Convert(IMagickGeometry? geometry)
-        {
-            if (geometry == null)
-                return null;
-
-            return geometry.ToString();
-        }
-
         private static INativeInstance CreateNativeInstance(IMontageSettings<QuantumType> instance)
         {
             var result = new NativeMontageSettings();
@@ -115,13 +107,13 @@
             result.SetFillColor(instance.FillColor);
             result.SetFont(instance.Font);
             result.SetFontPointsize(instance.FontPointsize);
-            result.SetFrameGeometry(Convert(instance.FrameGeometry));
-            result.SetGeometry(Convert(instance.Geometry));
+            result.SetFrameGeometry(instance.FrameGeometry?.ToString());
+            result.SetGeometry(instance.Geometry?.ToString());
             result.SetGravity(instance.Gravity);
             result.SetShadow(instance.Shadow);
             result.SetStrokeColor(instance.StrokeColor);
             result.SetTextureFileName(instance.TextureFileName);
-            result.SetTileGeometry(Convert(instance.TileGeometry));
+            result.SetTileGeometry(instance.TileGeometry?.ToString());
             result.SetTitle(instance.Title);

             return result;


Fix location of import for TeakProcessDeepLinks

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -427,20 +427,20 @@

     [DllImport ("__Internal")]
     private static extern void TeakSetStringAttribute(string key, string value);
+#endif
+
+#if UNITY_IPHONE
+    [DllImport ("__Internal")]
+    private static extern int TeakGetNotificationState();
+
+    [DllImport ("__Internal")]
+    private static extern bool TeakOpenSettingsAppToThisAppsSettings();
+
+    [DllImport ("__Internal")]
+    private static extern bool TeakRequestProvisionalPushAuthorization();

     [DllImport ("__Internal")]
     private static extern void TeakProcessDeepLinks();
-#endif
-
-#if UNITY_IPHONE
-    [DllImport ("__Internal")]
-    private static extern int TeakGetNotificationState();
-
-    [DllImport ("__Internal")]
-    private static extern bool TeakOpenSettingsAppToThisAppsSettings();
-
-    [DllImport ("__Internal")]
-    private static extern bool TeakRequestProvisionalPushAuthorization();
 #endif

 #if UNITY_WEBGL


React to Logging API changes

React to Logging API changes

--- src/Microsoft.Net.Http.Server/LogHelper.cs
+++ src/Microsoft.Net.Http.Server/LogHelper.cs
@@ -99,7 +99,7 @@
                 return false;
             }

-            public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
+            public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
             {
             }


#254 - Fix NRU when event arrived when summary is reloading.

--- src/Money.UI.Blazor/Pages/Summary.razor.cs
+++ src/Money.UI.Blazor/Pages/Summary.razor.cs
@@ -221,7 +221,7 @@

         private async void OnMonthUpdatedEvent(DateTime changed)
         {
-            if (!IsContained(changed) && Periods != null)
+            if (Periods != null && !IsContained(changed))
                 await LoadPeriodsAsync();

             await LoadSelectedPeriodAsync();


Update the test picker too

Update the test picker too

svn path=/trunk/bitsharp/; revision=126903

--- src/MonoTorrent.Tests/Client/TestPicker.cs
+++ src/MonoTorrent.Tests/Client/TestPicker.cs
@@ -38,6 +38,7 @@
 {
     class TestPicker : PiecePicker
     {
+        public List<BitField> IsInterestingBitfield = new List<BitField>();
         public List<PeerId> PickPieceId = new List<PeerId>();
         public List<BitField> PickPieceBitfield = new List<BitField>();
         public List<List<PeerId>> PickPiecePeers = new List<List<PeerId>>();
@@ -81,5 +82,11 @@
         {

         }
+
+        public override bool IsInteresting(BitField bitfield)
+        {
+            IsInterestingBitfield.Add(bitfield);
+            return !bitfield.AllFalse;
+        }
     }
 }


ObjectReflectionCache - Skip property-reflection for IFormattable

--- src/NLog/Internal/ObjectReflectionCache.cs
+++ src/NLog/Internal/ObjectReflectionCache.cs
@@ -177,10 +177,7 @@

         private static bool ConvertToString(Type objectType)
         {
-            if (objectType == typeof(Guid))
-                return true;
-
-            if (objectType == typeof(TimeSpan))
+            if (typeof(IFormattable).IsAssignableFrom(objectType))
                 return true;

             if (typeof(Uri).IsAssignableFrom(objectType))


Update DomainBase.cs

Update DomainBase.cs

--- src/Natasha.Framework/Domain/DomainBase.cs
+++ src/Natasha.Framework/Domain/DomainBase.cs
@@ -3,6 +3,7 @@
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;

@@ -54,18 +55,16 @@
             var methodInfo = typeof(AssemblyDependencyResolver).GetField("_assemblyPaths", BindingFlags.NonPublic | BindingFlags.Instance);
             GetDictionary = item => (Dictionary<string, string>)methodInfo.GetValue(item);
             _shareLibraries = new ConcurrentQueue<string>();
-            var assemblies = AppDomain.CurrentDomain.GetAssemblies();
+            var assemblies = AppDomain
+                .CurrentDomain
+                .GetAssemblies()
+                .Where(asm => !asm.IsDynamic && !string.IsNullOrWhiteSpace(asm.Location))
+                .Distinct();
+
             foreach (var asm in assemblies)
             {

-                try
-                {
-                    _shareLibraries.Enqueue(asm.Location);
-                }
-                catch (Exception)
-                {
-
-                }
+                _shareLibraries.Enqueue(asm.Location);

             }


fix #648 little addendum to @gmarz's work on #649 allowing a an enumerable of documents to passed in, no longer pass ids over querystring but instead always translate them to documents inside the POST body internally

--- src/Nest/DSL/MultiTermVectorsDescriptor.cs
+++ src/Nest/DSL/MultiTermVectorsDescriptor.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using System.Text;
 using Elasticsearch.Net;
@@ -28,6 +29,26 @@
 			return this;
 		}

+		public MultiTermVectorsDescriptor<T> Ids(params string[] ids)
+		{
+			return this.Documents(ids.Select(id => new MultiTermVectorDocument { Id = id }));
+		}
+
+		public MultiTermVectorsDescriptor<T> Ids(params long[] ids)
+		{
+			return this.Documents(ids.Select(id => new MultiTermVectorDocument { Id = id.ToString(CultureInfo.InvariantCulture) }));
+		}
+
+		public MultiTermVectorsDescriptor<T> Ids(IEnumerable<string> ids)
+		{
+			return this.Documents(ids.Select(id => new MultiTermVectorDocument { Id = id }));
+		}
+
+		public MultiTermVectorsDescriptor<T> Ids(IEnumerable<long> ids)
+		{
+			return this.Documents(ids.Select(id => new MultiTermVectorDocument { Id = id.ToString(CultureInfo.InvariantCulture) }));
+		}
+
 		ElasticsearchPathInfo<MultiTermVectorsRequestParameters> IPathInfo<MultiTermVectorsRequestParameters>.ToPathInfo(IConnectionSettingsValues settings)
 		{
 			var pathInfo = base.ToPathInfo(settings, this._QueryString);


conversion to callable respects $this

conversion to callable respects $this

--- src/Peachpie.Runtime/PhpValue.TypeTable.cs
+++ src/Peachpie.Runtime/PhpValue.TypeTable.cs
@@ -382,7 +382,7 @@
             }
             public override PhpAlias EnsureItemAlias(ref PhpValue me, PhpValue index, bool quiet) { throw new NotSupportedException(); } // TODO: Err
             public override PhpArray ToArray(ref PhpValue me) => PhpArray.New(me);
-            public override IPhpCallable AsCallable(ref PhpValue me, RuntimeTypeHandle callerCtx, object callerObj) => PhpCallback.Create(me.String, callerCtx);
+            public override IPhpCallable AsCallable(ref PhpValue me, RuntimeTypeHandle callerCtx, object callerObj) => PhpCallback.Create(me.String, callerCtx, callerObj);
             public override string DisplayString(ref PhpValue me) => "'" + me.String + "'";
             public override void Output(ref PhpValue me, Context ctx) => ctx.Echo(me.String);
             public override void Accept(ref PhpValue me, PhpVariableVisitor visitor) => visitor.Accept(me.String);
@@ -442,7 +442,7 @@
             public override PhpValue DeepCopy(ref PhpValue me) => new PhpValue(me.MutableStringBlob.AddRef());
             public override void PassValue(ref PhpValue me) => me = new PhpValue(me.MutableStringBlob.AddRef());    // ~ DeepCopy
             public override PhpArray ToArray(ref PhpValue me) => me.MutableString.ToArray();
-            public override IPhpCallable AsCallable(ref PhpValue me, RuntimeTypeHandle callerCtx, object callerObj) => PhpCallback.Create(me.MutableStringBlob.ToString(Encoding.UTF8), callerCtx);
+            public override IPhpCallable AsCallable(ref PhpValue me, RuntimeTypeHandle callerCtx, object callerObj) => PhpCallback.Create(me.MutableStringBlob.ToString(Encoding.UTF8), callerCtx, callerObj);
             public override string DisplayString(ref PhpValue me) => "'" + me.MutableStringBlob.ToString(Encoding.UTF8) + "'";
             public override void Output(ref PhpValue me, Context ctx) => me.MutableStringBlob.Output(ctx);
             public override void Accept(ref PhpValue me, PhpVariableVisitor visitor) => visitor.Accept(me.MutableString);
@@ -581,7 +581,7 @@
             {
                 var obj = me.Object;

-                if (obj is IPhpCallable) return (IPhpCallable)obj;  // classes with __invoke() magic method implements IPhpCallable
+                if (obj is IPhpCallable callable) return callable;  // classes with __invoke() magic method implements IPhpCallable
                 if (obj is Delegate d) return RoutineInfo.CreateUserRoutine(d.GetMethodInfo().Name, d);

                 return PhpCallback.CreateInvalid();


Add user agent to client

Add user agent to client

--- API/OCM.Net/OCM.API.Client/OCMClient.cs
+++ API/OCM.Net/OCM.API.Client/OCMClient.cs
@@ -69,7 +69,7 @@
         private HttpClient _client = new HttpClient();
         private ILogger _logger = null;

-        public OCMClient(bool sandBoxMode = false, string apiKey = null, ILogger logger = null)
+        public OCMClient(bool sandBoxMode = false, string apiKey = null, ILogger logger = null, string userAgent="OCM-API-Client")
         {
             this.IsSandboxMode = sandBoxMode;

@@ -84,15 +84,17 @@

             APIKey = apiKey;
             _client.Timeout = TimeSpan.FromMinutes(10);
+            _client.DefaultRequestHeaders.Add("User-Agent", userAgent);
             _logger = logger;
         }

-        public OCMClient(string baseUrl, string apiKey, ILogger logger = null)
+        public OCMClient(string baseUrl, string apiKey, ILogger logger = null, string userAgent = "OCM-API-Client")
         {
             ServiceBaseURL = baseUrl;

             APIKey = apiKey;
             _client.Timeout = TimeSpan.FromMinutes(10);
+            _client.DefaultRequestHeaders.Add("User-Agent",userAgent);
             _logger = logger;
         }