replace by originial

replace by originial

--- src/Sanderling/Sanderling.Exe/sample/script/Travel.simple.cs
+++ src/Sanderling/Sanderling.Exe/sample/script/Travel.simple.cs
@@ -1,129 +1,33 @@
-//	This script mines ore from asteroids.
-//	before running this script, make sure to prepare as follows:
-//	+enter bookmark for mining site and bookmark for station in the configuration section below.
-//	+in the Overview create a preset which includes asteroids and rats and enter the name of that preset in the configuration section below at 'OverviewPreset'. The bot will make sure this preset is loaded when it needs to use the overview.
-//	+set Overview to sort by distance with the nearest entry at the top.
-//	+in the Inventory select the 'List' view.
-//	+set the UI language to english.
-//	+use a ship with an ore hold.
-//	+put some light drones into your ships' drone bay. The bot will make use of them to attack rats when HP are too low (configurable) or it gets jammed.
-//	+enable the info panel 'System info'. The bot will use the button in there to access bookmarks and asteroid belts.
-//	+arrange windows to not occlude modules or info panels.
-//	+in the ship UI, disable "Display Passive Modules" and disable "Display Empty Slots" and enable "Display Module Tooltips". The bot uses the module tooltips to automatically identify the properties of the modules.
-//
-//	for optional features (such as warp to safe on hostile in local) see the configuration section below.
+//	This is a warp to 0km auto-pilot, making your travels faster and thus safer by directly warping to gates/stations.

