Allowing enable/disable individual components of the explosion system. Emitters and effectors are allocated/deallocated as needed

--- Demos/DemosCommon/SExplosionRenderer.cs
+++ Demos/DemosCommon/SExplosionRenderer.cs
@@ -61,6 +61,10 @@
 			}

 			#region flame smoke parameters
+            public bool doFlameSmoke {
+                get { return _doFlameSmoke; }
+                set { _doFlameSmoke = value; configureFlameSmoke(); }
+            }
 			public RectangleF[] flameSmokeSprites {
 				get { return _flameSmokeSprites; }
 				set { _flameSmokeSprites = value; configureFlameSmoke (); }
@@ -78,6 +82,11 @@
 			#endregion

 			#region flash parameters
+            public bool doFlash {
+                get { return _doFlash; }
+                set { _doFlash = value; configureFlash();
+                }
+            }
 			public RectangleF[] flashSprites {
 				get { return _flashSprites; }
 				set { _flashSprites = value; configureFlash (); }
@@ -93,6 +102,10 @@
 			#endregion

 			#region flying sparks parameters
+            public bool doflyingSparks {
+                get { return _doFlyingSparks; }
+                set { _doFlyingSparks = value; configureFlyingSparks(); }
+            }
 			public RectangleF[] flyingSparksSprites {
 				get { return _flyingSparksSprites; }
 				set { _flyingSparksSprites = value; configureFlyingSparks (); }
@@ -108,6 +121,10 @@
 			#endregion

 			#region smoke trails parameters
+            public bool doSmokeTrails {
+                get { return _doSmokeTrails; }
+                set { _doSmokeTrails = value; configureSmokeTrails(); }
+            }
 			public RectangleF[] smokeTrailsSprites {
 				get { return _smokeTrailsSprites; }
 				set { _smokeTrailsSprites = value; configureSmokeTrails (); }
@@ -123,6 +140,10 @@
 			#endregion

 			#region round sparks parameters
+            public bool doRoundSparks {
+                get { return _doRoundSparks; }
+                set { _doRoundSparks = value; configureRoundSparks(); }
+            }
 			public RectangleF[] roundSparksSprites {
 				get { return _roundSparksSprites; }
 				set { _roundSparksSprites = value; configureRoundSparks (); }
@@ -138,6 +159,10 @@
 			#endregion

 			#region debris parameters
+            public bool doDebris {
+                get { return _doDebris; }
+                set { _doDebris = value; configureDebris(); }
+            }
 			public RectangleF[] debrisSprites {
 				get { return _debrisSprites; }
 				set { _debrisSprites = value; configureDebris (); }
@@ -157,6 +182,10 @@
 			#endregion

 			#region shockwave parameters
+            public bool doShockwave {
+                get { return _doShockwave; }
+                set { _doShockwave = value; configureShockwave(); }
+            }
 			public RectangleF[] shockwaveSprites {
 				get { return _shockwaveSprites; }
 				set { _shockwaveSprites = value; configureShockwave (); }
@@ -243,6 +272,16 @@
 			};
 			#endregion

+            #region effects's enable on/off
+            protected bool _doFlameSmoke = true;
+            protected bool _doFlash = true;
+            protected bool _doFlyingSparks = true;
+            protected bool _doSmokeTrails = true;
+            protected bool _doRoundSparks = true;
+            protected bool _doDebris = true;
+            protected bool _doShockwave = true;
+            #endregion
+
 			#region effects' colors
 			protected Color4 _flameColor = Color4.DarkOrange;
 			protected Color4 _flashColor = Color4.Yellow;
@@ -267,137 +306,51 @@

 			#region emitters and effectors
 			// flame/smoke
-			protected readonly SSRadialEmitter _flameSmokeEmitter
-				= new SSRadialEmitter();
-			protected readonly SSColorKeyframesEffector _flamesSmokeColorEffector
-				= new SSColorKeyframesEffector();
-			protected readonly SSMasterScaleKeyframesEffector _flameSmokeScaleEffector
-				= new SSMasterScaleKeyframesEffector();
+            protected SSRadialEmitter _flameSmokeEmitter = null;
+            protected SSColorKeyframesEffector _flamesSmokeColorEffector = null;
+            protected SSMasterScaleKeyframesEffector _flameSmokeScaleEffector = null;
 			// flash
-			protected readonly SSParticlesFieldEmitter _flashEmitter
-				= new SSParticlesFieldEmitter(new ParticlesSphereGenerator());
-			protected readonly SSColorKeyframesEffector _flashColorEffector
-				= new SSColorKeyframesEffector ();
-			protected readonly SSMasterScaleKeyframesEffector _flashScaleEffector
-				= new SSMasterScaleKeyframesEffector ();
+            protected SSParticlesFieldEmitter _flashEmitter = null;
+            protected SSColorKeyframesEffector _flashColorEffector = null;
+            protected SSMasterScaleKeyframesEffector _flashScaleEffector = null;
 			// flying sparks
-			protected readonly SSRadialEmitter _flyingSparksEmitter
-				= new SSRadialEmitter();
-			protected readonly SSColorKeyframesEffector _flyingSparksColorEffector
-				= new SSColorKeyframesEffector ();
+            protected SSRadialEmitter _flyingSparksEmitter = null;
+            protected SSColorKeyframesEffector _flyingSparksColorEffector = null;
 			// smoke trails
-			protected readonly SSRadialEmitter _smokeTrailsEmitter
-				= new SSRadialEmitter();
-			protected readonly SSColorKeyframesEffector _smokeTrailsColorEffector
-				= new SSColorKeyframesEffector();
-			protected readonly SSComponentScaleKeyframeEffector _smokeTrailsScaleEffector
-				= new SSComponentScaleKeyframeEffector ();
+            protected SSRadialEmitter _smokeTrailsEmitter = null;
+            protected SSColorKeyframesEffector _smokeTrailsColorEffector = null;
+            protected SSComponentScaleKeyframeEffector _smokeTrailsScaleEffector = null;
 			// round sparks
-			protected readonly SSRadialEmitter _roundSparksEmitter
-				= new SSRadialEmitter();
-			protected readonly SSColorKeyframesEffector _roundSparksColorEffector
-				= new SSColorKeyframesEffector ();
-			protected readonly SSMasterScaleKeyframesEffector _roundSparksScaleEffector
-				= new SSMasterScaleKeyframesEffector ();
+            protected SSRadialEmitter _roundSparksEmitter = null;
+            protected SSColorKeyframesEffector _roundSparksColorEffector = null;
+            protected SSMasterScaleKeyframesEffector _roundSparksScaleEffector = null;
 			// debris
-			protected readonly SSRadialEmitter _debrisEmitter
-				= new SSRadialEmitter ();
-			protected readonly SSColorKeyframesEffector _debrisColorEffector
-				= new SSColorKeyframesEffector ();
+            protected SSRadialEmitter _debrisEmitter = null;
+            protected SSColorKeyframesEffector _debrisColorEffector = null;
 			// shockwave
-			protected readonly ShockwaveEmitter _shockwaveEmitter
-				= new ShockwaveEmitter();
-			protected readonly SSMasterScaleKeyframesEffector _shockwaveScaleEffector
-				= new SSMasterScaleKeyframesEffector();
-			protected readonly SSColorKeyframesEffector _shockwaveColorEffector
-				= new SSColorKeyframesEffector();
+            protected ShockwaveEmitter _shockwaveEmitter = null;
+            protected SSMasterScaleKeyframesEffector _shockwaveScaleEffector = null;
+            protected SSColorKeyframesEffector _shockwaveColorEffector = null;
 			// shared
-			protected readonly RadialBillboardOrientator _radialOrientator
-				= new RadialBillboardOrientator();
+            protected RadialBillboardOrientator _radialOrientator = null;
 			#endregion

 			public SExplosionSystem (int particleCapacity)
 				: base(particleCapacity)
 			{
-				// flame/smoke
-				{
-					_flameSmokeEmitter.effectorMask
-						= _flameSmokeScaleEffector.effectorMask
-						= _flamesSmokeColorEffector.effectorMask
-						= (ushort)ComponentMask.FlameSmoke;
-					addEmitter(_flameSmokeEmitter);
-					addEffector(_flamesSmokeColorEffector);
-					addEffector(_flameSmokeScaleEffector);
-					configureFlameSmoke();
-				}
-				// flash
-				{
-					_flashEmitter.effectorMask
-						= _flashColorEffector.effectorMask
-						= _flashScaleEffector.effectorMask
-						= (ushort)ComponentMask.Flash;
-					addEmitter (_flashEmitter);
-					addEffector (_flashColorEffector);
-					addEffector (_flashScaleEffector);
-					configureFlash();
-				}
-				// flying sparks
-				{
-					_flyingSparksEmitter.effectorMask
-						= _flyingSparksColorEffector.effectorMask
-						= (ushort)ComponentMask.FlyingSparks;
-					addEmitter (_flyingSparksEmitter);
-					addEffector (_flyingSparksColorEffector);
-					configureFlyingSparks();
-				}
-				// smoke trails
-				{
-					_smokeTrailsEmitter.effectorMask
-						= _smokeTrailsColorEffector.effectorMask
-						= _smokeTrailsScaleEffector.effectorMask
-						= (ushort)ComponentMask.SmokeTrails;
-					addEmitter(_smokeTrailsEmitter);
-					addEffector(_smokeTrailsColorEffector);
-					addEffector(_smokeTrailsScaleEffector);
-					configureSmokeTrails();
-				}
-				// round sparks
-				{
-					_roundSparksEmitter.effectorMask
-						= _roundSparksScaleEffector.effectorMask
-						= _roundSparksColorEffector.effectorMask
-						= (ushort)ComponentMask.RoundSparks;
-					addEmitter (_roundSparksEmitter);
-					addEffector (_roundSparksColorEffector);
-					addEffector (_roundSparksScaleEffector);
-					configureRoundSparks();
-				}
-				// debris
-				{
-					_debrisEmitter.effectorMask
-						= _debrisColorEffector.effectorMask
-						= (ushort)ComponentMask.Debris;
-					addEmitter (_debrisEmitter);
-					addEffector (_debrisColorEffector);
-					configureDebris();
-				}
-				// shockwave
-				{
-					_shockwaveEmitter.effectorMask
-						= _shockwaveScaleEffector.effectorMask
-						= _shockwaveColorEffector.effectorMask
-						= (ushort)ComponentMask.Shockwave;
-					addEmitter(_shockwaveEmitter);
-					addEffector(_shockwaveScaleEffector);
-					addEffector(_shockwaveColorEffector);
-					configureShockwave();
-				}
-				// shared
-				{
-					_radialOrientator.effectorMask
-						= (ushort)ComponentMask.FlyingSparks | (ushort)ComponentMask.SmokeTrails;
-					addEffector (_radialOrientator);
-				}
+                configureFlameSmoke();
+                configureFlash();
+                configureFlyingSparks();
+                configureSmokeTrails();
+    			configureRoundSparks();
+    			configureDebris();
+			    configureShockwave();
+
+                // shared
+                _radialOrientator = new RadialBillboardOrientator();
+				_radialOrientator.effectorMask
+					= (ushort)ComponentMask.FlyingSparks | (ushort)ComponentMask.SmokeTrails;
+				addEffector (_radialOrientator);
 			}

 			public virtual void showExplosion(Vector3 position, float intensity)
@@ -426,35 +379,56 @@

 			protected void configureFlameSmoke()
 			{
-				_flameSmokeEmitter.spriteRectangles = _flameSmokeSprites;
-				_flameSmokeEmitter.particlesPerEmission = 2;
-				_flameSmokeEmitter.emissionInterval = 0.03f * _flameSmokeDuration;
-				_flameSmokeEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
-				_flameSmokeEmitter.life = _flameSmokeDuration;
-				_flameSmokeEmitter.orientationMin = new Vector3(0f, 0f, 0f);
-				_flameSmokeEmitter.orientationMax = new Vector3(0f, 0f, 2f*(float)Math.PI);
-				_flameSmokeEmitter.billboardXY = true;
-				_flameSmokeEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.5f);
-				_flameSmokeEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.5f);
-				_flameSmokeEmitter.radiusOffsetMin = 0f;
-				_flameSmokeEmitter.radiusOffsetMax = 0.5f;
-
-				_flamesSmokeColorEffector.colorMask = _flameColor;
-				_flamesSmokeColorEffector.particleLifetime = _flameSmokeDuration;
-				_flamesSmokeColorEffector.keyframes.Clear ();
-				_flamesSmokeColorEffector.keyframes.Add (0f, new Color4 (1f, 1f, 1f, 1f));
-				_flamesSmokeColorEffector.keyframes.Add (0.4f, new Color4 (0f, 0f, 0f, 0.5f));
-				_flamesSmokeColorEffector.keyframes.Add (1f, new Color4 (0f, 0f, 0f, 0f));
-
-				_flameSmokeScaleEffector.particleLifetime = _flameSmokeDuration;
-				_flameSmokeScaleEffector.keyframes.Clear ();
-				_flameSmokeScaleEffector.keyframes.Add (0f, 0.1f);
-				_flameSmokeScaleEffector.keyframes.Add (0.25f, 1f);
-				_flameSmokeScaleEffector.keyframes.Add (1f, 1.2f);
+                if (_doFlameSmoke) {
+                    if (_flameSmokeEmitter == null) {
+                        _flameSmokeEmitter = new SSRadialEmitter ();
+                        _flamesSmokeColorEffector = new SSColorKeyframesEffector ();
+                        _flameSmokeScaleEffector = new SSMasterScaleKeyframesEffector ();
+                        addEmitter(_flameSmokeEmitter);
+                        addEffector(_flamesSmokeColorEffector);
+                        addEffector(_flameSmokeScaleEffector);
+                        _flameSmokeEmitter.effectorMask = _flameSmokeScaleEffector.effectorMask
+                            = _flamesSmokeColorEffector.effectorMask = (ushort)ComponentMask.FlameSmoke;
+                    }
+
+                    _flameSmokeEmitter.spriteRectangles = _flameSmokeSprites;
+                    _flameSmokeEmitter.particlesPerEmission = 2;
+                    _flameSmokeEmitter.emissionInterval = 0.03f * _flameSmokeDuration;
+                    _flameSmokeEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
+                    _flameSmokeEmitter.life = _flameSmokeDuration;
+                    _flameSmokeEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
+                    _flameSmokeEmitter.orientationMax = new Vector3 (0f, 0f, 2f * (float)Math.PI);
+                    _flameSmokeEmitter.billboardXY = true;
+                    _flameSmokeEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.5f);
+                    _flameSmokeEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.5f);
+                    _flameSmokeEmitter.radiusOffsetMin = 0f;
+                    _flameSmokeEmitter.radiusOffsetMax = 0.5f;
+
+                    _flamesSmokeColorEffector.colorMask = _flameColor;
+                    _flamesSmokeColorEffector.particleLifetime = _flameSmokeDuration;
+                    _flamesSmokeColorEffector.keyframes.Clear();
+                    _flamesSmokeColorEffector.keyframes.Add(0f, new Color4 (1f, 1f, 1f, 1f));
+                    _flamesSmokeColorEffector.keyframes.Add(0.4f, new Color4 (0f, 0f, 0f, 0.5f));
+                    _flamesSmokeColorEffector.keyframes.Add(1f, new Color4 (0f, 0f, 0f, 0f));
+
+                    _flameSmokeScaleEffector.particleLifetime = _flameSmokeDuration;
+                    _flameSmokeScaleEffector.keyframes.Clear();
+                    _flameSmokeScaleEffector.keyframes.Add(0f, 0.1f);
+                    _flameSmokeScaleEffector.keyframes.Add(0.25f, 1f);
+                    _flameSmokeScaleEffector.keyframes.Add(1f, 1.2f);
+                } else if (_flameSmokeEmitter != null) {
+                    removeEmitter(_flameSmokeEmitter);
+                    removeEffector(_flamesSmokeColorEffector);
+                    removeEffector(_flameSmokeScaleEffector);
+                    _flameSmokeEmitter = null;
+                    _flamesSmokeColorEffector = null;
+                    _flameSmokeScaleEffector = null;
+                }
 			}

 			protected void emitFlameSmoke(Vector3 position, float intensity)
 			{
+                if (!_doFlameSmoke) return;
 				_flameSmokeEmitter.componentScale = new Vector3(intensity*3f, intensity*3f, 1f);
 				_flameSmokeEmitter.velocityMagnitudeMin = 0.60f * intensity;
 				_flameSmokeEmitter.velocityMagnitudeMax = 0.80f * intensity;
@@ -464,32 +438,54 @@

 			protected void configureFlash()
 			{
-				_flashEmitter.spriteRectangles = _flashSprites;
-				_flashEmitter.particlesPerEmissionMin = 1;
-				_flashEmitter.particlesPerEmissionMax = 2;
-				_flashEmitter.emissionIntervalMin = 0f;
-				_flashEmitter.emissionIntervalMax = 0.2f * _flashDuration;
-				_flashEmitter.life = _flashDuration;
-				_flashEmitter.velocity = Vector3.Zero;
-				_flashEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
-				_flashEmitter.orientationMax = new Vector3 (0f, 0f, 2f*(float)Math.PI);
-				_flashEmitter.billboardXY = true;
-				_flashEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
-
-				_flashColorEffector.particleLifetime = _flashDuration;
-				_flashColorEffector.colorMask = _flashColor;
-				_flashColorEffector.keyframes.Clear ();
-				_flashColorEffector.keyframes.Add (0f, new Color4 (1f, 1f, 1f, 1f));
-				_flashColorEffector.keyframes.Add (1f, new Color4 (1f, 1f, 1f, 0f));
-
-				_flashScaleEffector.particleLifetime = _flashDuration;
-				_flashScaleEffector.keyframes.Clear ();
-				_flashScaleEffector.keyframes.Add (0f, 1f);
-				_flashScaleEffector.keyframes.Add (1f, 1.5f);
+                if (_doFlash) {
+                    if (_flashEmitter == null) {
+                        _flashEmitter = new SSParticlesFieldEmitter (new ParticlesSphereGenerator ());
+                        _flashColorEffector = new SSColorKeyframesEffector ();
+                        _flashScaleEffector = new SSMasterScaleKeyframesEffector ();
+                        addEmitter(_flashEmitter);
+                        addEffector(_flashColorEffector);
+                        addEffector(_flashScaleEffector);
+                        _flashEmitter.effectorMask = _flashColorEffector.effectorMask
+                            = _flashScaleEffector.effectorMask = (ushort)ComponentMask.Flash;
+                    }
+
+                    _flashEmitter.spriteRectangles = _flashSprites;
+                    _flashEmitter.particlesPerEmissionMin = 1;
+                    _flashEmitter.particlesPerEmissionMax = 2;
+                    _flashEmitter.emissionIntervalMin = 0f;
+                    _flashEmitter.emissionIntervalMax = 0.2f * _flashDuration;
+                    _flashEmitter.life = _flashDuration;
+                    _flashEmitter.velocity = Vector3.Zero;
+                    _flashEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
+                    _flashEmitter.orientationMax = new Vector3 (0f, 0f, 2f * (float)Math.PI);
+                    _flashEmitter.billboardXY = true;
+                    _flashEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
+
+                    _flashColorEffector.particleLifetime = _flashDuration;
+                    _flashColorEffector.colorMask = _flashColor;
+                    _flashColorEffector.keyframes.Clear();
+                    _flashColorEffector.keyframes.Add(0f, new Color4 (1f, 1f, 1f, 1f));
+                    _flashColorEffector.keyframes.Add(1f, new Color4 (1f, 1f, 1f, 0f));
+
+                    _flashScaleEffector.particleLifetime = _flashDuration;
+                    _flashScaleEffector.keyframes.Clear();
+                    _flashScaleEffector.keyframes.Add(0f, 1f);
+                    _flashScaleEffector.keyframes.Add(1f, 1.5f);
+                } else if (_flashEmitter != null) {
+                    removeEmitter(_flashEmitter);
+                    removeEffector(_flashColorEffector);
+                    removeEffector(_flashScaleEffector);
+                    _flashEmitter = null;
+                    _flashColorEffector = null;
+                    _flashScaleEffector = null;
+                }
+
 			}

 			protected void emitFlash(Vector3 position, float intensity)
 			{
+                if (!_doFlash) return;
 				_flashEmitter.componentScale = new Vector3(intensity*3f, intensity*3f, 1f);
 				ParticlesSphereGenerator flashSphere = _flashEmitter.Field as ParticlesSphereGenerator;
 				flashSphere.Center = position;
@@ -499,24 +495,41 @@

 			protected void configureFlyingSparks()
 			{
-				_flyingSparksEmitter.spriteRectangles = _flyingSparksSprites;
-				_flyingSparksEmitter.emissionIntervalMin = 0f;
-				_flyingSparksEmitter.emissionIntervalMax = 0.1f * _flyingSparksDuration;
-				_flyingSparksEmitter.life = _flyingSparksDuration;
-				_flyingSparksEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
-				_flyingSparksEmitter.componentScale = new Vector3 (5f, 1f, 1f);
-				_flyingSparksEmitter.color = _flyingSparksColor;
-
-				_flyingSparksColorEffector.colorMask = _flashColor;
-				_flyingSparksColorEffector.keyframes.Clear ();
-				_flyingSparksColorEffector.keyframes.Add (0f, new Color4 (1f, 1f, 1f, 1f));
-				_flyingSparksColorEffector.keyframes.Add (1f, new Color4 (1f, 1f, 1f, 0f));
-				_flyingSparksColorEffector.particleLifetime = _flyingSparksDuration;
+                if (_doFlyingSparks) {
+                    if (_flyingSparksEmitter == null) {
+                        _flyingSparksEmitter = new SSRadialEmitter ();
+                        _flyingSparksColorEffector = new SSColorKeyframesEffector ();
+                        addEmitter(_flyingSparksEmitter);
+                        addEffector(_flyingSparksColorEffector);
+                        _flyingSparksEmitter.effectorMask = _flyingSparksColorEffector.effectorMask
+                            = (ushort)ComponentMask.FlyingSparks;
+                    }
+
+                    _flyingSparksEmitter.spriteRectangles = _flyingSparksSprites;
+                    _flyingSparksEmitter.emissionIntervalMin = 0f;
+                    _flyingSparksEmitter.emissionIntervalMax = 0.1f * _flyingSparksDuration;
+                    _flyingSparksEmitter.life = _flyingSparksDuration;
+                    _flyingSparksEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
+                    _flyingSparksEmitter.componentScale = new Vector3 (5f, 1f, 1f);
+                    _flyingSparksEmitter.color = _flyingSparksColor;
+
+                    _flyingSparksColorEffector.colorMask = _flashColor;
+                    _flyingSparksColorEffector.keyframes.Clear();
+                    _flyingSparksColorEffector.keyframes.Add(0f, new Color4 (1f, 1f, 1f, 1f));
+                    _flyingSparksColorEffector.keyframes.Add(1f, new Color4 (1f, 1f, 1f, 0f));
+                    _flyingSparksColorEffector.particleLifetime = _flyingSparksDuration;
+                } else if (_flyingSparksEmitter != null) {
+                    removeEmitter(_flyingSparksEmitter);
+                    removeEffector(_flyingSparksColorEffector);
+                    _flyingSparksEmitter = null;
+                    _flyingSparksColorEffector = null;
+                }
 			}

 			protected void emitFlyingSparks(Vector3 position, float intensity)
 			{
-				_flyingSparksEmitter.center = position;
+                if (!_doFlyingSparks) return;
+                _flyingSparksEmitter.center = position;
 				_flyingSparksEmitter.velocityMagnitudeMin = intensity * 2f;
 				_flyingSparksEmitter.velocityMagnitudeMax = intensity * 3f;
 				_flyingSparksEmitter.particlesPerEmission = (int)(5.0*Math.Log(intensity));
@@ -525,31 +538,53 @@

 			protected void configureSmokeTrails()
 			{
-				_smokeTrailsEmitter.radiusOffset = 3f;
-				_smokeTrailsEmitter.spriteRectangles = _smokeTrailsSprites;
-				_smokeTrailsEmitter.particlesPerEmission = 16;
-				_smokeTrailsEmitter.emissionIntervalMin = 0f;
-				_smokeTrailsEmitter.emissionIntervalMax = 0.1f * _smokeTrailsDuration;
-				_smokeTrailsEmitter.life = _smokeTrailsDuration;
-				_smokeTrailsEmitter.totalEmissionsLeft = 0; // control this in ShowExplosion()
-				_smokeTrailsEmitter.color = _smokeTrailsColor;
-
-				_smokeTrailsColorEffector.particleLifetime = _smokeTrailsDuration;
-				_smokeTrailsColorEffector.colorMask = _smokeTrailsColor;
-				_smokeTrailsColorEffector.keyframes.Clear ();
-				_smokeTrailsColorEffector.keyframes.Add(0f, new Color4(1f, 1f, 1f, 1f));
-				_smokeTrailsColorEffector.keyframes.Add(1f, new Color4(0.3f, 0.3f, 0.3f, 0f));
-
-				_smokeTrailsScaleEffector.particleLifetime = _smokeTrailsDuration;
-				_smokeTrailsScaleEffector.baseOffset = new Vector3(1f, 1f, 1f);
-				_smokeTrailsScaleEffector.keyframes.Clear ();
-				_smokeTrailsScaleEffector.keyframes.Add(0f, new Vector3(0f));
-				_smokeTrailsScaleEffector.keyframes.Add(0.5f, new Vector3(12f, 1.5f, 0f));
-				_smokeTrailsScaleEffector.keyframes.Add(1f, new Vector3(7f, 2f, 0f));
+                if (_doSmokeTrails) {
+                    if (_flameSmokeEmitter == null) {
+                        _smokeTrailsEmitter = new SSRadialEmitter ();
+                        _smokeTrailsColorEffector = new SSColorKeyframesEffector ();
+                        _smokeTrailsScaleEffector = new SSComponentScaleKeyframeEffector ();
+                        addEmitter(_smokeTrailsEmitter);
+                        addEffector(_smokeTrailsColorEffector);
+                        addEffector(_smokeTrailsScaleEffector);
+                        _smokeTrailsEmitter.effectorMask = _smokeTrailsColorEffector.effectorMask
+                            = _smokeTrailsScaleEffector.effectorMask = (ushort)ComponentMask.SmokeTrails;
+                    }
+
+                    _smokeTrailsEmitter.radiusOffset = 3f;
+                    _smokeTrailsEmitter.spriteRectangles = _smokeTrailsSprites;
+                    _smokeTrailsEmitter.particlesPerEmission = 16;
+                    _smokeTrailsEmitter.emissionIntervalMin = 0f;
+                    _smokeTrailsEmitter.emissionIntervalMax = 0.1f * _smokeTrailsDuration;
+                    _smokeTrailsEmitter.life = _smokeTrailsDuration;
+                    _smokeTrailsEmitter.totalEmissionsLeft = 0; // control this in ShowExplosion()
+                    _smokeTrailsEmitter.color = _smokeTrailsColor;
+
+                    _smokeTrailsColorEffector.particleLifetime = _smokeTrailsDuration;
+                    _smokeTrailsColorEffector.colorMask = _smokeTrailsColor;
+                    _smokeTrailsColorEffector.keyframes.Clear();
+                    _smokeTrailsColorEffector.keyframes.Add(0f, new Color4 (1f, 1f, 1f, 1f));
+                    _smokeTrailsColorEffector.keyframes.Add(1f, new Color4 (0.3f, 0.3f, 0.3f, 0f));
+
+                    _smokeTrailsScaleEffector.particleLifetime = _smokeTrailsDuration;
+                    _smokeTrailsScaleEffector.baseOffset = new Vector3 (1f, 1f, 1f);
+                    _smokeTrailsScaleEffector.keyframes.Clear();
+                    _smokeTrailsScaleEffector.keyframes.Add(0f, new Vector3 (0f));
+                    _smokeTrailsScaleEffector.keyframes.Add(0.5f, new Vector3 (12f, 1.5f, 0f));
+                    _smokeTrailsScaleEffector.keyframes.Add(1f, new Vector3 (7f, 2f, 0f));
+                } else if (_smokeTrailsEmitter != null) {
+                    removeEmitter(_smokeTrailsEmitter);
+                    removeEffector(_smokeTrailsColorEffector);
+                    removeEffector(_smokeTrailsScaleEffector);
+                    _smokeTrailsEmitter = null;
+                    _smokeTrailsColorEffector = null;
+                    _smokeTrailsScaleEffector = null;
+                }
 			}

 			protected void emitSmokeTrails(Vector3 position, float intensity)
 			{
+                if (!_doSmokeTrails) return;
+
 				_smokeTrailsEmitter.center = position;
 				_smokeTrailsEmitter.velocityMagnitudeMin = intensity * 0.8f;
 				_smokeTrailsEmitter.velocityMagnitudeMax = intensity * 1f;
@@ -562,35 +597,55 @@

 			protected void configureRoundSparks()
 			{
-				_roundSparksEmitter.spriteRectangles = _roundSparksSprites;
-				_roundSparksEmitter.particlesPerEmission = 6;
-				_roundSparksEmitter.emissionIntervalMin = 0f;
-				_roundSparksEmitter.emissionIntervalMax = 0.05f * _roundSparksDuration;
-				_roundSparksEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
-				_roundSparksEmitter.life = _roundSparksDuration;
-				_roundSparksEmitter.billboardXY = true;
-				_roundSparksEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
-				_roundSparksEmitter.orientationMax = new Vector3 (0f, 0f, 2f*(float)Math.PI);
-				_roundSparksEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.25f);
-				_roundSparksEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.25f);
-				_roundSparksEmitter.radiusOffsetMin = 0f;
-				_roundSparksEmitter.radiusOffsetMax = 1f;
-
-				_roundSparksColorEffector.particleLifetime = _roundSparksDuration;
-				_roundSparksColorEffector.colorMask = _roundSparksColor;
-				_roundSparksColorEffector.keyframes.Clear ();
-				_roundSparksColorEffector.keyframes.Add (0.1f, new Color4 (1f, 1f, 1f, 1f));
-				_roundSparksColorEffector.keyframes.Add (1f, new Color4 (1f, 1f, 1f, 0f));
-
-				_roundSparksScaleEffector.particleLifetime = _roundSparksDuration;
-				_roundSparksScaleEffector.keyframes.Clear ();
-				_roundSparksScaleEffector.keyframes.Add (0f, 1f);
-				_roundSparksScaleEffector.keyframes.Add (0.25f, 3f);
-				_roundSparksScaleEffector.keyframes.Add (1f, 6f);
+
+                if (_doRoundSparks) {
+                    _roundSparksEmitter = new SSRadialEmitter ();
+                    _roundSparksColorEffector = new SSColorKeyframesEffector ();
+                    _roundSparksScaleEffector = new SSMasterScaleKeyframesEffector ();
+                    addEmitter (_roundSparksEmitter);
+                    addEffector (_roundSparksColorEffector);
+                    addEffector (_roundSparksScaleEffector);
+                    _roundSparksEmitter.effectorMask = _roundSparksScaleEffector.effectorMask
+                        = _roundSparksColorEffector.effectorMask = (ushort)ComponentMask.RoundSparks;
+
+                    _roundSparksEmitter.spriteRectangles = _roundSparksSprites;
+                    _roundSparksEmitter.particlesPerEmission = 6;
+                    _roundSparksEmitter.emissionIntervalMin = 0f;
+                    _roundSparksEmitter.emissionIntervalMax = 0.05f * _roundSparksDuration;
+                    _roundSparksEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
+                    _roundSparksEmitter.life = _roundSparksDuration;
+                    _roundSparksEmitter.billboardXY = true;
+                    _roundSparksEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
+                    _roundSparksEmitter.orientationMax = new Vector3 (0f, 0f, 2f * (float)Math.PI);
+                    _roundSparksEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.25f);
+                    _roundSparksEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.25f);
+                    _roundSparksEmitter.radiusOffsetMin = 0f;
+                    _roundSparksEmitter.radiusOffsetMax = 1f;
+
+                    _roundSparksColorEffector.particleLifetime = _roundSparksDuration;
+                    _roundSparksColorEffector.colorMask = _roundSparksColor;
+                    _roundSparksColorEffector.keyframes.Clear();
+                    _roundSparksColorEffector.keyframes.Add(0.1f, new Color4 (1f, 1f, 1f, 1f));
+                    _roundSparksColorEffector.keyframes.Add(1f, new Color4 (1f, 1f, 1f, 0f));
+
+                    _roundSparksScaleEffector.particleLifetime = _roundSparksDuration;
+                    _roundSparksScaleEffector.keyframes.Clear();
+                    _roundSparksScaleEffector.keyframes.Add(0f, 1f);
+                    _roundSparksScaleEffector.keyframes.Add(0.25f, 3f);
+                    _roundSparksScaleEffector.keyframes.Add(1f, 6f);
+                } else if (_roundSparksEmitter != null) {
+                    removeEmitter(_roundSparksEmitter);
+                    removeEffector(_roundSparksColorEffector);
+                    removeEffector(_roundSparksScaleEffector);
+                    _roundSparksEmitter = null;
+                    _roundSparksColorEffector = null;
+                    _roundSparksScaleEffector = null;
+                }
 			}

 			protected void emitRoundSparks(Vector3 position, float intensity)
 			{
+                if (!_doRoundSparks) return;
 				_roundSparksEmitter.componentScale = new Vector3(intensity, intensity, 1f);
 				_roundSparksEmitter.velocityMagnitudeMin = 0.7f * intensity;
 				_roundSparksEmitter.velocityMagnitudeMax = 1.2f * intensity;
@@ -600,29 +655,45 @@

 			protected void configureDebris()
 			{
-				_debrisEmitter.spriteRectangles = _debrisSprites;
-				_debrisEmitter.particlesPerEmissionMin = 7;
-				_debrisEmitter.particlesPerEmissionMax = 10;
-				_debrisEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
-				_debrisEmitter.life = _debrisDuration;
-				_debrisEmitter.orientationMin = new Vector3(0f, 0f, 0f);
-				_debrisEmitter.orientationMax = new Vector3(0f, 0f, 2f*(float)Math.PI);
-				_debrisEmitter.billboardXY = true;
-				_debrisEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.5f);
-				_debrisEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.5f);
-				_debrisEmitter.radiusOffsetMin = 0f;
-				_debrisEmitter.radiusOffsetMax = 1f;
-
-				var debrisColorFinal = new Color4(_debrisColorEnd.R, _debrisColorEnd.G, _debrisColorEnd.B, 0f);
-				_debrisColorEffector.particleLifetime = _debrisDuration;
-				_debrisColorEffector.keyframes.Clear();
-				_debrisColorEffector.keyframes.Add (0f, _debrisColorStart);
-				_debrisColorEffector.keyframes.Add (0.3f, _debrisColorEnd);
-				_debrisColorEffector.keyframes.Add (1f, debrisColorFinal);
+                if (_doDebris) {
+                    if (_debrisEmitter == null) {
+                        _debrisEmitter = new SSRadialEmitter ();
+                        _debrisColorEffector = new SSColorKeyframesEffector ();
+                        addEmitter (_debrisEmitter);
+                        addEffector (_debrisColorEffector);
+                        _debrisEmitter.effectorMask = _debrisColorEffector.effectorMask
+                            = (ushort)ComponentMask.Debris;
+                    }
+                    _debrisEmitter.spriteRectangles = _debrisSprites;
+                    _debrisEmitter.particlesPerEmissionMin = 7;
+                    _debrisEmitter.particlesPerEmissionMax = 10;
+                    _debrisEmitter.totalEmissionsLeft = 0; // Control this in ShowExplosion()
+                    _debrisEmitter.life = _debrisDuration;
+                    _debrisEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
+                    _debrisEmitter.orientationMax = new Vector3 (0f, 0f, 2f * (float)Math.PI);
+                    _debrisEmitter.billboardXY = true;
+                    _debrisEmitter.angularVelocityMin = new Vector3 (0f, 0f, -0.5f);
+                    _debrisEmitter.angularVelocityMax = new Vector3 (0f, 0f, +0.5f);
+                    _debrisEmitter.radiusOffsetMin = 0f;
+                    _debrisEmitter.radiusOffsetMax = 1f;
+
+                    var debrisColorFinal = new Color4 (_debrisColorEnd.R, _debrisColorEnd.G, _debrisColorEnd.B, 0f);
+                    _debrisColorEffector.particleLifetime = _debrisDuration;
+                    _debrisColorEffector.keyframes.Clear();
+                    _debrisColorEffector.keyframes.Add(0f, _debrisColorStart);
+                    _debrisColorEffector.keyframes.Add(0.3f, _debrisColorEnd);
+                    _debrisColorEffector.keyframes.Add(1f, debrisColorFinal);
+                } else if (_debrisEmitter != null) {
+                    removeEmitter(_debrisEmitter);
+                    removeEffector(_debrisColorEffector);
+                    _debrisEmitter = null;
+                    _debrisColorEffector = null;
+                }
 			}

 			protected void emitDebris(Vector3 position, float intensity)
 			{
+                if (!_doDebris) return;
 				//m_debrisEmitter.MasterScale = intensity / 2f;
 				_debrisEmitter.masterScaleMin = 3f;
 				_debrisEmitter.masterScaleMax = 0.4f*intensity;
@@ -635,26 +706,46 @@

 			protected void configureShockwave()
 			{
-				_shockwaveEmitter.spriteRectangles = _shockwaveSprites;
-				_shockwaveEmitter.particlesPerEmission = 1;
-				_shockwaveEmitter.totalEmissionsLeft = 0;   // Control this in ShowExplosion()
-				_shockwaveEmitter.life = _shockwaveDuration;
-				_shockwaveEmitter.velocity = Vector3.Zero;
-
-				_shockwaveScaleEffector.particleLifetime = _shockwaveDuration;
-				_shockwaveScaleEffector.keyframes.Clear();
-				_shockwaveScaleEffector.keyframes.Add(0f, 0f);
-				_shockwaveScaleEffector.keyframes.Add(_shockwaveDuration, 7f);
-
-				_shockwaveColorEffector.colorMask = _shockwaveColor;
-                _shockwaveColorEffector.particleLifetime = _shockwaveDuration;
-				_shockwaveColorEffector.keyframes.Clear ();
-				_shockwaveColorEffector.keyframes.Add(0f, new Color4(1f, 1f, 1f, 1f));
-				_shockwaveColorEffector.keyframes.Add(1f, new Color4(1f, 1f, 1f, 0f));
+                if (_doShockwave) {
+                    if (_shockwaveEmitter == null) {
+                        _shockwaveEmitter = new ShockwaveEmitter ();
+                        _shockwaveColorEffector = new SSColorKeyframesEffector ();
+                        _shockwaveScaleEffector = new SSMasterScaleKeyframesEffector ();
+                        addEmitter(_shockwaveEmitter);
+                        addEffector(_shockwaveScaleEffector);
+                        addEffector(_shockwaveColorEffector);
+                        _shockwaveEmitter.effectorMask = _shockwaveScaleEffector.effectorMask
+                            = _shockwaveColorEffector.effectorMask = (ushort)ComponentMask.Shockwave;
+                    }
+                    _shockwaveEmitter.spriteRectangles = _shockwaveSprites;
+                    _shockwaveEmitter.particlesPerEmission = 1;
+                    _shockwaveEmitter.totalEmissionsLeft = 0;   // Control this in ShowExplosion()
+                    _shockwaveEmitter.life = _shockwaveDuration;
+                    _shockwaveEmitter.velocity = Vector3.Zero;
+
+                    _shockwaveScaleEffector.particleLifetime = _shockwaveDuration;
+                    _shockwaveScaleEffector.keyframes.Clear();
+                    _shockwaveScaleEffector.keyframes.Add(0f, 0f);
+                    _shockwaveScaleEffector.keyframes.Add(_shockwaveDuration, 7f);
+
+                    _shockwaveColorEffector.colorMask = _shockwaveColor;
+                    _shockwaveColorEffector.particleLifetime = _shockwaveDuration;
+                    _shockwaveColorEffector.keyframes.Clear();
+                    _shockwaveColorEffector.keyframes.Add(0f, new Color4 (1f, 1f, 1f, 1f));
+                    _shockwaveColorEffector.keyframes.Add(1f, new Color4 (1f, 1f, 1f, 0f));
+                } else if (_shockwaveEmitter != null) {
+                    removeEmitter(_shockwaveEmitter);
+                    removeEffector(_shockwaveColorEffector);
+                    removeEffector(_shockwaveScaleEffector);
+                    _shockwaveEmitter = null;
+                    _shockwaveColorEffector = null;
+                    _shockwaveScaleEffector = null;
+                }
 			}

 			protected void emitShockwave(Vector3 position, float intensity)
 			{
+                if (!_doShockwave) return;
 				_shockwaveEmitter.componentScale = new Vector3(intensity, intensity, 1f);
 				_shockwaveEmitter.position = position;
 				_shockwaveEmitter.totalEmissionsLeft = 1;


Add extracted element / attribute help from MSBuild.*.xsd.


Removed "Permission" class to replicate the MFWS internal structures. Added some comments to MFWSStructs.

--- Libraries/MFaaP.MFWSClient/MFWSStructs.cs
+++ Libraries/MFaaP.MFWSClient/MFWSStructs.cs
@@ -1342,22 +1342,46 @@
         public bool RealObjectType { get; set; }

 		/// <summary>
-		/// An overview of effective permissions.
-		/// </summary>
-	    public Permission Permission { get; set; }
-
-	    public bool Hierarchial { get; set; }
-
-    }
-
-	public class Permission
-	{
-		public Permission()
+		/// Effective permissions for the current user.
+		/// </summary>
+	    public Permissions Permission { get; set; }
+
+		/// <summary>
+		/// Specifies whether this object type is hierarchical (has an internal hierarchy).
+		/// </summary>
+		/// <remarks>ref: https://www.m-files.com/api/documentation/latest/MFilesAPI~ObjType~Hierarchical.html</remarks>
+		public bool Hierarchial { get; set; }
+
+    }
+
+	/// <summary>
+	/// Represents the effective permissions for the current user.
+	/// </summary>
+	public class Permissions
+	{
+		/// <summary>
+		/// Instantiates a Permissions object.
+		/// </summary>
+		public Permissions()
 		{
 		}

+		/// <summary>
+		/// Represents whether the user has
+		/// MFObjectAccessRead access (or MFPropertyDefAccessSee for <see cref="PropertyDef"/>s).
+		/// </summary>
 		public bool CanRead { get; set; }
+
+		/// <summary>
+		/// Represents whether the user has
+		/// MFObjectAccessEdit access.
+		/// </summary>
 		public bool CanEdit { get; set; }
+
+		/// <summary>
+		/// Represents whether the user has
+		/// MFObjectAccessAttachObjects access.
+		/// </summary>
 		public bool CanAttachObjects { get; set; }
 	}

@@ -1375,26 +1399,32 @@
         /// Based on M-Files API.
         /// </summary>
         public bool IsCreatePermissionAllowed { get; set; }
-        /// <summary>
-        /// Based on M-Files API.
-        /// </summary>
-        public Permissions Permissions { get; set; }
+
+		/// <summary>
+		/// Effective permissions for the current user.
+		/// </summary>
+		public Permissions Permissions { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public int ContentType { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public int DependencyPD { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public int DependencyRelation { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public string GUID { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
@@ -1403,22 +1433,27 @@
         /// Based on M-Files API.
         /// </summary>
         public Ownerpropertydef OwnerPropertyDef { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public bool SortAscending { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public int UpdateType { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public int ValueListSortingType { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
         public bool IsOwnerPropertyDef { get; set; }
+
         /// <summary>
         /// Based on M-Files API.
         /// </summary>
@@ -2123,17 +2158,9 @@

 	}

-
     /// <summary>
     /// Based on M-Files API.
     /// </summary>
-    public class Permissions : Permission
-    {
-    }
-
-    /// <summary>
-    /// Based on M-Files API.
-    /// </summary>
     public class Ownerpropertydef
     {
         /// <summary>


update

update

--- Demos/FrontToBackPeeling/PeelingNode.cs
+++ Demos/FrontToBackPeeling/PeelingNode.cs
@@ -172,13 +172,12 @@

         private void DrawFullScreenQuad(RenderEventArgs arg, QuadNode.RenderMode renderMode, Texture tempTexture, bool useBackground)
         {
+            if (tempTexture == null) { throw new Exception(); }
+
+            this.fullscreenQuad.TempTexture = tempTexture;
             this.fullscreenQuad.Mode = renderMode;
-            if (tempTexture != null)
-            {
-                this.fullscreenQuad.TempTexture = tempTexture;
-            }
+            this.fullscreenQuad.UseBackground = useBackground;

-            this.fullscreenQuad.UseBackground = useBackground;
             this.fullscreenQuad.RenderBeforeChildren(arg);
         }


Improved previous fix

Improved previous fix

--- MailKit/Net/Imap/ImapUtils.cs
+++ MailKit/Net/Imap/ImapUtils.cs
@@ -605,16 +605,17 @@
 					return type;
 				}

-				// Note: In other IMAP server implementations, such as the one found in
-				// https://github.com/jstedfast/MailKit/issues/371, if the server comes
-				// across something like "Content-Type: X-ZIP", it will only send a
-				// media-subtype token and completely fail to send a media-type token.
-				subtype = type;
-				type = "application";
-
-				// assume the NIL token is the subtype?
-				if (token.Type == ImapTokenType.Nil)
+				if (token.Type != ImapTokenType.Nil) {
+					// Note: In other IMAP server implementations, such as the one found in
+					// https://github.com/jstedfast/MailKit/issues/371, if the server comes
+					// across something like "Content-Type: X-ZIP", it will only send a
+					// media-subtype token and completely fail to send a media-type token.
+					subtype = type;
+					type = "application";
+				} else {
 					await engine.ReadTokenAsync (doAsync, cancellationToken).ConfigureAwait (false);
+					subtype = string.Empty;
+				}
 			} else {
 				subtype = await ReadStringTokenAsync (engine, format, doAsync, cancellationToken).ConfigureAwait (false);
 			}


Removing workaround code in the IsNewUser() method that was there to account for bug with double counting of timezone conversion (8 hours from PST to UTC). This code should work without any magic numbers or conversions now.

--- DocuSign.Integrations.Client/Account.cs
+++ DocuSign.Integrations.Client/Account.cs
@@ -1051,8 +1051,7 @@
         /// <returns></returns>
         public bool IsNewUser(int seconds)
         {
-            // A bug in RESTApi causes double counting of 8 hrs offset. We offset that 8 hrs for the moment before the bug is fixed
-            return DateTime.UtcNow.Subtract(this.CreatedDateTime()).TotalSeconds + 28800 < seconds;
+            return DateTime.UtcNow.Subtract(this.CreatedDateTime()).TotalSeconds < seconds;
         }

         /// <summary>


Made passing of a message parameter optional. Allowing passing of only the message tag

--- Messaging/MessageEventArgs.cs
+++ Messaging/MessageEventArgs.cs
@@ -18,7 +18,8 @@
 		public object Message { get; set; }
 		public string MessageTag { get; set; }

-		public MessageEventArgs(object message,string messageTag)
+
+		public MessageEventArgs(string messageTag,object message = null)
 		{
 			Message = message;
 			MessageTag = messageTag;


changed the migration

changed the migration

`UpdateFrom2()` now returns 4, so that `UpdateFrom3()` does not run on new tenants.

--- Migrations/OrderMigrations.cs
+++ Migrations/OrderMigrations.cs
@@ -57,7 +57,7 @@
         public int UpdateFrom2() {
             SchemaBuilder.AlterTable("OrderPartRecord", table => table
                 .AddColumn<int>("UserId", column => column.WithDefault(-1)));
-            return 3;
+            return 4;
         }

         public int UpdateFrom3() {


Ensure correct instance returned from UmbracoHostBuilderDecorator

--- src/Umbraco.Web.Common/Hosting/UmbracoHostBuilderDecorator.cs
+++ src/Umbraco.Web.Common/Hosting/UmbracoHostBuilderDecorator.cs
@@ -1,5 +1,3 @@
-using System;
-using System.Collections.Generic;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
@@ -17,25 +15,43 @@
         _onBuild = onBuild;
     }

-    public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) =>
+    public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate)
+    {
         _inner.ConfigureAppConfiguration(configureDelegate);
+        return this;
+    }

-    public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) =>
+    public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
+    {
         _inner.ConfigureContainer(configureDelegate);
+        return this;
+    }

-    public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) =>
+    public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate)
+    {
         _inner.ConfigureHostConfiguration(configureDelegate);
+        return this;
+    }

-    public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) =>
+    public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)
+    {
         _inner.ConfigureServices(configureDelegate);
+        return this;
+    }

     public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory)
-        where TContainerBuilder : notnull =>
+        where TContainerBuilder : notnull
+    {
         _inner.UseServiceProviderFactory(factory);
+        return this;
+    }

     public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory)
-        where TContainerBuilder : notnull =>
+        where TContainerBuilder : notnull
+    {
         _inner.UseServiceProviderFactory(factory);
+        return this;
+    }

     public IDictionary<object, object> Properties => _inner.Properties;


#22 fix align data in file name

#22 fix align data in file name

--- MailRuCloud/MailRuCloudApi/MailRuCloud.cs
+++ MailRuCloud/MailRuCloudApi/MailRuCloud.cs
@@ -643,7 +643,7 @@

             //================================================================================================================================

-            long delta = size % XTSWriteOnlyStream.BlockSize;
+            long delta = XTSWriteOnlyStream.BlockSize - size % XTSWriteOnlyStream.BlockSize;
             destinationPath += $".c{delta:x}.wdmrc";

             size = size % XTSWriteOnlyStream.BlockSize == 0


Counter rotating symbols in WPF to keep them upright for #253

--- Mapsui.Rendering.Xaml/GeometryRenderer.cs
+++ Mapsui.Rendering.Xaml/GeometryRenderer.cs
@@ -22,7 +22,7 @@
             var matrix = XamlMedia.Matrix.Identity;
             var mapCenterX = viewport.Width * 0.5;
             var mapCenterY = viewport.Height * 0.5;
-
+
             var pointOffsetFromViewPortCenterX = point.X - viewport.Center.X;
             var pointOffsetFromViewPortCenterY = point.Y - viewport.Center.Y;

@@ -46,7 +46,7 @@
         {
             return CreateTransformMatrix(new Point(0, 0), viewport);
         }
-
+
         private static XamlShapes.Path CreatePointPath(SymbolStyle style)
         {
             // todo: use this:
@@ -85,7 +85,7 @@
             path.IsHitTestVisible = false;
             return path;
         }
-
+
         private static XamlMedia.Geometry ConvertSymbol(Point point, SymbolStyle style, IViewport viewport)
         {
             Point p = viewport.WorldToScreen(point);
@@ -102,7 +102,7 @@
             return rect;
         }

-        public static XamlShapes.Shape RenderMultiPoint(MultiPoint multiPoint, IStyle style, IViewport viewport,
+        public static XamlShapes.Shape RenderMultiPoint(MultiPoint multiPoint, IStyle style, IViewport viewport,
             SymbolCache symbolCache)
         {
             // This method needs a test
@@ -120,7 +120,7 @@
             var group = new XamlMedia.GeometryGroup();
             foreach (var geometry in multiPoint)
             {
-                var point = (Point) geometry;
+                var point = (Point)geometry;
                 group.Children.Add(ConvertSymbol(point, style, viewport));
             }
             return group;
@@ -151,7 +151,7 @@
                 Fill = new XamlMedia.ImageBrush { ImageSource = bitmapImage },
                 IsHitTestVisible = false,
                 SnapsToDevicePixels = true
-
+
             };

             if (Utilities.DeveloperTools.DeveloperMode)
@@ -159,8 +159,8 @@
                 var color = (style as VectorStyle)?.Line.Color.ToXaml();
                 if (color.HasValue && color.Value.A > 0)
                 {
-                    path.Stroke = new XamlMedia.SolidColorBrush {Color = color.Value};
-                    path.StrokeThickness = ((VectorStyle) style).Line.Width;
+                    path.Stroke = new XamlMedia.SolidColorBrush { Color = color.Value };
+                    path.StrokeThickness = ((VectorStyle)style).Line.Width;
                 }
             }

@@ -179,7 +179,7 @@
                 Math.Round(dest.Bottom) - Math.Round(dest.Top));
             return dest;
         }