-using BotSharp.ToScript.Extension;
-using Parse = Sanderling.Parse;
+while(true)
+{
+	var Measurement = Sanderling?.MemoryMeasurementParsed?.Value;

-//	begin of configuration section ->
+	var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;

-//	The bot uses the bookmarks from the menu which is opened from the button in the 'System info' panel.
-
-//	Bookmarks of places to mine. Add additional bookmarks separated by comma.
-string[] SetMiningSiteBookmark = new[] {
-	"Asteroid Belts",
-	};
-
-//	Bookmark of location where ore should be unloaded.
-string UnloadBookmark = "home";
-
-//	Name of the container to unload to as shown in inventory.
-string UnloadDestContainerName = "Item Hangar";
-
-//	when this is set to true, the bot will try to unload when undocked.
-bool UnloadInSpace = false;
-
-//	Bookmark of place to retreat to to prevent ship loss.
-string RetreatBookmark = UnloadBookmark;
-
-//	The bot loads this preset to the active tab.
-string OverviewPreset = "b";
-
-var ActivateHardener = true; // activate shield hardener.
-
-//	bot will start fighting (and stop mining) when hitpoints are lower.
-var DefenseEnterHitpointThresholdPercent = 95;
-var DefenseExitHitpointThresholdPercent = 100;
-
-var EmergencyWarpOutHitpointPercent = 25;
-var EmergencyWarpOutHitpointPercentArmor = 60;
-
-var i =0;
-var te = 0;
-var FightAllRats = false;	//	when this is set to true, the bot will attack rats independent of shield hp.
-
-var EnterOffloadOreHoldFillPercent = 95;	//	percentage of ore hold fill level at which to enter the offload process.
-
-var RetreatOnNeutralOrHostileInLocal = false;   // warp to RetreatBookmark when a neutral or hostile is visible in local.
-
-//	<- end of configuration section
-
-
-Func<object> BotStopActivity = () => null;
-
-Func<object> NextActivity = MainStep;
-
-for(;;)
-{
-loopsa:
-	MemoryUpdate();
-
-
-	Host.Log(
-		"ore hold fill: " + OreHoldFillPercent + "%" +
-		", mining range: " + MiningRange +
-		", mining modules (inactive): " + SetModuleMiner?.Length + "(" + SetModuleMinerInactive?.Length + ")" +
-		", shield.hp: " + ShieldHpPercent + "%" +
-		", Armor.hp: " + ShieldApPercent + "%" +
-		", retreat: " + RetreatReason +
-		", JLA: " + JammedLastAge +
-		", overview.rats: " + ListRatOverviewEntry?.Length +
-		", overview.roids: " + ListAsteroidOverviewEntry?.Length +
-		", offload count: " + OffloadCount +
-		", nextAct: " + NextActivity?.Method?.Name);
-
-	CloseModalUIElement();
-
-	if(0 < RetreatReason?.Length && !(Measurement?.IsDocked ?? false))
-	{
-	DroneEnsureInBay();
-		InitiateDockToOrWarpToBookmark(RetreatBookmark);
-		continue;
-	}
-	loops1:
-	MemoryUpdate();
-	var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;
 	if(ShipManeuverTypeEnum.Warp == ManeuverType	||
 		ShipManeuverTypeEnum.Jump == ManeuverType)
-		{
-		Host.Log("Wait Finish");
-		Host.Delay(5000);
-		te =0;
-		goto loops1;
-		}
-
-
-
+		goto loop;	//	do nothing while warping or jumping.

 	//	from the set of route element markers in the Info Panel pick the one that represents the next Waypoint/System.
 	//	We assume this is the one which is nearest to the topleft corner of the Screen which is at (0,0)
-
-
-var RouteElementMarkerNext =
+	var RouteElementMarkerNext =
 		Measurement?.InfoPanelRoute?.RouteElementMarker
 		?.OrderByCenterDistanceToPoint(new Vektor2DInt(0, 0))?.FirstOrDefault();
-	if(null != RouteElementMarkerNext && te < 9)
+
+	if(null == RouteElementMarkerNext)
 	{
-
-		Undock();
-
+		Host.Log("no route found in info panel.");
+		goto loop;
+	}

 	//	rightclick the marker to open the contextmenu.
 	Sanderling.MouseClickRight(RouteElementMarkerNext);

 	//	retrieve a new measurement.
-
+	Measurement = Sanderling?.MemoryMeasurementParsed?.Value;
+
 	//	from the first menu, pick the first entry that contains "dock" or "jump".
 	var MenuEntry =
 		Measurement?.Menu?.FirstOrDefault()
@@ -132,967 +36,16 @@
 	if(null == MenuEntry)
 	{
 		Host.Log("no suitable menu entry found.");
-		te = te + 1;
-		Host.Delay(100);
-		goto loops1;
-
+		goto loop;
 	}
-      te=0;
+
 	Host.Log("menu entry found. clicking to initiate warp.");
 	Sanderling.MouseClickLeft(MenuEntry);

-
+loop:
 	//	wait for four seconds before repeating.
-	Host.Delay(1000);
-
+	Host.Delay(4000);
 	//	make sure new measurement will be taken.
-	Sanderling.InvalidateMeasurement();
-	goto loopsa;
-
-	}
-
-
-
-	NextActivity = NextActivity?.Invoke() as Func<object>;
-
-	if(BotStopActivity == NextActivity)
-		break;
-
-
-
-	if(null == NextActivity)
-		NextActivity = MainStep;
-
-	Host.Delay(1111);
-}
-
-//	seconds since ship was jammed.
-long? JammedLastAge => Jammed ? 0 : (Host.GetTimeContinuousMilli() - JammedLastTime) / 1000;
-
-int?	ShieldHpPercent => ShipUi?.HitpointsAndEnergy?.Shield / 10;
-
- int?ShieldApPercent =>ShipUi?.HitpointsAndEnergy?.Armor /10;
-bool	DefenseExit =>
-	(Measurement?.IsDocked ?? false) ||
-	!(0 < ListRatOverviewEntry?.Length)	||
-	(DefenseExitHitpointThresholdPercent < ShieldHpPercent && !(JammedLastAge < 40) &&
-	!(FightAllRats && 0 < ListRatOverviewEntry?.Length));
-
-bool	DefenseEnter =>
-	!DefenseExit	||
-	!(DefenseEnterHitpointThresholdPercent < ShieldHpPercent) || JammedLastAge < 10;
-
-bool	OreHoldFilledForOffload => Math.Max(0, Math.Min(100, EnterOffloadOreHoldFillPercent)) <= OreHoldFillPercent;
-
-Int64?	JammedLastTime = null;
-string RetreatReasonTemporary = null;
-string RetreatReasonPermanent = null;
-string RetreatReason => RetreatReasonPermanent ?? RetreatReasonTemporary;
-int? LastCheckOreHoldFillPercent = null;
-
-int OffloadCount = 0;
-
-Func<object>	Heal()
-{
-
-
-var inventoryActiveShip = WindowInventory?.ActiveShipEntry;
-
-
-ClickMenuEntryOnMenuRoot(inventoryActiveShip,@"get\s*repair\s*quote");
-Host.Delay(2000);
-
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(1000);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(1000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Log("repair finish");
-		NextActivity = MainStep;
-		RetreatReasonPermanent=null;
-return MainStep;
-}
-Func<object>	MainStep()
-{
-	if(Measurement?.IsDocked ?? false)
-	{
-		InInventoryUnloadItems();
-
-		if (0 < RetreatReasonPermanent?.Length)
-			return Heal;
-
-		if (0 < RetreatReason?.Length)
-			return MainStep;
-
-		Undock();
-	}
-
-	if(DefenseEnter)
-	{
-		Host.Log("enter defense.");
-		return DefenseStep;
-	}
-
-	EnsureOverviewTypeSelectionLoaded();
-
-	EnsureWindowInventoryOpenOreHold();
-
-	if(ReadyForManeuver)
-	{
-		DroneEnsureInBay();
-
-		if(OreHoldFilledForOffload)
-		{
-			if(ReadyForManeuver)
-				InitiateDockToOrWarpToBookmark(UnloadBookmark);
-
-			if (UnloadInSpace)
-			{
-				Host.Delay(4444);
-				InInventoryUnloadItems();
-			}
-
-			return MainStep;
-		}
-
-		if(!(0 < ListAsteroidOverviewEntry?.Length))
-			InitiateWarpToRandomMiningSite();
-	}
-
-	ModuleMeasureAllTooltip();
-
-	if(ActivateHardener)
-		ActivateHardenerExecute();
-
-	return InBeltMineStep;
-}
-
-int RandomInt() => new Random((int)Host.GetTimeContinuousMilli()).Next();
-
-T RandomElement<T>(IEnumerable<T> sequence)
-{
-	var array = (sequence as T[]) ?? sequence?.ToArray();
-
-	if (!(0 < array?.Length))
-		return default(T);
-
-	return array[RandomInt() % array.Length];
-}
-
-void CloseModalUIElement()
-{
-	var	ButtonClose =
-		ModalUIElement?.ButtonText?.FirstOrDefault(button => (button?.Text).RegexMatchSuccessIgnoreCase("close|no|ok"));
-
-	Sanderling.MouseClickLeft(ButtonClose);
-}
-
-void DroneLaunch()
-{
-	Host.Log("launch drones.");
-	Sanderling.MouseClickRight(DronesInBayListEntry);
-	Sanderling.MouseClickLeft(Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("launch", RegexOptions.IgnoreCase));
-}
-
-void DroneEnsureInBay()
-{
-	if(0 < DronesInSpaceCount)
-		return;
-
-	DroneReturnToBay();
-
-	Host.Delay(4444);
-}
-
-void DroneReturnToBay()
-{
-	Host.Log("return drones to bay.");
-	Sanderling.MouseClickRight(DronesInSpaceListEntry);
-	Sanderling.MouseClickLeft(Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("return.*bay", RegexOptions.IgnoreCase));
-}
-
-Func<object>	DefenseStep()
-{
-MemoryUpdate();
-
-	if(DefenseExit)
-	{
-	var	SubsetModuleHardenero =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsShieldBooster ?? true);
-
-
-
-	foreach (var Module in SubsetModuleHardenero.EmptyIfNull())
-		ModuleToggle(Module);
-
-		var	SubsetModuleHardeneroa2 =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsWeapon ?? true);
-
-if(SubsetModuleHardeneroa2 != null)
-		{
-		foreach (var Module in SubsetModuleHardeneroa2.EmptyIfNull())
-		ModuleToggle(Module);
-		}
-
-		Host.Log("exit defense.");
-		return null;
-	}
-
-
-	var	SubsetModuleHardener =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsShieldBooster ?? true);
-
-	var	SubsetModuleToToggle =
-		SubsetModuleHardener
-		?.Where(module => !(module?.RampActive ?? true));
-
-	foreach (var Module in SubsetModuleToToggle.EmptyIfNull())
-		ModuleToggle(Module);
-
-	if (!(0 > DronesInSpaceCount))
-		DroneLaunch();
-
-	EnsureOverviewTypeSelectionLoaded();
-
-	var SetRatName =
-		ListRatOverviewEntry?.Select(entry => Regex.Split(entry?.Name ?? "", @"\s+")?.FirstOrDefault())
-		?.Distinct()
-		?.ToArray();
-
-	var SetRatTarget = Measurement?.Target?.Where(target =>
-		SetRatName?.Any(ratName => target?.TextRow?.Any(row => row.RegexMatchSuccessIgnoreCase(ratName)) ?? false) ?? false);
-
-	var RatTargetNext = SetRatTarget?.OrderBy(target => target?.DistanceMax ?? int.MaxValue)?.FirstOrDefault();
-
-	if(null == RatTargetNext )
-	{
-		Host.Log("no rat targeted.");
-		Sanderling.MouseClickRight(ListRatOverviewEntry?.FirstOrDefault());
-		Sanderling.MouseClickLeft(MenuEntryLockTarget);
-
-			var	SubsetModuleHardeneroa =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsWeapon ?? true);
-		if(SubsetModuleHardeneroa != null)
-		{
-			Sanderling.MouseClickRight(ListRatOverviewEntry?.FirstOrDefault());
-		ClickMenuEntryOnMenuRoot(RatTargetNext, "approach");
-		}
-	}
-	else
-	{
-		Host.Log("rat targeted. sending drones.");
-		Sanderling.MouseClickLeft(RatTargetNext);
-		Sanderling.MouseClickRight(DronesInSpaceListEntry);
-		Sanderling.MouseClickLeft(Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("engage", RegexOptions.IgnoreCase));
-		var	SubsetModuleHardeneroa =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsWeapon ?? true);
-
-	var	SubsetModuleToToggleoa =
-		SubsetModuleHardeneroa
-		?.Where(module => !(module?.RampActive ?? false));
-if(SubsetModuleHardeneroa != null)
-		{
-		foreach (var Module in SubsetModuleToToggleoa.EmptyIfNull())
-		ModuleToggle(Module);
-		}
-
-	}
-
-	return DefenseStep;
-}
-
-Func<object> InBeltMineStep()
-{
-var loop = 0;
-
-	if (DefenseEnter)
-	{
-
-
-	var asteroidOverviewEntryNextNotTargeteda = ListAsteroidOverviewEntry?.FirstOrDefault(entry => !((entry?.MeTargeted ?? false) || (entry?.MeTargeting ?? false)));
-
-		var asteroidOverviewEntryNexatq = ListAsteroidOverviewEntry?.FirstOrDefault();
-		Host.Delay(1000);
-		ClickMenuEntryOnMenuRoot(asteroidOverviewEntryNexatq, "^unlock");
-		Host.Delay(1000);
-		ClickMenuEntryOnMenuRoot(asteroidOverviewEntryNextNotTargeteda, "^unlock");
-
-
-
-		Host.Log("enter defense.");
-		 i = 0;
-		return DefenseStep;
-	}
-
-	EnsureWindowInventoryOpenOreHold();
-
-	EnsureOverviewTypeSelectionLoaded();
-
-	if(OreHoldFilledForOffload)
-		return null;
-
-	var moduleMinerInactive = SetModuleMinerInactive?.FirstOrDefault();
-
-	if (null == moduleMinerInactive)
-	{
-
-	var MenuEntrya =
-		Measurement?.ShipUi?.Indication?.LabelText?.FirstOrDefault(candidate => candidate.Text.RegexMatchSuccessIgnoreCase("APPROACHING|WARP"));
-		var stop =
-		Measurement?.ShipUi?.ButtonSpeed0;
-
-	if(null != MenuEntrya)
-	{
-
-		var	SubsetModuleHardenerr=
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsAfterburner ?? true);
-
-
-
-	foreach (var Module in SubsetModuleHardenerr.EmptyIfNull())
-		ModuleToggle(Module);
-	Host.Delay(1000);
-	Sanderling.MouseClickLeft(stop);
-	Host.Delay(7777);
-		return InBeltMineStep;
-	}
-		Host.Delay(7777);
-		return InBeltMineStep;
-	}
-	loopm1:
-	var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;
-if(ShipManeuverTypeEnum.Warp == ManeuverType	||
-		ShipManeuverTypeEnum.Jump == ManeuverType)
-		{
-		Host.Log("Wait Finish");
-		Host.Delay(2000);
-		goto loopm1;
-		}
-	var	setTargetAsteroidInRange	=
-		SetTargetAsteroid?.Where(target => target?.DistanceMax <= MiningRange)?.ToArray();
-
-	var setTargetAsteroidInRangeNotAssigned =
-		setTargetAsteroidInRange?.Where(target => !(0 < target?.Assigned?.Length))?.ToArray();
-
-	Host.Log("targeted asteroids in range (without assignment): " + setTargetAsteroidInRange?.Length + " (" + setTargetAsteroidInRangeNotAssigned?.Length + ")");
-	 i = i+1 ;
-	if(0 < setTargetAsteroidInRangeNotAssigned?.Length)
-	{
-		var targetAsteroidInputFocus	=
-			setTargetAsteroidInRangeNotAssigned?.FirstOrDefault(target => target?.IsSelected ?? false);
-
-		if(null == targetAsteroidInputFocus)
-			Sanderling.MouseClickLeft(setTargetAsteroidInRangeNotAssigned?.FirstOrDefault());
-
-		ModuleToggle(moduleMinerInactive);
-
-		return InBeltMineStep;
-	}
-
-	var asteroidOverviewEntryNext = ListAsteroidOverviewEntry?.FirstOrDefault();
-	var asteroidOverviewEntryNextNotTargeted = ListAsteroidOverviewEntry?.FirstOrDefault(entry => !((entry?.MeTargeted ?? false) || (entry?.MeTargeting ?? false)));
-
-	Host.Log("next asteroid: (" + asteroidOverviewEntryNext?.Name + " , distance: " + asteroidOverviewEntryNext?.DistanceMax + ")" +
-		", next asteroid not targeted: (" + asteroidOverviewEntryNext?.Name + " , distance: " + asteroidOverviewEntryNext?.DistanceMax + ")");
-
-	if(null == asteroidOverviewEntryNext)
-	{
-
-	if(ShipManeuverTypeEnum.Warp == ManeuverType	||
-		ShipManeuverTypeEnum.Jump == ManeuverType)
-		{
-		Host.Log("Wait Finish");
-		Host.Delay(2000);
-		goto loopm1;
-		}
-		return null;
-	}
-
-	if(null == asteroidOverviewEntryNextNotTargeted)
-	{
-		Host.Log("all asteroids targeted");
-		loop= 0;
-		return null;
-	}
-
-
-	if (!(asteroidOverviewEntryNextNotTargeted.DistanceMax < MiningRange))
-	{
-		if(!(1111 < asteroidOverviewEntryNext?.DistanceMin))
-		{
-			Host.Log("distance between asteroids too large");
-			return null;
-		}
- 		if(loop ==0){
- 		loop = loop +1;
-		Host.Log("out of range, approaching");
-		ClickMenuEntryOnMenuRoot(asteroidOverviewEntryNext, "approach");
-		Host.Delay(2000);
-		var	a =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsAfterburner ?? true);
-
-	var	z =
-		a
-		?.Where(module => !(module?.RampActive ?? true));
-
-	foreach (var Module in z.EmptyIfNull())
-		ModuleToggle(Module);
-		}
-		var MenuEntry =
-		Measurement?.ShipUi?.Indication?.LabelText?.FirstOrDefault(candidate => candidate.Text.RegexMatchSuccessIgnoreCase("APPROACHING|WARP"));
-		if(0 < RetreatReason?.Length && !(Measurement?.IsDocked ?? false))
-		{
-		InitiateDockToOrWarpToBookmark(RetreatBookmark);
-		MenuEntry = null;
-		}
-	if(null != MenuEntry)
-	{
-		Host.Log("Wait For Finish.");
-		Host.Delay(2000);
-		MemoryUpdate();
-		goto loopm1;
-	}
-	}
-	else
-	{
-		var MenuEntry =
-		Measurement?.ShipUi?.Indication?.LabelText?.FirstOrDefault(candidate => candidate.Text.RegexMatchSuccessIgnoreCase("APPROACHING|WARP"));
-
-	var stop =
-		Measurement?.ShipUi?.ButtonSpeed0;
-	if(null != MenuEntry)
-	{
-		Host.Log("ActionFinish.");
-		var	SubsetModuleHardenere =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsAfterburner ?? true);
-
-
-
-	foreach (var Module in SubsetModuleHardenere.EmptyIfNull())
-		ModuleToggle(Module);
-		Host.Delay(2000);
-			Sanderling.MouseClickLeft(stop);
-	}
-		Host.Log("initiate lock asteroid");
-		ClickMenuEntryOnMenuRoot(asteroidOverviewEntryNextNotTargeted, "^lock");
-	}
-
-	return InBeltMineStep;
-}
-
-
-Sanderling.Parse.IMemoryMeasurement	Measurement	=>
-	Sanderling?.MemoryMeasurementParsed?.Value;
-
-IWindow ModalUIElement =>
-	Measurement?.EnumerateReferencedUIElementTransitive()?.OfType<IWindow>()?.Where(window => window?.isModal ?? false)
-	?.OrderByDescending(window => window?.InTreeIndex ?? int.MinValue)
-	?.FirstOrDefault();
-
-IEnumerable<Parse.IMenu> Menu => Measurement?.Menu;
-
-Parse.IShipUi ShipUi => Measurement?.ShipUi;
-
-bool Jammed => ShipUi?.EWarElement?.Any(EwarElement => (EwarElement?.EWarType).RegexMatchSuccess("electronic")) ?? false;
-
-Sanderling.Interface.MemoryStruct.IMenuEntry MenuEntryLockTarget =>
-	Menu?.FirstOrDefault()?.Entry?.FirstOrDefault(entry => entry.Text.RegexMatchSuccessIgnoreCase("^lock"));
-	Sanderling.Interface.MemoryStruct.IMenuEntry MenuEntryorbitTarget =>
-	Menu?.FirstOrDefault()?.Entry?.FirstOrDefault(entry => entry.Text.RegexMatchSuccessIgnoreCase("approach"));
-
-
-Sanderling.Parse.IWindowOverview	WindowOverview	=>
-	Measurement?.WindowOverview?.FirstOrDefault();
-
-Sanderling.Parse.IWindowInventory	WindowInventory	=>
-	Measurement?.WindowInventory?.FirstOrDefault();
-
-IWindowDroneView	WindowDrones	=>
-	Measurement?.WindowDroneView?.FirstOrDefault();
-IWindowStation	WindowStation	=>
-	Measurement?.WindowStation?.FirstOrDefault();
-
-ITreeViewEntry InventoryActiveShipOreHold =>
-	WindowInventory?.ActiveShipEntry?.TreeEntryFromCargoSpaceType(ShipCargoSpaceTypeEnum.OreHold);
-
-ITreeViewEntry InventoryActiveShipgeneralHold =>
-	WindowInventory?.ActiveShipEntry?.TreeEntryFromCargoSpaceType(ShipCargoSpaceTypeEnum.General);
-
-
-IInventoryCapacityGauge OreHoldCapacityMilli =>
-	(InventoryActiveShipOreHold?.IsSelected ?? false) ? WindowInventory?.SelectedRightInventoryCapacityMilli : null;
-
-int? OreHoldFillPercent => (int?)((OreHoldCapacityMilli?.Used * 100) / OreHoldCapacityMilli?.Max);
-
-Tab OverviewPresetTabActive =>
-	WindowOverview?.PresetTab
-	?.OrderByDescending(tab => tab?.LabelColorOpacityMilli ?? 0)
-	?.FirstOrDefault();
-
-string OverviewTypeSelectionName =>
-	WindowOverview?.Caption?.RegexMatchIfSuccess(@"\(([^\)]*)\)")?.Groups?[1]?.Value;
-
-Parse.IOverviewEntry[] ListRatOverviewEntry => WindowOverview?.ListView?.Entry?.Where(entry =>
-		(entry?.MainIconIsRed ?? false)	&& (entry?.IsAttackingMe ?? false))
-		?.OrderBy(entry => entry?.DistanceMax ?? int.MaxValue)
-		?.ToArray();
-
-Parse.IOverviewEntry[] ListAsteroidOverviewEntry =>
-	WindowOverview?.ListView?.Entry
-	?.Where(entry => null != OreTypeFromAsteroidName(entry?.Name))
-	?.OrderBy(entry => entry.DistanceMax ?? int.MaxValue)
-	?.ToArray();
-
-
-DroneViewEntryGroup DronesInBayListEntry =>
-	WindowDrones?.ListView?.Entry?.OfType<DroneViewEntryGroup>()?.FirstOrDefault(Entry => null != Entry?.Caption?.Text?.RegexMatchIfSuccess(@"Drones in bay", RegexOptions.IgnoreCase));
-
-DroneViewEntryGroup DronesInSpaceListEntry =>
-	WindowDrones?.ListView?.Entry?.OfType<DroneViewEntryGroup>()?.FirstOrDefault(Entry => null != Entry?.Caption?.Text?.RegexMatchIfSuccess(@"Drones in Local Space", RegexOptions.IgnoreCase));
-
-int?	DronesInSpaceCount => DronesInSpaceListEntry?.Caption?.Text?.AsDroneLabel()?.Status?.TryParseInt();
-
-bool ReadyForManeuverNot =>
-	Measurement?.ShipUi?.Indication?.LabelText?.Any(indicationLabel =>
-		(indicationLabel?.Text).RegexMatchSuccessIgnoreCase("warp|docking")) ?? false;
-
-bool ReadyForManeuver => !ReadyForManeuverNot && !(Measurement?.IsDocked ?? true);
-
-Sanderling.Parse.IShipUiTarget[] SetTargetAsteroid =>
-	Measurement?.Target?.Where(target =>
-		target?.TextRow?.Any(textRow => textRow.RegexMatchSuccessIgnoreCase("asteroid")) ?? false)?.ToArray();
-
-
-Sanderling.Interface.MemoryStruct.IListEntry	WindowInventoryItem	=>
-	WindowInventory?.SelectedRightInventory?.ListView?.Entry?.FirstOrDefault();
-
-Sanderling.Accumulation.IShipUiModule[] SetModuleMiner =>
-	Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.Where(module => module?.TooltipLast?.Value?.IsMiner ?? false)?.ToArray();
-Sanderling.Accumulation.IShipUiModule[] SetModulebooster =>
-	Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.Where(module => module?.TooltipLast?.Value?.IsAfterburner ?? false)?.ToArray();
-
-Sanderling.Accumulation.IShipUiModule[] SetModuleBoosteractif =>
-	SetModuleMiner?.Where(module => (module?.RampActive ?? false))?.ToArray();
-
-Sanderling.Accumulation.IShipUiModule[] SetModuleMinerInactive	 =>
-	SetModuleMiner?.Where(module => !(module?.RampActive ?? false))?.ToArray();
-
-int?	MiningRange => SetModuleMiner?.Select(module =>
-	module?.TooltipLast?.Value?.RangeOptimal ?? module?.TooltipLast?.Value?.RangeMax ?? module?.TooltipLast?.Value?.RangeWithin ?? 0)?.DefaultIfEmpty(0)?.Min();;
-
-
-
-WindowChatChannel chatLocal =>
-	 Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
-	 ?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase("local") ?? false);
-
-
-//    assuming that own character is always visible in local
-bool hostileOrNeutralsInLocal => 1 != chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy);
-var ok = false;
-//	extract the ore type from the name as seen in overview. "Asteroid (Plagioclase)"
-string OreTypeFromAsteroidName(string AsteroidName)	=>
-	AsteroidName.ValueFromRegexMatchGroupAtIndex(@"Asteroid \(([^\)]+)", 0);
-
-void ClickMenuEntryOnMenuRoot(IUIElement MenuRoot, string MenuEntryRegexPattern)
-{
-	Sanderling.MouseClickRight(MenuRoot);
-
-	var Menu = Measurement?.Menu?.FirstOrDefault();
-
-	var	MenuEntry = Menu?.EntryFirstMatchingRegexPattern(MenuEntryRegexPattern, RegexOptions.IgnoreCase);
-
-	Sanderling.MouseClickLeft(MenuEntry);
-}
-
-void EnsureWindowInventoryOpen()
-{
-	if (null != WindowInventory)
-		return;
-
-	Host.Log("open Inventory.");
-	Sanderling.MouseClickLeft(Measurement?.Neocom?.InventoryButton);
-}
-
-void EnsureWindowInventoryOpenOreHold()
-{
-	EnsureWindowInventoryOpen();
-
-	var inventoryActiveShip = WindowInventory?.ActiveShipEntry;
-
-	if(InventoryActiveShipOreHold == null && !(inventoryActiveShip?.IsExpanded ?? false))
-		Sanderling.MouseClickLeft(inventoryActiveShip?.ExpandToggleButton);
-
-	if(!(InventoryActiveShipOreHold?.IsSelected ?? false))
-		Sanderling.MouseClickLeft(InventoryActiveShipOreHold);
-}
-
-void EnsureWindowInventoryOpengeneraleHold(string s )
-{
-	EnsureWindowInventoryOpen();
-	var DestinationContainerLabelRegexPatterna =
-			InventoryContainerLabelRegexPatternFromContainerName(s);
-
-		var DestinationContainera =
-			WindowInventory?.LeftTreeListEntry?.SelectMany(entry => new[] { entry }.Concat(entry.EnumerateChildNodeTransitive()))
-			?.FirstOrDefault(entry => entry?.Text?.RegexMatchSuccessIgnoreCase(DestinationContainerLabelRegexPatterna) ?? false);
-
-	var inventoryActiveShip = WindowInventory?.ActiveShipEntry;
-
-	if( InventoryActiveShipgeneralHold == null && !(inventoryActiveShip?.IsExpanded ?? false))
-		Sanderling.MouseClickLeft(inventoryActiveShip?.ExpandToggleButton);
-
-	if(!(InventoryActiveShipgeneralHold?.IsSelected ?? false))
-		Sanderling.MouseClickLeft(DestinationContainera);
-		ok = true;
-}
-
-//	sample label text: Intensive Reprocessing Array <color=#66FFFFFF>1,123 m</color>
-string InventoryContainerLabelRegexPatternFromContainerName(string containerName) =>
-	@"^\s*" + Regex.Escape(containerName) + @"\s*($|\<)";
-
-void InInventoryUnloadItems() => InInventoryUnloadItemsTo(UnloadDestContainerName);
-
-void InInventoryUnloadItemsTo(string DestinationContainerName)
-{
-	Host.Log("unload items to '" + DestinationContainerName + "'.");
-
-	EnsureWindowInventoryOpenOreHold();
-
-	for (;;)
-	{
-		var oreHoldListItem = WindowInventory?.SelectedRightInventory?.ListView?.Entry?.ToArray();
-
-		var oreHoldItem = oreHoldListItem?.FirstOrDefault();
-
-		if(null == oreHoldItem)
-			break;    //    0 items in OreHold
-
-		if(1 < oreHoldListItem?.Length)
-			ClickMenuEntryOnMenuRoot(oreHoldItem, @"select\s*all");
-
-		var DestinationContainerLabelRegexPattern =
-			InventoryContainerLabelRegexPatternFromContainerName(DestinationContainerName);
-
-		var DestinationContainer =
-			WindowInventory?.LeftTreeListEntry?.SelectMany(entry => new[] { entry }.Concat(entry.EnumerateChildNodeTransitive()))
-			?.FirstOrDefault(entry => entry?.Text?.RegexMatchSuccessIgnoreCase(DestinationContainerLabelRegexPattern) ?? false);
-
-		if (null == DestinationContainer)
-			Host.Log("error: Inventory entry labeled '" + DestinationContainerName + "' not found");
-
-		Sanderling.MouseDragAndDrop(oreHoldItem, DestinationContainer);
-		ok = true;
-	}
-	EnsureWindowInventoryOpengeneraleHold(DestinationContainerName);
-	for (;;)
-	{
-		var oreHoldListItem = WindowInventory?.SelectedRightInventory?.ListView?.Entry?.ToArray();
-
-		var oreHoldItem = oreHoldListItem?.FirstOrDefault();
-
-		if(null == oreHoldItem)
-			break;    //    0 items in OreHold
-
-		if(1 < oreHoldListItem?.Length)
-			{ClickMenuEntryOnMenuRoot(oreHoldItem, @"select\s*all");
-
-
-			Host.Log("try sell item");
-
-		ClickMenuEntryOnMenuRoot(oreHoldItem, @"sell\s*items|sell\s*this\s*item");
-		Host.Delay(5000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(2000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(1000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		ok = false;
-		}
-			if(1 == oreHoldListItem?.Length)
-			{
-
-
-			Host.Log("try sell item");
-
-		ClickMenuEntryOnMenuRoot(oreHoldItem, @"sell\s*items|sell\s*this\s*item");
-		Host.Delay(5000);
-
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(1000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		Host.Delay(1000);
-		Sanderling.KeyboardPress(VirtualKeyCode.TAB);
-		Host.Delay(500);
-		Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
-		ok = false;
-		}
-
-
-		ok = false;
-	}
-	}
-
-
-
-bool InitiateWarpToRandomMiningSite()	=>
-	InitiateDockToOrWarpToBookmark(RandomElement(SetMiningSiteBookmark));
-
-bool InitiateDockToOrWarpToBookmark(string bookmarkOrFolder)
-{
-	loopr1:
-	var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;
-	if(ShipManeuverTypeEnum.Warp == ManeuverType	||
-		ShipManeuverTypeEnum.Jump == ManeuverType)
-		{
-		Host.Log("Wait Finish");
-		Host.Delay(3000);
-		goto loopr1;
-		}
-	Host.Log("dock to or warp to bookmark or random bookmark in folder: '" + bookmarkOrFolder + "'");
-
-	var listSurroundingsButton = Measurement?.InfoPanelCurrentSystem?.ListSurroundingsButton;
-
-	Sanderling.MouseClickRight(listSurroundingsButton);
-
-	var bookmarkMenuEntry = Measurement?.Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("^" + bookmarkOrFolder + "$", RegexOptions.IgnoreCase);
-
-	if(null == bookmarkMenuEntry)
-	{
-		Host.Log("menu entry not found for bookmark or folder: '" + bookmarkOrFolder + "'");
-		return true;
-	}
-
-	var currentLevelMenuEntry = bookmarkMenuEntry;
-
-	for (var menuLevel = 1; ; ++menuLevel)
-	{
-		Sanderling.MouseClickLeft(currentLevelMenuEntry);
-
-		var menu = Measurement?.Menu?.ElementAtOrDefault(menuLevel);
-		var dockMenuEntry = menu?.EntryFirstMatchingRegexPattern("dock", RegexOptions.IgnoreCase);
-		var warpMenuEntry = menu?.EntryFirstMatchingRegexPattern(@"warp.*within\s*0", RegexOptions.IgnoreCase);
-		var approachEntry = menu?.EntryFirstMatchingRegexPattern(@"approach", RegexOptions.IgnoreCase);
-
-		var maneuverMenuEntry = dockMenuEntry ?? warpMenuEntry;
-
-
-	Host.Delay(100);
-	Sanderling.InvalidateMeasurement();
-
-
-		if (null != maneuverMenuEntry)
-		{
-			Host.Log("initiating '" + maneuverMenuEntry.Text + "' on entry '" + currentLevelMenuEntry?.Text + "'");
-			Sanderling.MouseClickLeft(maneuverMenuEntry);
-			return false;
-		}
-
-		if (null != approachEntry)
-		{
-			Host.Log("found menu entry '" + approachEntry.Text + "'. Assuming we are already there.");
-			return false;
-		}
-
-		var setBookmarkOrFolderMenuEntry =
-			menu?.Entry;	//	assume that each entry on the current menu level is a bookmark or a bookmark folder.
-
-		var nextLevelMenuEntry = RandomElement(setBookmarkOrFolderMenuEntry);
-
-		if(null == nextLevelMenuEntry)
-		{
-			Host.Log("no suitable menu entry found");
-			return true;
-		}
-
-		currentLevelMenuEntry = nextLevelMenuEntry;
-	}
-}
-
-void Undock()
-{
-	while(Measurement?.IsDocked ?? true)
-	{
-		Sanderling.MouseClickLeft(Measurement?.WindowStation?.FirstOrDefault()?.UndockButton);
-		Host.Log("waiting for undocking to complete.");
-		Host.Delay(8000);
-	}
-
-	Host.Delay(4444);
 	Sanderling.InvalidateMeasurement();
 }

-void ModuleMeasureAllTooltip()
-{
-	Host.Log("measure tooltips of all modules.");
-
-	for (;;)
-	{
-		var NextModule = Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.FirstOrDefault(m => null == m?.TooltipLast);
-
-		if(null == NextModule)
-			break;
-
-		Host.Log("measure module.");
-		//	take multiple measurements of module tooltip to reduce risk to keep bad read tooltip.
-		Sanderling.MouseMove(NextModule);
-		Sanderling.WaitForMeasurement();
-		Sanderling.MouseMove(NextModule);
-	}
-}
-
-void ActivateHardenerExecute()
-{
-	var	SubsetModuleHardener =
-		Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
-		?.Where(module => module?.TooltipLast?.Value?.IsHardener ?? false);
-
-	var	SubsetModuleToToggle =
-		SubsetModuleHardener
-		?.Where(module => !(module?.RampActive ?? false));
-
-	foreach (var Module in SubsetModuleToToggle.EmptyIfNull())
-		ModuleToggle(Module);
-}
-
-void ModuleToggle(Sanderling.Accumulation.IShipUiModule Module)
-{
-	var ToggleKey = Module?.TooltipLast?.Value?.ToggleKey;
-
-	Host.Log("toggle module using " + (null == ToggleKey ? "mouse" : Module?.TooltipLast?.Value?.ToggleKeyTextLabel?.Text));
-
-	if(null == ToggleKey)
-		Sanderling.MouseClickLeft(Module);
-	else
-		Sanderling.KeyboardPressCombined(ToggleKey);
-}
-
-void EnsureOverviewTypeSelectionLoaded()
-{
-	if(null == OverviewPresetTabActive || null == WindowOverview || null == OverviewPreset)
-		return;
-
-	if(string.Equals(OverviewTypeSelectionName, OverviewPreset, StringComparison.OrdinalIgnoreCase))
-		return;
-
-	Host.Log("loading preset '" + OverviewPreset + "' to overview (current selection is '" + OverviewTypeSelectionName + "').");
-	Sanderling.MouseClickRight(OverviewPresetTabActive);
-	Sanderling.MouseClickLeft(Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("load.*preset", RegexOptions.IgnoreCase));
-	var PresetMenuEntry = Menu?.ElementAtOrDefault(1)?.EntryFirstMatchingRegexPattern(@"^\s*" + Regex.Escape(OverviewPreset) + @"\s*$", RegexOptions.IgnoreCase);
-
-	if(null == PresetMenuEntry)
-	{
-		Host.Log("error: menu entry '" + OverviewPreset + "' not found");
-		return;
-	}
-
-	Sanderling.MouseClickLeft(PresetMenuEntry);
-}
-
-void MemoryUpdate()
-{
-	RetreatUpdate();
-	RetreatUpdate1();
-	JammedLastTimeUpdate();
-	OffloadCountUpdate();
-}
-
-void JammedLastTimeUpdate()
-{
-	if(Jammed)
-		JammedLastTime	= Host.GetTimeContinuousMilli();
-}
-
-bool MeasurementEmergencyWarpOutEnter =>
-	!(Measurement?.IsDocked ?? false) && !(EmergencyWarpOutHitpointPercent < ShieldHpPercent);
-
-bool MeasurementEmergencyWarpOutEntera =>
-	!(Measurement?.IsDocked ?? false) && !(EmergencyWarpOutHitpointPercentArmor < ShieldApPercent);
-void RetreatUpdate()
-{
-	RetreatReasonTemporary = (RetreatOnNeutralOrHostileInLocal && hostileOrNeutralsInLocal)	? "hostile or neutral in local" : null;
-
-	if (!MeasurementEmergencyWarpOutEnter)
-		return;
-
-	//	measure multiple times to avoid being scared off by noise from a single measurement.
-	Sanderling.InvalidateMeasurement();
-	if (!MeasurementEmergencyWarpOutEnter)
-		return;
-
-	RetreatReasonPermanent = "shield hp";
-
-
-
-
-}
-
-void RetreatUpdate1()
-{
-	RetreatReasonTemporary = (RetreatOnNeutralOrHostileInLocal && hostileOrNeutralsInLocal)	? "hostile or neutral in local" : null;
-
-
-
-	if (!MeasurementEmergencyWarpOutEntera)
-		return;
-
-	//	measure multiple times to avoid being scared off by noise from a single measurement.
-	Sanderling.InvalidateMeasurement();
-	if (!MeasurementEmergencyWarpOutEntera)
-		return;
-
-		RetreatReasonPermanent = "shield hp";
-
-
-}
-void OffloadCountUpdate()
-{
-	var	OreHoldFillPercentSynced	= OreHoldFillPercent;
-
-	if(!OreHoldFillPercentSynced.HasValue)
-		return;
-
-	if(0 == OreHoldFillPercentSynced && OreHoldFillPercentSynced < LastCheckOreHoldFillPercent)
-		++OffloadCount;
-
-	LastCheckOreHoldFillPercent = OreHoldFillPercentSynced;
-}
-
-bool IsNeutralOrEnemy(IChatParticipantEntry participantEntry) =>
-   !(participantEntry?.FlagIcon?.Any(flagIcon =>
-	 new[] { "good standing", "excellent standing", "Pilot is in your (fleet|corporation)", }
-	 .Any(goodStandingText =>
-		flagIcon?.HintText?.RegexMatchSuccessIgnoreCase(goodStandingText) ?? false)) ?? false);
-


Added support to SequenceValue types to preserve array types

--- src/Serilog.Sinks.Fluentd/Sinks/Fluentd/FluentdSinkClient.cs
+++ src/Serilog.Sinks.Fluentd/Sinks/Fluentd/FluentdSinkClient.cs
@@ -6,6 +6,7 @@
 using System.Threading.Tasks;
 using Serilog.Debugging;
 using Serilog.Events;
+using System.Linq;

 namespace Serilog.Sinks.Fluentd
 {
@@ -34,7 +35,6 @@
                 ReceiveTimeout = _options.SendTimeout,
                 LingerState = new LingerOption(_options.LingerEnabled, _options.LingerTime)
             };
-
         }

         protected async Task EnsureConnectedAsync()
@@ -63,6 +63,7 @@
                 _stream.Dispose();
                 _stream = null;
             }
+
             if (_tcpClient != null)
             {
                 _tcpClient.Client.Dispose();
@@ -74,15 +75,22 @@

         public async Task SendAsync(LogEvent logEvent, int retryCount = 1)
         {
-
-            var record = new Dictionary<string, object> {
-                { "Level", logEvent.Level },
-                { _options.MessageTemplateKey, logEvent.MessageTemplate.Text }
+            var record = new Dictionary<string, object>
+            {
+                {"Level", logEvent.Level},
+                {_options.MessageTemplateKey, logEvent.MessageTemplate.Text}
             };

             foreach (var log in logEvent.Properties)
             {
-                record.Add(log.Key, log.Value.ToString());
+                if (log.Value is SequenceValue sequenceValue)
+                {
+                    record.Add(log.Key, sequenceValue.Elements.Select(RenderSequenceValue).ToArray());
+                }
+                else
+                {
+                    record.Add(log.Key, log.Value.ToString());
+                }
             }

             if (logEvent.Exception != null)
@@ -117,6 +125,8 @@
             }
         }

+        private static object RenderSequenceValue(LogEventPropertyValue x) => (x as ScalarValue)?.Value ?? x.ToString();
+
         private async Task RetrySendAsync(LogEvent logEvent, int retryCount)
         {
             if (retryCount < _options.RetryCount)
@@ -127,7 +137,8 @@
             }
             else
             {
-                SelfLog.WriteLine($"[Serilog.Sinks.Fluentd] Retry count has exceeded limit {_options.RetryCount}. Giving up. Data will be lost");
+                SelfLog.WriteLine(
+                    $"[Serilog.Sinks.Fluentd] Retry count has exceeded limit {_options.RetryCount}. Giving up. Data will be lost");
             }
         }

@@ -147,4 +158,4 @@
             return true;
         }
     }
-}
+}


Fixed typo in error message

Fixed typo in error message

--- src/SolutionCop.DefaultRules/NuGet/NuGetPackagesUsageRule.cs
+++ src/SolutionCop.DefaultRules/NuGet/NuGetPackagesUsageRule.cs
@@ -73,7 +73,7 @@
                         var xmlHintPaths = xmlProject.Descendants(Namespace + "HintPath").Where(x => x.Value.Contains(hintPathSubstring));
                         if (!xmlHintPaths.Any())
                         {
-                            yield return string.Format("Package {0} with version {1} is declared in projects.config, but not referenced in project {2}", packageId, packageVersion, projectFileName);
+                            yield return string.Format("Package {0} with version {1} is declared in packages.config, but not referenced in project {2}", packageId, packageVersion, projectFileName);
                         }
                     }
                 }


introduce proposed changes to address the buffer overflow in the FileSystemWatcher

--- src/Takenet.MessagingHub.Client.Host/ApplicationActivator.cs
+++ src/Takenet.MessagingHub.Client.Host/ApplicationActivator.cs
@@ -4,6 +4,7 @@
 using System.IO;
 using System.Linq;
 using System.Threading;
+using System.Threading.Tasks;

 namespace Takenet.MessagingHub.Client.Host
 {
@@ -15,7 +16,7 @@
         private readonly ConcurrentDictionary<string, Process> _applicationProcessesDictionary;
         private readonly ConcurrentDictionary<string, DateTime> _applicationLastWriteDictionary;
         private readonly string _tempBasePath;
-        private readonly Job _job;
+        private readonly Job _job;
         private readonly object _syncRoot = new object();

         public ApplicationActivator(string basePath, TimeSpan waitForActivationDelay)
@@ -28,13 +29,14 @@
             _watcher = new FileSystemWatcher()
             {
                 Path = basePath,
-                Filter = Bootstrapper.DefaultApplicationFileName,
+                Filter = Bootstrapper.DefaultApplicationFileName,
                 IncludeSubdirectories = true,
-                NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName
+                InternalBufferSize = 1024 * 64,
+                NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName
             };

             _watcher.Created += Watcher_Changed;
-            _watcher.Changed += Watcher_Changed;
+            _watcher.Changed += Watcher_Changed;
             _watcher.Deleted += Watcher_Deleted;
             _watcher.Renamed += Watcher_Renamed; // When moved to the recycle bin
             _watcher.Error += Watcher_Error;
@@ -54,65 +56,74 @@

         private void Watcher_Changed(object sender, FileSystemEventArgs e)
         {
-            Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
-
-            lock (_syncRoot)
-            {
-                var fileInfo = new FileInfo(e.FullPath);
-                while (IsFileLocked(fileInfo))
-                {
-                    Thread.Sleep(250);
-                }
-
-                Thread.Sleep(_waitForActivationDelay);
-
-                // Fix for the multiple raises on the FileSystemWatcher
-                var applicationLastWrite = File.GetLastWriteTimeUtc(e.FullPath);
-                if (!_applicationLastWriteDictionary.ContainsKey(e.FullPath) ||
-                    _applicationLastWriteDictionary[e.FullPath] < applicationLastWrite)
-                {
+            Task.Run(() =>
+            {
+                Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
+
+                lock (_syncRoot)
+                {
+                    var fileInfo = new FileInfo(e.FullPath);
+                    while (IsFileLocked(fileInfo))
+                    {
+                        Thread.Sleep(250);
+                    }
+
+                    Thread.Sleep(_waitForActivationDelay);
+
+                    // Fix for the multiple raises on the FileSystemWatcher
+                    var applicationLastWrite = File.GetLastWriteTimeUtc(e.FullPath);
+                    if (!_applicationLastWriteDictionary.ContainsKey(e.FullPath) ||
+                        _applicationLastWriteDictionary[e.FullPath] < applicationLastWrite)
+                    {
+                        Deactivate(e.FullPath);
+                        if (Activate(e.FullPath))
+                        {
+                            _applicationLastWriteDictionary.AddOrUpdate(
+                                e.FullPath,
+                                applicationLastWrite,
+                                (k, v) => applicationLastWrite);
+                        }
+                    }
+                }
+            });
+        }
+
+        private void Watcher_Deleted(object sender, FileSystemEventArgs e)
+        {
+            Task.Run(() =>
+            {
+                Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
+
+                lock (_syncRoot)
+                {
+                    Thread.Sleep(_waitForActivationDelay);
                     Deactivate(e.FullPath);
-                    if (Activate(e.FullPath))
-                    {
-                        _applicationLastWriteDictionary.AddOrUpdate(
-                            e.FullPath,
-                            applicationLastWrite,
-                            (k, v) => applicationLastWrite);
-                    }
-                }
-            }
-        }
-
-        private void Watcher_Deleted(object sender, FileSystemEventArgs e)
-        {
-            Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
-
-            lock (_syncRoot)
-            {
-                Thread.Sleep(_waitForActivationDelay);
-                Deactivate(e.FullPath);
-
-                DateTime applicationLastWrite;
-                _applicationLastWriteDictionary.TryRemove(e.FullPath, out applicationLastWrite);
-            }
+
+                    DateTime applicationLastWrite;
+                    _applicationLastWriteDictionary.TryRemove(e.FullPath, out applicationLastWrite);
+                }
+            });
         }

         private void Watcher_Renamed(object sender, RenamedEventArgs e)
         {
-            Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
-
-            lock (_syncRoot)
-            {
-                Thread.Sleep(_waitForActivationDelay);
-                Deactivate(e.OldFullPath);
-
-                DateTime applicationLastWrite;
-                _applicationLastWriteDictionary.TryRemove(e.FullPath, out applicationLastWrite);
-            }
+            Task.Run(() =>
+            {
+                Trace.TraceError("{0} event raised for path '{1}'", e.ChangeType, e.FullPath);
+
+                lock (_syncRoot)
+                {
+                    Thread.Sleep(_waitForActivationDelay);
+                    Deactivate(e.OldFullPath);
+
+                    DateTime applicationLastWrite;
+                    _applicationLastWriteDictionary.TryRemove(e.FullPath, out applicationLastWrite);
+                }
+            });
         }

         private void Watcher_Error(object sender, ErrorEventArgs e)
-        {
+        {
             Trace.TraceError(e.GetException().ToString());
         }

@@ -129,14 +140,14 @@
             var tempApplicationDirectory = Path.Combine(
                 _tempBasePath, applicationDirectory.Replace(_basePath, "").TrimStart('\\', '/'));

-            Trace.TraceInformation("Copying files from path '{0}' to '{1}'...",
+            Trace.TraceInformation("Copying files from path '{0}' to '{1}'...",
                 applicationDirectory, tempApplicationDirectory);

             RecreateDirectory(tempApplicationDirectory);
-            CopyDirectory(applicationDirectory, tempApplicationDirectory);
+            CopyDirectory(applicationDirectory, tempApplicationDirectory);

             var tempApplicationPath = Path.Combine(
-                tempApplicationDirectory,
+                tempApplicationDirectory,
                 Path.GetFileName(applicationPath) ?? Bootstrapper.DefaultApplicationFileName);

             Trace.TraceInformation("Starting the process for application '{0}'...",
@@ -187,16 +198,11 @@
                 return false;
             }

-            Trace.TraceInformation("Application started from file '{0}' in the path '{1}'",
+            Trace.TraceInformation("Application started from file '{0}' in the path '{1}'",
                 applicationPath, tempApplicationPath);
             return true;
         }

-        private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
-        {
-            throw new NotImplementedException();
-        }
-
         private bool Deactivate(string applicationPath)
         {
             Trace.TraceInformation("Deactivating application at '{0}'...", applicationPath);
@@ -206,7 +212,7 @@
             {
                 Trace.TraceError("No application found at path '{0}'", applicationPath);
                 return false;
-            }
+            }
             StopProcess(process);

             Trace.TraceInformation("Application stopped from file '{0}'", applicationPath);
@@ -217,7 +223,7 @@
         {
             if (!process.HasExited)
             {
-                process.StandardInput.Write(13);
+                process.StandardInput.Write(13);
                 process.WaitForExit();
             }
         }


Code cleanup

Code cleanup

--- src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs
+++ src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs
@@ -38,7 +38,7 @@
 		Task Shutdown(CancellationToken cancellationToken);

 		/// <summary>
-		/// Update <see cref="DreamDaemon"/>. This may trigger <see cref="Api.Models.Internal.DreamDaemonSettings.SoftRestart"/>
+		/// Update <see cref="DreamDaemon"/>. This may trigger <see cref="DreamDaemon.SoftRestart"/>
 		/// </summary>
 		/// <param name="dreamDaemon">The <see cref="DreamDaemon"/> to update</param>
 		/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>


Removing unused field from Styles

Removing unused field from Styles

--- src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs
@@ -49,8 +49,6 @@

         private const string WarningLabel = "<b>Warning:</b> {0}";

-        private static Color headerGreyColor = new Color(0.878f, 0.878f, 0.878f, 1.0f);
-
         private static GUIStyle label,
                                 boldLabel,
                                 errorLabel,


support BaseHref, an alternative to Controller/Action or Route

--- src/cloudscribe.Web.Pagination/PagerTagHelper.cs
+++ src/cloudscribe.Web.Pagination/PagerTagHelper.cs
@@ -44,8 +44,8 @@
         private const string RouteAttributeName = "asp-route";
         private const string RouteValuesDictionaryName = "asp-all-route-data";
         private const string RouteValuesPrefix = "asp-route-";
-
-
+        private const string BaseHrefAttributeName = "asp-basehref";
+
         public PagerTagHelper(
             IUrlHelperFactory urlHelperFactory,
             IActionContextAccessor actionContextAccesor,
@@ -220,8 +220,14 @@
         { get; set; }
         = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

-
-        private string baseHref = string.Empty;
+        /// <summary>
+        /// An alternative to Controller/Action or Route
+        /// </summary>
+        /// <remarks>
+        /// <see cref="Route"/> and <see cref="Action"/> and <see cref="Controller"/> must be null to be effective
+        /// </remarks>
+        [HtmlAttributeName(BaseHrefAttributeName)]
+        public string BaseHref { get; set; }

         private IUrlHelper urlHelper = null;

@@ -438,12 +444,18 @@
             else if (Action != null && Controller != null)
             {
                 return urlHelper.Action(Action, Controller, routeValues);
-
-            }
-
+            }
+            else if (BaseHref != null)
+            {
+                if (BaseHref.StartsWith("~/"))
+                {
+                    BaseHref = urlHelper.Content(BaseHref);
+                }
+
+                return $"{BaseHref}?{routeValues.Select(x => $"{x.Key}={x.Value}").Aggregate((current, next) => $"{current}&{next}")}";
+            }
+
             return pageNumber.ToString();
         }
-
-
     }
 }