-
+
         public static void PositionRaster(UIElement renderedGeometry, BoundingBox boundingBox, IViewport viewport)
         {
             UpdateRenderTransform(renderedGeometry, viewport);
@@ -208,7 +208,7 @@
         public static void PositionGeometry(XamlShapes.Shape renderedGeometry, IViewport viewport)
         {
             CounterScaleLineWidth(renderedGeometry, viewport.Resolution);
-            var matrixTransform = new XamlMedia.MatrixTransform {Matrix = CreateTransformMatrix1(viewport)};
+            var matrixTransform = new XamlMedia.MatrixTransform { Matrix = CreateTransformMatrix1(viewport) };
             renderedGeometry.RenderTransform = matrixTransform;

             if (renderedGeometry.Fill != null)


InvalidCommand Execute way changed.

InvalidCommand Execute way changed.

--- Minesweeper-4/Engine/MinesweeperEngine.cs
+++ Minesweeper-4/Engine/MinesweeperEngine.cs
@@ -95,7 +95,9 @@

                 default:
                     currentCommand = new InvalidCommand(this.matrix, this.player, this.printer);
-                    break;
+                    currentCommand.Execute(commandInfo);
+                    this.Start();
+                    return;
             }

             currentCommand.Execute(commandInfo);


Updated link generation

Updated link generation

--- ModuleFilesGenerator/MarkDownGenerator.cs
+++ ModuleFilesGenerator/MarkDownGenerator.cs
@@ -233,7 +233,7 @@
                         docBuilder.Append($"# RELATED LINKS{Environment.NewLine}{Environment.NewLine}");
                         foreach (var link in cmdletInfo.RelatedLinks)
                         {
-                            docBuilder.Append($"[{link.Text}:]({link.Url})");
+                            docBuilder.Append($"[{link.Text}]({link.Url})");
                         }
                     }