DirectoryTreeWatcherBase - SubscribeSameFileTwice

--- projects/DirectoryWatcherSample/DirectoryWatcherSample.Test/DirectoryTreeWatcherBaseTest.cs
+++ projects/DirectoryWatcherSample/DirectoryWatcherSample.Test/DirectoryTreeWatcherBaseTest.cs
@@ -166,6 +166,19 @@
                 @"X:\root\file2.txt");
         }

+        [TestMethod]
+        public void SubscribeSameFileTwice()
+        {
+            DirectoryTreeWatcherBase watcherBase = new FakeDirectoryTreeWatcher(new DirectoryInfo(@"X:\root"));
+            Action<FileInfo> onUpdate = f => { };
+            watcherBase.Subscribe("file1.txt", onUpdate);
+
+            Action act = () => watcherBase.Subscribe("file1.txt", onUpdate);
+
+            act.Should().Throw<InvalidOperationException>()
+                .WithMessage(@"A subscription for 'X:\root\file1.txt' already exists.");
+        }
+
         private sealed class FakeDirectoryTreeWatcher : DirectoryTreeWatcherBase
         {
             public FakeDirectoryTreeWatcher(DirectoryInfo path)


Properly pass along a cancellation token so we don't get an AggregateException

--- src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs
+++ src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs
@@ -727,7 +727,7 @@

                     var context = new TaggerContext<TTag>(
                         this.State, spansToTag, caretPoint, this.AccumulatedTextChanges, oldTagTrees, cancellationToken);
-                    ProduceTagsAsync(context).Wait();
+                    ProduceTagsAsync(context).Wait(cancellationToken);

                     ProcessContext(spansToTag, oldTagTrees, context);
                 }


Fixed: http status codes on invalid Content-Type: and not supported Accept: headers

--- src/EventStore/EventStore.Core/Services/Transport/Http/AuthenticatedHttpRequestProcessor.cs
+++ src/EventStore/EventStore.Core/Services/Transport/Http/AuthenticatedHttpRequestProcessor.cs
@@ -131,7 +131,7 @@
                         request.HttpMethod, request.ContentType, supportedRequestCodecs);
                     if (requestCodec == null)
                     {
-                        BadRequest(httpEntity, "Invalid or missing Content-Type");
+                        BadContentType(httpEntity, "Invalid or missing Content-Type");
                         return;
                     }
                 }
@@ -207,15 +207,15 @@
         {
             var entity = httpEntity.CreateManager();
             entity.ReplyStatus(
+                HttpStatusCode.NotAcceptable, reason,
+                e => Log.ErrorException(e, "Error while closing http connection (http service core)."));
+        }
+
+        private void BadContentType(HttpEntity httpEntity, string reason)
+        {
+            var entity = httpEntity.CreateManager();
+            entity.ReplyStatus(
                 HttpStatusCode.UnsupportedMediaType, reason,
-                e => Log.ErrorException(e, "Error while closing http connection (http service core)."));
-        }
-
-        private void BadRequest(HttpEntity httpEntity, string reason)
-        {
-            var entity = httpEntity.CreateManager();
-            entity.ReplyStatus(
-                HttpStatusCode.BadRequest, reason,
                 e => Log.ErrorException(e, "Error while closing http connection (http service core)."));
         }


Align taxonomy filter to right so it doesn't brake the view (#10275)

--- src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/ContentsAdminListTaxonomyFilter.cshtml
+++ src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/ContentsAdminListTaxonomyFilter.cshtml
@@ -2,7 +2,7 @@

-        <select asp-for="SelectedContentItemId" asp-items="Model.Taxonomies" class="selectpicker taxonomy-selectpicker show-tick mr-2" data-header="@T["Filter by {0}", Model.DisplayText]" data-live-search="true" data-selected-text-format="static" data-width="fit" title="@T["{0}", Model.DisplayText]" data-style="btn-sm">
+        <select asp-for="SelectedContentItemId" asp-items="Model.Taxonomies" class="selectpicker taxonomy-selectpicker show-tick mr-2" data-header="@T["Filter by {0}", Model.DisplayText]" data-live-search="true" data-selected-text-format="static" data-width="fit" title="@T["{0}", Model.DisplayText]" data-style="btn-sm" data-dropdown-align-right="auto">
         </select>


Check StakeModifierV2 property is not null on a PH (#2948)

--- src/Stratis.Bitcoin.Features.Consensus/Rules/ProvenHeaderRules/ProvenHeaderCoinstakeRule.cs
+++ src/Stratis.Bitcoin.Features.Consensus/Rules/ProvenHeaderRules/ProvenHeaderCoinstakeRule.cs
@@ -241,6 +241,12 @@

             if (previousProvenHeader != null)
             {
+                if (previousProvenHeader.StakeModifierV2 == null)
+                {
+                    this.Logger.LogTrace("(-)[MODIF_IS_NULL]");
+                    ConsensusErrors.InvalidPreviousProvenHeaderStakeModifier.Throw();
+                }
+
                 //Stake modifier acquired from prev PH.
                 this.Logger.LogTrace("(-)[PREV_PH]");
                 return previousProvenHeader.StakeModifierV2;
@@ -284,12 +290,6 @@

             uint256 previousStakeModifier = this.GetPreviousStakeModifier(chainedHeader);

-            if (previousStakeModifier == null)
-            {
-                this.Logger.LogTrace("(-)[MODIF_IS_NULL]");
-                ConsensusErrors.InvalidPreviousProvenHeaderStakeModifier.Throw();
-            }
-
             if (header.Coinstake.IsCoinStake)
             {
                 this.Logger.LogTrace("Found coinstake checking kernal hash.");


Initialize controller's with default mapping when new profile is created

--- Assets/MixedRealityToolkit/_Core/Definitions/Devices/MixedRealityControllerMappingProfile.cs
+++ Assets/MixedRealityToolkit/_Core/Definitions/Devices/MixedRealityControllerMappingProfile.cs
@@ -102,5 +102,13 @@

             return null;
         }
+
+        private void Awake()
+        {
+            for (int i = 0; i < mixedRealityControllerMappingProfiles.Length; i++)
+            {
+                mixedRealityControllerMappingProfiles[i].SetDefaultInteractionMapping();
+            }
+        }
     }
 }


RA.Messaging.Core 정보를 설정합니다.

RA.Messaging.Core 정보를 설정합니다.

--- source/RA.Messaging.Core/Properties/AssemblyInfo.cs
+++ source/RA.Messaging.Core/Properties/AssemblyInfo.cs
@@ -1,28 +1,9 @@
 using System.Reflection;
-using System.Resources;

-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("RA.Messaging.Core")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("RA.Messaging.Core")]
-[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyCompany("Reative Essentials")]
+[assembly: AssemblyTitle("Reactive Messaging Core")]
+[assembly: AssemblyProduct("Reactive Messaging")]
+[assembly: AssemblyCopyright("Copyright Gyuwon 2017")]
 [assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: NeutralResourcesLanguage("en")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]


Fix bug with Solution dialog not updating the project reference list after every install/uninstall operation. Work items: 1867.