Added tests for reading of values from MqFrame.

--- DtronixMessageQueue.Tests/FrameTests.cs
+++ DtronixMessageQueue.Tests/FrameTests.cs
@@ -17,7 +17,7 @@

 		[Fact]
 		public void Frame_creates_empty_frame() {
-			expected_bytes = new byte[] { 1 };
+			expected_bytes = new byte[] {1};
 			actual_frame = new MqFrame(null, MqFrameType.Empty);
 			actual_bytes = actual_frame.RawFrame();

@@ -31,7 +31,7 @@

 		[Fact]
 		public void Frame_empty_frame_accepts_empty_array() {
-			expected_bytes = new byte[] { 1 };
+			expected_bytes = new byte[] {1};
 			actual_frame = new MqFrame(new byte[] {}, MqFrameType.Empty);
 			actual_bytes = actual_frame.RawFrame();

@@ -40,7 +40,7 @@

 		[Fact]
 		public void Frame_creates_empty_last_frame() {
-			expected_bytes = new byte[] { 4 };
+			expected_bytes = new byte[] {4};
 			actual_frame = new MqFrame(null, MqFrameType.EmptyLast);
 			actual_bytes = actual_frame.RawFrame();

@@ -49,13 +49,13 @@

 		[Fact]
 		public void Frame_empty_last_frame_throws_on_bytes() {
-			Assert.Throws<ArgumentException>(() => new MqFrame(new byte[] { 1 }, MqFrameType.EmptyLast));
+			Assert.Throws<ArgumentException>(() => new MqFrame(new byte[] {1}, MqFrameType.EmptyLast));
 		}

 		[Fact]
 		public void Frame_creates_more_frame_bytes() {
-			expected_bytes = new byte[] { 2, 5, 0, 1, 2, 3, 4, 5 };
-			actual_frame = new MqFrame(new byte[] { 1, 2, 3, 4, 5 }, MqFrameType.More);
+			expected_bytes = new byte[] {2, 5, 0, 1, 2, 3, 4, 5};
+			actual_frame = new MqFrame(new byte[] {1, 2, 3, 4, 5}, MqFrameType.More);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -63,8 +63,8 @@

 		[Fact]
 		public void Frame_creates_last_frame_bytes() {
-			expected_bytes = new byte[] { 3, 5, 0, 1, 2, 3, 4, 5 };
-			actual_frame = new MqFrame(new byte[] { 1, 2, 3, 4, 5 }, MqFrameType.Last);
+			expected_bytes = new byte[] {3, 5, 0, 1, 2, 3, 4, 5};
+			actual_frame = new MqFrame(new byte[] {1, 2, 3, 4, 5}, MqFrameType.Last);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -74,7 +74,7 @@
 		public void Frame_writes_byte_array_full() {
 			expected_bytes = new byte[] {3, 5, 0, 1, 2, 3, 4, 241};
 			actual_frame = new MqFrame(new byte[5], MqFrameType.Last);
-			actual_frame.Write(0, new byte[] {1,2,3,4,241}, 0, 5);
+			actual_frame.Write(0, new byte[] {1, 2, 3, 4, 241}, 0, 5);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -82,9 +82,9 @@

 		[Fact]
 		public void Frame_writes_byte_array_offset() {
-			expected_bytes = new byte[] { 3, 3, 0, 3, 4, 241 };
+			expected_bytes = new byte[] {3, 3, 0, 3, 4, 241};
 			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
-			actual_frame.Write(0, new byte[] { 1, 2, 3, 4, 241 }, 2, 3);
+			actual_frame.Write(0, new byte[] {1, 2, 3, 4, 241}, 2, 3);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -92,9 +92,9 @@

 		[Fact]
 		public void Frame_writes_byte_array_offset_length() {
-			expected_bytes = new byte[] { 3, 2, 0, 3, 4 };
-			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(0, new byte[] { 1, 2, 3, 4, 241 }, 2, 2);
+			expected_bytes = new byte[] {3, 2, 0, 3, 4};
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(0, new byte[] {1, 2, 3, 4, 241}, 2, 2);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -102,17 +102,27 @@

 		[Fact]
 		public void Frame_writes_byte_array_offset_length_position() {
-			expected_bytes = new byte[] { 3, 3, 0, 0, 3, 4 };
+			expected_bytes = new byte[] {3, 3, 0, 0, 3, 4};
 			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
-			actual_frame.Write(1, new byte[] { 1, 2, 3, 4, 241 }, 2, 2);
-			actual_bytes = actual_frame.RawFrame();
+			actual_frame.Write(1, new byte[] {1, 2, 3, 4, 241}, 2, 2);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_byte_array() {
+			expected_bytes = new byte[] {1, 2, 3, 4, 5};
+			actual_frame = new MqFrame(expected_bytes, MqFrameType.Last);
+			actual_bytes = new byte[5];
+			actual_frame.Read(0, actual_bytes, 0, 5);

 			Assert.Equal(expected_bytes, actual_bytes);
 		}

 		[Fact]
 		public void Frame_writes_bool_true() {
-			expected_bytes = new byte[] { 3, 1, 0, 1 };
+			expected_bytes = new byte[] {3, 1, 0, 1};
 			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
 			actual_frame.Write(0, true);
 			actual_bytes = actual_frame.RawFrame();
@@ -122,7 +132,7 @@

 		[Fact]
 		public void Frame_writes_bool_false() {
-			expected_bytes = new byte[] { 3, 2, 0, 0, 0 };
+			expected_bytes = new byte[] {3, 2, 0, 0, 0};
 			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
 			actual_frame.Write(0, false);
 			actual_bytes = actual_frame.RawFrame();
@@ -141,10 +151,18 @@
 		}

 		[Fact]
+		public void Frame_reads_bool() {
+			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
+			actual_frame.Write(0, true);
+
+			Assert.Equal(true, actual_frame.ReadBoolean(0));
+		}
+
+		[Fact]
 		public void Frame_writes_byte() {
-			expected_bytes = new byte[] { 3, 1, 0, 231 };
+			expected_bytes = new byte[] {3, 1, 0, 231};
 			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
-			actual_frame.Write(0, (byte)231);
+			actual_frame.Write(0, (byte) 231);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -152,9 +170,9 @@

 		[Fact]
 		public void Frame_writes_byte_position() {
-			expected_bytes = new byte[] { 3, 2, 0, 0, 231 };
-			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(1, (byte)231);
+			expected_bytes = new byte[] {3, 2, 0, 0, 231};
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(1, (byte) 231);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -162,9 +180,9 @@

 		[Fact]
 		public void Frame_writes_short_positive() {
-			expected_bytes = new byte[] { 3, 2, 0, 93, 94};
-			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(0, (short)24157);
+			expected_bytes = new byte[] {3, 2, 0, 93, 94};
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(0, (short) 24157);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -172,9 +190,9 @@

 		[Fact]
 		public void Frame_writes_short_negative() {
-			expected_bytes = new byte[] { 3, 2, 0, 163, 161 };
-			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(0, (short)-24157);
+			expected_bytes = new byte[] {3, 2, 0, 163, 161};
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(0, (short) -24157);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -182,19 +200,38 @@

 		[Fact]
 		public void Frame_writes_short_position() {
-			expected_bytes = new byte[] { 3, 3, 0, 0, 93, 94 };
+			expected_bytes = new byte[] {3, 3, 0, 0, 93, 94};
 			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
-			actual_frame.Write(1, (short)24157);
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			actual_frame.Write(1, (short) 24157);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+
+		[Fact]
+		public void Frame_reads_short() {
+			var value = (short) 24157;
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadInt16(0));
+		}
+
+		[Fact]
+		public void Frame_reads_short_position() {
+			var value = (short)24157;
+			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadInt16(1));
 		}

 		[Fact]
 		public void Frame_writes_ushort() {
 			expected_bytes = new byte[] {3, 2, 0, 191, 215};
 			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(0, (ushort)55231);
+			actual_frame.Write(0, (ushort) 55231);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -202,19 +239,38 @@

 		[Fact]
 		public void Frame_writes_ushort_position() {
-			expected_bytes = new byte[] { 3, 3, 0, 0, 191, 215 };
+			expected_bytes = new byte[] {3, 3, 0, 0, 191, 215};
 			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
-			actual_frame.Write(1, (ushort)55231);
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
-		}
+			actual_frame.Write(1, (ushort) 55231);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_ushort() {
+			var value = (ushort)55231;
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt16(0));
+		}
+
+		[Fact]
+		public void Frame_reads_ushort_position() {
+			var value = (ushort)55231;
+			actual_frame = new MqFrame(new byte[3], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt16(1));
+		}
+

 		[Fact]
 		public void Frame_writes_int_positive() {
-			expected_bytes = new byte[] { 3, 4, 0, 210, 2, 150, 73 };
-			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
-			actual_frame.Write(0, (int)1234567890);
+			expected_bytes = new byte[] {3, 4, 0, 210, 2, 150, 73};
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, (int) 1234567890);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -222,9 +278,9 @@

 		[Fact]
 		public void Frame_writes_int_negative() {
-			expected_bytes = new byte[] { 3, 4, 0, 46, 253, 105, 182 };
-			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
-			actual_frame.Write(0, (int)-1234567890);
+			expected_bytes = new byte[] {3, 4, 0, 46, 253, 105, 182};
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, (int) -1234567890);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -232,19 +288,37 @@

 		[Fact]
 		public void Frame_writes_int_position() {
-			expected_bytes = new byte[] { 3, 5, 0, 0, 210, 2, 150, 73 };
+			expected_bytes = new byte[] {3, 5, 0, 0, 210, 2, 150, 73};
 			actual_frame = new MqFrame(new byte[5], MqFrameType.Last);
-			actual_frame.Write(1, (int)1234567890);
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			actual_frame.Write(1, (int) 1234567890);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_int() {
+			var value = (int)1234567890;
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadInt32(0));
+		}
+
+		[Fact]
+		public void Frame_reads_int_position() {
+			var value = (int)1234567890;
+			actual_frame = new MqFrame(new byte[5], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadInt32(1));
 		}

 		[Fact]
 		public void Frame_writes_uint() {
 			expected_bytes = new byte[] {3, 4, 0, 167, 251, 4, 253};
 			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
-			actual_frame.Write(0, (uint)4244962215);
+			actual_frame.Write(0, (uint) 4244962215);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -253,12 +327,30 @@

 		[Fact]
 		public void Frame_writes_uint_position() {
-			expected_bytes = new byte[] { 3, 4, 0, 167, 251, 4, 253 };
-			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
-			actual_frame.Write(0, (uint)4244962215);
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			expected_bytes = new byte[] {3, 4, 0, 167, 251, 4, 253};
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, (uint) 4244962215);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_uint() {
+			var value = (uint)4244962215;
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt32(0));
+		}
+
+		[Fact]
+		public void Frame_reads_uint_position() {
+			var value = (uint)4244962215;
+			actual_frame = new MqFrame(new byte[5], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt32(1));
 		}

@@ -266,7 +358,7 @@
 		public void Frame_writes_long_positive() {
 			expected_bytes = new byte[] {3, 8, 0, 178, 125, 244, 181, 59, 233, 33, 17};
 			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
-			actual_frame.Write(0, (long)1234524215541267890);
+			actual_frame.Write(0, (long) 1234524215541267890);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -276,7 +368,7 @@
 		public void Frame_writes_long_negative() {
 			expected_bytes = new byte[] {3, 8, 0, 78, 130, 11, 74, 196, 22, 222, 238};
 			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
-			actual_frame.Write(0, (long)-1234524215541267890);
+			actual_frame.Write(0, (long) -1234524215541267890);
 			actual_bytes = actual_frame.RawFrame();

 			Assert.Equal(expected_bytes, actual_bytes);
@@ -284,19 +376,37 @@

 		[Fact]
 		public void Frame_writes_long_position() {
-			expected_bytes = new byte[] { 3, 9, 0, 0, 178, 125, 244, 181, 59, 233, 33, 17 };
+			expected_bytes = new byte[] {3, 9, 0, 0, 178, 125, 244, 181, 59, 233, 33, 17};
 			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
-			actual_frame.Write(1, (long)1234524215541267890);
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			actual_frame.Write(1, (long) 1234524215541267890);
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_long() {
+			var value = (long)4244962215;
+			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadInt64(0));
+		}
+
+		[Fact]
+		public void Frame_reads_long_position() {
+			var value = (long)4244962215;
+			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadInt64(1));
 		}

 		[Fact]
 		public void Frame_writes_ulong() {
-			expected_bytes = new byte[] { 3, 8, 0, 63, 244, 163, 154, 134, 47, 214, 251 };
+			expected_bytes = new byte[] {3, 8, 0, 63, 244, 163, 154, 134, 47, 214, 251};
 			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
-			actual_frame.Write(0, (ulong)18146744003702551615);
+			actual_frame.Write(0, (ulong) 18146744003702551615);

 			actual_bytes = actual_frame.RawFrame();

@@ -305,40 +415,37 @@

 		[Fact]
 		public void Frame_writes_ulong_position() {
-			expected_bytes = new byte[] { 3, 9, 0, 0, 63, 244, 163, 154, 134, 47, 214, 251 };
+			expected_bytes = new byte[] {3, 9, 0, 0, 63, 244, 163, 154, 134, 47, 214, 251};
 			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
-			actual_frame.Write(1, (ulong)18146744003702551615);
-
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
-		}
-
-		[Fact]
-		public void Frame_writes_double() {
-			expected_bytes = new byte[] {3, 8, 0, 119, 219, 133, 230, 214, 28, 200, 64};
+			actual_frame.Write(1, (ulong) 18146744003702551615);
+
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_ulong() {
+			var value = (ulong)18146744003702551615;
 			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
-			actual_frame.Write(0, (double)12345.67891);
-
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
-		}
-
-		[Fact]
-		public void Frame_writes_double_position() {
-			expected_bytes = new byte[] {3, 9, 0, 0, 119, 219, 133, 230, 214, 28, 200, 64};
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt64(0));
+		}
+
+		[Fact]
+		public void Frame_reads_ulong_position() {
+			var value = (ulong)18146744003702551615;
 			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
-			actual_frame.Write(1, (double)12345.67891);
-
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
-		}
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadUInt64(1));
+		}
+

 		[Fact]
 		public void Frame_writes_float() {
-			expected_bytes = new byte[] {3, 4, 0, 121, 233, 246, 66};
+			expected_bytes = new byte[] { 3, 4, 0, 121, 233, 246, 66 };
 			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
 			actual_frame.Write(0, (float)123.456);

@@ -359,10 +466,69 @@
 		}

 		[Fact]
+		public void Frame_reads_float() {
+			var value = (float)123.456;
+			actual_frame = new MqFrame(new byte[4], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadSingle(0));
+		}
+
+		[Fact]
+		public void Frame_reads_float_position() {
+			var value = (float)123.456;
+			actual_frame = new MqFrame(new byte[5], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadSingle(1));
+		}
+
+		[Fact]
+		public void Frame_writes_double() {
+			expected_bytes = new byte[] {3, 8, 0, 119, 219, 133, 230, 214, 28, 200, 64};
+			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
+			actual_frame.Write(0, (double) 12345.67891);
+
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_writes_double_position() {
+			expected_bytes = new byte[] {3, 9, 0, 0, 119, 219, 133, 230, 214, 28, 200, 64};
+			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
+			actual_frame.Write(1, (double) 12345.67891);
+
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_double() {
+			var value = (double)12345.67891;
+			actual_frame = new MqFrame(new byte[8], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadDouble(0));
+		}
+
+		[Fact]
+		public void Frame_reads_double_position() {
+			var value = (double)12345.67891;
+			actual_frame = new MqFrame(new byte[9], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadDouble(1));
+		}
+
+
+		[Fact]
 		public void Frame_writes_decimal() {
 			expected_bytes = new byte[] {3, 16, 0, 160, 107, 84, 143, 156, 7, 157, 126, 0, 0, 0, 0, 0, 0, 0, 0};
 			actual_frame = new MqFrame(new byte[16], MqFrameType.Last);
-			actual_frame.Write(0, (decimal)9123456789123456789.9123456789123456789);
+			actual_frame.Write(0, (decimal) 9123456789123456789.9123456789123456789);

 			actual_bytes = actual_frame.RawFrame();

@@ -371,18 +537,36 @@

 		[Fact]
 		public void Frame_writes_decimal_position() {
-			expected_bytes = new byte[] { 3, 17, 0, 0, 160, 107, 84, 143, 156, 7, 157, 126, 0, 0, 0, 0, 0, 0, 0, 0 };
+			expected_bytes = new byte[] {3, 17, 0, 0, 160, 107, 84, 143, 156, 7, 157, 126, 0, 0, 0, 0, 0, 0, 0, 0};
 			actual_frame = new MqFrame(new byte[17], MqFrameType.Last);
-			actual_frame.Write(1, (decimal)9123456789123456789.9123456789123456789);
-
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			actual_frame.Write(1, (decimal) 9123456789123456789.9123456789123456789);
+
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_decimal() {
+			var value = (decimal)9123456789123456789.9123456789123456789;
+			actual_frame = new MqFrame(new byte[16], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadDecimal(0));
+		}
+
+		[Fact]
+		public void Frame_reads_decimal_position() {
+			var value = (decimal)9123456789123456789.9123456789123456789;
+			actual_frame = new MqFrame(new byte[17], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadDecimal(1));
 		}

 		[Fact]
 		public void Frame_writes_sbyte_positive() {
-			expected_bytes = new byte[] { 3, 1, 0, 101 };
+			expected_bytes = new byte[] {3, 1, 0, 101};
 			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
 			actual_frame.Write(0, (sbyte) 101);

@@ -393,9 +577,9 @@

 		[Fact]
 		public void Frame_writes_sbyte_negative() {
-			expected_bytes = new byte[] { 3, 1, 0, 155 };
+			expected_bytes = new byte[] {3, 1, 0, 155};
 			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
-			actual_frame.Write(0, (sbyte)-101);
+			actual_frame.Write(0, (sbyte) -101);

 			actual_bytes = actual_frame.RawFrame();

@@ -404,13 +588,31 @@

 		[Fact]
 		public void Frame_writes_sbyte_position() {
-			expected_bytes = new byte[] { 3, 2, 0, 0, 101 };
-			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
-			actual_frame.Write(1, (sbyte)101);
-
-			actual_bytes = actual_frame.RawFrame();
-
-			Assert.Equal(expected_bytes, actual_bytes);
+			expected_bytes = new byte[] {3, 2, 0, 0, 101};
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(1, (sbyte) 101);
+
+			actual_bytes = actual_frame.RawFrame();
+
+			Assert.Equal(expected_bytes, actual_bytes);
+		}
+
+		[Fact]
+		public void Frame_reads_sbyte() {
+			var value = (sbyte)101;
+			actual_frame = new MqFrame(new byte[1], MqFrameType.Last);
+			actual_frame.Write(0, value);
+
+			Assert.Equal(value, actual_frame.ReadSByte(0));
+		}
+
+		[Fact]
+		public void Frame_reads_sbyte_position() {
+			var value = (sbyte)101;
+			actual_frame = new MqFrame(new byte[2], MqFrameType.Last);
+			actual_frame.Write(1, value);
+
+			Assert.Equal(value, actual_frame.ReadSByte(1));
 		}
 	}
 }


Completed left and bottom

Completed left and bottom

--- EasyLayout.Droid.Sample/MainActivity.cs
+++ EasyLayout.Droid.Sample/MainActivity.cs
@@ -12,6 +12,8 @@
         private TextView _center;
         private TextView _top;
         private TextView _right;
+        private TextView _left;
+        private TextView _bottom;

         protected override void OnCreate(Bundle bundle)
         {
@@ -28,6 +30,8 @@
             _center = _relativeLayout.AddTextView(this, "this.GetCenter() == \nrelativeLayout.GetCenter()", Colors.DarkGrey, Colors.White);
             _top = _relativeLayout.AddTextView(this, "this.Bottom == \n_center.Top - 20", Colors.Yellow, Colors.Black);
             _right = _relativeLayout.AddTextView(this, "this.Left == \n_center.Right + 20", Colors.Orange, Colors.White);
+            _left = _relativeLayout.AddTextView(this, "this.Right == \n_center.Left - 20", Colors.Blue, Colors.White);
+            _bottom = _relativeLayout.AddTextView(this, "this.Top == \n_center.Bottom + 20", Colors.Purple, Colors.White);
         }

         private void ConstrainLayout()
@@ -41,7 +45,15 @@

                 _right.Left == _center.Right + 20 &&
                 _right.Top == _center.Top &&
-                _right.Bottom == _center.Bottom
+                _right.Bottom == _center.Bottom &&
+
+                _left.Right == _center.Left - 20 &&
+                _left.Top == _center.Top &&
+                _left.Bottom == _center.Bottom &&
+
+                _bottom.Left == _center.Left &&
+                _bottom.Right == _center.Right &&
+                _bottom.Top == _center.Bottom + 20

                 );
         }


Bump up the log level of both of those messages. Even in terse mode, a summary if update count is good.

--- NuKeeper/Engine/PackageUpdateSelection.cs
+++ NuKeeper/Engine/PackageUpdateSelection.cs
@@ -40,11 +40,11 @@
                 .Take(_maxPullRequests)
                 .ToList();

-            _logger.Info($"Selection of package updates: {unfiltered.Count} potential, filtered to {filtered.Count} and capped at {capped.Count}");
+            _logger.Terse($"Selection of package updates: {unfiltered.Count} potential, filtered to {filtered.Count} and capped at {capped.Count}");

             foreach (var updateSet in capped)
             {
-                _logger.Verbose($"Selected package update of {updateSet.PackageId} to {updateSet.NewVersion}");
+                _logger.Info($"Selected package update of {updateSet.PackageId} to {updateSet.NewVersion}");
             }

             return capped;


removed some warnings

removed some warnings

--- EditorProject/Assets/ThreeDMapScript.cs
+++ EditorProject/Assets/ThreeDMapScript.cs
@@ -63,7 +63,6 @@
         var imageMetadataCoroutine = new EditorCoroutine("Image Metadata Loader", mdUrl, MapImageMetadataLoadingDone);
         _coRoutines.Add(imageMetadataCoroutine);

-        //WhenDone("Image Data Loading", AllImageDataLoaded, imageCoroutine, imageMetadataCoroutine);
         WhenDone("All Loading", LoadingComplete, imageCoroutine, imageMetadataCoroutine, geomCoroutine);

         RecreateMapContainer();
@@ -89,68 +88,6 @@
         EditorUtility.DisplayProgressBar("Done", "", 100.0f);
         EditorUtility.ClearProgressBar();
         EditorApplication.update -= EditorUpdate;
-    }
-
-    private void AllImageDataLoaded(object obj)
-    {
-        var bbox = _tileMetadata.resourceSets[0].resources[0].bbox;
-
-        var bMinLat = bbox[0];
-        var bMinLon = bbox[1];
-        var bMaxLat = bbox[2];
-        var bMaxLon = bbox[3];
-
-        // compare these values;
-        var givenCentreLat = _tileMetadata.resourceSets[0].resources[0].mapCenter.coordinates[0];
-        var givenCentreLon = _tileMetadata.resourceSets[0].resources[0].mapCenter.coordinates[1];
-
-        var bCentreLat = bMinLat + (bMaxLat - bMinLat) * 0.5f;
-        var bCentreLon = bMinLon + (bMaxLon - bMinLon) * 0.5f;
-
-        var centreLat = minLat + (maxLat - minLat) * 0.5f;
-        var centreLon = minLon + (maxLon - minLon) * 0.5f;
-
-        // The centres seem to be the same so work from that principle for a bit..
-        var w = int.Parse(_tileMetadata.resourceSets[0].resources[0].imageWidth);
-        var h = int.Parse(_tileMetadata.resourceSets[0].resources[0].imageHeight);
-
-        // distL and distR should be equivalent
-        var distL = minLat - bMinLat;
-        var distR = bMaxLat - minLat;
-
-        var innerWidth = maxLon - minLon;
-        var outerWidth = bMaxLon - bMinLon;
-
-        float propX = innerWidth / outerWidth;
-
-        var newW = (int)Math.Round(w * propX, MidpointRounding.AwayFromZero);
-
-        var innerHeight = maxLat - minLat;
-        var outerHeight = bMaxLat - bMinLat;
-
-        float propY = innerHeight / outerHeight;
-        var newH = (int)Math.Round(h * propY, MidpointRounding.AwayFromZero);
-
-        var ar = newW / (float)newH;
-
-        float propLon = (bMaxLon - bMinLon) / (maxLon - minLon);
-        float propLat = (bMaxLat - bMinLat) / (maxLat - minLat);
-
-        w = 377;
-        h = 812;
-
-        var prop = propLat < propLon ? propLat : propLon;
-        if (propLat < propLon)
-        {
-            newW = (int)(prop * h / 2.0f);
-        }
-        else
-        {
-            newW = (int)(prop * w / 2.0f);
-        }
-
-        // Don't want to call this until all  of the data is loaded..
-        CreateProjector(_satelliteTexture, newW, _tilePlane);
     }

     /// <summary>
@@ -446,7 +383,7 @@
                     g.transform.parent = geomContainer.transform;
                 }
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 Debug.Log(string.Format("Building load failed"));
             }
@@ -496,7 +433,6 @@
                 ret = new Bounds(latLons.First(), Vector3.zero);
             foreach (var latLon in latLons)
             {
-                var toset = latLon;
                 var bnds = ret.Value;
                 bnds.Encapsulate(latLon);
                 ret = bnds;


Fix unit test

Fix unit test

--- Espera/Espera.Core.Tests/LibraryTest.cs
+++ Espera/Espera.Core.Tests/LibraryTest.cs
@@ -993,7 +993,10 @@
                 libraryReader.ReadPlaylists().Returns(new List<Playlist>());
                 libraryReader.ReadSongs().Returns(new[] { missingSong });

-                using (Library library = Helpers.CreateLibrary(libraryReader))
+                var fileSystem = new MockFileSystem();
+                fileSystem.Directory.CreateDirectory("C://");
+
+                using (Library library = Helpers.CreateLibrary(libraryReader, fileSystem))
                 {
                     await library.AwaitInitializationAndUpdate();


Made `FpsCounter` more C#6.0-ish.

Made `FpsCounter` more C#6.0-ish.

--- Evbpc.Framework/Utilities/FpsCounter.cs
+++ Evbpc.Framework/Utilities/FpsCounter.cs
@@ -11,17 +11,16 @@
     public class FpsCounter
     {
         private List<DateTime> _frames;
-        private TimeSpan _expirationTime = new TimeSpan(1, 0, 0);

         ///
         /// Gets the amount of time after which a frame would expire.
         ///
-        public TimeSpan ExpirationTime { get { return _expirationTime; } }
+        public TimeSpan ExpirationTime { get; } = new TimeSpan(1, 0, 0);

         ///
         /// Returns the list of Frames that are stored within the <see cref="FpsCounter"/>.
         ///
-        public IEnumerable<DateTime> Frames { get { return _frames.ToArray(); /* prevent the internal `List<DateTime>` from being modified by the outside */ } }
+        public IEnumerable<DateTime> Frames => _frames.ToArray(); /* prevent the internal `List<DateTime>` from being modified by the outside */

         ///
         /// Creates a new instance of the <see cref="FpsCounter"/>.
@@ -38,7 +37,7 @@
         public FpsCounter(TimeSpan expirationTime)
             : this()
         {
-            _expirationTime = expirationTime;
+            ExpirationTime = expirationTime;
         }

         ///
@@ -50,7 +49,7 @@

             for (int i = 0; i < _frames.Count; i++)
             {
-                if (_frames[i] - DateTime.UtcNow > _expirationTime)
+                if (_frames[i] - DateTime.UtcNow > ExpirationTime)
                     _frames.RemoveAt(i);
                 else
                     break;
@@ -74,30 +73,21 @@
         ///
         /// <param name="previousSeconds">The number of seconds previous to now that should be measured.</param>
         /// <returns>The average FPS for the time interval.</returns>
-        public int LastSeconds(int previousSeconds = 1)
-        {
-            return LastTimeSpan(new TimeSpan(0, 0, previousSeconds));
-        }
+        public int LastSeconds(int previousSeconds = 1) => LastTimeSpan(new TimeSpan(0, 0, previousSeconds));

         ///
         /// Gets the average FPS over the last specified number of minutes.
         ///
         /// <param name="previousMinutes">The number of minutes before now that should be included.</param>
         /// <returns>The average FPS for the time interval.</returns>
-        public int LastMinutes(int previousMinutes = 1)
-        {
-            return LastTimeSpan(new TimeSpan(0, previousMinutes, 0));
-        }
+        public int LastMinutes(int previousMinutes = 1) => LastTimeSpan(new TimeSpan(0, previousMinutes, 0));

         ///
         /// Gets the average FPS over the last specified number of hours.
         ///
         /// <param name="previousHours">The number of hours before now that should be included.</param>
         /// <returns>The average FPS for the time interval.</returns>
-        public int LastHours(int previousHours = 1)
-        {
-            return LastTimeSpan(new TimeSpan(previousHours, 0, 0));
-        }
+        public int LastHours(int previousHours = 1) => LastTimeSpan(new TimeSpan(previousHours, 0, 0));

         ///
         /// Gets the average FPS over the last specified TimeSpan.


Tweaked PurgeExpiredSessions

Tweaked PurgeExpiredSessions

--- OpenIIoT.Core/Security/SecurityManager.cs
+++ OpenIIoT.Core/Security/SecurityManager.cs
@@ -45,7 +45,6 @@
 using System.Security.Claims;
 using System.Threading;
 using System.Threading.Tasks;
-using System.Timers;
 using NLog.xLogger;
 using OpenIIoT.Core.Common;
 using OpenIIoT.SDK;
@@ -788,7 +787,7 @@

             foreach (Session session in sessions)
             {
-                if (session.Ticket.Properties.ExpiresUtc < DateTime.UtcNow)
+                if (session.IsExpired)
                 {
                     EndSession(session);
                 }


Try to fix "NSInternalInconsistencyException" crash.


API working

API working


To avoid viewers (particularly on the Hypergrid) from permanently caching a UUID -> "Unknown User" binding, drop the binding request rather than replying with "Unknown User"

By not binding UUID -> "Unknown User", we leave open the possibility that the binding may be correctly resolved at a later time, which can still happen in some Hypergrid situations.
Observed behaviour of LL viewer 3.3.4 is that a dropped bind request is not retried until the next session.

--- OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -178,17 +178,20 @@
                 m_ServiceThrottle.Enqueue("name", uuid.ToString(),  delegate
                 {
                     //m_log.DebugFormat("[YYY]: Name request {0}", uuid);
-                    bool foundRealName = TryGetUserNames(uuid, names);
-
-                    if (names.Length == 2)
-                    {
-                        if (!foundRealName)
-                            m_log.DebugFormat("[USER MANAGEMENT MODULE]: Sending {0} {1} for {2} to {3} since no bound name found", names[0], names[1], uuid, client.Name);
-
+
+                    // As least upto September 2013, clients permanently cache UUID -> Name bindings.  Some clients
+                    // appear to clear this when the user asks it to clear the cache, but others may not.
+                    //
+                    // So to avoid clients
+                    // (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will
+                    // instead drop the request entirely.
+                    if (TryGetUserNames(uuid, names))
                         client.SendNameReply(uuid, names[0], names[1]);
-                    }
+//                    else
+//                        m_log.DebugFormat(
+//                            "[USER MANAGEMENT MODULE]: No bound name for {0} found, ignoring request from {1}",
+//                            uuid, client.Name);
                 });
-
             }
         }

@@ -391,7 +394,7 @@
                 }

                 names[0] = "Unknown";
-                names[1] = "UserUMMTGUN8";
+                names[1] = "UserUMMTGUN9";

                 return false;
             }
@@ -539,7 +542,7 @@
             AddUser(uuid, homeURL + ";" + first + " " + last);
         }

-        public void AddUser (UUID id, string creatorData)
+        public void AddUser(UUID id, string creatorData)
         {
             //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);

@@ -549,24 +552,24 @@

             if (oldUser != null)
             {
-                if (creatorData == null || creatorData == String.Empty)
-                {
-                    //ignore updates without creator data
-                    return;
-                }
-
-                //try update unknown users, but don't update anyone else
-                if (oldUser.FirstName == "Unknown" && !creatorData.Contains("Unknown"))
-                {
-                    lock (m_UserCache)
-                        m_UserCache.Remove(id);
-                    m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData, oldUser.HomeURL);
-                }
-                else
-                {
+//                if (creatorData == null || creatorData == String.Empty)
+//                {
+//                    //ignore updates without creator data
+//                    return;
+//                }
+//
+//                //try update unknown users, but don't update anyone else
+//                if (oldUser.FirstName == "Unknown" && !creatorData.Contains("Unknown"))
+//                {
+//                    lock (m_UserCache)
+//                        m_UserCache.Remove(id);
+//                    m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData, oldUser.HomeURL);
+//                }
+//                else
+//                {
                     //we have already a valid user within the cache
                     return;
-                }
+//                }
             }

             UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id);
@@ -602,15 +605,19 @@
                     if (parts.Length >= 2)
                         user.FirstName = parts[1].Replace(' ', '.');
                 }
-                else
-                {
-                    // Temporarily add unknown user entries of this type into the cache so that we can distinguish
-                    // this source from other recent (hopefully resolved) bugs that fail to retrieve a user name binding
-                    // TODO: Can be removed when GUN* unknown users have definitely dropped significantly or
-                    // disappeared.
-                    user.FirstName = "Unknown";
-                    user.LastName = "UserUMMAU4";
-                }
+
+                // To avoid issues with clients, particularly Hypergrid ones, permanently caching
+                // UUID -> "Unknown User" name bindings, elsewhere we will drop such requests rather than replying.
+                // This also means that we cannot add an unknown user binding to the cache here.
+//                else
+//                {
+//                    // Temporarily add unknown user entries of this type into the cache so that we can distinguish
+//                    // this source from other recent (hopefully resolved) bugs that fail to retrieve a user name binding
+//                    // TODO: Can be removed when GUN* unknown users have definitely dropped significantly or
+//                    // disappeared.
+//                    user.FirstName = "Unknown";
+//                    user.LastName = "UserUMMAU4";
+//                }

                 AddUserInternal(user);
             }


refs #14 Use a mock class for Person model

--- Application/MatchGeneratorTest/ViewModel/MemberListItemViewModelTest.cs
+++ Application/MatchGeneratorTest/ViewModel/MemberListItemViewModelTest.cs
@@ -2,7 +2,9 @@
 using System.Reflection;
 using Xunit;
 using MatchGenerator.Core;
+using MatchGenerator.Model;
 using MatchGenerator.ViewModel;
+using MatchGeneratorTest.Model;

 namespace MatchGeneratorTest.ViewModel
 {
@@ -14,8 +16,8 @@
 		public void ConstructorTest()
 		{
 			// Arrange
-			Person inputModel = new Person();
-			Person expectedModel = inputModel;
+			IPerson inputModel = new PersonMock();
+			IPerson expectedModel = inputModel;

 			// Act
 			MemberListItemViewModel actualReturn = new MemberListItemViewModel(inputModel);
@@ -29,11 +31,11 @@
 	public class MemberListItemViewModelInstanceTest
 	{
 		private MemberListItemViewModel Instance;
-		private Person ModelField;
+		private IPerson ModelField;

 		public MemberListItemViewModelInstanceTest()
 		{
-			ModelField = new Person(new string[] { "foo", "bar", "M", "0", "foobar" });
+			ModelField = new PersonMock();
 			Instance = new MemberListItemViewModel(ModelField);
 			Instance.SetPrivateField("Model", ModelField);
 		}
@@ -44,13 +46,17 @@
 		public void NameTest()
 		{
 			// Arrange
-			string expectedName = ModelField.Name;
+			string expectedName = "foobar";
+			((PersonMock)ModelField).NameFunc = () => "foobar";

 			// Act
 			string actualName = Instance.Name;

 			// Assert
+			// 戻り値
 			Assert.Equal(expectedName, actualName);
+			// 内部でメソッドが呼ばれた回数
+			Assert.Equal(1, ((PersonMock)ModelField).NameCount);
 		}

 		[Fact(DisplayName = "Descriptionプロパティ : 正常系")]
@@ -59,13 +65,17 @@
 		public void DescriptionTest()
 		{
 			// Arrange
-			string expectedDescription = ModelField.Description;
+			string expectedDescription = "foobar";
+			((PersonMock)ModelField).DescriptionFunc = () => "foobar";

 			// Act
 			string actualDescription = Instance.Description;

 			// Assert
+			// 戻り値
 			Assert.Equal(expectedDescription, actualDescription);
+			// 内部でメソッドが呼ばれた回数
+			Assert.Equal(1, ((PersonMock)ModelField).DescriptionCount);
 		}
 	}
 }


Mark obsolete

Mark obsolete

--- Assets/MixedRealityToolkit/Definitions/Utilities/ArticulatedHandPose.cs
+++ Assets/MixedRealityToolkit/Definitions/Utilities/ArticulatedHandPose.cs
@@ -201,11 +201,13 @@
             OpenSteadyGrabPoint,
         }

+        [Obsolete("Use SimulatedArticulatedHandPoses class or other custom class")]
         private static readonly Dictionary<GestureId, ArticulatedHandPose> handPoses = new Dictionary<GestureId, ArticulatedHandPose>();

         /// <summary>
         /// Get pose data for a supported gesture.
         /// </summary>
+        [Obsolete("Use SimulatedArticulatedHandPoses.GetGesturePose() or other custom class")]
         public static ArticulatedHandPose GetGesturePose(GestureId gesture)
         {
             if (handPoses.TryGetValue(gesture, out ArticulatedHandPose pose))
@@ -216,9 +218,11 @@
         }

         #if UNITY_EDITOR
+
         /// <summary>
         /// Load pose data from files.
         /// </summary>
+        [Obsolete("Use SimulatedArticulatedHandPoses or other custom class")]
         public static void LoadGesturePoses()
         {
             string[] gestureNames = Enum.GetNames(typeof(GestureId));
@@ -231,6 +235,7 @@
             }
         }

+        [Obsolete("Use SimulatedArticulatedHandPoses class or other custom class")]
         private static ArticulatedHandPose LoadGesturePose(GestureId gesture, string filePath)
         {
             if (!string.IsNullOrEmpty(filePath))
@@ -243,6 +248,7 @@
             return null;
         }

+        [Obsolete("Use SimulatedArticulatedHandPoses class or other custom class")]
         public static void ResetGesturePoses()
         {
             handPoses.Clear();


Optimize reporting of property constraint

--- RDFSharp/Model/Validation/Abstractions/Constraints/RDFPropertyConstraint.cs
+++ RDFSharp/Model/Validation/Abstractions/Constraints/RDFPropertyConstraint.cs
@@ -65,14 +65,7 @@
                                          validationContext.ValueNodes));

             //Report property constraint shape evidences
-            foreach (RDFValidationResult propertyshapeResult in propertyshapeReport)
-                report.AddResult(new RDFValidationResult(propertyshapeResult.SourceShape,
-                                                         propertyshapeResult.SourceConstraintComponent,
-                                                         propertyshapeResult.FocusNode,
-                                                         propertyshapeResult.ResultPath,
-                                                         propertyshapeResult.ResultValue,
-                                                         propertyshapeResult.ResultMessages,
-                                                         propertyshapeResult.Severity));
+            report.MergeResults(propertyshapeReport);
             #endregion

             return report;


Passwords could be revealed in console by pressing backspace.

Pressing backspace causes hidden input (such as passwords) to be revealed on the console. The echo state was not being taken into account when handling a backspace key press.

--- OpenSim/Framework/Console/LocalConsole.cs
+++ OpenSim/Framework/Console/LocalConsole.cs
@@ -417,7 +417,10 @@
                         SetCursorLeft(0);
                         y = SetCursorTop(y);

-                        System.Console.Write("{0}{1} ", prompt, cmdline);
+                        if (echo)
+                            System.Console.Write("{0}{1} ", prompt, cmdline);
+                        else
+                            System.Console.Write("{0}", prompt);

                         break;
                     case ConsoleKey.End:


move animation sample to just use the navigator

--- Samples/Mapsui.Samples.Forms/Mapsui.Samples.Forms.Shared/AnimationSample.cs
+++ Samples/Mapsui.Samples.Forms/Mapsui.Samples.Forms.Shared/AnimationSample.cs
@@ -18,7 +18,7 @@
             var mapView = sender as MapView;
             var e = args as MapClickedEventArgs;

-            var navigator = (AnimatedNavigator)mapView.Navigator;
+            var navigator = mapView.Navigator;

             var newRot = random.NextDouble() * 360.0;

@@ -33,7 +33,6 @@
             var mapView = mapControl as MapView;

             mapControl.Map = OsmSample.CreateMap();
-            mapView.Navigator = new AnimatedNavigator(mapView.Map, (IViewport)mapView.Viewport);
         }
     }
 }