--- src/Dialog10/Providers/SolutionInstalledProvider.cs
+++ src/Dialog10/Providers/SolutionInstalledProvider.cs
@@ -210,6 +210,13 @@
             // For the solution Installed provider, packages can be installed and uninstalled.
             // It's cumbersome to update the packages incrementally, so we just refresh everything.
             SelectedNode.Refresh(resetQueryBeforeRefresh: true);
+
+            // repopulate the list of project references for all package items
+            foreach (PackageItem packageItem in SelectedNode.Extensions)
+            {
+                packageItem.ReferenceProjects.Clear();
+                packageItem.ReferenceProjects.AddRange(GetReferenceProjects(packageItem.PackageIdentity));
+            }
         }

         private void SelectedNode_PackageLoadCompleted(object sender, EventArgs e)


Add ignore for operation canceled exception.

--- src/DotNetCore.CAP/Processor/IDispatcher.Default.cs
+++ src/DotNetCore.CAP/Processor/IDispatcher.Default.cs
@@ -106,6 +106,10 @@
                         {
                             await _executor.DispatchAsync(message.Item1, message.Item2, cancellationToken);
                         }
+                        catch (OperationCanceledException)
+                        {
+                            //expected
+                        }
                         catch (Exception e)
                         {
                             _logger.LogError(e,


* ParameterExtensions check for null

* ParameterExtensions check for null

--- src/FacebookSharp.Extensions/ParameterExtensions.cs
+++ src/FacebookSharp.Extensions/ParameterExtensions.cs
@@ -17,6 +17,8 @@
         /// </remarks>
         public static IDictionary<string, string> LimitTo(this IDictionary<string, string> parameters, int limit)
         {
+            if (parameters == null)
+                parameters = new Dictionary<string, string>();
             parameters.Add("limit", limit.ToString());
             return parameters;
         }
@@ -34,12 +36,16 @@
         /// </remarks>
         public static IDictionary<string, string> Offset(this IDictionary<string, string> parameters, int offset)
         {
+            if (parameters == null)
+                parameters = new Dictionary<string, string>();
             parameters.Add("offset", offset.ToString());
             return parameters;
         }

         public static IDictionary<string, string> Until(this IDictionary<string, string> parameters, string until)
         {
+            if (parameters == null)
+                parameters = new Dictionary<string, string>();
             parameters.Add("until", until);
             return parameters;
         }


Fixes #776

Fixes #776

--- src/Framework/N2/Web/UI/WebControls/FreeTextArea.cs
+++ src/Framework/N2/Web/UI/WebControls/FreeTextArea.cs
@@ -1,118 +1,118 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Configuration;
-using System.Text;
-using System.Web.Hosting;
-using System.Web.UI.WebControls;
-using N2.Configuration;
-using N2.Resources;
-using N2.Web.Tokens;
-using N2.Details;
-
-namespace N2.Web.UI.WebControls
-{
-    /// <summary>
-    /// A wrapper for the ckeditor (http://ckeditor.com).
-    /// </summary>
-    public class FreeTextArea : TextBox
-    {
-        static string contentCssUrl;
-        static bool configEnabled = true;
-        string configJsPath = string.Empty;
-        string overwriteStylesSet = string.Empty;
-        string overwriteFormatTags = string.Empty;
-        string overwriteLanguage = string.Empty;
-        private EditorModeSetting editorMode = EditorModeSetting.Standard;
-        private string additionalFormats = string.Empty;
-        private string useStylesSet = string.Empty;
-        private bool advancedMenues = false;
-        private bool? allowedContent;
-        private KeyValueConfigurationCollection customConfig;
-
-        public FreeTextArea()
-        {
-            TextMode = TextBoxMode.MultiLine;
-            CssClass = "ckeditor";
-        }
-
-
-        public virtual bool EnableFreeTextArea
-        {
-            get { return (bool)(ViewState["EnableFreeTextArea"] ?? configEnabled); }
-            set { ViewState["EnableFreeTextArea"] = value; }
-        }
-
-        public virtual string DocumentBaseUrl
-        {
-            get { return (string)(ViewState["DocumentBaseUrl"]); }
-            set { ViewState["DocumentBaseUrl"] = value; }
-        }
-
-
-        public EditorModeSetting EditorMode
-        {
-            get { return editorMode; }
-            set { editorMode = value; }
-        }
-
-        public string AdditionalFormats
-        {
-            get { return additionalFormats; }
-            set { additionalFormats = value; }
-        }
-
-        public string UseStylesSet
-        {
-            get { return useStylesSet; }
-            set { useStylesSet = value; }
-        }
-
-        protected override void OnInit(EventArgs e)
-        {
-            base.OnInit(e);
-
-            var config = N2.Context.Current.Resolve<EditSection>();
-            if (config != null)
-            {
-                configJsPath = Url.ResolveTokens(config.CkEditor.ConfigJsPath);
-                overwriteStylesSet = Url.ResolveTokens(config.CkEditor.OverwriteStylesSet);
-                overwriteFormatTags = config.CkEditor.OverwriteFormatTags;
-                overwriteLanguage = config.CkEditor.OverwriteLanguage;
-                contentCssUrl = Url.ResolveTokens(config.CkEditor.ContentsCssPath);
-                advancedMenues = config.CkEditor.AdvancedMenus;
-                allowedContent = config.CkEditor.AllowedContent;
-                customConfig = config.CkEditor.Settings ?? new KeyValueConfigurationCollection();
-            }
-        }
-
-        protected override void OnPreRender(EventArgs e)
-        {
-            base.OnPreRender(e);
-            if (EnableFreeTextArea)
-            {
-                Register.JQuery(Page);
-                Register.CkEditor(Page);
-
-                string freeTextAreaInitScript = string.Format("CKEDITOR.replace('{0}', {1});",
-                    ClientID,
-                    GetOverridesJson());
-                Page.ClientScript.RegisterStartupScript(GetType(), "FreeTextArea_" + ClientID, freeTextAreaInitScript, true);
-            }
-			Attributes["ng-non-bindable"] = "true";
-        }
-
-        private IEnumerable<TokenDefinition> GetTokens()
-        {
-            return Context.GetEngine().Resolve<TokenDefinitionFinder>().FindTokens();
-        }
-
-        protected virtual string GetOverridesJson()
-        {
-            IDictionary<string, string> overrides = new Dictionary<string, string>();
-            overrides["elements"] = ClientID;
-			if (string.IsNullOrEmpty(contentCssUrl))
-				overrides["contentsCss"] = "{ManagementUrl}/Resources/Css/editor.css".ResolveUrlTokens();
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+using System.Text;
+using System.Web.Hosting;
+using System.Web.UI.WebControls;
+using N2.Configuration;
+using N2.Resources;
+using N2.Web.Tokens;
+using N2.Details;
+
+namespace N2.Web.UI.WebControls
+{
+    /// <summary>
+    /// A wrapper for the ckeditor (http://ckeditor.com).
+    /// </summary>
+    public class FreeTextArea : TextBox
+    {
+        static string contentCssUrl;
+        static bool configEnabled = true;
+        string configJsPath = string.Empty;
+        string overwriteStylesSet = string.Empty;
+        string overwriteFormatTags = string.Empty;
+        string overwriteLanguage = string.Empty;
+        private EditorModeSetting editorMode = EditorModeSetting.Standard;
+        private string additionalFormats = string.Empty;
+        private string useStylesSet = string.Empty;
+        private bool advancedMenues = false;
+        private bool? allowedContent;
+        private KeyValueConfigurationCollection customConfig;
+
+        public FreeTextArea()
+        {
+            TextMode = TextBoxMode.MultiLine;
+            CssClass = "ckeditor";
+        }
+
+
+        public virtual bool EnableFreeTextArea
+        {
+            get { return (bool)(ViewState["EnableFreeTextArea"] ?? configEnabled); }
+            set { ViewState["EnableFreeTextArea"] = value; }
+        }
+
+        public virtual string DocumentBaseUrl
+        {
+            get { return (string)(ViewState["DocumentBaseUrl"]); }
+            set { ViewState["DocumentBaseUrl"] = value; }
+        }
+
+
+        public EditorModeSetting EditorMode
+        {
+            get { return editorMode; }
+            set { editorMode = value; }
+        }
+
+        public string AdditionalFormats
+        {
+            get { return additionalFormats; }
+            set { additionalFormats = value; }
+        }
+
+        public string UseStylesSet
+        {
+            get { return useStylesSet; }
+            set { useStylesSet = value; }
+        }
+
+        protected override void OnInit(EventArgs e)
+        {
+            base.OnInit(e);
+
+            var config = N2.Context.Current.Resolve<EditSection>();
+            if (config != null)
+            {
+                configJsPath = Url.ResolveTokens(config.CkEditor.ConfigJsPath);
+                overwriteStylesSet = Url.ResolveTokens(config.CkEditor.OverwriteStylesSet);
+                overwriteFormatTags = config.CkEditor.OverwriteFormatTags;
+                overwriteLanguage = config.CkEditor.OverwriteLanguage;
+                contentCssUrl = Url.ResolveTokens(config.CkEditor.ContentsCssPath);
+                advancedMenues = config.CkEditor.AdvancedMenus;
+                allowedContent = config.CkEditor.AllowedContent;
+                customConfig = config.CkEditor.Settings ?? new KeyValueConfigurationCollection();
+            }
+        }
+
+        protected override void OnPreRender(EventArgs e)
+        {
+            base.OnPreRender(e);
+            if (EnableFreeTextArea)
+            {
+                Register.JQuery(Page);
+                Register.CkEditor(Page);
+
+                string freeTextAreaInitScript = string.Format("CKEDITOR.replace('{0}', {1});",
+                    ClientID,
+                    GetOverridesJson());
+                Page.ClientScript.RegisterStartupScript(GetType(), "FreeTextArea_" + ClientID, freeTextAreaInitScript, true);
+            }
+			Attributes["ng-non-bindable"] = "true";
+        }
+
+        private IEnumerable<TokenDefinition> GetTokens()
+        {
+            return Context.GetEngine().Resolve<TokenDefinitionFinder>().FindTokens();
+        }
+
+        protected virtual string GetOverridesJson()
+        {
+            IDictionary<string, string> overrides = new Dictionary<string, string>();
+            overrides["elements"] = ClientID;
+			if (string.IsNullOrEmpty(contentCssUrl))
+				overrides["contentsCss"] = "{ManagementUrl}/Resources/Css/editor.css".ResolveUrlTokens();
             else
 				overrides["contentsCss"] = contentCssUrl;

@@ -121,105 +121,105 @@
 				.AppendQuery("availableModes", "All")
 				.AppendQuery("selectableTypes", "");

-			overrides["filebrowserImageBrowseUrl"] = Url.Parse(Page.Engine().ManagementPaths.MediaBrowserUrl);
-            overrides["filebrowserFlashBrowseUrl"] = overrides["filebrowserImageBrowseUrl"];
-
-            string language = System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;
-
-            if (!string.IsNullOrEmpty(overwriteLanguage))
-                language = overwriteLanguage;
-
-            if (HostingEnvironment.VirtualPathProvider.FileExists(Url.ResolveTokens("{ManagementUrl}/Resources/ckeditor/lang/" + language + ".js")))
-            {
-                overrides["language"] = language;
-            }
-            else
-            {
-                overrides["language"] = "en";
-            }
-
-
-
-            if (!string.IsNullOrEmpty(DocumentBaseUrl))
-                overrides["baseHref"] = Page.ResolveUrl(DocumentBaseUrl);
-
-            if (advancedMenues == false)
-                overrides["removeDialogTabs"] = "image:advanced;link:advanced";
-
-            if (allowedContent.HasValue)
-                overrides["allowedContent"] = allowedContent.Value.ToString().ToLower();
-
-            if (!string.IsNullOrEmpty(configJsPath))
-                overrides["customConfig"] = configJsPath;
-
-
-            if (!string.IsNullOrEmpty(overwriteStylesSet))
-                overrides["stylesSet"] = overwriteStylesSet;
-
-            if (!string.IsNullOrEmpty(useStylesSet))
-                overrides["stylesSet"] = useStylesSet;
-
-
-            if (!string.IsNullOrEmpty(overwriteFormatTags))
-                overrides["format_tags"] = overwriteFormatTags;
-            else
-                overrides["format_tags"] = "p;h1;h2;h3;pre";
-
-
-
-            if (!string.IsNullOrEmpty(additionalFormats))
-            {
-                if (additionalFormats.StartsWith(";"))
-                    overrides["format_tags"] = overrides["format_tags"] + additionalFormats;
-                else
-                    overrides["format_tags"] = overrides["format_tags"] + ";" + additionalFormats;
-
-                if (overrides["format_tags"].EndsWith(";"))
-                    overrides["format_tags"] = overrides["format_tags"].Remove(overrides["format_tags"].Length - 1, 1);
-            }
-
-
-            //switch toolbar
-            switch (editorMode)
-            {
-                case EditorModeSetting.Basic:
-                    overrides["toolbar"] = "[{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline' ] },{ name: 'paragraph', items : [ 'NumberedList','BulletedList' ] }]";
-                    break;
-                case EditorModeSetting.Standard:
-                    overrides["toolbar"] = "[{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar' ] },{ name: 'tools', items : [ 'Maximize'] }, { name: 'document', items : [ 'Source'] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },{ name: 'styles', items : [ 'Styles','Format' ] }]";
-                    break;
-            }
-
-            foreach (NameValueConfigurationElement setting in customConfig)
-		         overrides[setting.Name] = setting.Value;
-
-            return ToJsonString(overrides);
-        }
-
-        protected static string ToJsonString(IDictionary<string, string> collection)
-        {
-            var sb = new StringBuilder("{");
-
-            foreach (string key in collection.Keys)
-            {
-                string value = collection[key];
-                int ignored = 0;
-                if (value == "true")
-                    value = "true";
-                else if (value == "false")
-                    value = "false";
-                else if (value == null)
-                    value = "null";
-                else if (!int.TryParse(value, out ignored) && !value.StartsWith("[") && !value.StartsWith("{"))
-                    value = "'" + value + "'";
-                sb.Append("'").Append(key).Append("': ").Append(value).Append(",");
-            }
-            if (sb.Length > 1)
-                sb.Length--; // remove trailing comma
-
-
-
-            return sb.Append("}").ToString();
-        }
-    }
-}
+			overrides["filebrowserImageBrowseUrl"] = Url.Parse(Page.Engine().ManagementPaths.MediaBrowserUrl);
+            overrides["filebrowserFlashBrowseUrl"] = overrides["filebrowserImageBrowseUrl"];
+
+            string language = System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;
+
+            if (!string.IsNullOrEmpty(overwriteLanguage))
+                language = overwriteLanguage;
+
+            if (HostingEnvironment.VirtualPathProvider.FileExists(Url.ResolveTokens("{ManagementUrl}/Resources/ckeditor/lang/" + language + ".js")))
+            {
+                overrides["language"] = language;
+            }
+            else
+            {
+                overrides["language"] = "en";
+            }
+
+
+
+            if (!string.IsNullOrEmpty(DocumentBaseUrl))
+                overrides["baseHref"] = Page.ResolveUrl(DocumentBaseUrl);
+
+            if (advancedMenues == false)
+                overrides["removeDialogTabs"] = "image:advanced;link:advanced";
+
+            if (allowedContent.HasValue)
+                overrides["allowedContent"] = allowedContent.Value.ToString().ToLower();
+
+            if (!string.IsNullOrEmpty(configJsPath))
+                overrides["customConfig"] = configJsPath;
+
+
+            if (!string.IsNullOrEmpty(overwriteStylesSet))
+                overrides["stylesSet"] = overwriteStylesSet;
+
+            if (!string.IsNullOrEmpty(useStylesSet))
+                overrides["stylesSet"] = useStylesSet;
+
+
+            if (!string.IsNullOrEmpty(overwriteFormatTags))
+                overrides["format_tags"] = overwriteFormatTags;
+            else
+                overrides["format_tags"] = "p;h1;h2;h3;pre";
+
+
+
+            if (!string.IsNullOrEmpty(additionalFormats))
+            {
+                if (additionalFormats.StartsWith(";"))
+                    overrides["format_tags"] = overrides["format_tags"] + additionalFormats;
+                else
+                    overrides["format_tags"] = overrides["format_tags"] + ";" + additionalFormats;
+
+                if (overrides["format_tags"].EndsWith(";"))
+                    overrides["format_tags"] = overrides["format_tags"].Remove(overrides["format_tags"].Length - 1, 1);
+            }
+
+
+            //switch toolbar
+            switch (editorMode)
+            {
+                case EditorModeSetting.Basic:
+                    overrides["toolbar"] = "[{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline' ] },{ name: 'paragraph', items : [ 'NumberedList','BulletedList' ] }]";
+                    break;
+                case EditorModeSetting.Standard:
+                    overrides["toolbar"] = "[{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar' ] },{ name: 'tools', items : [ 'Maximize'] }, { name: 'document', items : [ 'Source'] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },{ name: 'styles', items : [ 'Styles','Format' ] }]";
+                    break;
+            }
+
+            foreach (KeyValueConfigurationElement setting in customConfig)
+		         overrides[setting.Key] = setting.Value;
+
+            return ToJsonString(overrides);
+        }
+
+        protected static string ToJsonString(IDictionary<string, string> collection)
+        {
+            var sb = new StringBuilder("{");
+
+            foreach (string key in collection.Keys)
+            {
+                string value = collection[key];
+                int ignored = 0;
+                if (value == "true")
+                    value = "true";
+                else if (value == "false")
+                    value = "false";
+                else if (value == null)
+                    value = "null";
+                else if (!int.TryParse(value, out ignored) && !value.StartsWith("[") && !value.StartsWith("{"))
+                    value = "'" + value + "'";
+                sb.Append("'").Append(key).Append("': ").Append(value).Append(",");
+            }
+            if (sb.Length > 1)
+                sb.Length--; // remove trailing comma
+
+
+
+            return sb.Append("}").ToString();
+        }
+    }
+}


Timeout was too short for CI

Timeout was too short for CI

--- src/NUnitFramework/tests/Attributes/TimeoutTests.cs
+++ src/NUnitFramework/tests/Attributes/TimeoutTests.cs
@@ -187,14 +187,14 @@
             Thread.Sleep(Timeout.Infinite);
         }

-        [Test, Timeout(100)]
+        [Test, Timeout(1000)]
         public void TestTimeoutDoesNotStopCompletion()
         {
             Thread.Sleep(20);
             Assert.True(true);
         }

-        [Timeout(100)]
+        [Timeout(1000)]
         public void TestTimeoutWhichThrowsTestException()
         {
             throw new ArgumentException($"{nameof(ArgumentException)} was thrown.");


gd: correct resource type name

gd: correct resource type name

--- src/Peachpie.Library.Graphics/PhpGdImageResource.cs
+++ src/Peachpie.Library.Graphics/PhpGdImageResource.cs
@@ -20,6 +20,8 @@
     /// </summary>
     internal class PhpGdImageResource : PhpResource
     {
+        const string ResourceTypeName = "gd";
+
         /// <summary>
         /// Underlying <see cref="Image"/> object.
         /// Cannot be <c>null</c> reference until it is not disposed.
@@ -66,7 +68,7 @@
         //public bool BackgroundAllocated { get; set; }

         private PhpGdImageResource()
-            : base("GdImage")
+            : base(ResourceTypeName)
         {
         }


add gen of project.json file for uap builds

--- gen_build.cs
+++ gen_build.cs
@@ -149,12 +149,10 @@
 		items_pcl.Add(new config_pcl { env="win81", api="pinvoke", what="sqlite3", cpu="x64"});
 		items_pcl.Add(new config_pcl { env="win81", api="pinvoke", what="sqlite3", cpu="x86"});

-#if not
 		items_pcl.Add(new config_pcl { env="uap10", api="pinvoke", what="sqlite3", cpu="anycpu"});
 		items_pcl.Add(new config_pcl { env="uap10", api="pinvoke", what="sqlite3", cpu="arm"});
 		items_pcl.Add(new config_pcl { env="uap10", api="pinvoke", what="sqlite3", cpu="x64"});
 		items_pcl.Add(new config_pcl { env="uap10", api="pinvoke", what="sqlite3", cpu="x86"});
-#endif

 		items_pcl.Add(new config_pcl { env="wpa81", api="pinvoke", what="sqlite3", cpu="anycpu"});
 		items_pcl.Add(new config_pcl { env="wpa81", api="pinvoke", what="sqlite3", cpu="arm"});
@@ -321,13 +319,20 @@

 public static class config_info_ext
 {
-	public static string get_project_path(this config_info cfg, string top)
+	public static string get_project_subdir(this config_info cfg, string top)
 	{
 		string subdir = Path.Combine(Path.Combine(top, cfg.get_name()));
 		Directory.CreateDirectory(subdir);
+		return subdir;
+	}
+
+	public static string get_project_path(this config_info cfg, string top)
+	{
+		string subdir = cfg.get_project_subdir(top);
 		string proj = Path.Combine(subdir, cfg.get_project_filename());
 		return proj;
 	}
+
 }

 public class config_sqlite3 : config_info
@@ -572,6 +577,17 @@
 			}
 		}
 		throw new Exception(get_name());
+	}
+
+	public bool needs_project_dot_json()
+	{
+		switch (env)
+		{
+			case "uap10":
+				return true;
+			default:
+				return false;
+		}
 	}

 	public static string get_nuget_framework_name(string env)
@@ -1769,7 +1785,7 @@
 						break;
 					case "uap10":
 						f.WriteStartElement("PropertyGroup");
-						f.WriteAttributeString("Condition", " '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ");
+						f.WriteAttributeString("Condition", " '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ");
 						f.WriteElementString("VisualStudioVersion", "14.0");
 						f.WriteEndElement(); // PropertyGroup
 						break;
@@ -1942,6 +1958,30 @@
 			f.WriteEndElement(); // Project

 			f.WriteEndDocument();
+		}
+
+		if (cfg.needs_project_dot_json())
+		{
+			string subdir = cfg.get_project_subdir(top);
+			using (TextWriter tw = new StreamWriter(Path.Combine(subdir, "project.json")))
+			{
+				tw.WriteLine("{");
+				tw.WriteLine("    \"dependencies\" : {");
+				tw.WriteLine("         \"Microsoft.NETCore.UniversalWindowsPlatform\": \"5.0.0\"");
+				tw.WriteLine("    },");
+				tw.WriteLine("    \"frameworks\" : {");
+				tw.WriteLine("         \"uap10.0\": {}");
+				tw.WriteLine("    },");
+				tw.WriteLine("    \"runtimes\" : {");
+				tw.WriteLine("         \"win10-arm\": {},");
+				tw.WriteLine("         \"win10-arm-aot\": {},");
+				tw.WriteLine("         \"win10-x86\": {},");
+				tw.WriteLine("         \"win10-x86-aot\": {},");
+				tw.WriteLine("         \"win10-x64\": {},");
+				tw.WriteLine("         \"win10-x64-aot\": {}");
+				tw.WriteLine("    }");
+				tw.WriteLine("}");
+			}
 		}
 	}


fix e_sqlite3 underscore issues in ios libs

--- gen_build.cs
+++ gen_build.cs
@@ -2060,280 +2060,6 @@

     }

-#if not
-	private static void gen_plugin(config_plugin cfg, string root, string top)
-	{
-		XmlWriterSettings settings = new XmlWriterSettings();
-		settings.Indent = true;
-		settings.OmitXmlDeclaration = false;
-
-		string proj = cfg.get_project_path(top);
-		using (XmlWriter f = XmlWriter.Create(proj, settings))
-		{
-			f.WriteStartDocument();
-			f.WriteComment("Automatically generated");
-
-			f.WriteStartElement("Project", "http://schemas.microsoft.com/developer/msbuild/2003");
-			write_toolsversion(f, cfg.env);
-			f.WriteAttributeString("DefaultTargets", "Build");
-
-			// TODO is this actually needed?
-			f.WriteStartElement("Import");
-			f.WriteAttributeString("Project", "$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props");
-			f.WriteAttributeString("Condition", "Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')");
-			f.WriteEndElement(); // Import
-
-			f.WriteStartElement("PropertyGroup");
-
-			f.WriteElementString("ProjectGuid", cfg.guid);
-
-			write_project_type_guids_for_env(f, cfg.env);
-
-			f.WriteStartElement("Configuration");
-			f.WriteAttributeString("Condition", " '$(Configuration)' == '' ");
-
-			f.WriteString("Debug");
-
-			f.WriteEndElement(); // Configuration
-
-			f.WriteElementString("SchemaVersion", "2.0");
-			f.WriteElementString("Platform", "AnyCPU");
-			f.WriteElementString("DefaultLanguage", "en-us");
-			//f.WriteElementString("FileAlignment", "512");
-			f.WriteElementString("WarningLevel", "4");
-			//f.WriteElementString("PlatformTarget", cfg.cpu.Replace(" ", ""));
-			f.WriteElementString("OutputType", "Library");
-			f.WriteElementString("RootNamespace", "SQLitePCL");
-			f.WriteElementString("AssemblyName", string.Format("SQLitePCLPlugin_{0}", cfg.imp)); // match the name in get_products()
-
-			List<string> defines = write_header_properties(f, cfg.env);
-
-			switch (cfg.env)
-			{
-				case "net35":
-				case "net40":
-				case "net45":
-					defines.Add("PRELOAD_FROM_ARCH_DIRECTORY");
-					break;
-			}
-
-			switch (cfg.env)
-			{
-				case "ios_classic":
-				case "ios_unified":
-					switch (cfg.what)
-					{
-						case "plain":
-							// no define needed
-							break;
-						case "custom":
-							defines.Add("IOS_PACKAGED_CUSTOM");
-							break;
-						case "sqlite3":
-							defines.Add("IOS_PACKAGED_SQLITE3");
-							break;
-						case "sqlcipher":
-							defines.Add("IOS_PACKAGED_SQLCIPHER");
-							break;
-						default:
-							throw new Exception(cfg.what);
-					}
-					break;
-			}
-
-			f.WriteEndElement(); // PropertyGroup
-
-			write_section(top, cfg, f, true, defines);
-			write_section(top, cfg, f, false, defines);
-
-			f.WriteStartElement("ItemGroup");
-			write_standard_assemblies(f, cfg.env);
-			f.WriteEndElement(); // ItemGroup
-
-			switch (cfg.env)
-			{
-				case "ios_unified":
-				case "ios_classic":
-					f.WriteStartElement("ItemGroup");
-					write_cs_compile(f, root, "src\\cs\\imp_ios_internal.cs");
-					write_cs_compile(f, top, "pinvoke_ios_internal.cs");
-					write_cs_compile(f, root, "src\\cs\\util.cs");
-					f.WriteEndElement(); // ItemGroup
-					break;
-				default:
-					f.WriteStartElement("ItemGroup");
-					switch (cfg.what)
-					{
-						case "plain":
-							write_cs_compile(f, top, "pinvoke_sqlite3.cs");
-							break;
-						case "custom":
-							write_cs_compile(f, top, "pinvoke_custom_sqlite3.cs");
-							break;
-						case "sqlite3":
-							write_cs_compile(f, top, "pinvoke_esqlite3.cs");
-							break;
-						case "sqlcipher":
-							write_cs_compile(f, top, "pinvoke_sqlcipher.cs");
-							break;
-						default:
-							throw new Exception(cfg.what);
-					}
-					write_cs_compile(f, root, "src\\cs\\util.cs");
-					f.WriteEndElement(); // ItemGroup
-					break;
-			}
-
-			f.WriteStartElement("ItemGroup");
-			f.WriteStartElement("ProjectReference");
-			{
-				config_pcl other = projects.find_bait(cfg.env);
-				f.WriteAttributeString("Include", other.get_project_path(top));
-				f.WriteElementString("Project", other.guid);
-				f.WriteElementString("Name", other.get_name());
-				//f.WriteElementString("Private", "true");
-			}
-			f.WriteEndElement(); // ProjectReference
-			f.WriteEndElement(); // ItemGroup
-
-			switch (cfg.env)
-			{
-				case "ios_unified":
-                        if (cfg.what == "sqlite3")
-                        {
-                            f.WriteStartElement("ItemGroup");
-                            // TODO warning says this is deprecated
-                            f.WriteStartElement("ManifestResourceWithNoCulture");
-                            // TODO underscore in name
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
-                            f.WriteEndElement(); // ManifestResourceWithNoCulture
-                            f.WriteEndElement(); // ItemGroup
-                        }
-			else if (cfg.what == "sqlcipher")
-                        {
-                            f.WriteStartElement("ItemGroup");
-
-                            // TODO warning says this is deprecated
-                            f.WriteStartElement("ManifestResourceWithNoCulture");
-                            f.WriteAttributeString("Include", Path.Combine(root, "couchbase-lite-libsqlcipher\\libs\\ios\\libsqlcipher.a"));
-                            f.WriteElementString("Link", "libsqlcipher.a");
-                            f.WriteEndElement(); // ManifestResourceWithNoCulture
-
-                            f.WriteEndElement(); // ItemGroup
-                        }
-			else if (cfg.what == "plain")
-			{
-				// nothing in resources needed
-			}
-			else if (cfg.what == "custom")
-			{
-				// resource must be provided later
-			}
-			else
-			{
-				throw new NotImplementedException(string.Format("{0}, {1}", cfg.env, cfg.what));
-			}
-					break;
-
-					case "ios_classic":
-                        if (cfg.what == "sqlite3")
-                        {
-                            f.WriteStartElement("ItemGroup");
-                            // TODO warning says this is deprecated
-                            f.WriteStartElement("ManifestResourceWithNoCulture");
-                            // TODO underscore in name
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
-                            f.WriteEndElement(); // ManifestResourceWithNoCulture
-                            f.WriteEndElement(); // ItemGroup
-                        }
-			else if (cfg.what == "sqlcipher")
-                        {
-                            f.WriteStartElement("ItemGroup");
-
-                            // TODO warning says this is deprecated
-                            f.WriteStartElement("ManifestResourceWithNoCulture");
-                            // TODO underscore
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlcipher\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
-                            f.WriteEndElement(); // ManifestResourceWithNoCulture
-
-                            // TODO warning says this is deprecated
-                            f.WriteStartElement("ManifestResourceWithNoCulture");
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\libcrypto.a"));
-                            f.WriteElementString("Link", "libcrypto.a");
-                            f.WriteEndElement(); // ManifestResourceWithNoCulture
-
-                            f.WriteEndElement(); // ItemGroup
-                        }
-			else if (cfg.what == "plain")
-			{
-				// nothing in resources needed
-			}
-			else if (cfg.what == "custom")
-			{
-				// resource must be provided later
-			}
-			else
-			{
-				throw new NotImplementedException(string.Format("{0}, {1}", cfg.env, cfg.what));
-			}
-						break;
-
-					case "android":
-						if (cfg.what == "sqlite3")
-						{
-                            f.WriteStartElement("ItemGroup");
-                            write_android_native_libs(root, f, "sqlite3");
-                            f.WriteEndElement(); // ItemGroup
-						}
-						else if (cfg.what == "sqlcipher")
-						{
-                            f.WriteStartElement("ItemGroup");
-                            write_android_native_libs_sqlcipher(root, f);
-                            f.WriteEndElement(); // ItemGroup
-                        }
-			else if (cfg.what == "plain")
-			{
-				// nothing in resources needed
-				// TODO this should be disallowed as of Android N, right?
-			}
-			else if (cfg.what == "custom")
-			{
-				// dll must be provided later
-			}
-			else
-			{
-				throw new NotImplementedException(string.Format("{0}, {1}", cfg.env, cfg.what));
-			}
-
-						break;
-				}
-
-			write_csproj_footer(f, cfg.env);
-
-			f.WriteEndElement(); // Project
-
-			f.WriteEndDocument();
-		}
-
-		string subdir = cfg.get_project_subdir(top);
-		switch (cfg.env)
-		{
-			case "uap10.0":
-				write_project_dot_json_uap(subdir);
-				break;
-			case "netstandard1.0":
-				write_project_dot_json_netstandard10(subdir);
-				break;
-			case "netstandard1.1":
-				write_project_dot_json_netstandard11(subdir);
-				break;
-		}
-	}
-#endif
-
 	private static void gen_csproj(config_csproj cfg, string root, string top)
 	{
 		XmlWriterSettings settings = new XmlWriterSettings();
@@ -2482,8 +2208,8 @@
                             // TODO warning says this is deprecated
                             f.WriteStartElement("ManifestResourceWithNoCulture");
                             // TODO underscore
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
+                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\e_sqlite3.a"));
+                            f.WriteElementString("Link", "e_sqlite3.a");
                             f.WriteEndElement(); // ManifestResourceWithNoCulture
                             f.WriteEndElement(); // ItemGroup
                         }
@@ -2512,8 +2238,8 @@
                             // TODO warning says this is deprecated
                             f.WriteStartElement("ManifestResourceWithNoCulture");
                             // TODO underscore
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
+                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlite3\\e_sqlite3.a"));
+                            f.WriteElementString("Link", "e_sqlite3.a");
                             f.WriteEndElement(); // ManifestResourceWithNoCulture
                             f.WriteEndElement(); // ItemGroup
                         }
@@ -2524,8 +2250,8 @@
                             // TODO warning says this is deprecated
                             f.WriteStartElement("ManifestResourceWithNoCulture");
                             // TODO underscore
-                            f.WriteAttributeString("Include", Path.Combine(root, "apple\\libs\\ios\\sqlcipher\\esqlite3.a"));
-                            f.WriteElementString("Link", "esqlite3.a");
+                            f.WriteAttributeString("Include", Path.Combine(root, "couchbase-lite-libsqlcipher\\libs\\ios\\libsqlcipher.a"));
+                            f.WriteElementString("Link", "libsqlcipher.a");
                             f.WriteEndElement(); // ManifestResourceWithNoCulture

                             // TODO warning says this is deprecated


Increment version to v1.5

Increment version to v1.5

--- phdesign.NppToolBucket/Properties/AssemblyInfo.cs
+++ phdesign.NppToolBucket/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("phdesign")]
 [assembly: AssemblyProduct("phdesign.NppToolBucket")]
-[assembly: AssemblyCopyright("Copyright © phdesign 2011")]
+[assembly: AssemblyCopyright("Copyright © phdesign 2011 - 2012")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.*")]
+[assembly: AssemblyVersion("1.5.*")]
 //[assembly: AssemblyFileVersion("1.0.0.0")]


update ios language choose

update ios language choose

--- DotNetRu.iOS/Localize.cs
+++ DotNetRu.iOS/Localize.cs
@@ -23,68 +23,13 @@
         }
         public CultureInfo GetCurrentCultureInfo()
         {
-            var netLanguage = "en";
-            if (NSLocale.PreferredLanguages.Length > 0)
+            var language = "en";
+            if (NSLocale.PreferredLanguages.Length > 0 &&
+                NSLocale.PreferredLanguages[0].ToLower().Contains("ru"))
             {
-                var pref = NSLocale.PreferredLanguages[0];
-                netLanguage = iOSToDotnetLanguage(pref);
+                language = "ru";
             }
-            // this gets called a lot - try/catch can be expensive so consider caching or something
-            System.Globalization.CultureInfo ci = null;
-            try
-            {
-                ci = new System.Globalization.CultureInfo(netLanguage);
-            }
-            catch (CultureNotFoundException e1)
-            {
-                // iOS locale not valid .NET culture (eg. "en-ES" : English in Spain)
-                // fallback to first characters, in this case "en"
-                try
-                {
-                    var fallback = ToDotnetFallbackLanguage(new PlatformCulture(netLanguage));
-                    ci = new System.Globalization.CultureInfo(fallback);
-                }
-                catch (CultureNotFoundException e2)
-                {
-                    // iOS language not valid .NET culture, falling back to English
-                    ci = new System.Globalization.CultureInfo("en");
-                }
-            }
-            return ci;
-        }
-        string iOSToDotnetLanguage(string iOSLanguage)
-        {
-            var netLanguage = iOSLanguage;
-            //certain languages need to be converted to CultureInfo equivalent
-            switch (iOSLanguage)
-            {
-                case "ms-MY":   // "Malaysian (Malaysia)" not supported .NET culture
-                case "ms-SG":   // "Malaysian (Singapore)" not supported .NET culture
-                    netLanguage = "ms"; // closest supported
-                    break;
-                case "gsw-CH":  // "Schwiizertüütsch (Swiss German)" not supported .NET culture
-                    netLanguage = "de-CH"; // closest supported
-                    break;
-                // add more application-specific cases here (if required)
-                // ONLY use cultures that have been tested and known to work
-            }
-            return netLanguage;
-        }
-        string ToDotnetFallbackLanguage(PlatformCulture platCulture)
-        {
-            var netLanguage = platCulture.LanguageCode; // use the first part of the identifier (two chars, usually);
-            switch (platCulture.LanguageCode)
-            {
-                case "pt":
-                    netLanguage = "pt-PT"; // fallback to Portuguese (Portugal)
-                    break;
-                case "gsw":
-                    netLanguage = "de-CH"; // equivalent to German (Switzerland) for this app
-                    break;
-                // add more application-specific cases here (if required)
-                // ONLY use cultures that have been tested and known to work
-            }
-            return netLanguage;
+            return new CultureInfo(language);
         }
     }