[
  {
    "path": ".gitattributes",
    "content": "###############################################################################\n# Set default behavior to automatically normalize line endings.\n###############################################################################\n* text=auto\n\n###############################################################################\n# Set default behavior for command prompt diff.\n#\n# This is need for earlier builds of msysgit that does not have it on by\n# default for csharp files.\n# Note: This is only used by command line\n###############################################################################\n#*.cs     diff=csharp\n\n###############################################################################\n# Set the merge driver for project and solution files\n#\n# Merging from the command prompt will add diff markers to the files if there\n# are conflicts (Merging from VS is not affected by the settings below, in VS\n# the diff markers are never inserted). Diff markers may cause the following \n# file extensions to fail to load in VS. An alternative would be to treat\n# these files as binary and thus will always conflict and require user\n# intervention with every merge. To do so, just uncomment the entries below\n###############################################################################\n#*.sln       merge=binary\n#*.csproj    merge=binary\n#*.vbproj    merge=binary\n#*.vcxproj   merge=binary\n#*.vcproj    merge=binary\n#*.dbproj    merge=binary\n#*.fsproj    merge=binary\n#*.lsproj    merge=binary\n#*.wixproj   merge=binary\n#*.modelproj merge=binary\n#*.sqlproj   merge=binary\n#*.wwaproj   merge=binary\n\n###############################################################################\n# behavior for image files\n#\n# image files are treated as binary by default.\n###############################################################################\n#*.jpg   binary\n#*.png   binary\n#*.gif   binary\n\n###############################################################################\n# diff behavior for common document formats\n# \n# Convert binary document formats to text before diffing them. This feature\n# is only available from the command line. Turn it on by uncommenting the \n# entries below.\n###############################################################################\n#*.doc   diff=astextplain\n#*.DOC   diff=astextplain\n#*.docx  diff=astextplain\n#*.DOCX  diff=astextplain\n#*.dot   diff=astextplain\n#*.DOT   diff=astextplain\n#*.pdf   diff=astextplain\n#*.PDF   diff=astextplain\n#*.rtf   diff=astextplain\n#*.RTF   diff=astextplain\n"
  },
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.sln.docstates\n*.csproj.user\n[Ee]xcluded/\nDocumentation/\ndocs/\n\n# External NuGet Packages\n[Pp]ackages/\n\n# Build results\n\n[Dd]ebug/\n[Rr]elease/\nx64/\nbuild/\n[Bb]in/\n[Oo]bj/\n\n# Enable \"build/\" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets\n!packages/*/build/\n\n# Install Sheild Setup Project files\n*.isl\n*.isproj\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n*_i.c\n*_p.c\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.log\n*.scc\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n*.cachefile\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n*.ncrunch*\n.*crunch*.local.xml\n_Ncrunch*\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.Publish.xml\n\n# NuGet Packages Directory\n## TODO: If you have NuGet Package Restore enabled, uncomment the next line\n#packages/\n\n# Windows Azure Build Output\ncsx\n*.build.csdef\n\n# Windows Store app package directory\nAppPackages/\n\n# IDE Configuration\n.vs/\n.vscode/\n\n# Others\nsql/\n*.Cache\nClientBin/\n[Ss]tyle[Cc]op.*\n~$*\n*~\n*.dbmdl\n*.[Pp]ublish.xml\n*.pfx\n*.publishsettings\n*.playlist\n\n# Monodevelop detritus\n*.userprefs\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file to a newer\n# Visual Studio version. Backup files are not needed, because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\nApp_Data/*.mdf\nApp_Data/*.ldf\n\n\n#LightSwitch generated files\nGeneratedArtifacts/\n_Pvt_Extensions/\nModelManifest.xml\n\n# =========================\n# Windows detritus\n# =========================\n\n# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Mac desktop service store files\n.DS_Store\n\n# Workbook for debugging\n*.xlsm\nInstallers/\n*.xlsx\n"
  },
  {
    "path": "CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n            <Word>Alt</Word>\n            <Word>App</Word>\n            <Word>Bkgnd</Word>\n            <Word>Cb</Word>\n            <Word>Calc</Word>\n            <Word>Char</Word>\n            <Word>coloured</Word>\n            <Word>Comm</Word>\n            <Word>Coords</Word>\n            <Word>Ctl</Word>\n            <Word>Dbl</Word>\n            <Word>Dlg</Word>\n            <Word>Eachable</Word>\n            <Word>Fov</Word>\n            <Word>Fwd</Word>\n            <Word>functor</Word>      <Word>functors</Word>\n            <Word>hexgrid</Word>\n            <Word>HexgridExampleWinForms</Word>\n            <Word>HexgridUtilities</Word>\n            <Word>hexside</Word>      <Word>hexsides</Word>\n            <Word>Hotspot</Word>\n            <Word>Hwheel</Word>\n            <Word>Ime</Word>\n            <Word>Init</Word>\n            <Word>Lang</Word>\n            <Word>lhs</Word>\n            <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n            <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n            <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n            <Word>Mdi</Word>\n            <Word>Msgbox</Word>\n            <Word>Napoleonics</Word>\n            <Word>NC</Word>\n            <Word>Neighbour</Word>    <Word>Neighbours</Word>\n            <Word>New32x32</Word>\n            <Word>Overseeable</Word>\n            <Word>Populator</Word>\n            <Word>Pos</Word>\n            <Word>rhs</Word>\n            <Word>c</Word>\n            <Word>dx</Word>\n            <Word>dy</Word>\n            <Word>f</Word>\n            <Word>g</Word>\n            <Word>h</Word>\n            <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n            <Word>l</Word>\n            <Word>m</Word>\n            <Word>p</Word>\n            <Word>Pathfinding</Word>\n            <Word>s</Word>\n            <Word>Sync</Word>\n            <Word>Sys</Word>\n            <Word>TransparentPanel</Word>\n            <Word>Uni</Word>\n            <Word>Uninit</Word>\n            <Word>v</Word>\n            <Word>w</Word>\n            <Word>Wts</Word>\n            <Word>x</Word>      <Word>dx</Word>\n            <Word>y</Word>      <Word>dy</Word>\n            <Word>z</Word>      <Word>dz</Word>\n            <Word>wParam</Word>\n            <Word>lParam</Word>\n            <Word>param</Word>\n            <Word>param</Word>\n            <Word>Lbutton</Word>\n            <Word>Rbutton</Word>\n            <Word>Mbutton</Word>\n            <Word>Xbutton</Word>\n            <Word>Vscroll</Word>\n            <Word>Hscroll</Word>\n            <Word>Afx</Word>\n            <Word>DWM</Word>\n            <Word>Cpl</Word>\n            <Word>Rtl</Word>\n            <Word>Ltr</Word>\n         </Recognized>\n         <Deprecated>\n            <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n         <DiscreteExceptions>\n            <Term>LParam</Term>\n            <Term>lParam</Term>\n            <Term>TransparentPanel</Term>  <!-- Remedies CA1702 Compound words should be cased correctly -->\n            <Term>WParam</Term>\n            <Term>wParam</Term>\n            <Term>LineUp</Term>\n         </DiscreteExceptions>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n            <Acronym>ASL</Acronym>\n            <Acronym>CB</Acronym>\n            <Acronym>CCW</Acronym>\n            <Acronym>DWM</Acronym>\n            <Acronym>Fov</Acronym>\n            <Acronym>NC</Acronym>\n            <Acronym>PG</Acronym>\n            <Acronym>x</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "HexGridExampleCommon/AStarBugMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public sealed class AStarBugMap : MapDisplayBlocked<TerrainGridHex> {\n        public async static Task<AStarBugMap> NewAsync() {\n            var map = new AStarBugMap();\n            map.ForEachHex<TerrainGridHex,AStarBugMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            await map.ResetLandmarksAsync();\n            return map;\n        }\n\n        public static AStarBugMap New() {\n            var map = new AStarBugMap();\n            map.ForEachHex<TerrainGridHex,AStarBugMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            map.ResetLandmarks();\n            return map;\n        }\n\n         /// <summary>TODO</summary>\n         private AStarBugMap() : base(_sizeHexes, new HexSize(26,30), TerrainMap.InitializeHex) { }\n\n        /// <inheritdoc/>\n        public override int?   Heuristic(HexCoords source, HexCoords target)\n        => MinimumStepCost * source.Range(target);\n\n        /// <inheritdoc/>\n        public override int    ElevationBase   =>  0;\n\n        /// <inheritdoc/>\n        public override int    ElevationStep   => 10;\n\n        /// <summary>TODO</summary>\n        protected override int MinimumStepCost => 2;\n\n        /// <inheritdoc/>\n        public override int? Heuristic(IHex source, IHex target) => Heuristic(source.Coords, target.Coords);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(int range) => range;\n\n        #region static Board definition\n        static IReadOnlyList<string> _board     = MapDefinitions.AStarBugMapDefinition;\n        static HexSize               _sizeHexes = new HexSize(_board[0].Length, _board.Count);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n           <Word>Alt</Word>\n           <Word>coloured</Word>\n           <Word>Coords</Word>\n           <Word>Ctl</Word>\n           <Word>Eachable</Word>\n           <Word>Fov</Word>\n           <Word>Fwd</Word>\n           <Word>functor</Word>      <Word>functors</Word>\n           <Word>hexgrid</Word>\n           <Word>HexgridUtilities</Word>\n           <Word>hexside</Word>      <Word>hexsides</Word>\n           <Word>Hotspot</Word>\n           <Word>lhs</Word>\n           <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n           <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n           <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n           <Word>Napoleonics</Word>\n           <Word>Neighbour</Word>    <Word>Neighbours</Word>\n           <Word>rhs</Word>\n           <Word>c</Word>\n           <Word>f</Word>\n           <Word>g</Word>\n           <Word>h</Word>\n           <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n           <Word>m</Word>\n           <Word>p</Word>\n           <Word>Pathfinding</Word>\n           <Word>s</Word>\n           <Word>v</Word>\n           <Word>w</Word>\n           <Word>x</Word>      <Word>dx</Word>\n           <Word>y</Word>      <Word>dy</Word>\n           <Word>z</Word>      <Word>dz</Word>\n           <Word>wParam</Word>\n           <Word>lParam</Word>\n           <Word>params</Word>\n         </Recognized>\n         <Deprecated>\n           <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n           <Acronym>ASL</Acronym>\n           <Acronym>Fov</Acronym>\n           <Acronym>PG</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "HexGridExampleCommon/DocMainPage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n#pragma warning disable 1587\n/// @mainpage HexgridUtilities V 6.4\n/// \n/// @section Introduction \n/// \n/// <b>PGNapoleonics.HexgridUtilities</b> is a library of utilities and controls for buillding strategy simulation games on hexagonal-grid \n/// mapboards.\n/// \n/// @subsection Detailed_Description Detailed Description\n///\n/// - <b>PGNapoleonics</b> is the top level namespace for software develoepd by <b>PGSoftware Solutions.</b>,\n/// and comprises these subsidiary namespaces:\n///   + <b>HexgridExample2</b> is a sample <b>WinForms</b> application demonstrating some straight-forward usage of the library.\n///   + <b>HexgridPanel</b> is the <b>System.Windows.Forms</b> specific extensions to support hex-grid panels in <b>Winforms</b> applications.\n///   + <b>HexUtilities</b> is the display-technology independent utilities underpinnign the provision of hex-grid utilities.\n///   + <b>WinForms</b> is a collection of extensions to the <b>System.Windows.Forms</b> technologies used by the remainder of the library.\n/// \n/// @subsection Getting_Started Getting Started\n///\n/// To get started, explore how the two sample maps in HexgridExample2 override\n/// the base class MapDisplay<THex>, and how the sample form overrides the base control HexgridPanel. \n/// \n/// The Collaboration diagram for MapDisplay<THex> provides a good overview of the library structure.\n/// \n/// @subsection Authorship \n/// \n/// Brought to you by <b>PG Software Solutions</b>, a quality software provider.\n/// \n/// Our software are more than <b>Pretty Good Solutions</b>; ... they're <b>Pretty Great Solutions!</b>\n/// \n/// @subsection The_MIT_License The MIT License:\n/// \n/// @copyright &copy; 2012-2013 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n/// \n/// > Permission is hereby granted, free of charge, to any person obtaining a copy of this  \n/// > software and associated documentation files (the \"Software\"), to deal in the Software  \n/// > without restriction, including without limitation the rights to use, copy, modify,  \n/// > merge, publish, distribute, sublicense, and/or sell copies of the Software, and to  \n/// > permit persons to whom the Software is furnished to do so, subject to the following  \n/// > conditions:\n/// >\n/// >     The above copyright notice and this permission notice shall be \n/// >     included in all copies or substantial portions of the Software.\n/// >\n/// >     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n/// >     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n/// >     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n/// >     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n/// >     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n/// >     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n/// >     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n/// >     OTHER DEALINGS IN THE SOFTWARE.\n//////////////////////////////////////////////////////////////////////////////////////////\n#pragma warning restore 1587\n}\n"
  },
  {
    "path": "HexGridExampleCommon/EmptyBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public sealed class EmptyBoard : MapDisplayBlocked<IHex> {\n        public static EmptyBoard TheOne { get; } = New();\n\n        private static EmptyBoard NewAsync() {\n            var map = new EmptyBoard();\n            map.ResetLandmarksAsync();\n            return map;\n        }\n\n        private static EmptyBoard New() {\n            var map = new EmptyBoard();\n            map.ResetLandmarks();\n            return map;\n        }\n\n        /// <summary>TODO</summary>\n        private EmptyBoard() : base(new HexSize(1,1),new HexSize(26,30),c => new EmptyGridHex(c))\n        => FovRadius = 20;\n\n        /// <inheritdoc/>\n        public override int  ElevationBase     => 0;\n\n        /// <inheritdoc/>\n        public override int  ElevationStep     => 10;\n\n        /// <inheritdoc/>\n        public override int? Heuristic(HexCoords source, HexCoords target) => source.Range(target);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(IHex source, IHex target) => Heuristic(source.Coords, target.Coords);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(int range) => range;\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/EmptyGridHex.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    /// <summary>TODO</summary>\n    public sealed class EmptyGridHex : Hex {\n        /// <summary>TODO</summary>\n        public EmptyGridHex(HexCoords coords) : base(coords,0) => TerrainType = default; \n\n        ///  <inheritdoc/>\n        public override char   TerrainType   { get; }\n\n        ///  <inheritdoc/>\n        public override int    HeightTerrain => 0;\n\n        ///  <inheritdoc/>\n        public override bool   IsPassable => false;\n\n        ///  <inheritdoc/>\n        public override int    EntryCost(Hexside hexsideExit) => -1;\n\n        ///  <inheritdoc/>\n        public override int    ExitCost(Hexside hexsideExit) => -1;\n\n        ///  <inheritdoc/>\n        private         int?   StepCost(Hexside hexsideExit) => default;\n \n        internal void SetCosts<THex>(IBoard<EmptyGridHex> board)\n        => _costs = new List<IList<int>>() {\n             ( from hexside in Hexside.HexsideList select StepCost(hexside) ?? -1).ToList(),\n             ( from hexside in Hexside.HexsideList\n               select ( from hex in board[Coords.GetNeighbour(hexside)] select hex.StepCost(hexside)\n                      ).ElseDefault() ?? -1\n             ).ToList()\n        };\n\n        IList<IList<int>> _costs;\n   }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/HexgridExampleCommon.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleCommon</RootNamespace>\n    <AssemblyName>HexgridExampleCommon</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\HexgridExampleCommon.xml</DocumentationFile>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>false</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EmptyBoard.cs\" />\n    <Compile Include=\"DocMainPage.cs\" />\n    <Compile Include=\"EmptyGridHex.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"MapDefs.cs\" />\n    <Compile Include=\"MapList.cs\" />\n    <Compile Include=\"MazeMap.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"TerrainGridHex.cs\" />\n    <Compile Include=\"AStarBugMap.cs\" />\n    <Compile Include=\"TerrainMap.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"HexgridUtilities.Doxyfile\" />\n    <None Include=\"HexgridUtilities.HtmlHelp.Doxyfile\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexGridExampleCommon/HexgridUtilities.Doxyfile",
    "content": "# Doxyfile 1.8.4\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file \n# that follow. The default is UTF-8 which is also the encoding used for all \n# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n# iconv built into libc) for the transcoding. See \n# http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or sequence of words) that should \n# identify the project. Note that if you do not use Doxywizard you need \n# to put quotes around the project name if it contains spaces.\n\nPROJECT_NAME           = \"Hexgrid Utilities\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         = \"V 6.4\"\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description \n# for a project that appears at the top of each page and should give viewer \n# a quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Hexgrid Utilities for Board Game Implementations\"\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is \n# included in the documentation. The maximum height of the logo should not \n# exceed 55 pixels and the maximum width should not exceed 200 pixels. \n# Doxygen will copy the logo to the output directory.\n\nPROJECT_LOGO           = \n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\Documentation\\XHTML\"\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, \n# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English \n# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, \n# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, \n# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip. Note that you specify absolute paths here, but also \n# relative paths, which will be relative from the directory where doxygen is \n# started.\n\nSTRIP_FROM_PATH        = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful if your file system \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like regular Qt-style comments \n# (thus requiring an explicit @brief command for a brief description.)\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n# interpret the first line (until the first dot) of a Qt-style \n# comment as the brief description. If set to NO, the comments \n# will behave just like regular Qt-style comments (thus requiring \n# an explicit \\brief command for a brief description.)\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# This tag can be used to specify a number of word-keyword mappings (TCL only). \n# A mapping has the form \"name=value\". For example adding \n# \"class=itcl::class\" will allow you to use the command class in the \n# itcl::class meaning.\n\nTCL_SUBST              = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for \n# Java. For instance, namespaces will be presented as packages, qualified \n# scopes will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran \n# sources only. Doxygen will then generate output that is more tailored for \n# Fortran.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL \n# sources. Doxygen will then generate output that is tailored for \n# VHDL.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it \n# parses. With this tag you can assign which parser to use for a given \n# extension. Doxygen has a built-in mapping, but you can override or extend it \n# using this tag. The format is ext=language, where ext is a file extension, \n# and language is one of the parsers supported by doxygen: IDL, Java, \n# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, \n# C++. For instance to make doxygen treat .inc files as Fortran files (default \n# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note \n# that for custom extensions you also need to set FILE_PATTERNS otherwise the \n# files are not read by doxygen.\n\nEXTENSION_MAPPING      = \n\n# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all \n# comments according to the Markdown format, which allows for more readable \n# documentation. See http://daringfireball.net/projects/markdown/ for details. \n# The output of markdown processing is further processed by doxygen, so you \n# can mix doxygen, HTML, and XML commands with Markdown formatting. \n# Disable only in case of backward compatibilities issues.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented \n# classes, or namespaces to their corresponding documentation. Such a link can \n# be prevented in individual cases by by putting a % sign in front of the word \n# or globally by setting AUTOLINK_SUPPORT to NO.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n# to include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also makes the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to \n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. \n# Doxygen will parse them like normal C++ but will assume all classes use public \n# instead of private inheritance when no explicit protection keyword is present.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate \n# getter and setter methods for a property. Setting this option to YES (the \n# default) will make doxygen replace the get and set methods by a property in \n# the documentation. This will only work if the methods are indeed getting or \n# setting a simple type. If this is not the case, or you want to show the \n# methods anyway, you should set this option to NO.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and \n# unions are shown inside the group in which they are included (e.g. using \n# @ingroup) instead of on a separate page (for HTML and Man pages) or \n# section (for LaTeX and RTF).\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and \n# unions with only public data fields or simple typedef fields will be shown \n# inline in the documentation of the scope in which they are defined (i.e. file, \n# namespace, or group documentation), provided this scope is documented. If set \n# to NO (the default), structs, classes, and unions are shown on a separate \n# page (for HTML and Man pages) or section (for LaTeX and RTF).\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n# is documented as struct, union, or enum with the name of the typedef. So \n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n# with name TypeT. When disabled the typedef will appear as a member of a file, \n# namespace, or class. And the struct will be named TypeS. This can typically \n# be useful for C code in case the coding convention dictates that all compound \n# types are typedef'ed and only the typedef is referenced, never the tag name.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This \n# cache is used to resolve symbols given their name and scope. Since this can \n# be an expensive process and often the same symbol appear multiple times in \n# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too \n# small doxygen will become slower. If the cache is too large, memory is wasted. \n# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid \n# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 \n# symbols.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal \n# scope will be included in the documentation.\n\nEXTRACT_PACKAGE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be \n# extracted and appear in the documentation as a namespace called \n# 'anonymous_namespace{file}', where file will be replaced with the base \n# name of the file that contains the anonymous namespace. By default \n# anonymous namespaces are hidden.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = YES\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen \n# will list include files with double quotes in the documentation \n# rather than with sharp brackets.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = YES\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen \n# will sort the (brief and detailed) documentation of class members so that \n# constructors and destructors are listed first. If set to NO (the default) \n# the constructors will appear in the respective orders defined by \n# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. \n# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO \n# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.\n\nSORT_MEMBERS_CTORS_1ST = YES\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the \n# hierarchy of group names into alphabetical order. If set to NO (the default) \n# the group names will appear in their defined order.\n\nSORT_GROUP_NAMES       = YES\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. \n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = YES\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to \n# do proper type resolution of all parameters of a function it will reject a \n# match between the prototype and the implementation of a member function even \n# if there is only one candidate or it is obvious which candidate to choose \n# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen \n# will still accept a match between prototype and implementation in such cases.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if section-label ... \\endif \n# and \\cond section-label ... \\endcond blocks.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or macro consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and macros in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. \n# This will remove the Files entry from the Quick Index and from the \n# Folder Tree View (if specified). The default is YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n# Namespaces page.  This will remove the Namespaces entry from the Quick Index \n# and from the Folder Tree View (if specified). The default is YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from \n# the version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed \n# by doxygen. The layout file controls the global structure of the generated \n# output files in an output format independent way. To create the layout file \n# that represents doxygen's defaults, run doxygen with the -l option. \n# You can optionally specify a file name after the option, if omitted \n# DoxygenLayout.xml will be used as the name of the layout file.\n\nLAYOUT_FILE            = \n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files \n# containing the references data. This must be a list of .bib files. The \n# .bib extension is automatically appended if omitted. Using this command \n# requires the bibtex tool to be installed. See also \n# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style \n# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this \n# feature you need bibtex and perl available in the search path. Do not use \n# file names with spaces, bibtex cannot handle them.\n\nCITE_BIB_FILES         = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = NO\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# The WARN_NO_PARAMDOC option can be enabled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# This tag can be used to specify the character encoding of the source files \n# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is \n# also the default input encoding. Doxygen uses libiconv (or the iconv built \n# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for \n# the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh \n# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py \n# *.f90 *.f *.for *.vhd *.vhdl\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag. \n# Note that relative paths are relative to the directory from which doxygen is \n# run.\n\nEXCLUDE                = \"./C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/obj\" \\\n                         \"../HexgridPanel/Reference Source\"\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or \n# directories that are symbolic links (a Unix file system feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = */obj/* \\\n                         *.Designer.cs\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the \n# output. The symbol name can be a fully qualified name, a word, or if the \n# wildcard * is used, a substring. Examples: ANamespace, AClass, \n# AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = WindowStylesEx \\\n                         WM\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be ignored. \n# Note that the filter must not add or remove lines; it is applied before the \n# code is scanned, but not when the output code is generated. If lines are added \n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty or if \n# non of the patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file \n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) \n# and it is also possible to disable source filtering for a specific pattern \n# using *.ext= (so without naming a filter). This option only has effect when \n# FILTER_SOURCE_FILES is enabled.\n\nFILTER_SOURCE_PATTERNS = \n\n# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that \n# is part of the input, its contents will be placed on the main page \n# (index.html). This can be useful if you have a project on for instance GitHub \n# and want reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C, C++ and Fortran comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) \n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from \n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will \n# link to the source code.  Otherwise they will link to the documentation.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser \n# for more acurate parsing at the cost of reduced performance. This can be \n# particularly helpful with template rich C++ code for which doxygen's built-in \n# parser lacks the necessairy type information.\n\nCLANG_ASSISTED_PARSING = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command \n# line options that you would normally use when invoking the compiler. Note that \n# the include paths will already be set by doxygen for the files and directories \n# specified at INPUT and INCLUDE_PATH.\n\nCLANG_OPTIONS          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = YES\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 2\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .xhtml\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header. Note that when using a custom header you are responsible  \n# for the proper inclusion of any scripts and style sheets that doxygen \n# needs, which is dependent on the configuration options used. \n# It is advised to generate a default header using \"doxygen -w html \n# header.html footer.html stylesheet.css YourConfigFile\" and then modify \n# that header. Note that the header is subject to change so you typically \n# have to redo this when upgrading to a newer version of doxygen or when \n# changing the value of configuration settings such as GENERATE_TREEVIEW!\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If left blank doxygen will \n# generate a default style sheet. Note that it is recommended to use \n# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this \n# tag will in the future become obsolete.\n\nHTML_STYLESHEET        = \n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional \n# user-defined cascading style sheet that is included after the standard \n# style sheets created by doxygen. Using this option one can overrule \n# certain style aspects. This is preferred over using HTML_STYLESHEET \n# since it does not replace the standard style sheet and is therefor more \n# robust against future updates. Doxygen will copy the style sheet file to \n# the output directory.\n\nHTML_EXTRA_STYLESHEET  = \n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or \n# other source files which should be copied to the HTML output directory. Note \n# that these files will be copied to the base HTML output directory. Use the \n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these \n# files. In the HTML_STYLESHEET file, use the file name only. Also note that \n# the files will be copied as-is; there are no commands or markers available.\n\nHTML_EXTRA_FILES       = \n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. \n# Doxygen will adjust the colors in the style sheet and background images \n# according to this color. Hue is specified as an angle on a colorwheel, \n# see http://en.wikipedia.org/wiki/Hue for more information. \n# For instance the value 0 represents red, 60 is yellow, 120 is green, \n# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. \n# The allowed range is 0 to 359.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of \n# the colors in the HTML output. For a value of 0 the output will use \n# grayscales only. A value of 255 will produce the most vivid colors.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to \n# the luminance component of the colors in the HTML output. Values below \n# 100 gradually make the output lighter, whereas values above 100 make \n# the output darker. The value divided by 100 is the actual gamma applied, \n# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, \n# and 100 does not change the gamma.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML \n# page will contain the date and time when the page was generated. Setting \n# this to NO can help when comparing the output of multiple runs.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n# documentation will contain sections that can be hidden and shown after the \n# page has loaded.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of \n# entries shown in the various tree structured indices initially; the user \n# can expand and collapse entries dynamically later on. Doxygen will expand \n# the tree to such a level that at most the specified number of entries are \n# visible (unless a fully collapsed tree already exceeds this amount). \n# So setting the number of entries 1 will produce a full collapsed tree by \n# default. 0 is a special value representing an infinite number of entries \n# and will result in a full expanded tree by default.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files \n# will be generated that can be used as input for Apple's Xcode 3 \n# integrated development environment, introduced with OSX 10.5 (Leopard). \n# To create a documentation set, doxygen will generate a Makefile in the \n# HTML output directory. Running make will produce the docset in that \n# directory and running \"make install\" will install the docset in \n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find \n# it at startup. \n# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html \n# for more information.\n\nGENERATE_DOCSET        = NO\n\n# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the \n# feed. A documentation feed provides an umbrella under which multiple \n# documentation sets from a single provider (such as a company or product suite) \n# can be grouped.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that \n# should uniquely identify the documentation set bundle. This should be a \n# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen \n# will append .docset to the name.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely \n# identify the documentation publisher. This should be a reverse domain-name \n# style string, e.g. com.mycompany.MyDocSet.documentation.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING \n# is used to encode HtmlHelp index (hhk), content (hhc) and project file \n# content.\n\nCHM_INDEX_ENCODING     = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and \n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated \n# that can be used as input for Qt's qhelpgenerator to generate a \n# Qt Compressed Help (.qch) of the generated HTML documentation.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can \n# be used to specify the file name of the resulting .qch file. \n# The path specified is relative to the HTML output folder.\n\nQCH_FILE               = \n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#namespace\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#virtual-folders\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to \n# add. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#custom-filters\n\nQHP_CUST_FILTER_NAME   = \n\n# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the \n# custom filter to add. For more information please see \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#custom-filters\"> \n# Qt Help Project / Custom Filters</a>.\n\nQHP_CUST_FILTER_ATTRS  = \n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this \n# project's \n# filter section matches. \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#filter-attributes\"> \n# Qt Help Project / Filter Attributes</a>.\n\nQHP_SECT_FILTER_ATTRS  = \n\n# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n# be used to specify the location of Qt's qhelpgenerator. \n# If non-empty doxygen will try to run qhelpgenerator on the generated \n# .qhp file.\n\nQHG_LOCATION           = \n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  \n# will be generated, which together with the HTML files, form an Eclipse help \n# plugin. To install this plugin and make it available under the help contents \n# menu in Eclipse, the contents of the directory containing the HTML and XML \n# files needs to be copied into the plugins directory of eclipse. The name of \n# the directory within the plugins directory should be the same as \n# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before \n# the help appears.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the eclipse help plugin. When installing the plugin \n# the directory name containing the HTML and XML files should also have \n# this name.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) \n# at top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it. Since the tabs have the same information as the \n# navigation tree you can set this option to NO if you already set \n# GENERATE_TREEVIEW to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index \n# structure should be generated to display hierarchical information. \n# If the tag value is set to YES, a side panel will be generated \n# containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). \n# Windows users are probably better off using the HTML help feature. \n# Since the tree basically has the same information as the tab index you \n# could consider to set DISABLE_INDEX to NO when enabling this option.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values \n# (range [0,1..20]) that doxygen will group on one line in the generated HTML \n# documentation. Note that a value of 0 will completely suppress the enum \n# values from appearing in the overview section.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open \n# links to external symbols imported via tag files in a separate window.\n\nEXT_LINKS_IN_WINDOW    = YES\n\n# Use this tag to change the font size of Latex formulas included \n# as images in the HTML documentation. The default is 10. Note that \n# when you change the font size after a successful doxygen run you need \n# to manually remove any form_*.png images from the HTML output directory \n# to force them to be regenerated.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images \n# generated for formulas are transparent PNGs. Transparent PNGs are \n# not supported properly for IE 6.0, but are supported on all modern browsers. \n# Note that when changing this option you need to delete any form_*.png files \n# in the HTML output before the changes have effect.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax \n# (see http://www.mathjax.org) which uses client side Javascript for the \n# rendering instead of using prerendered bitmaps. Use this if you do not \n# have LaTeX installed or if you want to formulas look prettier in the HTML \n# output. When enabled you may also need to install MathJax separately and \n# configure the path to it using the MATHJAX_RELPATH option.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for \n# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and \n# SVG. The default value is HTML-CSS, which is slower, but has the best \n# compatibility.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the \n# HTML output directory using the MATHJAX_RELPATH option. The destination \n# directory should contain the MathJax.js script. For instance, if the mathjax \n# directory is located at the same level as the HTML output directory, then \n# MATHJAX_RELPATH should be ../mathjax. The default value points to \n# the MathJax Content Delivery Network so you can quickly see the result without \n# installing MathJax.  However, it is strongly recommended to install a local \n# copy of MathJax from http://www.mathjax.org before deployment.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension \n# names that should be enabled during MathJax rendering.\n\nMATHJAX_EXTENSIONS     = \n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript \n# pieces of code that will be used on startup of the MathJax code.\n\nMATHJAX_CODEFILE       = \n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box \n# for the HTML output. The underlying search engine uses javascript \n# and DHTML and should work on any modern browser. Note that when using \n# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets \n# (GENERATE_DOCSET) there is already a search function so this one should \n# typically be disabled. For large projects the javascript based search engine \n# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be \n# implemented using a web server instead of a web client using Javascript. \n# There are two flavours of web server based search depending on the \n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for \n# searching and an index file used by the script. When EXTERNAL_SEARCH is \n# enabled the indexing and searching needs to be provided by external tools. \n# See the manual for details.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP \n# script for searching. Instead the search results are written to an XML file \n# which needs to be processed by an external indexer. Doxygen will invoke an \n# external search engine pointed to by the SEARCHENGINE_URL option to obtain \n# the search results. Doxygen ships with an example indexer (doxyindexer) and \n# search engine (doxysearch.cgi) which are based on the open source search \n# engine library Xapian. See the manual for configuration details.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server \n# which will returned the search results when EXTERNAL_SEARCH is enabled. \n# Doxygen ships with an example search engine (doxysearch) which is based on \n# the open source search engine library Xapian. See the manual for configuration \n# details.\n\nSEARCHENGINE_URL       = \n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed \n# search data is written to a file for indexing by an external tool. With the \n# SEARCHDATA_FILE tag the name of this file can be specified.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the \n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is \n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple \n# projects and redirect the results back to the right project.\n\nEXTERNAL_SEARCH_ID     = \n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen \n# projects other than the one defined by this configuration file, but that are \n# all added to the same external search index. Each project needs to have a \n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id \n# of to a relative location where the documentation can be found. \n# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...\n\nEXTRA_SEARCH_MAPPINGS  = \n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name. \n# Note that when enabling USE_PDFLATEX this option is only used for \n# generating bitmaps for formulas in the HTML output, but not in the \n# Makefile that is written to the output directory.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, letter, legal and \n# executive. If left blank a4 will be used.\n\nPAPER_TYPE             = letter\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for \n# the generated latex document. The footer should contain everything after \n# the last chapter. If it is left blank doxygen will generate a \n# standard footer. Notice: only use this tag if you know what you are doing!\n\nLATEX_FOOTER           = \n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images \n# or other source files which should be copied to the LaTeX output directory. \n# Note that the files will be copied as-is; there are no commands or markers \n# available.\n\nLATEX_EXTRA_FILES      = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n# If LATEX_SOURCE_CODE is set to YES then doxygen will include \n# source code with syntax highlighting in the LaTeX output. \n# Note that which sources are shown also depends on other settings \n# such as SOURCE_BROWSER.\n\nLATEX_SOURCE_CODE      = YES\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the \n# bibliography, e.g. plainnat, or ieeetr. The default style is \"plain\". See \n# http://en.wikipedia.org/wiki/BibTeX for more info.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load style sheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files \n# that can be used to generate PDF.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in \n# front of it. If left blank docbook will be used as the default path.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# pointed to by INCLUDE_PATH will be searched when a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = \n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition that \n# overrules the definition found in the source code.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all references to function-like macros \n# that are alone on a line, have an all uppercase name, and do not end with a \n# semicolon, because these will confuse the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. For each \n# tag file the location of the external documentation should be added. The \n# format of a tag file without this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths \n# or URLs. Note that each tag file must have a unique name (where the name does \n# NOT include the path). If a tag file is not located in the directory in which \n# doxygen is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed \n# in the related pages index. If set to NO, only the current project's \n# pages will be listed.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option also works with HAVE_DOT disabled, but it is recommended to \n# install and use dot, since it yields more powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see \n# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the \n# documentation. The MSCGEN_PATH tag allows you to specify the directory where \n# the mscgen tool resides. If left empty the tool is assumed to be found in the \n# default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = NO\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is \n# allowed to run in parallel. When set to 0 (the default) doxygen will \n# base this on the number of processors available in the system. You can set it \n# explicitly to a value larger than 0 to get control over the balance \n# between CPU load and processing speed.\n\nDOT_NUM_THREADS        = 0\n\n# By default doxygen will use the Helvetica font for all dot files that \n# doxygen generates. When you want a differently looking font you can specify \n# the font name using DOT_FONTNAME. You need to make sure dot is able to find \n# the font, which can be done by putting it in a standard location or by setting \n# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the \n# directory containing the font.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. \n# The default size is 10pt.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the Helvetica font. \n# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to \n# set the path where dot can find it.\n\nDOT_FONTPATH           = \n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = YES\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside \n# the class node. If there are many fields or methods and many nodes the \n# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS \n# threshold limits the number of items for each type to make the size more \n# manageable. Set this to 0 for no limit. Note that the threshold may be \n# exceeded by 50% before the limit is enforced.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH and HAVE_DOT options are set to YES then \n# doxygen will generate a call dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable call graphs \n# for selected functions only using the \\callgraph command.\n\nCALL_GRAPH             = YES\n\n# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then \n# doxygen will generate a caller dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable caller \n# graphs for selected functions only using the \\callergraph command.\n\nCALLER_GRAPH           = YES\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will generate a graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include \n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are svg, png, jpg, or gif. \n# If left blank png will be used. If you choose svg you need to set \n# HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible in IE 9+ (other browsers do not have this requirement).\n\nDOT_IMAGE_FORMAT       = svg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to \n# enable generation of interactive SVG images that allow zooming and panning. \n# Note that this requires a modern browser other than Internet Explorer. \n# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you \n# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible. Older versions of IE do not have SVG support.\n\nINTERACTIVE_SVG        = YES\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\3rd Party\\GraphViz-2.30.1\\release\\bin\"\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that \n# contain msc files that are included in the documentation (see the \n# \\mscfile command).\n\nMSCFILE_DIRS           = \n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen if the \n# number of direct children of the root node in a graph is already larger than \n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n# graphs generated by dot. A depth value of 3 means that only nodes reachable \n# from the root by following a path via at most 3 edges will be shown. Nodes \n# that lay further from the root node will be omitted. Note that setting this \n# option to 1 or 2 may greatly reduce the computation time needed for large \n# code bases. Also note that the size of a graph can be further restricted by \n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, because dot on Windows does not \n# seem to support this out of the box. Warning: Depending on the platform used, \n# enabling this option may lead to badly anti-aliased labels on the edges of \n# a graph (i.e. they become hard to read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = YES\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "HexGridExampleCommon/HexgridUtilities.HtmlHelp.Doxyfile",
    "content": "# Doxyfile 1.8.4\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file \n# that follow. The default is UTF-8 which is also the encoding used for all \n# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n# iconv built into libc) for the transcoding. See \n# http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or sequence of words) that should \n# identify the project. Note that if you do not use Doxywizard you need \n# to put quotes around the project name if it contains spaces.\n\nPROJECT_NAME           = \"Hexgrid Utilities\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         = \"V 6.4\"\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description \n# for a project that appears at the top of each page and should give viewer \n# a quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Hexgrid Utilities for Board Game Implementations\"\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is \n# included in the documentation. The maximum height of the logo should not \n# exceed 55 pixels and the maximum width should not exceed 200 pixels. \n# Doxygen will copy the logo to the output directory.\n\nPROJECT_LOGO           = \n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\Documentation\\HtmlHelp\"\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, \n# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English \n# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, \n# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, \n# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip. Note that you specify absolute paths here, but also \n# relative paths, which will be relative from the directory where doxygen is \n# started.\n\nSTRIP_FROM_PATH        = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful if your file system \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like regular Qt-style comments \n# (thus requiring an explicit @brief command for a brief description.)\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n# interpret the first line (until the first dot) of a Qt-style \n# comment as the brief description. If set to NO, the comments \n# will behave just like regular Qt-style comments (thus requiring \n# an explicit \\brief command for a brief description.)\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# This tag can be used to specify a number of word-keyword mappings (TCL only). \n# A mapping has the form \"name=value\". For example adding \n# \"class=itcl::class\" will allow you to use the command class in the \n# itcl::class meaning.\n\nTCL_SUBST              = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for \n# Java. For instance, namespaces will be presented as packages, qualified \n# scopes will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran \n# sources only. Doxygen will then generate output that is more tailored for \n# Fortran.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL \n# sources. Doxygen will then generate output that is tailored for \n# VHDL.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it \n# parses. With this tag you can assign which parser to use for a given \n# extension. Doxygen has a built-in mapping, but you can override or extend it \n# using this tag. The format is ext=language, where ext is a file extension, \n# and language is one of the parsers supported by doxygen: IDL, Java, \n# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, \n# C++. For instance to make doxygen treat .inc files as Fortran files (default \n# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note \n# that for custom extensions you also need to set FILE_PATTERNS otherwise the \n# files are not read by doxygen.\n\nEXTENSION_MAPPING      = \n\n# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all \n# comments according to the Markdown format, which allows for more readable \n# documentation. See http://daringfireball.net/projects/markdown/ for details. \n# The output of markdown processing is further processed by doxygen, so you \n# can mix doxygen, HTML, and XML commands with Markdown formatting. \n# Disable only in case of backward compatibilities issues.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented \n# classes, or namespaces to their corresponding documentation. Such a link can \n# be prevented in individual cases by by putting a % sign in front of the word \n# or globally by setting AUTOLINK_SUPPORT to NO.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n# to include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also makes the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to \n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. \n# Doxygen will parse them like normal C++ but will assume all classes use public \n# instead of private inheritance when no explicit protection keyword is present.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate \n# getter and setter methods for a property. Setting this option to YES (the \n# default) will make doxygen replace the get and set methods by a property in \n# the documentation. This will only work if the methods are indeed getting or \n# setting a simple type. If this is not the case, or you want to show the \n# methods anyway, you should set this option to NO.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and \n# unions are shown inside the group in which they are included (e.g. using \n# @ingroup) instead of on a separate page (for HTML and Man pages) or \n# section (for LaTeX and RTF).\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and \n# unions with only public data fields or simple typedef fields will be shown \n# inline in the documentation of the scope in which they are defined (i.e. file, \n# namespace, or group documentation), provided this scope is documented. If set \n# to NO (the default), structs, classes, and unions are shown on a separate \n# page (for HTML and Man pages) or section (for LaTeX and RTF).\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n# is documented as struct, union, or enum with the name of the typedef. So \n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n# with name TypeT. When disabled the typedef will appear as a member of a file, \n# namespace, or class. And the struct will be named TypeS. This can typically \n# be useful for C code in case the coding convention dictates that all compound \n# types are typedef'ed and only the typedef is referenced, never the tag name.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This \n# cache is used to resolve symbols given their name and scope. Since this can \n# be an expensive process and often the same symbol appear multiple times in \n# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too \n# small doxygen will become slower. If the cache is too large, memory is wasted. \n# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid \n# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 \n# symbols.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal \n# scope will be included in the documentation.\n\nEXTRACT_PACKAGE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be \n# extracted and appear in the documentation as a namespace called \n# 'anonymous_namespace{file}', where file will be replaced with the base \n# name of the file that contains the anonymous namespace. By default \n# anonymous namespaces are hidden.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = YES\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen \n# will list include files with double quotes in the documentation \n# rather than with sharp brackets.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = YES\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen \n# will sort the (brief and detailed) documentation of class members so that \n# constructors and destructors are listed first. If set to NO (the default) \n# the constructors will appear in the respective orders defined by \n# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. \n# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO \n# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.\n\nSORT_MEMBERS_CTORS_1ST = YES\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the \n# hierarchy of group names into alphabetical order. If set to NO (the default) \n# the group names will appear in their defined order.\n\nSORT_GROUP_NAMES       = YES\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. \n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = YES\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to \n# do proper type resolution of all parameters of a function it will reject a \n# match between the prototype and the implementation of a member function even \n# if there is only one candidate or it is obvious which candidate to choose \n# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen \n# will still accept a match between prototype and implementation in such cases.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if section-label ... \\endif \n# and \\cond section-label ... \\endcond blocks.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or macro consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and macros in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. \n# This will remove the Files entry from the Quick Index and from the \n# Folder Tree View (if specified). The default is YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n# Namespaces page.  This will remove the Namespaces entry from the Quick Index \n# and from the Folder Tree View (if specified). The default is YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from \n# the version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed \n# by doxygen. The layout file controls the global structure of the generated \n# output files in an output format independent way. To create the layout file \n# that represents doxygen's defaults, run doxygen with the -l option. \n# You can optionally specify a file name after the option, if omitted \n# DoxygenLayout.xml will be used as the name of the layout file.\n\nLAYOUT_FILE            = \n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files \n# containing the references data. This must be a list of .bib files. The \n# .bib extension is automatically appended if omitted. Using this command \n# requires the bibtex tool to be installed. See also \n# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style \n# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this \n# feature you need bibtex and perl available in the search path. Do not use \n# file names with spaces, bibtex cannot handle them.\n\nCITE_BIB_FILES         = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = NO\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# The WARN_NO_PARAMDOC option can be enabled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# This tag can be used to specify the character encoding of the source files \n# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is \n# also the default input encoding. Doxygen uses libiconv (or the iconv built \n# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for \n# the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh \n# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py \n# *.f90 *.f *.for *.vhd *.vhdl\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag. \n# Note that relative paths are relative to the directory from which doxygen is \n# run.\n\nEXCLUDE                = \"./C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/obj\" \\\n                         \"../HexgridPanel/Reference Source\"\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or \n# directories that are symbolic links (a Unix file system feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = */obj/* \\\n                         *.Designer.cs\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the \n# output. The symbol name can be a fully qualified name, a word, or if the \n# wildcard * is used, a substring. Examples: ANamespace, AClass, \n# AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = WindowStylesEx \\\n                         WM\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be ignored. \n# Note that the filter must not add or remove lines; it is applied before the \n# code is scanned, but not when the output code is generated. If lines are added \n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty or if \n# non of the patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file \n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) \n# and it is also possible to disable source filtering for a specific pattern \n# using *.ext= (so without naming a filter). This option only has effect when \n# FILTER_SOURCE_FILES is enabled.\n\nFILTER_SOURCE_PATTERNS = \n\n# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that \n# is part of the input, its contents will be placed on the main page \n# (index.html). This can be useful if you have a project on for instance GitHub \n# and want reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C, C++ and Fortran comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) \n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from \n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will \n# link to the source code.  Otherwise they will link to the documentation.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser \n# for more acurate parsing at the cost of reduced performance. This can be \n# particularly helpful with template rich C++ code for which doxygen's built-in \n# parser lacks the necessairy type information.\n\nCLANG_ASSISTED_PARSING = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command \n# line options that you would normally use when invoking the compiler. Note that \n# the include paths will already be set by doxygen for the files and directories \n# specified at INPUT and INCLUDE_PATH.\n\nCLANG_OPTIONS          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = YES\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 2\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header. Note that when using a custom header you are responsible  \n# for the proper inclusion of any scripts and style sheets that doxygen \n# needs, which is dependent on the configuration options used. \n# It is advised to generate a default header using \"doxygen -w html \n# header.html footer.html stylesheet.css YourConfigFile\" and then modify \n# that header. Note that the header is subject to change so you typically \n# have to redo this when upgrading to a newer version of doxygen or when \n# changing the value of configuration settings such as GENERATE_TREEVIEW!\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If left blank doxygen will \n# generate a default style sheet. Note that it is recommended to use \n# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this \n# tag will in the future become obsolete.\n\nHTML_STYLESHEET        = \n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional \n# user-defined cascading style sheet that is included after the standard \n# style sheets created by doxygen. Using this option one can overrule \n# certain style aspects. This is preferred over using HTML_STYLESHEET \n# since it does not replace the standard style sheet and is therefor more \n# robust against future updates. Doxygen will copy the style sheet file to \n# the output directory.\n\nHTML_EXTRA_STYLESHEET  = \n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or \n# other source files which should be copied to the HTML output directory. Note \n# that these files will be copied to the base HTML output directory. Use the \n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these \n# files. In the HTML_STYLESHEET file, use the file name only. Also note that \n# the files will be copied as-is; there are no commands or markers available.\n\nHTML_EXTRA_FILES       = \n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. \n# Doxygen will adjust the colors in the style sheet and background images \n# according to this color. Hue is specified as an angle on a colorwheel, \n# see http://en.wikipedia.org/wiki/Hue for more information. \n# For instance the value 0 represents red, 60 is yellow, 120 is green, \n# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. \n# The allowed range is 0 to 359.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of \n# the colors in the HTML output. For a value of 0 the output will use \n# grayscales only. A value of 255 will produce the most vivid colors.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to \n# the luminance component of the colors in the HTML output. Values below \n# 100 gradually make the output lighter, whereas values above 100 make \n# the output darker. The value divided by 100 is the actual gamma applied, \n# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, \n# and 100 does not change the gamma.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML \n# page will contain the date and time when the page was generated. Setting \n# this to NO can help when comparing the output of multiple runs.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n# documentation will contain sections that can be hidden and shown after the \n# page has loaded.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of \n# entries shown in the various tree structured indices initially; the user \n# can expand and collapse entries dynamically later on. Doxygen will expand \n# the tree to such a level that at most the specified number of entries are \n# visible (unless a fully collapsed tree already exceeds this amount). \n# So setting the number of entries 1 will produce a full collapsed tree by \n# default. 0 is a special value representing an infinite number of entries \n# and will result in a full expanded tree by default.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files \n# will be generated that can be used as input for Apple's Xcode 3 \n# integrated development environment, introduced with OSX 10.5 (Leopard). \n# To create a documentation set, doxygen will generate a Makefile in the \n# HTML output directory. Running make will produce the docset in that \n# directory and running \"make install\" will install the docset in \n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find \n# it at startup. \n# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html \n# for more information.\n\nGENERATE_DOCSET        = NO\n\n# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the \n# feed. A documentation feed provides an umbrella under which multiple \n# documentation sets from a single provider (such as a company or product suite) \n# can be grouped.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that \n# should uniquely identify the documentation set bundle. This should be a \n# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen \n# will append .docset to the name.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely \n# identify the documentation publisher. This should be a reverse domain-name \n# style string, e.g. com.mycompany.MyDocSet.documentation.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = YES\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\HexgridExample2\\HexgridUtilities.chm\"\n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \"C:/Program Files (x86)/HTML Help Workshop/hhc.exe\"\n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING \n# is used to encode HtmlHelp index (hhk), content (hhc) and project file \n# content.\n\nCHM_INDEX_ENCODING     = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = YES\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and \n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated \n# that can be used as input for Qt's qhelpgenerator to generate a \n# Qt Compressed Help (.qch) of the generated HTML documentation.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can \n# be used to specify the file name of the resulting .qch file. \n# The path specified is relative to the HTML output folder.\n\nQCH_FILE               = \n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#namespace\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#virtual-folders\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to \n# add. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#custom-filters\n\nQHP_CUST_FILTER_NAME   = \n\n# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the \n# custom filter to add. For more information please see \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#custom-filters\"> \n# Qt Help Project / Custom Filters</a>.\n\nQHP_CUST_FILTER_ATTRS  = \n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this \n# project's \n# filter section matches. \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#filter-attributes\"> \n# Qt Help Project / Filter Attributes</a>.\n\nQHP_SECT_FILTER_ATTRS  = \n\n# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n# be used to specify the location of Qt's qhelpgenerator. \n# If non-empty doxygen will try to run qhelpgenerator on the generated \n# .qhp file.\n\nQHG_LOCATION           = \n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  \n# will be generated, which together with the HTML files, form an Eclipse help \n# plugin. To install this plugin and make it available under the help contents \n# menu in Eclipse, the contents of the directory containing the HTML and XML \n# files needs to be copied into the plugins directory of eclipse. The name of \n# the directory within the plugins directory should be the same as \n# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before \n# the help appears.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the eclipse help plugin. When installing the plugin \n# the directory name containing the HTML and XML files should also have \n# this name.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) \n# at top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it. Since the tabs have the same information as the \n# navigation tree you can set this option to NO if you already set \n# GENERATE_TREEVIEW to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index \n# structure should be generated to display hierarchical information. \n# If the tag value is set to YES, a side panel will be generated \n# containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). \n# Windows users are probably better off using the HTML help feature. \n# Since the tree basically has the same information as the tab index you \n# could consider to set DISABLE_INDEX to NO when enabling this option.\n\nGENERATE_TREEVIEW      = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values \n# (range [0,1..20]) that doxygen will group on one line in the generated HTML \n# documentation. Note that a value of 0 will completely suppress the enum \n# values from appearing in the overview section.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open \n# links to external symbols imported via tag files in a separate window.\n\nEXT_LINKS_IN_WINDOW    = YES\n\n# Use this tag to change the font size of Latex formulas included \n# as images in the HTML documentation. The default is 10. Note that \n# when you change the font size after a successful doxygen run you need \n# to manually remove any form_*.png images from the HTML output directory \n# to force them to be regenerated.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images \n# generated for formulas are transparent PNGs. Transparent PNGs are \n# not supported properly for IE 6.0, but are supported on all modern browsers. \n# Note that when changing this option you need to delete any form_*.png files \n# in the HTML output before the changes have effect.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax \n# (see http://www.mathjax.org) which uses client side Javascript for the \n# rendering instead of using prerendered bitmaps. Use this if you do not \n# have LaTeX installed or if you want to formulas look prettier in the HTML \n# output. When enabled you may also need to install MathJax separately and \n# configure the path to it using the MATHJAX_RELPATH option.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for \n# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and \n# SVG. The default value is HTML-CSS, which is slower, but has the best \n# compatibility.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the \n# HTML output directory using the MATHJAX_RELPATH option. The destination \n# directory should contain the MathJax.js script. For instance, if the mathjax \n# directory is located at the same level as the HTML output directory, then \n# MATHJAX_RELPATH should be ../mathjax. The default value points to \n# the MathJax Content Delivery Network so you can quickly see the result without \n# installing MathJax.  However, it is strongly recommended to install a local \n# copy of MathJax from http://www.mathjax.org before deployment.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension \n# names that should be enabled during MathJax rendering.\n\nMATHJAX_EXTENSIONS     = \n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript \n# pieces of code that will be used on startup of the MathJax code.\n\nMATHJAX_CODEFILE       = \n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box \n# for the HTML output. The underlying search engine uses javascript \n# and DHTML and should work on any modern browser. Note that when using \n# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets \n# (GENERATE_DOCSET) there is already a search function so this one should \n# typically be disabled. For large projects the javascript based search engine \n# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.\n\nSEARCHENGINE           = NO\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be \n# implemented using a web server instead of a web client using Javascript. \n# There are two flavours of web server based search depending on the \n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for \n# searching and an index file used by the script. When EXTERNAL_SEARCH is \n# enabled the indexing and searching needs to be provided by external tools. \n# See the manual for details.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP \n# script for searching. Instead the search results are written to an XML file \n# which needs to be processed by an external indexer. Doxygen will invoke an \n# external search engine pointed to by the SEARCHENGINE_URL option to obtain \n# the search results. Doxygen ships with an example indexer (doxyindexer) and \n# search engine (doxysearch.cgi) which are based on the open source search \n# engine library Xapian. See the manual for configuration details.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server \n# which will returned the search results when EXTERNAL_SEARCH is enabled. \n# Doxygen ships with an example search engine (doxysearch) which is based on \n# the open source search engine library Xapian. See the manual for configuration \n# details.\n\nSEARCHENGINE_URL       = \n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed \n# search data is written to a file for indexing by an external tool. With the \n# SEARCHDATA_FILE tag the name of this file can be specified.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the \n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is \n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple \n# projects and redirect the results back to the right project.\n\nEXTERNAL_SEARCH_ID     = \n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen \n# projects other than the one defined by this configuration file, but that are \n# all added to the same external search index. Each project needs to have a \n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id \n# of to a relative location where the documentation can be found. \n# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...\n\nEXTRA_SEARCH_MAPPINGS  = \n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name. \n# Note that when enabling USE_PDFLATEX this option is only used for \n# generating bitmaps for formulas in the HTML output, but not in the \n# Makefile that is written to the output directory.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, letter, legal and \n# executive. If left blank a4 will be used.\n\nPAPER_TYPE             = letter\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for \n# the generated latex document. The footer should contain everything after \n# the last chapter. If it is left blank doxygen will generate a \n# standard footer. Notice: only use this tag if you know what you are doing!\n\nLATEX_FOOTER           = \n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images \n# or other source files which should be copied to the LaTeX output directory. \n# Note that the files will be copied as-is; there are no commands or markers \n# available.\n\nLATEX_EXTRA_FILES      = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n# If LATEX_SOURCE_CODE is set to YES then doxygen will include \n# source code with syntax highlighting in the LaTeX output. \n# Note that which sources are shown also depends on other settings \n# such as SOURCE_BROWSER.\n\nLATEX_SOURCE_CODE      = YES\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the \n# bibliography, e.g. plainnat, or ieeetr. The default style is \"plain\". See \n# http://en.wikipedia.org/wiki/BibTeX for more info.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load style sheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files \n# that can be used to generate PDF.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in \n# front of it. If left blank docbook will be used as the default path.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# pointed to by INCLUDE_PATH will be searched when a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = \n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition that \n# overrules the definition found in the source code.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all references to function-like macros \n# that are alone on a line, have an all uppercase name, and do not end with a \n# semicolon, because these will confuse the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. For each \n# tag file the location of the external documentation should be added. The \n# format of a tag file without this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths \n# or URLs. Note that each tag file must have a unique name (where the name does \n# NOT include the path). If a tag file is not located in the directory in which \n# doxygen is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed \n# in the related pages index. If set to NO, only the current project's \n# pages will be listed.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option also works with HAVE_DOT disabled, but it is recommended to \n# install and use dot, since it yields more powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see \n# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the \n# documentation. The MSCGEN_PATH tag allows you to specify the directory where \n# the mscgen tool resides. If left empty the tool is assumed to be found in the \n# default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = NO\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is \n# allowed to run in parallel. When set to 0 (the default) doxygen will \n# base this on the number of processors available in the system. You can set it \n# explicitly to a value larger than 0 to get control over the balance \n# between CPU load and processing speed.\n\nDOT_NUM_THREADS        = 0\n\n# By default doxygen will use the Helvetica font for all dot files that \n# doxygen generates. When you want a differently looking font you can specify \n# the font name using DOT_FONTNAME. You need to make sure dot is able to find \n# the font, which can be done by putting it in a standard location or by setting \n# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the \n# directory containing the font.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. \n# The default size is 10pt.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the Helvetica font. \n# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to \n# set the path where dot can find it.\n\nDOT_FONTPATH           = \n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = YES\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside \n# the class node. If there are many fields or methods and many nodes the \n# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS \n# threshold limits the number of items for each type to make the size more \n# manageable. Set this to 0 for no limit. Note that the threshold may be \n# exceeded by 50% before the limit is enforced.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH and HAVE_DOT options are set to YES then \n# doxygen will generate a call dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable call graphs \n# for selected functions only using the \\callgraph command.\n\nCALL_GRAPH             = YES\n\n# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then \n# doxygen will generate a caller dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable caller \n# graphs for selected functions only using the \\callergraph command.\n\nCALLER_GRAPH           = YES\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will generate a graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include \n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are svg, png, jpg, or gif. \n# If left blank png will be used. If you choose svg you need to set \n# HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible in IE 9+ (other browsers do not have this requirement).\n\nDOT_IMAGE_FORMAT       = jpg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to \n# enable generation of interactive SVG images that allow zooming and panning. \n# Note that this requires a modern browser other than Internet Explorer. \n# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you \n# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible. Older versions of IE do not have SVG support.\n\nINTERACTIVE_SVG        = YES\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\3rd Party\\GraphViz-2.30.1\\release\\bin\"\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that \n# contain msc files that are included in the documentation (see the \n# \\mscfile command).\n\nMSCFILE_DIRS           = \n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen if the \n# number of direct children of the root node in a graph is already larger than \n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n# graphs generated by dot. A depth value of 3 means that only nodes reachable \n# from the root by following a path via at most 3 edges will be shown. Nodes \n# that lay further from the root node will be omitted. Note that setting this \n# option to 1 or 2 may greatly reduce the computation time needed for large \n# code bases. Also note that the size of a graph can be further restricted by \n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, because dot on Windows does not \n# seem to support this out of the box. Warning: Depending on the platform used, \n# enabling this option may lead to badly anti-aliased labels on the edges of \n# a graph (i.e. they become hard to read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = YES\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "HexGridExampleCommon/MapDefs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    /// <summary>TODO</summary>\n    public static class MapDefinitions {\n\n        #region Map Definitions\n        /// <summary>TODO</summary>\n        public static readonly IReadOnlyList<string> TerrainMapDefinition = new List<string>() {\n          \"...................3.......22...........R..............\",\n          \"...................3.........222222.....R..............\",\n          \"...................3..............2.....R..............\",\n          \"...................33..............22222F.2.2..........\",\n          \"..........WWRR......3...................R2.2.2222......\",\n          \".........WWRRRR.....3.....HHHH..........R........22....\",\n          \".........WRRRRRRR...3....HHMMHH.........R..........22..\",\n          \"..........RRRRRRR....3....HHHH..........R............22\",\n          \"...........RRRR......3..................R..............\",\n          \"............RR.......3..........RRRRRRRR...............\",\n          \".....................3.........R............WW.........\",\n          \".....................3.........R...........WWWWW.......\",\n          \".....................3.........R............WWW........\",\n          \".....................3.........R.......................\",\n          \".....................3.........RRRRRRRR................\",\n          \"..........WWWWWWW....3.................R...............\",\n          \"........WWWWWWWWW....33................R...............\",\n          \".......WWWWWWWWW.....3.33..............R...............\",\n          \"..........WWWWWWW....3...32222222222222F22222..........\",\n          \"...........WWWWWWW...3...2.............R.....222222....\",\n          \"............WWWWW....32222.............R...........22..\",\n          \"....................22....HHHH........RR.............22\",\n          \"................2222.....HHMMHH.....RR.......WW........\",\n          \"............2222..........HHMHH...RR.......WWWWW.......\",\n          \"........2222...............HHH..RR.........WWWW........\",\n          \"......22......................RR............WW.........\",\n          \"..2222......................RR.........................\",\n          \"22..................RRRRRRRR...........................\",\n          \"..................RR...................................\",\n          \".................RRR...................................\"\n        }.AsReadOnly();\n\n        /// <summary>TODO</summary>\n        public static readonly IReadOnlyList<string> MazeMapDefinition = new List<string>() {\n          \".............|.........|.......|.........|.............\",\n          \".............|.........|.......|.........|.............\",\n          \"....xxxxxxxxx|....|....|...|...|...|.....|.............\",\n          \".............|....|....|...|...|...|.....|.............\",\n          \"xxxxxxxxx....|....|....|...|...|...|.....|.............\",\n          \".............|....|....|...|...|...|.....|.............\",\n          \".............|....|....|...|...|...|...................\",\n          \".....xxxxxxxx|....|........|.......|.......xxxxxxxx....\",\n          \"..................|........|.......|.......|......|....\",\n          \"xxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxx......|......|....\",\n          \"................|........|...|.............|...|..|....\",\n          \"xxxxxxxxxxxx....|...|....|...|.............|...|...|...\",\n          \"................|...|....|...|.............|...|...|...\",\n          \"..xxxxxxxxxxxxxxx...|....|...|.............|...|...|...\",\n          \"....................|....|.................|...|...|...\",\n          \"xxxxxxxxxxxxxxxxx..xx....|.................|...|.......\",\n          \".........................|...xxxxxxxxxxxxxxx...|xxxxxxx\",\n          \"xxxxxx...................|...|.................|.......\",\n          \".........xxxxxxxxxxxxxxxxx...|.................|.......\",\n          \".............................|...xxxxxxxxxxxxxx|.......\",\n          \"xxxxxxxxxx......xxxxxxxxxxxxx|...|.....................\",\n          \".............................|...|.....................\",\n          \".............................|...|...xxxxxxxxxxxxx.....\",\n          \"....xxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.................\",\n          \".............................|...|...|..........xxxxxxx\",\n          \"xxxxxxxxxxxxxxxxxxxxxxxxx....|...|...|.....|....|......\",\n          \".............................|...|...|.....|....|......\",\n          \"...xxxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.....|....|......\",\n          \".............................|.......|.....|...........\",\n          \".............................|.......|.....|...........\"\n        }.AsReadOnly();\n\n        /// <summary>TODO</summary>\n        public static readonly IReadOnlyList<string> AStarBugMapDefinition = new List<string>() {\n          \".2333333333R..........2\",\n          \".2........R33333333.22.\",\n          \".2.......R........22...\",\n          \".2......RR......22...RR\",\n          \"R2RRRRRR.......2.......\",\n          \".2.....R.......2....RR.\",\n          \".2.....R.......2.....RR.\",\n          \".2.....R.......2......R.\"\n        }.AsReadOnly();\n        #endregion\n\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/MapList.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    using Map = Map<TerrainGridHex>;\n\n    public static class MapList {\n        public static IReadOnlyList<Map> Maps { get; } = new ReadOnlyCollection<Map>(\n            new Map[] {\n                new Map(\"Terrain Map\", () => TerrainMap.New()),\n                new Map(\"Maze Map\",    () => MazeMap.New()),\n                new Map(\"A* Bug Map\",  () => AStarBugMap.New())\n            } );\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/MazeGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\n//namespace PGNapoleonics.HexgridExampleCommon {\n//  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n//  /// <summary>Abstract class for <c>MapGridHex</c> as used in the MazeGrid example.</summary>\n//  internal abstract class MazeGridHex : MapGridHex {\n//    /// <summary>Initializes a new instance of a <see cref=\"MazeGridHex\"/>.</summary>\n//    /// <param name=\"coords\">Board location of this hex.</param>\n//    /// <param name=\"elevation\">Elevation of this hex.</param>\n//    protected MazeGridHex(HexCoords coords, int elevation) : base(coords, elevation) { }\n//  }\n\n//  /// <summary>A <c>MazeGridHex</c> representing a passable hex in the maze.</summary>\n//  internal sealed class PathMazeGridHex : MazeGridHex {\n//    /// <summary>Create a new instance of a passable <c>MazeGridHex</c>.</summary>\n//    /// <param name=\"coords\">Location of the new hex.</param>\n//    public PathMazeGridHex(HexCoords coords) : base(coords,0) { }\n\n//    /// <inheritdoc/>\n//    public override int  HeightTerrain  { get { return 0; } }\n//    /// <inheritdoc/>\n//    public override Maybe<short> TryStepCost(Hexside direction) { return 1; }\n//    ///  <inheritdoc/>\n//    public override void Paint(Graphics graphics, GraphicsPath graphicsPath) { ; }\n//  }\n\n//  /// <summary>A <c>MazeGridHex</c> representing an impassable hex, or wall, in the maze.</summary>\n//  internal sealed class WallMazeGridHex : MazeGridHex {\n//    /// <summary>Create a new instance of an impassable <c>MazeGridHex</c>.</summary>\n//    /// <param name=\"coords\">Location of the new hex.</param>\n//    public WallMazeGridHex(HexCoords coords) : base(coords,1) { }\n\n//    /// <inheritdoc/>\n//    public override int  HeightTerrain  { get { return 10; } }\n//    /// <inheritdoc/>\n//    public override Maybe<short> TryStepCost(Hexside direction) { return Maybe<short>.NoValue(); }\n//    ///  <inheritdoc/>\n//    public override void Paint(Graphics graphics, GraphicsPath graphicsPath) {\n//      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n//      using(var brush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n//        graphics.FillPath(brush, graphicsPath);\n//    }\n//  }\n//}\n"
  },
  {
    "path": "HexGridExampleCommon/MazeMap.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    using HexSize = System.Drawing.Size;\n    using IMapDef = IReadOnlyList<string>;\n\n    /// <summary>Example of <see cref=\"HexUtilities\"/> usage to implement a maze map.</summary>\n    public sealed class MazeMap : MapDisplayBlocked<TerrainGridHex> {\n        public async static Task<MazeMap> NewAsync() {\n            var map = new MazeMap();\n            map.ForEachHex<TerrainGridHex,MazeMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            await map.ResetLandmarksAsync();\n            return map;\n        }\n\n        public static MazeMap New() {\n            var map = new MazeMap();\n            map.ForEachHex<TerrainGridHex,MazeMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            map.ResetLandmarks();\n            return map;\n        }\n\n        /// <summary>TODO</summary>\n        private MazeMap() : base(_sizeHexes, new HexSize(26,30), InitializeHex) {}\n\n        /// <inheritdoc/>\n        public override int  ElevationBase   =>  0;\n\n        /// <inheritdoc/>\n        public override int  ElevationStep   => 10;\n\n        /// <inheritdoc/>\n        public override int? Heuristic(HexCoords source, HexCoords target)\n        => MinimumStepCost * source.Range(target);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(IHex source, IHex target) => Heuristic(source.Coords, target.Coords);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(int range) => range;\n\n        /// <summary>TODO</summary>\n        protected override int MinimumStepCost => 1;\n\n        static IMapDef         _board     = MapDefinitions.MazeMapDefinition;\n        static HexSize         _sizeHexes = new HexSize(_board[0].Length, _board.Count);\n\n        private new static TerrainGridHex InitializeHex(HexCoords coords) {\n            var value = _board[coords.User.Y][coords.User.X];\n            switch (value) {\n                case '.': return TerrainGridHex.NewPassable   (coords,0, 0, value, 1); // Path\n                default:  return TerrainGridHex.NewImpassable (coords,1,10, value);    // Wall\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Resources;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleCommon\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexgridExampleCommon\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"2cdda541-1494-415c-b276-04a65e32c141\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\n\n[assembly:CLSCompliant(true)]\n\n"
  },
  {
    "path": "HexGridExampleCommon/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleCommon.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    public class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleCommon.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}.\n        /// </summary>\n        public static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}</value>\n  </data>\n</root>"
  },
  {
    "path": "HexGridExampleCommon/TerrainGridHex.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    /// <summary>Implementation of abstract class <c>MapGridHex</c> as used in the examples.</summary>\n    public class TerrainGridHex : Hex {\n        /// <summary>Returns a new passable <see cref=\"TerrainGridHex\"/>, as specified.</summary>\n        /// <param name=\"coords\">Board location of this hex.</param>\n        /// <param name=\"elevationLevel\">Elevation of this hex.</param>\n        /// <param name=\"heightTerrain\"></param>\n        /// <param name=\"terrainType\"></param>\n        /// <param name=\"stepCost\"></param>\n        public static TerrainGridHex NewPassable(HexCoords coords, int elevationLevel,\n                                            int heightTerrain, char terrainType, int stepCost)\n        => new TerrainGridHex(coords, elevationLevel, heightTerrain, terrainType, stepCost);\n\n        /// <summary>Returns a new impassable <see cref=\"TerrainGridHex\"/>.</summary>\n        /// <param name=\"coords\">Board location of this hex.</param>\n        /// <param name=\"elevationLevel\">Elevation of this hex.</param>\n        /// <param name=\"heightTerrain\"></param>\n        /// <param name=\"terrainType\"></param>\n        public static TerrainGridHex NewImpassable(HexCoords coords, int elevationLevel,\n                                            int heightTerrain, char terrainType)\n        => new TerrainGridHex(coords, elevationLevel, heightTerrain, terrainType, null);\n\n        /// <summary>Initializes a new instance of a <see cref=\"TerrainGridHex\"/>.</summary>\n        /// <param name=\"coords\">Board location of this hex.</param>\n        /// <param name=\"elevationLevel\">Elevation of this hex.</param>\n        /// <param name=\"heightTerrain\">Elevation of the terrain in this hex.</param>\n        /// <param name=\"terrainType\">Type of the terrain in this hex.</param>\n        /// <param name=\"stepCost\">Cost to enter this hex.</param>\n        private TerrainGridHex(HexCoords coords, int elevationLevel, int heightTerrain,\n                        char terrainType, int? stepCost)\n        : base(coords,elevationLevel) {\n            HeightTerrain = heightTerrain;\n            TerrainType   = terrainType;\n            _stepCost     = stepCost;\n        }\n\n        ///  <inheritdoc/>\n        public  override int   HeightTerrain { get; }\n\n        ///  <inheritdoc/>\n        public override bool   IsPassable => _stepCost != null;\n\n        ///  <inheritdoc/>\n        public override char   TerrainType   { get; }\n   \n        ///  <inheritdoc/>\n        public override int    EntryCost(Hexside hexside) => _costs[(int)Direction.ToHex][hexside];\n\n        ///  <inheritdoc/>\n        public override int    ExitCost(Hexside hexside) => _costs[(int)Direction.FromHex][hexside];\n\n        ///  <inheritdoc/>\n        private         int?   StepCost(Hexside direction) => _stepCost; \n        internal int? _stepCost { get; }\n\n        internal void SetCosts<THex>(GetHex board)\n        => _costs = new List<IList<int>>() {\n             ( from hexside in Hexside.HexsideList select StepCost(hexside) ?? -1).ToList(),\n             ( from hexside in Hexside.HexsideList\n               select ( from hex in board(Coords.GetNeighbour(hexside)) select hex.StepCost(hexside)\n                      ).ElseDefault() ?? -1\n             ).ToList()\n        };\n\n        IList<IList<int>> _costs;\n\n        internal delegate Maybe<TerrainGridHex> GetHex(HexCoords coords);\n    }\n}\n"
  },
  {
    "path": "HexGridExampleCommon/TerrainMap.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n    using HexSize = System.Drawing.Size;\n    using IMapDef = IReadOnlyList<string>;\n\n    /// <summary>Example of <see cref=\"HexUtilities\"/> usage to implement a terrain map.</summary>\n    public sealed class TerrainMap : MapDisplayBlocked<TerrainGridHex> {\n        public async static Task<TerrainMap> NewAsync() {\n            var map = new TerrainMap();\n            map.ForEachHex<TerrainGridHex,TerrainMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            await map.ResetLandmarksAsync();\n            return map;\n        }\n\n        public static TerrainMap New() {\n            var map = new TerrainMap();\n            map.ForEachHex<TerrainGridHex,TerrainMap>(hex => hex.IfHasValueDo(h=> h.SetCosts<TerrainGridHex>(c => map[c])));\n            map.ResetLandmarks();\n            return map;\n        }\n\n        /// <summary>TODO</summary>\n        private TerrainMap() : base(_sizeHexes, new HexSize(26,30), InitializeHex) {}\n\n        /// <inheritdoc/>\n        public override int  ElevationBase =>  0;\n\n        /// <inheritdoc/>\n        public override int  ElevationStep => 10;\n\n        /// <inheritdoc/>\n        public override int? Heuristic(HexCoords source, HexCoords target) => 2 * source.Range(target);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(IHex source, IHex target) => Heuristic(source.Coords, target.Coords);\n\n        /// <inheritdoc/>\n        public override int? Heuristic(int range) => range;\n\n        static IMapDef       _board     = MapDefinitions.TerrainMapDefinition;\n        static HexSize       _sizeHexes = new HexSize(_board[0].Length, _board.Count);\n\n        public new static TerrainGridHex InitializeHex(HexCoords coords) {\n            char value = _board[coords.User.Y][coords.User.X];\n            switch(value) {\n                case '.': return TerrainGridHex.NewPassable(coords, 0,0,value, 4); // Clear\n                case '2': return TerrainGridHex.NewPassable(coords, 0,0,value, 2); // Pike\n                case '3': return TerrainGridHex.NewPassable(coords, 0,0,value, 3); // Road\n                case 'F': return TerrainGridHex.NewPassable(coords, 0,0,value, 5); // Ford\n                case 'H': return TerrainGridHex.NewPassable(coords, 1,0,value, 5); // Hill\n                case 'M': return TerrainGridHex.NewPassable(coords, 2,0,value, 6); // Mountain\n                case 'W': return TerrainGridHex.NewPassable(coords, 0,7,value, 8); // Woods\n                default:\n                case 'R': return TerrainGridHex.NewImpassable(coords, 0,0,value);    // River\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexGridUtilitiesExamples.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.329\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexUtilities\", \"HexUtilities\\HexUtilities.csproj\", \"{013628E1-60E2-40A6-91D4-8B446F397A0A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridPanel\", \"HexgridPanel\\HexgridPanel.csproj\", \"{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleWpf\", \"HexgridExampleWpf\\HexgridExampleWpf.csproj\", \"{6CEB2C15-1E1A-446C-92C6-77BC49833742}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleCommon\", \"HexGridExampleCommon\\HexgridExampleCommon.csproj\", \"{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleWinforms\", \"HexgridExampleWinforms\\HexgridExampleWinforms.csproj\", \"{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleWinforms2\", \"HexgridExampleWinforms2\\HexgridExampleWinforms2.csproj\", \"{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tChecked|Any CPU = Checked|Any CPU\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {576C0909-BD88-4F7E-A252-299F24B24CE1}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "HexGridUtilitiesForGames.Doxyfile",
    "content": "# Doxyfile 1.8.15\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the configuration\n# file that follow. The default is UTF-8 which is also the encoding used for all\n# text before the first occurrence of this tag. Doxygen uses libiconv (or the\n# iconv built into libc) for the transcoding. See\n# https://www.gnu.org/software/libiconv/ for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = HexgridUtilitiesExamples\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         = \"V 6.4\"\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Hexgrid Utilities for Board Game Implementations - Examples\"\n\n# With the PROJECT_LOGO tag one can specify a logo or an icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy\n# the logo to the output directory.\n\nPROJECT_LOGO           =\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = .\\docs\n\n# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII\n# characters to appear in the names of generated files. If set to NO, non-ASCII\n# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode\n# U+3044.\n# The default value is: NO.\n\nALLOW_UNICODE_NAMES    = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,\n# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),\n# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,\n# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),\n# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,\n# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,\n# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,\n# Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all generated output in the proper direction.\n# Possible values are: None, LTR, RTL and Context.\n# The default value is: None.\n\nOUTPUT_TEXT_DIRECTION  = None\n\n# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = YES\n\n# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = NO\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new\n# page for each member. If set to NO, the documentation of a member will be part\n# of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines (in the resulting output). You can put ^^ in the value part of an\n# alias to insert a newline as if a physical newline was in the original file.\n# When you need a literal { or } or , in the value part of an alias you have to\n# escape them by means of a backslash (\\), this can lead to conflicts with the\n# commands \\{ and \\} for these it is advised to use the version @{ and @} or use\n# a double escape (\\\\{ and \\\\})\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice\n# sources only. Doxygen will then generate output that is more tailored for that\n# language. For instance, namespaces will be presented as modules, types will be\n# separated into more groups, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_SLICE  = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,\n# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:\n# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser\n# tries to guess whether the code is fixed or free formatted code, this is the\n# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat\n# .inc files as Fortran files (default is PHP), and .f files as C (default is\n# Fortran), use: inc=Fortran f=C.\n#\n# Note: For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See https://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up\n# to that level are automatically included in the table of contents, even if\n# they do not have an id attribute.\n# Note: This feature currently applies only to Markdown headings.\n# Minimum value: 0, maximum value: 99, default value: 0.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nTOC_INCLUDE_HEADINGS   = 0\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by putting a % sign in front of the word or\n# globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# If one adds a struct or class to a group and this option is enabled, then also\n# any nested class or struct is added to the same group. By default this option\n# is disabled and one has to add nested compounds explicitly via \\ingroup.\n# The default value is: NO.\n\nGROUP_NESTED_COMPOUNDS = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO,\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. If set to YES, local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO, only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO, these classes will be included in the various overviews. This option\n# has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO, these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO, these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = YES\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES, upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES, the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will\n# append additional text to a page's title, such as Class Reference. If set to\n# YES the compound reference will be hidden.\n# The default value is: NO.\n\nHIDE_COMPOUND_REFERENCE= NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\n# grouped member an include statement to the documentation, telling the reader\n# which file to include in order to use the member.\n# The default value is: NO.\n\nSHOW_GROUPED_MEMB_INC  = NO\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order. Note that\n# this will also influence the order of the classes in the class list.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = YES\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = YES\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = YES\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo\n# list. This list is created by putting \\todo commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test\n# list. This list is created by putting \\test commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES, the\n# list will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. See also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = NO\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO, doxygen will only warn about wrong or incomplete\n# parameter documentation, but not about the absence of documentation. If\n# EXTRACT_ALL is set to YES then this flag will automatically be disabled.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when\n# a warning is encountered.\n# The default value is: NO.\n\nWARN_AS_ERROR          = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = \".\"\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: https://www.gnu.org/software/libiconv/) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# read by doxygen.\n#\n# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,\n# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,\n# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,\n# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,\n# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                = codeplex/* \\\n                         codeplex/ \\\n                         old/\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = */obj/* \\\n                         */bin/* \\\n                         \"*/Reference Source/*\"\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE =\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# entity all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see https://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the\n# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the\n# cost of reduced performance. This can be particularly helpful with template\n# rich C++ code for which doxygen's built-in parser lacks the necessary type\n# information.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n# The default value is: NO.\n\nCLANG_ASSISTED_PARSING = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command\n# line options that you would normally use when invoking the compiler. Note that\n# the include paths will already be set by doxygen for the files and directories\n# specified with INPUT and INCLUDE_PATH.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_OPTIONS          =\n\n# If clang assisted parsing is enabled you can provide the clang parser with the\n# path to the compilation database (see:\n# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files\n# were built. This is equivalent to specifying the \"-p\" option to a clang tool,\n# such as clang-check. These options will then be passed to the parser.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n\nCLANG_DATABASE_PATH    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 2\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .xhtml\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# cascading style sheets that are included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefore more robust against future updates.\n# Doxygen will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list). For an example see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the style sheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# https://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to YES can help to show when doxygen was last run and thus if the\n# documentation is up to date.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML\n# documentation will contain a main index with vertical navigation menus that\n# are dynamically created via Javascript. If disabled, the navigation index will\n# consists of multiple levels of tabs that are statically embedded in every HTML\n# page. Disable this option to support browsers that do not have Javascript,\n# like the Qt help browser.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_MENUS     = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: https://developer.apple.com/xcode/), introduced with OSX\n# 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy\n# genXcode/_index.html for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler (hhc.exe). If non-empty,\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated\n# (YES) or that it should be included in the master .chm file (NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated\n# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it\n# enables the Previous and Next buttons.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = YES\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANSPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# https://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from https://www.mathjax.org before deployment.\n# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavors of web server based searching depending on the EXTERNAL_SEARCH\n# setting. When disabled, doxygen will generate a PHP script for searching and\n# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing\n# and searching needs to be provided by external tools. See the section\n# \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: https://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: https://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when not enabling USE_PDFLATEX the default is latex when enabling\n# USE_PDFLATEX the default is pdflatex and when in the later case latex is\n# chosen this is overwritten by pdflatex. For specific output languages the\n# default can have been set differently, this depends on the implementation of\n# the output language.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# Note: This tag is used in the Makefile / make.bat.\n# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file\n# (.tex).\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to\n# generate index for LaTeX.\n# Note: This tag is used in the generated output file (.tex).\n# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.\n# The default value is: \\makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_MAKEINDEX_CMD    = \\makeindex\n\n# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = letter\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. The package can be specified just\n# by its name or with the correct syntax as to be used with the LaTeX\n# \\usepackage command. To get the times font for instance you can specify :\n# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}\n# To use the option intlimits with the amsmath package you can specify:\n# EXTRA_PACKAGES=[intlimits]{amsmath}\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber,\n# $projectbrief, $projectlogo. Doxygen will replace $title with the empty\n# string, for the replacement values of the other commands the user is referred\n# to HTML_HEADER.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer. See\n# LATEX_HEADER for more information on how to generate a default footer and what\n# special commands can be used inside the footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# LaTeX style sheets that are included after the standard style sheets created\n# by doxygen. Using this option one can overrule certain style aspects. Doxygen\n# will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_STYLESHEET =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES, to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = YES\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# https://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_TIMESTAMP        = NO\n\n# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)\n# path from which the emoji images will be read. If a relative path is entered,\n# it will be relative to the LATEX_OUTPUT directory. If left blank the\n# LATEX_OUTPUT directory will be used.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EMOJI_DIRECTORY  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's\n# configuration file, i.e. a series of assignments. You only have to provide\n# replacements, missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's configuration file. A template extensions file can be\n# generated using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code\n# with syntax highlighting in the RTF output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_SOURCE_CODE        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# The MAN_SUBDIR tag determines the name of the directory created within\n# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by\n# MAN_EXTENSION with the initial . removed.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_SUBDIR             =\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include\n# namespace members in file scope as well, matching the HTML output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_NS_MEMB_FILE_SCOPE = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the\n# program listings (including syntax highlighting and cross-referencing\n# information) to the DOCBOOK output. Note that enabling this will significantly\n# increase the size of the DOCBOOK output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_PROGRAMLISTING = NO\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an\n# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures\n# the structure of the code including all documentation. Note that this feature\n# is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO, the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = NO\n\n# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names\n# in the source code. If set to NO, only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES, the include files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             =\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all references to function-like macros that are alone on a line, have\n# an all uppercase name, and do not end with a semicolon. Such function macros\n# are typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have a unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES, all external class will be listed in\n# the class index. If set to NO, only the inherited external classes will be\n# listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed\n# in the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = NO\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# You can include diagrams made with dia in doxygen documentation. Doxygen will\n# then run dia to produce the diagram and insert it in the documentation. The\n# DIA_PATH tag allows you to specify the directory where the dia binary resides.\n# If left empty dia is assumed to be found in the default search path.\n\nDIA_PATH               =\n\n# If set to YES the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = NO\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font in the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command. Disabling a call graph can be\n# accomplished by means of the command \\hidecallgraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command. Disabling a caller graph can be\n# accomplished by means of the command \\hidecallergraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot. For an explanation of the image formats see the section\n# output formats in the documentation of the dot tool (Graphviz (see:\n# http://www.graphviz.org/)).\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,\n# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and\n# png:gdiplus:gdiplus.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = svg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = YES\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               = \"C:/Program Files (x86)/Graphviz2.38/bin\"\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DIAFILE_DIRS tag can be used to specify one or more directories that\n# contain dia files that are included in the documentation (see the \\diafile\n# command).\n\nDIAFILE_DIRS           =\n\n# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the\n# path where java can find the plantuml.jar file. If left blank, it is assumed\n# PlantUML is not used or called during a preprocessing step. Doxygen will\n# generate a warning when it encounters a \\startuml command in this case and\n# will not generate output for the diagram.\n\nPLANTUML_JAR_PATH      =\n\n# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a\n# configuration file for plantuml.\n\nPLANTUML_CFG_FILE      =\n\n# When using plantuml, the specified paths are searched for files specified by\n# the !include statement in a plantuml block.\n\nPLANTUML_INCLUDE_PATH  =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "HexUtilities/Common/EnumExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Type-safe extension methods for parsing Enums.</summary>\n    public static partial class EnumExtensions{\n        /// <summary>Typesafe wrapper for <c>Enum.GetValues(typeof(TEnum).</c></summary>\n        public static IList<TEnum> EnumGetValues<TEnum>()\n        => new List<TEnum>((TEnum[])(Enum.GetValues(typeof(TEnum)))).AsReadOnly();\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Design\",\"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n        [Obsolete(\"Less useful or convenient than originally thought - just use Enum.GetNames({TEnum}).\")]\n        public static IList<string> EnumGetNames<TEnum>() where TEnum : struct\n        => new List<string>(Enum.GetNames(typeof(TEnum))).AsReadOnly();\n\n        /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks membership.</summary>\n        public static TEnum ParseEnum<TEnum>(string value) where TEnum : struct\n        => ParseEnum<TEnum>(value,true,false);\n\n        /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks membership.</summary>\n        public static TEnum ParseEnum<TEnum>(string value, bool checkConstants, bool ignoreCase)\n        where TEnum : struct {\n            if (!TryParseEnum<TEnum>(value,ignoreCase,out var enumValue) && checkConstants)\n                throw new ArgumentOutOfRangeException(\"value\",value,\"Enum type: \" + typeof(TEnum).Name);\n\n            return enumValue;\n        }\n\n        /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks membership.</summary>\n        public static bool TryParseEnum<TEnum>(string value,bool ignoreCase,out TEnum enumValue)\n        where TEnum : struct\n        => Enum.TryParse(value,ignoreCase,out enumValue)\n        &  Enum.IsDefined(typeof(TEnum),enumValue);\n\n        /// <summary>Typesafe wrapper for <c>Enum.ToObject()</c>.</summary>\n        /// <typeparam name=\"TEnum\"></typeparam>\n        public static TEnum EnumParse<TEnum>(char c, string lookup) {\n            if (lookup==null) throw new ArgumentNullException(\"lookup\");\n            var index = lookup.IndexOf(c);\n            if (index == -1) throw new ArgumentOutOfRangeException(\"c\",c,\"Enum Type: \" + typeof(TEnum).Name);\n\n            return (TEnum) Enum.ToObject(typeof(TEnum), index);\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Common/EnumHelper.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Extension methods for enums that avoid boxing.</summary>\n    public static class EnumHelper {\n        /// <summary>Determines whether one or more bit fields are set in the current instance; without boxing.</summary>\n        /// <remarks>Use <see cref=\"Enum.HasFlag\"/> where CLS-Compliance is required.</remarks>\n        [SuppressMessage(\"Microsoft.Naming\",\"CA1704:IdentifiersShouldBeSpelledCorrectly\",MessageId = \"Hasflag\")]\n        [CLSCompliant(false)]\n        public static bool TestBits<TEnum>(this TEnum bitField,TEnum bitsToTest)\n        where TEnum : struct, IConvertible\n        => EnumHelper<TEnum>.HasflagDelegate(bitField,bitsToTest);\n\n        #region Utility methods for (all possible) base-types of an enumeration;\n        internal static bool HasFlag( sbyte item,  sbyte bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag(  byte item,   byte bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag( short item,  short bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag(ushort item, ushort bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag(   int item,    int bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag(  uint item,   uint bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag(  long item,   long bitFields) => (item & bitFields) != 0;\n        internal static bool HasFlag( ulong item,  ulong bitFields) => (item & bitFields) != 0;\n        #endregion\n    }\n\n    /// <summary>Support class for <see cref=\"EnumHelper\"/>.</summary>\n    /// <typeparam name=\"TEnum\"></typeparam>\n    internal static class EnumHelper<TEnum> where TEnum : struct, IConvertible {\n        /// <summary>Type-safe (and boxing-free) delegate supporting <see cref=\"EnumHelper.TestBits\"/>.</summary>\n        public static readonly Func<TEnum,TEnum,bool> HasflagDelegate = GetHasflagDelegate();\n\n        private static string HasFlag => \"HasFlag\";\n\n        /// <summary>Creates and returns a type-safe Hasflag delegate.</summary>\n        private static Func<TEnum,TEnum,bool> GetHasflagDelegate() {\n            const BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Static;\n\n            var baseType  = EnumBaseType(typeof(TEnum));\n            var baseTypes = new Type[] { baseType, baseType };\n            var method    = typeof(EnumHelper).GetMethod(HasFlag, bindingFlags, null, baseTypes, null);\n            if (method == null) throw new MissingMethodException(typeof(TEnum).Name,HasFlag);\n\n            return (Func<TEnum,TEnum,bool>)method.CreateDelegate(typeof(Func<TEnum, TEnum, bool>));\n        }\n        private static Type EnumBaseType(Type enumType) {\n            if ( ! enumType.IsEnum )        throw new MissingMethodException(typeof(TEnum).Name,HasFlag);\n            var attributes = enumType.GetCustomAttributesData() ?? new List<CustomAttributeData>();\n            if ( ! IsFlagsEnum(attributes)) throw new MissingMethodException(typeof(TEnum).Name,HasFlag);\n            return Enum.GetUnderlyingType(enumType);\n        }\n\n        private static bool IsFlagsEnum(IList<CustomAttributeData> attributes)\n        => attributes.Select(a => IsFlagsAttribute(a)).FirstOrDefault(b => b);\n\n        private static bool IsFlagsAttribute(CustomAttributeData attribute)\n        => attribute.AttributeType.FullName == \"System.FlagsAttribute\";\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Common/EventArgs.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    public class EventArgs<T> : EventArgs {\n        /// <summary>TODO</summary>\n        public EventArgs() : this(default(T)) { }\n        /// <summary>TODO</summary>\n        public EventArgs(T value) : base() => Value = value;\n        /// <summary>TODO</summary>\n        public T Value { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Common/ImmutableStack.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Eric Lippert's implementation for use in A*.</summary>\n    /// <remarks>An implementation of immutable stack for use in A* as a 'Path to here'..</remarks>\n    /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx\">Path Finding Using A* Part THree</a>\n    /// <typeparam name=\"T\"></typeparam>\n    public class ImmutableStack<T> : IEnumerable<T> {\n        /// <summary>Construct a new empty instance.</summary>\n        public ImmutableStack(T start) : this(start, null) {}\n\n        /// <summary>Construct a new instance by Push-ing <paramref name=\"item\"/> onto <paramref name=\"remainder\"/>.</summary>\n        private ImmutableStack(T item, ImmutableStack<T> remainder) {\n            TopItem   = item;\n            Remainder = remainder;\n        }\n\n        /// <summary>Gets the top item on the stack.</summary>\n        public T                 TopItem      { get; }\n\n        /// <summary>Gets the remainder of the stack.</summary>\n        public ImmutableStack<T> Remainder    { get; }\n\n        /// <summary>Returns a new ImmutableStack by adding <paramref name=\"item\"/> to this stack.</summary>\n        public ImmutableStack<T> Push(T item) => new ImmutableStack<T>(item,this);\n\n        /// <summary>Returns the stackitems in order from top to bottom.</summary>\n        public IEnumerator<T> GetEnumerator() {\n            for (var p = this; p != null; p = p.Remainder) { yield return p.TopItem; }\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Common/NativeMethods.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    internal static partial class NativeMethods {\n        [StructLayout(LayoutKind.Sequential)]\n        internal sealed class SystemTime {\n            public ushort year;\n            public ushort month;\n            public ushort weekday;\n            public ushort day;\n            public ushort hour;\n            public ushort minute;\n            public ushort second;\n            public ushort millisecond;\n\n            public override string ToString()\n            => string.Format(CultureInfo.InvariantCulture,\n                    $\"{hour,2}:{minute,2}:{second,2}.{millisecond,3}\");\n        }\n\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        [DllImport(\"Kernel32.dll\")]\n        internal static extern void GetSystemTime([In,Out] SystemTime st);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Common/Tracing.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>enumerationof known debugging trace flags.</summary>\n  public partial struct Tracing {\n    #region Named TraceFlags\n    private static int _bits;\n    /// <summary>TODO</summary>\n    private static readonly IDictionary<string,Tracing> Collection = new Dictionary<string,Tracing>() {\n      { \"None\",             new Tracing(0) },\n      { \"Caching\",          new Tracing(_bits  = 1) },\n      { \"FieldOfView\",      new Tracing(_bits *= 2) },\n      { \"Mouse\",            new Tracing(_bits *= 2) },\n      { \"MouseMove\",        new Tracing(_bits *= 2) },\n      { \"MainForm\",         new Tracing(_bits *= 2) },\n      { \"Initialization\",   new Tracing(_bits *= 2) },\n      { \"Docking\",          new Tracing(_bits *= 2) },\n      { \"MenuEvents\",       new Tracing(_bits *= 2) },\n      { \"KeyEvents\",        new Tracing(_bits *= 2) },\n      { \"Sizing\",           new Tracing(_bits *= 2) },\n      { \"ScrollEvents\",     new Tracing(_bits *= 2) },\n      { \"ToolTipEvents\",    new Tracing(_bits *= 2) },\n      { \"Paint\",            new Tracing(_bits *= 2) },\n      { \"PaintMap\",         new Tracing(_bits *= 2) },\n      { \"PaintDetail\",      new Tracing(_bits *= 2) },\n      { \"FindPathEnqueue\",  new Tracing(_bits *= 2) },\n      { \"FindPathDequeue\",  new Tracing(_bits *= 2) },\n      { \"FindPathDetail\",   new Tracing(_bits *= 2) },\n      { \"FindPathShortcut\", new Tracing(_bits *= 2) }\n    };\n\n    /// <summary>TODO</summary>\n    public static readonly Tracing None             = Item(\"None\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Caching          = Item(\"Caching\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing FieldOfView      = Item(\"FieldOfView\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Mouse            = Item(\"Mouse\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing MouseMove        = Item(\"MouseMove\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing MainForm         = Item(\"MainForm\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Initialization   = Item(\"Initialization\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Docking          = Item(\"Docking\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing MenuEvents       = Item(\"MenuEvents\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing KeyEvents        = Item(\"KeyEvents\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Sizing           = Item(\"Sizing\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing ScrollEvents     = Item(\"ScrollEvents\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing ToolTipEvents    = Item(\"ToolTipEvents\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing Paint            = Item(\"Paint\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing PaintMap         = Item(\"PaintMap\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing PaintDetail      = Item(\"PaintDetail\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing FindPathEnqueue  = Item(\"FindPathEnqueue\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing FindPathDequeue  = Item(\"FindPathDequeue\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing FindPathDetail   = Item(\"FindPathDetail\");\n    /// <summary>TODO</summary>\n    public static readonly Tracing FindPathShortcut = Item(\"FindPathShortcut\");\n    #endregion\n\n    /// <summary>TODO</summary>\n    public static void ForEachKey(Action<string> action, Func<string,bool> predicate) {\n      foreach(var item in Tracing.Collection.Select(t => t.Key).Where(t => predicate(t))) action(item);\n    }\n    /// <summary>TODO</summary>\n    public static void ForEachValue(Action<Tracing> action, Func<Tracing,bool> predicate) {\n      foreach(var item in Tracing.Collection.Select(t => t.Value).Where(t => predicate(t))) action(item);\n    }\n    /// <summary>TODO</summary>\n    public static Tracing Item(string name) {\n      return Collection[name];\n    }\n    /// <summary>TODO</summary>\n    public static Tracing EnabledTraces { get; set; }\n\n    private Tracing(int enumValue) : this() { Value = enumValue; }\n\n    /// <summary>TODO</summary>\n    private bool HasFlag(Tracing bits) { return (this & bits) != Tracing.None; }\n\n    /// <summary>TODO</summary>\n    public  int  Value { get; private set; }\n\n    /// <summary>TODO</summary>\n    [Conditional(\"TRACE\")]\n    public  void Trace(string format) => Trace(false, format);\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n    [Conditional(\"TRACE\")]\n    public  void Trace(string format, params object[] args)\n    =>  Trace(false, string.Format(CultureInfo.CurrentCulture,format,args));\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n    [Conditional(\"TRACE\")]\n    public  void Trace(bool newLine, string format, params object[] args)\n     => Trace(newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n\n    #region Operators\n    /// <summary>TODO</summary>\n    public static Tracing operator & (Tracing lhs, Tracing rhs) {return new Tracing(lhs.Value & rhs.Value);}\n    /// <summary>TODO</summary>\n    public static Tracing operator | (Tracing lhs, Tracing rhs) {return new Tracing(lhs.Value | rhs.Value);}\n    /// <summary>TODO</summary>\n    public static Tracing operator ~ (Tracing lhs)            {return new Tracing(~lhs.Value);}\n\n    /// <summary>TODO</summary>\n    public static Tracing operator + (Tracing lhs, Tracing rhs) {return new Tracing((lhs |  rhs).Value);}\n    /// <summary>TODO</summary>\n    public static Tracing operator - (Tracing lhs, Tracing rhs) {return new Tracing((lhs & ~rhs).Value);}\n\n    /// <summary>TODO</summary>\n    public static Tracing BitwiseAnd    (Tracing lhs, Tracing rhs) { return (lhs & rhs); }\n    /// <summary>TODO</summary>\n    public static Tracing BitwiseOr     (Tracing lhs, Tracing rhs) { return (lhs | rhs); }\n    /// <summary>TODO</summary>\n    public static Tracing OnesComplement(Tracing lhs)                { return ~lhs; }\n\n    /// <summary>TODO</summary>\n    public static Tracing Add           (Tracing lhs, Tracing rhs) { return (lhs + rhs); }\n    /// <summary>TODO</summary>\n    public static Tracing Subtract      (Tracing lhs, Tracing rhs) { return (lhs - rhs); }\n    #endregion\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n    [Conditional(\"TRACE\")]\n    public void Trace(bool newLine, string description) =>  TraceDetail(newLine, description);\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n    [Conditional(\"TRACE\")]\n    public void LogTime(string format, params object[] args)\n    =>  LogTime(false, string.Format(CultureInfo.CurrentCulture,format,args));\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n    [Conditional(\"TRACE\")]\n    public void LogTime(bool newLine, string format, params object[] args)\n    =>  LogTime(newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n    [Conditional(\"TRACE\")]\n    public void LogTime(string description) =>  LogTime(false, description);\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n    [Conditional(\"TRACE\")]\n    public void LogTime(bool newLine, string description)\n    =>  LogTimeDetail(newLine, description);\n\n    partial void TraceDetail(bool newLine, string description);\n    partial void LogTimeDetail(bool newLine, string description);\n\n    [Conditional(\"TRACE\")]\n    partial void TraceDetail(bool newLine, string description) {\n      if (HasFlag(Tracing.EnabledTraces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        System.Diagnostics.Trace.WriteLine(description);\n      }\n    }\n\n    [Conditional(\"TRACE\")]\n    partial void LogTimeDetail(bool newLine, string description) {\n      if (HasFlag(Tracing.EnabledTraces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        var st = new NativeMethods.SystemTime();\n        NativeMethods.GetSystemTime(st);\n\n        System.Diagnostics.Trace.Write(\"{0} - \", st.ToString());\n        Trace(false, description);\n      }\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as Tracing?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Value.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(Tracing other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (Tracing lhs, Tracing rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (Tracing lhs, Tracing rhs) { return (lhs.Value == rhs.Value); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexUtilities/Common/ValueChangedEventArgs.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    public class ValueChangedEventArgs<T> : EventArgs<T> {\n        /// <summary>TODO</summary>\n        public ValueChangedEventArgs(T value, T oldValue) : base(value) => OldValue = oldValue;\n\n        /// <summary>TODO</summary>\n        public T OldValue { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/CustomCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n    public class CustomCoords : IFormatProvider, ICustomFormatter {\n        /// <summary>Return the coordinate vector of this hex in the Custom frame.</summary>\n        public IntVector2D UserToCustom(HexCoords coords)\n        => coords.User * MatrixUserToCustom;\n        \n        /// <summary>Return the coordinate vector of this hex in the User frame.</summary>\n        public HexCoords CustomToUser(IntVector2D coords)\n        => HexCoords.NewUserCoords(coords * MatrixUserToCustom);\n\n        /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n        public CustomCoords(IntMatrix2D matrix) : this(matrix,matrix) { }\n\n        /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n        public CustomCoords(IntMatrix2D userToCustom, IntMatrix2D customToUser) {\n            MatrixUserToCustom = userToCustom;\n            MatrixCustomToUser = customToUser;\n        }\n\n        /// <summary>Gets the conversion @this from Custom to Rectangular (User) coordinates.</summary>\n        public IntMatrix2D MatrixCustomToUser { get; }\n\n        /// <summary>Gets the conversion @this from Rectangular (User) to Custom coordinates.</summary>\n        public IntMatrix2D MatrixUserToCustom { get; }\n\n        /// <summary>TODO</summary>\n        public ICustomFormatter GetFormat(Type formatType)\n        => formatType == typeof(HexCoords) ? this : CultureInfo.CurrentUICulture.GetFormat(formatType) as ICustomFormatter;\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Naming\", \"CA1719:ParameterNamesShouldNotMatchMemberNames\", MessageId = \"0#\",\n                                    Justification=\"Agrees with interface specification.\")]\n        public string Format(string format, HexCoords coords, IFormatProvider formatProvider) {\n            if (format==null || format.Length==0) format = \"U\";\n            switch(format[0]) {\n                case 'U': return UserToCustom(coords).ToString(format.Substring(1), formatProvider);\n                case 'u': return \"Custom: \" + \n                                 UserToCustom(coords).ToString(format.Substring(1), formatProvider);\n\n                default:  return coords.ToString(format, formatProvider);\n            }\n        }\n\n        object IFormatProvider.GetFormat(Type formatType) => GetFormat(formatType);\n \n        string ICustomFormatter.Format(string format, object arg, IFormatProvider formatProvider)\n        => Format(format, arg as HexCoords?, formatProvider);\n\n        string Format(string format, HexCoords? coords, IFormatProvider formatProvider)\n        => coords.HasValue ? Format(format, coords.Value, formatProvider)\n                           : HandleOtherFormats(format, coords);\n\n        private static string HandleOtherFormats(string format, object obj)\n        => (obj is IFormattable f) ? f.ToString(format, CultureInfo.CurrentCulture)\n                                   : obj?.ToString() ?? string.Empty;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Doxyfile",
    "content": "# Doxyfile 1.8.15\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the configuration\n# file that follow. The default is UTF-8 which is also the encoding used for all\n# text before the first occurrence of this tag. Doxygen uses libiconv (or the\n# iconv built into libc) for the transcoding. See\n# https://www.gnu.org/software/libiconv/ for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = HexUtilities\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"HexGrid Utilities for games\"\n\n# With the PROJECT_LOGO tag one can specify a logo or an icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy\n# the logo to the output directory.\n\nPROJECT_LOGO           =\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = docs\n\n# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII\n# characters to appear in the names of generated files. If set to NO, non-ASCII\n# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode\n# U+3044.\n# The default value is: NO.\n\nALLOW_UNICODE_NAMES    = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,\n# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),\n# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,\n# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),\n# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,\n# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,\n# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,\n# Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all generated output in the proper direction.\n# Possible values are: None, LTR, RTL and Context.\n# The default value is: None.\n\nOUTPUT_TEXT_DIRECTION  = None\n\n# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = YES\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new\n# page for each member. If set to NO, the documentation of a member will be part\n# of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines (in the resulting output). You can put ^^ in the value part of an\n# alias to insert a newline as if a physical newline was in the original file.\n# When you need a literal { or } or , in the value part of an alias you have to\n# escape them by means of a backslash (\\), this can lead to conflicts with the\n# commands \\{ and \\} for these it is advised to use the version @{ and @} or use\n# a double escape (\\\\{ and \\\\})\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice\n# sources only. Doxygen will then generate output that is more tailored for that\n# language. For instance, namespaces will be presented as modules, types will be\n# separated into more groups, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_SLICE  = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,\n# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:\n# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser\n# tries to guess whether the code is fixed or free formatted code, this is the\n# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat\n# .inc files as Fortran files (default is PHP), and .f files as C (default is\n# Fortran), use: inc=Fortran f=C.\n#\n# Note: For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See https://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up\n# to that level are automatically included in the table of contents, even if\n# they do not have an id attribute.\n# Note: This feature currently applies only to Markdown headings.\n# Minimum value: 0, maximum value: 99, default value: 0.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nTOC_INCLUDE_HEADINGS   = 0\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by putting a % sign in front of the word or\n# globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# If one adds a struct or class to a group and this option is enabled, then also\n# any nested class or struct is added to the same group. By default this option\n# is disabled and one has to add nested compounds explicitly via \\ingroup.\n# The default value is: NO.\n\nGROUP_NESTED_COMPOUNDS = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = NO\n\n# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = NO\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO,\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. If set to YES, local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO, only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO, these classes will be included in the various overviews. This option\n# has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO, these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO, these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES, upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = NO\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES, the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will\n# append additional text to a page's title, such as Class Reference. If set to\n# YES the compound reference will be hidden.\n# The default value is: NO.\n\nHIDE_COMPOUND_REFERENCE= NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\n# grouped member an include statement to the documentation, telling the reader\n# which file to include in order to use the member.\n# The default value is: NO.\n\nSHOW_GROUPED_MEMB_INC  = NO\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order. Note that\n# this will also influence the order of the classes in the class list.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo\n# list. This list is created by putting \\todo commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test\n# list. This list is created by putting \\test commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES, the\n# list will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. See also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO, doxygen will only warn about wrong or incomplete\n# parameter documentation, but not about the absence of documentation. If\n# EXTRACT_ALL is set to YES then this flag will automatically be disabled.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when\n# a warning is encountered.\n# The default value is: NO.\n\nWARN_AS_ERROR          = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = .\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: https://www.gnu.org/software/libiconv/) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# read by doxygen.\n#\n# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,\n# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,\n# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,\n# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,\n# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.idl \\\n                         *.ddl \\\n                         *.odl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.cs \\\n                         *.d \\\n                         *.php \\\n                         *.php4 \\\n                         *.php5 \\\n                         *.phtml \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.pyw \\\n                         *.f90 \\\n                         *.f95 \\\n                         *.f03 \\\n                         *.f08 \\\n                         *.f \\\n                         *.for \\\n                         *.tcl \\\n                         *.vhd \\\n                         *.vhdl \\\n                         *.ucf \\\n                         *.qsf \\\n                         *.ice\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                =\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       =\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE =\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# entity all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see https://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the\n# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the\n# cost of reduced performance. This can be particularly helpful with template\n# rich C++ code for which doxygen's built-in parser lacks the necessary type\n# information.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n# The default value is: NO.\n\nCLANG_ASSISTED_PARSING = NO\n\n# If clang assisted parsing is enabled you can provide the compiler with command\n# line options that you would normally use when invoking the compiler. Note that\n# the include paths will already be set by doxygen for the files and directories\n# specified with INPUT and INCLUDE_PATH.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_OPTIONS          =\n\n# If clang assisted parsing is enabled you can provide the clang parser with the\n# path to the compilation database (see:\n# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files\n# were built. This is equivalent to specifying the \"-p\" option to a clang tool,\n# such as clang-check. These options will then be passed to the parser.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n\nCLANG_DATABASE_PATH    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# cascading style sheets that are included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefore more robust against future updates.\n# Doxygen will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list). For an example see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the style sheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# https://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to YES can help to show when doxygen was last run and thus if the\n# documentation is up to date.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = NO\n\n# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML\n# documentation will contain a main index with vertical navigation menus that\n# are dynamically created via Javascript. If disabled, the navigation index will\n# consists of multiple levels of tabs that are statically embedded in every HTML\n# page. Disable this option to support browsers that do not have Javascript,\n# like the Qt help browser.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_MENUS     = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: https://developer.apple.com/xcode/), introduced with OSX\n# 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy\n# genXcode/_index.html for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = YES\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler (hhc.exe). If non-empty,\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated\n# (YES) or that it should be included in the master .chm file (NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated\n# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it\n# enables the Previous and Next buttons.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANSPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# https://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from https://www.mathjax.org before deployment.\n# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavors of web server based searching depending on the EXTERNAL_SEARCH\n# setting. When disabled, doxygen will generate a PHP script for searching and\n# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing\n# and searching needs to be provided by external tools. See the section\n# \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: https://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: https://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when not enabling USE_PDFLATEX the default is latex when enabling\n# USE_PDFLATEX the default is pdflatex and when in the later case latex is\n# chosen this is overwritten by pdflatex. For specific output languages the\n# default can have been set differently, this depends on the implementation of\n# the output language.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         =\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# Note: This tag is used in the Makefile / make.bat.\n# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file\n# (.tex).\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to\n# generate index for LaTeX.\n# Note: This tag is used in the generated output file (.tex).\n# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.\n# The default value is: \\makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_MAKEINDEX_CMD    = \\makeindex\n\n# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. The package can be specified just\n# by its name or with the correct syntax as to be used with the LaTeX\n# \\usepackage command. To get the times font for instance you can specify :\n# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}\n# To use the option intlimits with the amsmath package you can specify:\n# EXTRA_PACKAGES=[intlimits]{amsmath}\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber,\n# $projectbrief, $projectlogo. Doxygen will replace $title with the empty\n# string, for the replacement values of the other commands the user is referred\n# to HTML_HEADER.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer. See\n# LATEX_HEADER for more information on how to generate a default footer and what\n# special commands can be used inside the footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# LaTeX style sheets that are included after the standard style sheets created\n# by doxygen. Using this option one can overrule certain style aspects. Doxygen\n# will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_STYLESHEET =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES, to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# https://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_TIMESTAMP        = NO\n\n# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)\n# path from which the emoji images will be read. If a relative path is entered,\n# it will be relative to the LATEX_OUTPUT directory. If left blank the\n# LATEX_OUTPUT directory will be used.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EMOJI_DIRECTORY  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's\n# configuration file, i.e. a series of assignments. You only have to provide\n# replacements, missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's configuration file. A template extensions file can be\n# generated using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code\n# with syntax highlighting in the RTF output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_SOURCE_CODE        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# The MAN_SUBDIR tag determines the name of the directory created within\n# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by\n# MAN_EXTENSION with the initial . removed.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_SUBDIR             =\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include\n# namespace members in file scope as well, matching the HTML output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_NS_MEMB_FILE_SCOPE = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the\n# program listings (including syntax highlighting and cross-referencing\n# information) to the DOCBOOK output. Note that enabling this will significantly\n# increase the size of the DOCBOOK output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_PROGRAMLISTING = NO\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an\n# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures\n# the structure of the code including all documentation. Note that this feature\n# is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO, the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names\n# in the source code. If set to NO, only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES, the include files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             =\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all references to function-like macros that are alone on a line, have\n# an all uppercase name, and do not end with a semicolon. Such function macros\n# are typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have a unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES, all external class will be listed in\n# the class index. If set to NO, only the inherited external classes will be\n# listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed\n# in the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# You can include diagrams made with dia in doxygen documentation. Doxygen will\n# then run dia to produce the diagram and insert it in the documentation. The\n# DIA_PATH tag allows you to specify the directory where the dia binary resides.\n# If left empty dia is assumed to be found in the default search path.\n\nDIA_PATH               =\n\n# If set to YES the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = NO\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font in the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command. Disabling a call graph can be\n# accomplished by means of the command \\hidecallgraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command. Disabling a caller graph can be\n# accomplished by means of the command \\hidecallergraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot. For an explanation of the image formats see the section\n# output formats in the documentation of the dot tool (Graphviz (see:\n# http://www.graphviz.org/)).\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,\n# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and\n# png:gdiplus:gdiplus.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = png\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DIAFILE_DIRS tag can be used to specify one or more directories that\n# contain dia files that are included in the documentation (see the \\diafile\n# command).\n\nDIAFILE_DIRS           =\n\n# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the\n# path where java can find the plantuml.jar file. If left blank, it is assumed\n# PlantUML is not used or called during a preprocessing step. Doxygen will\n# generate a warning when it encounters a \\startuml command in this case and\n# will not generate output for the diagram.\n\nPLANTUML_JAR_PATH      =\n\n# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a\n# configuration file for plantuml.\n\nPLANTUML_CFG_FILE      =\n\n# When using plantuml, the specified paths are searched for files specified by\n# the !include statement in a plantuml block.\n\nPLANTUML_INCLUDE_PATH  =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "HexUtilities/Extensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public static partial class Extensions {\n        /// <summary><b>True</b>b> <i>modulo</i> operation returning <paramref name=\"dividend\"/> mod <paramref name=\"divisor\"/>.</summary>\n        /// <param name=\"dividend\"></param>\n        /// <param name=\"divisor\"></param>\n        /// <returns></returns>\n        public static int Modulo(this int dividend, int divisor) {\n            while(dividend <       0) dividend += divisor;\n            while(dividend > divisor) dividend -= divisor;\n            return dividend;\n        }\n\n        /// <summary>Returns whether the specified hex coordinates are \"on\" a board of the given dimensions.</summary>\n        /// <param name=\"mapSizeHexes\">The hex dimensions of the board.</param>\n        /// <param name=\"hexCoords\">The hex coordinates of the hex of interest.</param>\n        public static bool IsOnboard(this HexSize mapSizeHexes, HexCoords hexCoords) =>\n            mapSizeHexes.IsOnboard(hexCoords.User);\n\n        /// <summary>Returns whether the specified hex coordinates are \"on\" a board of the given dimensions.</summary>\n        /// <param name=\"mapSizeHexes\">The hex dimensions of the board.</param>\n        /// <param name=\"userCoords\">The User coordinates of the hex of interest.</param>\n        public static bool IsOnboard(this HexSize mapSizeHexes, IntVector2D userCoords) =>\n            mapSizeHexes.IsOnboard(userCoords.X,userCoords.Y);\n\n        /// <summary>Returns whether the specified hex coordinates are \"on\" a board of the given dimensions.</summary>\n        /// <param name=\"mapSizeHexes\">The hex dimensions of the board.</param>\n        /// <param name=\"x\">The horizontal hex index of the hex of interest.</param>\n        /// <param name=\"y\">The vertical hex index of the hex of interest.</param>\n        public static bool IsOnboard(this HexSize mapSizeHexes, int x, int y) =>\n            x.InRange(0, mapSizeHexes.Width)  &&  y.InRange(0, mapSizeHexes.Height);\n\n        /// <summary>Create and initialize a non-local <see cref=\"IDisposable\"/> instance safely.</summary>\n        /// <typeparam name=\"T\">The <see cref=\"IDisposable\"/> type being initialized.</typeparam>\n        /// <param name=\"initializer\">The <i>functor</i> creating and initializing the instance.</param>\n        /// <returns>Returns a safely initialized <see cref=\"IDisposable\"/> instance</returns>\n        /// <remarks>\n        /// The returned <see cref=\"IDisposable\"/> instance has been constructed and initialized in a manner\n        /// that does not raise the warning: <b>CA2000:</b> <i>Dispose objects before losing scope</i>.\n        /// </remarks>\n        public static T InitializeDisposable<T>(this Func<T> initializer) where T : class, IDisposable {\n            T item     = null;\n            T tempItem = null;\n            try {\n                tempItem = initializer();\n                item     = tempItem;\n                tempItem = null;\n              } finally { if(tempItem!=null) tempItem.Dispose(); }\n              return item;\n        }\n\n        /// <summary>Returns true exactly if lower &lt;= value &lt; lower+height</summary>\n        /// <param name=\"value\">Vlaue being tested.</param>\n        /// <param name=\"lower\">Inclusive lower bound for the range.</param>\n        /// <param name=\"height\">Height of the range.</param>\n        public static bool InRange(this int value, int lower, int height) =>\n            lower <= value && value < lower+height;\n\n        /// <summary>The <i>Manhattan</i> distance from this hex to that at <c>coords</c>.</summary>\n        public static int Range(this IHex @this, IHex target)\n        => @this.Coords.Range(target.Coords);\n    }\n}\n\n"
  },
  {
    "path": "HexUtilities/FastLists/AbstractFastList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    /// <summary>Adapted implementation of Joe Duffy's Simple (Fast) List enumerator.</summary>\n    /// <remarks>\n    /// This entire namespace is adapted from \n    /// <a href=\"http://joeduffyblog.com/2008/09/21/the-cost-of-enumerating-in-net/\">\n    /// The Cost of Enumeration in DotNet</a> by Joe Duffy.\n    /// \n    /// The idea behind IFastEnumerable{TItem} (and specifically IFastEnumerator{TItem}) is to\n    /// return the current element during the call to MoveNext itself.  This cuts the number of\n    /// interface method calls necessary to enumerate a list in half.  The impact to performance\n    /// isn’t huge, but it was enough to cut our overhead from about 3X to 2.3X.  Every little\n    /// bit counts.\n    /// </remarks>\n    /// <typeparam name=\"TItem\">The Type of the Item to be stored and iterated over.</typeparam>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    [DebuggerDisplay(\"Count={Count}\")]\n    public abstract partial class AbstractFastList<TItem> : IFastList<TItem>, IFastListX<TItem> {\n        /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n        protected AbstractFastList(TItem[] array) => _array = array;\n\n        /// <inheritdoc/>>\n        public IEnumerator<TItem> GetEnumerator()\n        => Extensions.InitializeDisposable( () => new ClassicEnumerable<TItem>(_array) );\n\n        /// <inheritdoc/>>\n        IEnumerator  IEnumerable.GetEnumerator() => GetEnumerator();\n    \n        IFastEnumerator<TItem> IFastEnumerable<TItem>.GetEnumerator() => new FastEnumerable<TItem>(_array);\n\n        /// <summary>IForEachable{TItem} implementation.</summary>\n        public   void  ForEach(Action<TItem> action) {\n            TItem[] array = _array;\n            for (int i = 0; i < array.Length; i++)    action(array[i]);\n        }\n\n        /// <inheritsdoc/>\n        void IForEachable<TItem>.ForEach(Action<TItem> action) => ForEach(action);\n\n        /// <summary>IForEachable2{TItem} implementation</summary>\n        public   void  ForEach(FastIteratorFunctor<TItem> functor) {\n            TItem[] array = _array;\n            for (int i = 0; i < array.Length; i++)    functor.Invoke(array[i]);\n        }\n\n        /// <inheritsdoc/>\n        void IForEachable2<TItem>.ForEach(FastIteratorFunctor<TItem> functor) => ForEach(functor);\n\n        /// <inheritdoc/>\n        public   int   Count               => _array.Length;\n\n        /// <inheritdoc/>\n        public   TItem this[int index]     => _array[index];\n\n        /// <inheritdoc/>\n        public   int   IndexOf(TItem item) => Array.IndexOf(_array, item, 0, _array.Length);\n\n        /// <summary>Use carefully - must not interfere with iterators.</summary>\n        void  IFastListX<TItem>.SetItem(int index, TItem value) => _array[index] = value;\n\n        /// <summary>TODO</summary>\n        private readonly TItem[] _array;\n\n        /// <summary>Implements IEnumerable{TItem} in the <i>standard</i> way:</summary>\n        /// <typeparam name=\"TItem2\">Type of the objects being enumerated.</typeparam>\n        [DebuggerDisplay(\"Count={Count}\")]\n        private sealed class ClassicEnumerable<TItem2> : IEnumerator<TItem2> {\n            /// <summary>Construct a new instance from array <c>a</c>.</summary>\n            /// <param name=\"array\">The array of type <c>TItem</c> to make enumerable.</param>\n            internal ClassicEnumerable(TItem2[] array) => _array = array;\n\n            private readonly TItem2[] _array;       //!< Array being enumerated..\n            private          int      _index = -1;  //!< Index of the currently-enumerated element.\n\n            /// <inheritdoc/>\n            public TItem2      Current    => _array[_index];\n\n            /// <inheritdoc/>\n            object IEnumerator.Current    => Current;\n\n            /// <inheritdoc/>\n            public bool        MoveNext() => ++_index < _array.Length;\n\n            /// <inheritdoc/>\n            public void        Reset()    => _index = -1;\n\n            /// <inheritdoc/>\n            /// <remarks> No unmanaged resources owned - so simply suppress finalization. </remarks>\n            public void Dispose() => GC.SuppressFinalize(this);\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FastLists/FastEnumerable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    public abstract partial class AbstractFastList<TItem> {\n        /// <summary>Implements IEnumerable{TItem} in the <i><b>fast</b></i> way:</summary>\n        /// <typeparam name=\"TItem2\">Type of the objects being enumerated.</typeparam>\n        [DebuggerDisplay(\"Count={Count}\")]\n        internal sealed class FastEnumerable<TItem2> : IFastEnumerator<TItem2> {\n            /// <summary>Construct a new instance from array <c>a</c>.</summary>\n            /// <param name=\"array\">The array of type <c>TItem</c> to make enumerable.</param>\n            internal FastEnumerable(TItem2[] array) => _array = array;\n\n            private readonly TItem2[] _array;       //!< Array being enumerated..\n            private          int      _index = -1;  //!< Index of the currently-enumerated element.\n\n            /// <summary>Return the next item in the enumeration.</summary>\n            /// <remarks>\n            /// Adopts a well-recognized JIT pattern to ensure redundant array-bounds-check is optimized out.\n            /// </remarks>\n            public bool MoveNext(ref TItem2 item) {\n                var array = _array;\n                int i;\n\n                if ((i = ++_index) >= array.Length) return false;\n\n                item = array[i];\n\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FastLists/FastIteratorFunctor.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    /// <summary>Abstract base class for a <c>FastList</c> functor.</summary>\n    /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n    [DebuggerDisplay(\"Count={Count}\")]\n    public abstract class FastIteratorFunctor<TItem> {\n        /// <summary>Perform the action associated with this functor on <paramref name=\"item\"/>.</summary>\n        public abstract void Invoke(TItem item);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FastLists/FastList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    /// <summary>Default concrete implementation of <see cref=\"AbstractFastList{TItem}\"/>.</summary>\n    /// <typeparam name=\"TItem\">The Type of the Item to be stored and iterated over.</typeparam>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    internal sealed class FastList<TItem> : AbstractFastList<TItem> {\n        /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n        internal FastList(TItem[] array) : base(array) { }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FastLists/FastListExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    ///// <summary>Contract-enforcing wrapper for FastList{T} constructors.</summary>\n    //public static class FastList {\n    //    ///// <summary>Contract-enforcing wrapper for FastList{T} constructor returning an IFastList{TItem}.</summary>\n    //    ///// <typeparam name=\"TItem\">Type of the class/interface being indexed.</typeparam>\n    //    ///// <param name=\"array\">An <c>T[]</c> to be indexed.</param>\n    //    //public static IFastList<T> New<T>(T[] array) => new FastList<T>(array);\n\n    //    ///// <summary>Contract-enforcing wrapper for FastList{T} constructor returning an IFastList{TItem}.</summary>\n    //    ///// <typeparam name=\"TItem\">Type of the class/interface being indexed.</typeparam>\n    //    ///// <param name=\"array\">An <c>T[]</c> to be indexed.</param>\n    //    //internal static IFastListX<T> NewX<T>(T[] array) => new FastList<T>(array);\n    //}\n\n    /// <summary>Contract-enforcing wrapper for FastList{T} constructors.</summary>\n    public static class FastListExtensions {\n        /// <summary>Creates an <see cref=\"IFastList{T}\"/> from a T[].</summary>\n        /// <typeparam name=\"T\">Type of the element in the supplied array and returned list.</typeparam>\n        /// <param name=\"this\">The T[] to be converted.</param>\n        public static IFastList<T> ToFastList<T>(this T[] @this) => new FastList<T>(@this ?? new T[0]);\n\n        /// <summary>Creates an <see cref=\"IFastList{T}\"/> from a <see cref=\"List{T}\"/>.</summary>\n        /// <typeparam name=\"T\">Type of the element in the supplied array and returned list.</typeparam>\n        /// <param name=\"this\">The T[] to be converted.</param>\n        public static IFastList<T> ToFastList<T>(this List<T> @this) => (@this ?? new List<T>()).ToArray().ToFastList();\n\n        /// <summary>TODO</summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"this\"></param>\n        /// <returns></returns>\n        public static IFastList<T> ToFastList<T>(this IEnumerable<T> @this) => new FastList<T>(@this.ToArray());\n\n        /// <summary>Creates an <see cref=\"IFastListX{T}\"/> from a T[].</summary>\n        /// <typeparam name=\"T\">Type of the element in the supplied array and returned list.</typeparam>\n        /// <param name=\"this\">The T[] to be converted.</param>\n        internal static IFastListX<T> ToFastListX<T>(this T[] @this) => new FastList<T>(@this ?? new T[0]);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FastLists/Interfaces.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FastList {\n    /// <summary>Optimized ForEach.</summary>\n    /// <typeparam name=\"TItem\"></typeparam>\n    public interface IFastEnumerable<TItem> {\n        /// <summary>Returns the items of a list in order.</summary>\n        IFastEnumerator<TItem> GetEnumerator();\n    }\n\n    /// <summary>Returns the items of a list in order.</summary>\n    /// <typeparam name=\"TItem\"></typeparam>\n    public interface IFastEnumerator<TItem>{\n        /// <summary>Return the next item in the enumeration.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1045:DoNotPassTypesByReference\", MessageId = \"0#\")]\n        bool MoveNext(ref TItem item);\n    }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    public interface IFastList<TItem> : IEnumerable<TItem>,\n        IFastEnumerable<TItem>, IForEachable<TItem>, IForEachable2<TItem> {\n        /// <summary>Gets the item at location <paramref name=\"index\"/>.</summary>\n        TItem this[int index] { get; }\n\n        /// <summary>Returns the current size of the list.</summary>\n        int   Count { get; }\n\n        /// <summary>Returns the index of the specified item in the internal array storage.</summary>\n        /// <param name=\"item\"></param>\n        int   IndexOf(TItem item);\n    }\n\n    /// <summary>Delegated ForEach - <c>action</c> describes the work to be performed on each iteration.</summary>\n    /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n    public interface IForEachable<TItem>{\n        /// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n        void ForEach(Action<TItem> action);\n    }\n\n    /// <summary>Functored ForEach - <c>functor</c> describes the work to be performed on each iteration.</summary>\n    /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n    public interface IForEachable2<TItem> {\n        /// <summary>Perform the action specified by <paramref name=\"functor\"/> for every item in the enumeration.</summary>\n        void ForEach(FastIteratorFunctor<TItem> functor);\n    }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    internal interface IFastListX<T> : IFastList<T>  {\n        void SetItem(int index, T value);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/ArrayFieldOfView.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\n#pragma warning disable 1587\n/// <summary>Fast efficient <b>Shadow-Casting</b> \n/// implementation of 3D Field-of-View on a <see cref=\"Hexgrid\"/> map.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>Implementation of <see cref=\"IShadingMask\"/> using a backing array of BitArray.</summary>\n    internal class ArrayFieldOfView : IShadingMask {\n        private readonly object _syncLock = new object();\n\n        public ArrayFieldOfView(IFovBoard board) {\n            _mapSizeHexes = board.MapSizeHexes;\n            _fovBacking   = ( from i in Enumerable.Range(0,board.MapSizeHexes.Width)\n                              select new BitArray(board.MapSizeHexes.Height)\n                            ).ToArray();\n        }\n\n        public bool this[HexCoords coords] {\n            get => _mapSizeHexes.IsOnboard(coords) && _fovBacking[coords.User.X][coords.User.Y];\n            internal set {\n                lock (_syncLock) {\n                    if (_mapSizeHexes.IsOnboard(coords)) { _fovBacking[coords.User.X][coords.User.Y] = value; }\n                }\n            }\n        }\n\n        private readonly BitArray[] _fovBacking;\n\n        private readonly HexSize _mapSizeHexes;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/Dodecant.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>Extension methods to support the identification of and translation between Dodecants.</summary>\n    internal class Dodecant {\n        /// <summary>The dodecant (30 degree arcs) transformations.</summary>\n        /// <remarks>\n        /// These transformations \n        /// \n        ///           Sextant map\n        ///                    X-axis\n        ///         \\     |     /\n        ///           \\ 3 | 2 /\n        ///             \\ | / \n        ///          4    +    1     \n        ///             / | \\\n        ///           / 5 | 0 \\  \n        ///         /     |     \\\n        ///             Y-axis\n        /// </remarks>\n        public static IFastList<Dodecant> Dodecants = new FastList<Dodecant>( new Dodecant[] {\n            new Dodecant( 0, new IntMatrix2D( 1, 0,  0, 1)), //  CW  from Hexside.North\n            new Dodecant( 1, new IntMatrix2D( 0,-1,  1, 1)), //  CW  from Hexside.Northwest\n            new Dodecant( 2, new IntMatrix2D(-1,-1,  1, 0)), //  CW  from Hexside.Southwest\n            new Dodecant( 3, new IntMatrix2D(-1, 0,  0,-1)), //  CW  from Hexside.South\n            new Dodecant( 4, new IntMatrix2D( 0, 1, -1,-1)), //  CW  from Hexside.Southeast\n            new Dodecant( 5, new IntMatrix2D( 1, 1, -1, 0)), //  CW  from Hexside.Northeast\n\n            new Dodecant( 6, new IntMatrix2D(-1,-1,  0, 1)), // CCW  from Hexside.North\n            new Dodecant( 7, new IntMatrix2D( 0,-1, -1, 0)), // CCW  from Hexside.Northeast\n            new Dodecant( 8, new IntMatrix2D( 1, 0, -1,-1)), // CCW  from Hexside.Southeast\n            new Dodecant( 9, new IntMatrix2D( 1, 1,  0,-1)), // CCW  from Hexside.South\n            new Dodecant(10, new IntMatrix2D( 0, 1,  1, 0)), // CCW  from Hexside.Southwest\n            new Dodecant(11, new IntMatrix2D(-1, 0,  1, 1))  // CCW  from Hexside.Northwest\n        } );\n\n        public Dodecant(Dodecant dodecant, IntMatrix2D matrixOrigin) {\n            HexsideMap = dodecant.HexsideMap;\n            Matrix     = dodecant.Matrix * matrixOrigin;\n        }\n\n        private Dodecant(int hexsideBase, IntMatrix2D matrix) {\n            var sign   = Math.Sign(matrix.Determinant);\n            HexsideMap = hexside => _hexsideMap[hexsideBase + sign * hexside];\n            Matrix     = matrix;\n        }\n\n        public  Func<Hexside, Hexside> HexsideMap { get; }\n        public  IntMatrix2D            Matrix     { get; }\n\n        #region Mod6 - replace an integer modulo operation with a lookup into a table twice as long \n        /// <summary>Replaces an modulo-6 operation with a lookup into a table twice as long.</summary>\n        private static readonly IList<Hexside> _hexsideMap = new Hexside[] {\n            Hexside.North, Hexside.Northeast, Hexside.Southeast, \n            Hexside.South, Hexside.Southwest, Hexside.Northwest,\n\n            Hexside.North, Hexside.Northeast, Hexside.Southeast, \n            Hexside.South, Hexside.Southwest, Hexside.Northwest \n        };\n        #endregion\n\n        #region TranslateDodecant\n        public Action<HexCoords> TranslateDodecant(Action<HexCoords> action)\n        => (coords) => action(HexCoords.NewCanonCoords(coords.Canon * Matrix));\n\n        public Func<HexCoords,T> TranslateDodecant<T>(Func<HexCoords,T> func)\n        => (coords) => func(HexCoords.NewCanonCoords(coords.Canon * Matrix));\n\n        public Func<HexCoords,Hexside,T> TranslateDodecant<T>(Func<HexCoords,Hexside,T> func)\n        => (coords,hexside) => func(HexCoords.NewCanonCoords(coords.Canon * Matrix), HexsideMap(hexside));\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/FovBoardExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>.</summary>\n    public static partial class FovBoardExtensions {\n        /// <summary>Elevation of the ground Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"hex\">The hex being tested.</param>\n        public static int ElevationASL(this IFovBoard @this, IHex hex)\n        => @this.ElevationBase + hex.ElevationLevel * @this.ElevationStep;\n\n        /// <summary>Elevation of the ground Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        public static int ElevationGroundASL(this IFovBoard @this, HexCoords coords)\n        => @this[coords].Match(hex => @this.ElevationASL(hex), MaxValue32);\n\n        /// <summary>Elevation of the hexside Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        /// <param name=\"hexside\"></param>\n        public static int ElevationHexsideASL(this IFovBoard @this, HexCoords coords, Hexside hexside)\n        => @this[coords].Match(hex => @this.ElevationASL(hex) + hex.HeightHexside(hexside), MaxValue32);\n\n        /// <summary>Elevation of the target Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        public static int ElevationTargetASL(this IFovBoard @this, HexCoords coords)\n        => @this[coords].Match(hex => @this.ElevationASL(hex) + @this.HeightOfMan, MaxValue32);\n\n        /// <summary>Elevation of the observer Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        public static int ElevationObserverASL(this IFovBoard @this, HexCoords coords)\n        => @this[coords].Match(hex => @this.ElevationASL(hex) + @this.HeightOfMan, MaxValue32);\n\n        /// <summary>Elevation of the terrain Above Sea Level</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        public static int ElevationTerrainASL(this IFovBoard @this, HexCoords coords)\n        => @this[coords].Match(hex => @this.ElevationASL(hex) + hex.HeightTerrain, MaxValue32);\n\n        /// <summary>Returns whether the hex at location <paramref name=\"coords\"/> is passable.</summary>\n        /// <param name=\"this\">The {IFovBoard} to be analyzed.</param>\n        /// <param name=\"coords\">The coordinates of the hex being tested.</param>\n        public static bool IsOverseeable(this IFovBoard @this, HexCoords coords)\n        => @this.MapSizeHexes.IsOnboard(coords);\n\n        private static readonly Func<int> MaxValue32 = () => int.MaxValue;\n    }\n}"
  },
  {
    "path": "HexUtilities/FieldOfView/FovCone.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>Field-of-View cone for shadow-casting implementation.</summary>\n    [DebuggerDisplay(\"{RiseRun} at {Range}; VTop: {VectorTop}; VBot: {VectorBottom}\")]\n    public struct FovCone : IEquatable<FovCone> {\n        /// <summary>Construct a new FovCone instance.</summary>\n        internal FovCone(int range, IntVector2D top, IntVector2D bottom, RiseRun riseRun) : this() {\n            Range        = range;\n            RiseRun      = riseRun;\n            VectorTop    = top;\n            VectorBottom = bottom;\n        }\n\n        /// <summary>The distance from the observer at which this FovCone was generated.</summary>\n        public int          Range        { get; }\n\n        /// <summary>The pitch angle at which visibility begisn for this FovCone. </summary>\n        public RiseRun      RiseRun      { get; }\n\n        /// <summary>The maximum yaw angle for this FovCone.</summary>\n        public IntVector2D  VectorBottom { get; }\n\n        /// <summary>The minimum yaw angle for this FovCone.</summary>\n        public IntVector2D  VectorTop    { get; }\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is FovCone other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(FovCone other)\n        => Range        == other.Range      && RiseRun      == other.RiseRun\n        && VectorTop    == other.VectorTop  && VectorBottom == other.VectorBottom;\n\n        /// <inheritdoc/>\n        public override int GetHashCode()\n        =>  VectorTop.GetHashCode() ^ Range.GetHashCode()\n          ^ RiseRun.GetHashCode()   ^ VectorBottom.GetHashCode();\n\n        /// <summary>Tests value-inequality of two <c>FovCone</c> instances.</summary>\n        public static bool operator !=(FovCone @this,FovCone rhs) => ! @this.Equals(rhs);\n\n        /// <summary>Tests value-equality of two <c>FovCone</c> instances.</summary>\n        public static bool operator ==(FovCone @this, FovCone rhs) => @this.Equals(rhs);\n        #endregion\n\n        /// <inheritdoc/>\n        public override string ToString() => string.Format(CultureInfo.InvariantCulture,\n            $\"Y={Range}, TopVector={VectorTop}, BottomVector={VectorBottom}, RiseRun={RiseRun}\");\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/FovFactory.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>Extension methods for interface IFovBoard {IHex}.</summary>\n    public static class FovFactory {\n        /// <summary>Gets a Field-of-View for this board asynchronously, assuming a flat earth.</summary>\n        public static Task<IShadingMask> GetFieldOfViewAsync(this IFovBoard @this, HexCoords origin,\n                int fovRadius)\n        => Task.Run(() => @this.GetFieldOfView(origin, fovRadius, FovTargetMode.EqualHeights, 1, 0));\n\n        /// <summary>Gets a Field-of-View for this board asynchronously, assuming a flat earth.</summary>\n        public static Task<IShadingMask> GetFieldOfViewAsync(this IFovBoard @this, HexCoords origin,\n                int fovRadius, int height)\n        => Task.Run(() => @this.GetFieldOfView(origin, fovRadius, FovTargetMode.EqualHeights, 1, 0));\n\n        /// <summary>Gets a Field-of-View for this board asynchronously, assuming a flat earth.</summary>\n        public static Task<IShadingMask> GetFieldOfViewAsync(this IFovBoard @this, HexCoords origin,\n                int fovRadius, FovTargetMode targetMode)\n        => Task.Run(() => @this.GetFieldOfView(origin, fovRadius, targetMode, 1, 0));\n\n        /// <summary>Gets a Field-of-View for this board asynchronously, assuming a flat earth.</summary>\n        public static Task<IShadingMask> GetFieldOfViewAsync(this IFovBoard @this, HexCoords origin,\n                int fovRadius, FovTargetMode targetMode, int height)\n        => Task.Run(() => @this.GetFieldOfView(origin, fovRadius, targetMode, height, 0));\n\n        /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n        public static Task<IShadingMask> GetFieldOfViewAsync(this IFovBoard @this, HexCoords origin,\n                int fovRadius, FovTargetMode targetMode, int height, int hexesPerMile)\n        => Task.Run(() => @this.GetFieldOfView(origin, fovRadius, targetMode, height, hexesPerMile));\n\n        /// <summary>Gets a Field-of-View for this board synchronously, assuming a flat earth.</summary>\n        public static IShadingMask GetFieldOfView(this IFovBoard @this, HexCoords origin,\n                int fovRadius)\n        => @this.GetFieldOfView(origin, fovRadius, FovTargetMode.EqualHeights, 1, 0);\n\n        /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n        public static IShadingMask GetFieldOfView(this IFovBoard @this, HexCoords origin,\n                int fovRadius, FovTargetMode targetMode, int heightOfMan, int hexesPerMile) {\n            Tracing.FieldOfView.Trace(\"GetFieldOfView\");\n            var fov = new ArrayFieldOfView(@this);\n            if (@this.IsOverseeable(origin))\n                ShadowCasting.ComputeFieldOfView(@this, origin, fovRadius, targetMode,\n                        coords => fov[coords] = true, heightOfMan, hexesPerMile);\n\n            return fov;\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/FovQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>A queue of FovCOne objects to be processed</summary>\n  /// <remarks> This implementation tracks the last added item as Pending, and merges all \n  /// subsequently added items with the same Range and RiseRun values prior to the Pending \n  /// item being Dequeued'</remarks>\n  [DebuggerDisplay(\"Count={Count}\")]\n  internal class FovConeQueue : Queue<FovCone> {\n    internal FovConeQueue() : this(0) {}\n    internal FovConeQueue(int capacity) : base(capacity) { Pending = null; }\n\n    FovCone?        Pending;\n\n    /// <summary>Returns the number of elemnts in the queue.</summary>\n    public new int Count { get { return base.Count + (Pending.HasValue ? 1 : 0); } }\n\n    /// <inheritdoc/>\n    public new FovCone Dequeue() {\n      if ( base.Count > 0 ) { return base.Dequeue(); }\n      if (Pending.HasValue) { var cache = Pending.Value; Pending = null; return cache; }\n      throw new InvalidOperationException(\"_heap empty.\");\n    }\n\n    /// <summary>Adds a new item to the queue.</summary>\n    /// <remarks>If cone has the same range and RiseRun as Pending, then Pending is extended by \n    /// merging the two.\n    /// \n    /// Otherwise Pending is added to the base queue and cone becomes the new pending item.</remarks>\n    public new void Enqueue(FovCone cone) {\n      if ( ! Pending.HasValue) {\n        Pending = cone;\n      } else if (Pending.Value.Range == cone.Range && Pending.Value.RiseRun == cone.RiseRun) {\n        Pending = new FovCone(cone.Range, Pending.Value.VectorTop, cone.VectorBottom, cone.RiseRun);\n      } else {\n        base.Enqueue(Pending.Value);\n        Pending = cone;\n      }\n    }\n\n    #region Save - perhaps is referenced by client\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new void Clear() { base.Clear(); Pending = null; }\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new bool Contains(FovCone cone) { \n    //  return base.Contains(cone) || (Pending.HasValue && Pending.Value==cone); \n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new void CopyTo(FovCone[] array, int index) { \n    //  base.CopyTo(array,index); \n    //  if (Pending.HasValue) array[index + base.Count] = Pending.Value;\n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new IEnumerator<FovCone> GetEnumerator() { \n    //  return ToList().GetEnumerator();\n    //}\n\n    ///// <summary>Returns and removes the top item in the queue.</summary>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new FovCone Peek() {\n    //  if ( base.Count > 0 ) { return base.Peek(); }\n    //  if (Pending.HasValue) { return Pending.Value; }\n    //  throw new InvalidOperationException(\"_heap empty.\");\n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new FovCone[] ToArray() { return ToList().ToArray(); }\n\n    ///// <summary></summary>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //List<FovCone> ToList() {\n    //  var list = new List<FovCone>(Count);  \n    //  foreach(var item in this) list.Add(item);\n    //  if (Pending.HasValue) list.Add(Pending.Value);\n    //  return list;\n    //}\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/IFovBoard.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>Enumeration of line-of-sight modes</summary>\n    public enum FovTargetMode {\n        /// <summary>Target height and observer height both set to the same constant value \n        /// (ShadowCasting.DefaultHeight) above ground elevation</summary>\n        EqualHeights,\n        /// <summary>Use actual observer height and ground level as target height.</summary>\n        TargetHeightEqualZero,\n        /// <summary>Use actual observer and target height.</summary>\n        TargetHeightEqualActual\n    }\n\n    /// <summary>Interface required to make use of ShadowCasting Field-of-View calculation.</summary>\n    public interface IFovBoard {\n        /// <summary>Height in units of elevation level 0 (zero).</summary>\n        int     ElevationBase { get; }\n\n        /// <summary>Height increase in units of each elevation level.</summary>\n        int     ElevationStep { get; }\n\n        /// <summary>Height in metres.</summary>\n        int     HeightOfMan   { get; }\n\n        /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n        HexSize MapSizeHexes  { get; }\n\n        /// <summary>Returns the <see cref=\"IHex\"/> at location <paramref name=\"coords\"/>.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        Maybe<IHex> this[HexCoords coords] { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/RiseRun.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>TODO</summary>\n    [DebuggerDisplay(\"RiseRun: ({Rise} over {Run})\")]\n    public struct RiseRun : IEquatable<RiseRun>, IComparable<RiseRun> {\n        /// <summary>Creates a new instance of the RiseRUn struct.</summary>\n        /// <param name=\"rise\"></param>\n        /// <param name=\"run\"></param>\n        internal RiseRun(int rise, int run) : this() {\n            Rise = rise;\n            Run  = run;\n        }\n\n        /// <summary>Delta-height in units of elevation: feet.</summary>\n        public int Rise { get; }\n        /// <summary>Delta-width in units of distance:  hexes.</summary>\n        public int Run  { get; }\n\n        #region Operators and  IComparable<RiseRun> implementations: \n        /// <summary>Less Than operator</summary>\n        public static bool operator <  (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) <  0;\n\n        /// <summary>Less Than or Equals operator</summary>\n        public static bool operator <= (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) <= 0;\n\n        /// <summary>Greater Thanoperator</summary>\n        public static bool operator >  (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) >  0;\n\n        /// <summary>Greater Than or Equals operator</summary>\n        public static bool operator >= (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) >= 0;\n\n        /// <summary>Less-Than comparaator.</summary>\n        public int CompareTo(RiseRun other) => (Rise * other.Run).CompareTo(other.Rise * Run);\n        \n        #endregion\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is RiseRun other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(RiseRun other) => Rise == other.Rise && Run == other.Run;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Run != 0 ? (Rise / Run).GetHashCode() \n                                                      : int.MaxValue.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator != (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) != 0;\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator == (RiseRun lhs, RiseRun rhs) => lhs.CompareTo(rhs) == 0;\n        #endregion\n\n        /// <inheritdoc/>\n        public override string ToString() => $\"Rise={Rise}; Run={Run}\";\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/ShadowCastingFov.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    /// <summary>Credit: Eric Lippert</summary>\n    /// <remarks>\n    /// It is important for realiism that observerHeight > board[observerCoords].ElevationASL, \n    /// or no parallax over the current ground elevation will be observed. TerrainHeight is the \n    /// ElevationASL of the hex, plus the height of any blocking in the hex, usually due to terrain \n    /// but sometimes occuppying units will block vision as well. Control this in the implementation \n    /// of IFovBoard {IHex} with the definition of the observerHeight, targetHeight, and \n    /// terrainHeight delegates.\n    /// \n    /// See: <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2011/12/29/shadowcasting-in-c-part-six.aspx\">\n    /// Shadow Casting in C# Part Six</a>\n    /// </remarks>\n    public static partial class ShadowCasting {\n        /// <summary>Get or set whether to force serial execution of FOV calculation.</summary>\n        /// <remarks>Defaults true when DEBUG defined; otherwise false.</remarks>\n        public static bool InSerial   { get; set; }\n\n        /// <summary>Set to use decimeters as height unit instead of feet.</summary>\n        public static bool UseMetric  { get; set; }\n\n        /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a flat earth.</summary>\n        /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n        /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n        /// <param name=\"fovRadius\">Radius of Field-of-view desired.</param>\n        /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n        /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n        public static void ComputeFieldOfView(\n            IFovBoard         board,\n            HexCoords         coordsObserver,\n            int               fovRadius,\n            FovTargetMode     targetMode, \n            Action<HexCoords> setFieldOfView\n        )\n        => ComputeFieldOfView(board, coordsObserver, fovRadius, targetMode, setFieldOfView, 1, 0);\n\n        /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a flat earth.</summary>\n        /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n        /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n        /// <param name=\"fovRadius\">Radius of Field-of-view desired.</param>\n        /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n        /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n        /// <param name=\"defaultHeight\">Height used for observer and target when targetMode = EqualHeights/</param>\n        public static void ComputeFieldOfView(\n            IFovBoard         board,\n            HexCoords         coordsObserver,\n            int               fovRadius,\n            FovTargetMode     targetMode, \n            Action<HexCoords> setFieldOfView,\n            int               defaultHeight\n        )\n        => ComputeFieldOfView(board, coordsObserver, fovRadius, targetMode, setFieldOfView, defaultHeight, 0);\n\n        /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a spherical earth\n        /// and height measured in feet if <code>hexesPerMile</code> is not equal 0.</summary>\n        /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n        /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n        /// <param name=\"fovRadius\">Radius of Field-of-view desired.</param>\n        /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n        /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n        /// <param name=\"defaultHeight\">Height used for observer and target when targetMode = EqualHeights/</param>\n        /// <param name=\"hexesPerMile\">Number of hexes per mile (ie 1/4000 of planet radius).</param>\n        /// <remarks>Adjusts visibility for curvature of the Earth. This is the only version of \n        /// ComputeFieldOfView that is <b>not</b> scale invariant for height, and assumes that height\n        /// is measured in feet.\n        /// </remarks>\n        /// <a href=\"http://mathcentral.uregina.ca/qq/database/QQ.09.02/shirley3.html\">Hidden by the Curvature of the Earth</a>\n        public static void ComputeFieldOfView(\n            IFovBoard         board, \n            HexCoords         coordsObserver, \n            int               fovRadius,\n            FovTargetMode     targetMode, \n            Action<HexCoords> setFieldOfView, \n            int               defaultHeight, \n            int               hexesPerMile\n        ) {\n            if (fovRadius > int.MinValue) fovRadius = fovRadius - 1;\n            int CalculationHeightUnits = UseMetric ?   5  // convert metres to  cm  for greater precision\n                                                   :  12; // convert feet to inches for greater precision\n\n            Func<HexCoords,int> elevationTarget;\n            int                 elevationObserver;\n            switch (targetMode) {\n                case FovTargetMode.TargetHeightEqualZero:\n                    elevationTarget   = coords => board.ElevationGroundASL(coords);\n                    elevationObserver = board.ElevationObserverASL(coordsObserver);\n                    break;\n\n                default:\n                case FovTargetMode.TargetHeightEqualActual:\n                    elevationTarget   = coords => board.ElevationTargetASL(coords);\n                    elevationObserver = board.ElevationObserverASL(coordsObserver);\n                    break;\n\n                case FovTargetMode.EqualHeights: \n                    elevationTarget   = coords => board.ElevationGroundASL(coords) + defaultHeight;\n                    elevationObserver = elevationTarget(coordsObserver);\n                    break;\n            }\n\n            var deltaHeight = GetDeltaHeight(coordsObserver,hexesPerMile,CalculationHeightUnits);\n\n            ComputeFieldOfView(\n                coordsObserver, \n                fovRadius, \n                elevationObserver * CalculationHeightUnits,\n                hc => board.MapSizeHexes.IsOnboard(hc),\n                coords => elevationTarget(coords) * CalculationHeightUnits - deltaHeight(coords),\n                (coords,hexside) => board.ElevationHexsideASL(coords,hexside) * CalculationHeightUnits - deltaHeight(coords),\n                setFieldOfView\n            );\n        }\n\n        private static Func<HexCoords,int> GetDeltaHeight(\n            HexCoords coordsObserver,\n            int       hexesPerMile,\n            int       calculationHeightUnits\n        ) {\n            if (hexesPerMile == 0) {\n                return coords => 0;\n            } else if(UseMetric) {\n                return coords => coordsObserver.Range(coords) * coordsObserver.Range(coords)\n                               * calculationHeightUnits * 2 / (9 * hexesPerMile * hexesPerMile);\n            } else {\n                return coords => coordsObserver.Range(coords) * coordsObserver.Range(coords)\n                               * calculationHeightUnits * 2 / (3 * hexesPerMile * hexesPerMile);\n            }\n        }\n\n        /// <summary>Calculate Field-of-View from a detailed prescription.</summary>\n        /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n        /// <param name=\"radius\">Maximum radius for Field-of-View.</param>\n        /// <param name=\"heightObserver\">Height (ASL) of the observer's eyes.</param>\n        /// <param name=\"isOnboard\">Returns whether this hex on the baoard.</param>\n        /// <param name=\"heightTarget\">Returns ground level (ASL) of supplied hex.</param>\n        /// <param name=\"heightTerrain\">Returns height (ASL) of terrain in supplied hex.</param>\n        /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n        private static void ComputeFieldOfView(\n            HexCoords                   coordsObserver, \n            int                         radius, \n            int                         heightObserver,\n            Func<HexCoords,bool>        isOnboard,\n            Func<HexCoords,int>         heightTarget, \n            Func<HexCoords,Hexside,int> heightTerrain,\n            Action<HexCoords>           setFieldOfView\n        ) {\n            FieldOfViewTrace(true, $\" - Coords = {coordsObserver.User.ToString()}\");\n            var matrixOrigin = new IntMatrix2D(coordsObserver.Canon);\n\n            if (radius >= 0) setFieldOfView(coordsObserver);    // Always visible to self!\n\n            void dodecantFov(Dodecant d) {\n                var dodecant = new Dodecant(d,matrixOrigin);\n                _mapCoordsDodecant = hex => dodecant.TranslateDodecant<HexCoords>(v => v)(hex);\n\n                ComputeFieldOfViewInDodecantZero(\n                    radius,\n                    heightObserver,\n                    dodecant.TranslateDodecant(isOnboard),\n                    dodecant.TranslateDodecant(heightTarget),\n                    dodecant.TranslateDodecant(heightTerrain),\n                    dodecant.TranslateDodecant(setFieldOfView)\n                );\n            }\n            #if DEBUG\n                InSerial = true;\n            #endif\n            if (InSerial) {\n                Dodecant.Dodecants.ForEach(dodecantFov);\n            } else {\n                Parallel.ForEach(Dodecant.Dodecants, dodecantFov);\n            }\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"radius\"></param>\n        /// <param name=\"heightObserver\"></param>\n        /// <param name=\"isOnboard\"></param>\n        /// <param name=\"heightTarget\"></param>\n        /// <param name=\"heightTerrain\"></param>\n        /// <param name=\"setFieldOfView\"></param>\n        private static void ComputeFieldOfViewInDodecantZero(\n            int                         radius,\n            int                         heightObserver,\n            Func<HexCoords,bool>        isOnboard,\n            Func<HexCoords,int>         heightTarget,\n            Func<HexCoords,Hexside,int> heightTerrain,\n            Action<HexCoords>           setFieldOfView\n        ) {\n            var currentCoords = HexCoords.NewCanonCoords(0,1);\n            if ( ! isOnboard(currentCoords) ) return;\n\n            if (radius > 0) setFieldOfView(currentCoords);\n\n            var queue   = new FovConeQueue();\n            var current = new FovCone(\n                    2,\n                    new IntVector2D(1,2), \n                    new IntVector2D(0,1), \n                    new RiseRun(2 * (heightTerrain(currentCoords,Hexside.North) - heightObserver), 1) );\n            while (current.Range <= radius) {\n                current = ComputeFoVForRange(heightObserver, isOnboard, heightTarget, heightTerrain, setFieldOfView, queue, current);\n            }\n        }\n\n        /// <summary>Processes the supplied FovCone and returns the next FovCone to process.</summary>\n        /// <param name=\"heightObserver\"></param>\n        /// <param name=\"isOnboard\"></param>\n        /// <param name=\"heightTarget\"></param>\n        /// <param name=\"heightTerrain\"></param>\n        /// <param name=\"setFieldOfView\"></param>\n        /// <param name=\"queue\"></param>\n        /// <param name=\"cone\"></param>\n        /// <returns></returns>\n        /// <remarks>\n        /// This method: \n        /// (1) marks points inside the cone-arc that are within the radius of the field \n        ///     of view; and \n        /// (2) computes which portions of the following column are in the field of view, \n        ///     queueing them for later processing. \n        ///\n        /// This algorithm is \"center-to-center\"; a more sophisticated algorithm \n        /// would say that a cell is visible if neighbour is *any* straight line segment that \n        /// passes through *any* portion of the origin cell and any portion of the target \n        /// cell, passing through only transparent cells along the way. This is the \n        /// \"Permissive Field Of View\" algorithm, and it is much harder to implement.\n        ///\n        /// Search for transitions from opaque to transparent or transparent to opaque and \n        /// use those to determine what portions of the *next* column are visible from the \n        /// origin.\n        /// </remarks>\n        private static FovCone ComputeFoVForRange(\n            int                         heightObserver, \n            Func<HexCoords,bool>        isOnboard, \n            Func<HexCoords,int>         heightTarget, \n            Func<HexCoords,Hexside,int> heightTerrain, \n            Action<HexCoords>           setFieldOfView, \n            FovConeQueue                queue, \n            FovCone                     cone\n        ) {\n            Action<FovCone> enqueue = queue.Enqueue;\n\n            var range         = cone.Range;\n            var topVector     = cone.VectorTop;\n            var topRiseRun    = cone.RiseRun;\n            var bottomVector  = cone.VectorBottom;\n\n            // track the overlap-cone between adjacent hexes as we move down.\n            var overlapVector = cone.VectorTop;\n            var hexX          = XFromVector(range, topVector);\n            FieldOfViewTrace(false, $\"DQ:   ({cone}) from {hexX}\");\n\n            do {\n                while (overlapVector.GT(bottomVector)) {\n                    var coordsCurrent   = HexCoords.NewCanonCoords(hexX,range);\n                    var hexVectorBottom = VectorHexBottom(coordsCurrent);\n                    if (isOnboard(coordsCurrent)) { \n                        #region Set current hex parameters\n                        var hexVectorTop  = VectorHexTop(coordsCurrent);\n                        var hexElevation  = heightTarget(coordsCurrent);\n                        var hexHeight     = heightTerrain(coordsCurrent,Hexside.North);\n                        var hexRiseRun    = new RiseRun(hexHeight-heightObserver, range);\n                        #endregion\n\n                        #region Check visibility of current hex\n                        var riseRun = new RiseRun(hexElevation-heightObserver, coordsCurrent.RangeFromOrigin);\n                        if ( riseRun >= cone.RiseRun  \n                        && bottomVector.LE(coordsCurrent.Canon) && coordsCurrent.Canon.LE(topVector)  \n                        ) {\n                            setFieldOfView(coordsCurrent);\n                            FieldOfViewTrace(false,\n                                $\"    Set visible: {_mapCoordsDodecant(coordsCurrent)} / {coordsCurrent.ToString()}; {riseRun} >= {cone.RiseRun}\");\n                        }\n                        #endregion\n\n                        #region Check hex transition\n                        if (hexRiseRun > topRiseRun) {\n                            topVector  = LogAndEnqueue(enqueue, range, topVector, hexVectorTop, topRiseRun, 0);\n                            topRiseRun = hexRiseRun;\n                        } else if (hexRiseRun > cone.RiseRun) {\n                            topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 1);\n                            topRiseRun = hexRiseRun;\n                        } else if (hexRiseRun < cone.RiseRun) {\n                            topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 2);\n                            topRiseRun = cone.RiseRun;\n                        }\n                        #endregion\n                    }\n\n                    overlapVector = VectorMax(hexVectorBottom, bottomVector); \n                    if (hexVectorBottom.GT(bottomVector))      -- hexX;\n                }\n\n                #region Dequeue next cone\n                if (queue.Count == 0) {\n                    topVector   = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 3);\n                    cone        = queue.Dequeue();\n                    break;\n                } else {\n                    cone        = queue.Dequeue();\n                    if(cone.Range != range) {\n                        topVector = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 4);\n                        break;\n                    }\n                    FieldOfViewTrace(false, $\"DQ:   ({cone}) from {hexX}\");\n                }\n                #endregion\n\n                #region Check cone transition\n                if (cone.RiseRun > topRiseRun) {\n                    topVector   = LogAndEnqueue(enqueue, range, topVector, cone.VectorTop, topRiseRun, 5);\n                    topRiseRun  = cone.RiseRun;\n                } else if (cone.RiseRun < topRiseRun) {\n                    topVector   = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 6);\n                    topRiseRun  = cone.RiseRun;\n                }\n                #endregion\n\n                overlapVector = topVector;\n                bottomVector  = cone.VectorBottom;\n            } while(true);\n\n            // Pick-up any cone portion at bottom of range still unprocessed\n            if (topVector.GT(bottomVector)) {\n                LogAndEnqueue(enqueue, range, topVector, bottomVector, cone.RiseRun, 7);\n            }\n            return cone;\n        }\n\n        #region Tracing partial methods\n        /// <summary>For tracing: maps HexCoords back to original hex.</summary>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1823:AvoidUnusedPrivateFields\")]\n        static Func<HexCoords, HexCoords> _mapCoordsDodecant;\n\n        static partial void FieldOfViewTrace(string format, params object[] paramArgs);\n\n        static partial void FieldOfViewTrace(bool newline, string format, params object[] paramArgs);\n\n        [Conditional(\"TRACE\")]\n        static partial void FieldOfViewTrace(string format, params object[] paramArgs)\n        =>  Tracing.FieldOfView.Trace(format, paramArgs);\n        \n        [Conditional(\"TRACE\")]\n        static partial void FieldOfViewTrace(bool newline, string format, params object[] paramArgs)\n        =>  Tracing.FieldOfView.Trace(newline, format, paramArgs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/FieldOfView/ShadowCastingFov_Utilities.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n    public static partial class ShadowCasting {\n        [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"code\")]\n        static IntVector2D LogAndEnqueue(Action<FovCone> enqueue, int range, IntVector2D top, \n                IntVector2D bottom, RiseRun riseRun, int code\n        ) {\n            if( top.GT(bottom)) {\n                var cone = new FovCone(range+1, top, bottom, riseRun);\n                FieldOfViewTrace(false, \"  EQ: ({0}) code: {1}\", cone, code);\n                enqueue(cone);\n                return bottom;\n            } else {\n                return top;\n            }\n        }\n\n        static int XFromVector(int y,IntVector2D v) => (-2 * v.Y + v.X * (3 * y + 1) + (3 * v.Y) - 1) / (3 * v.Y);\n\n        /// <summary>Helper IntMatrix2D for <c>VectorHexTop</c>.</summary>\n        static IntMatrix2D matrixHexTop    = new IntMatrix2D(3,0,  0,3,  2, 1);\n\n        /// <summary>Helper IntMatrix2D for <c>VectorHexBottom</c>.</summary>\n        static IntMatrix2D matrixHexBottom = new IntMatrix2D(3,0,  0,3, -2,-1);\n\n        /// <summary>IntVector2D for top corner of cell Canon(i,j).</summary>\n        /// <remarks>\n        /// In first dodecant; The top corner for hex (i,j) is determined \n        /// (from close visual inspection) as:\n        ///       (i,j) + 1/3 * (2,1)\n        /// which reduces to:\n        ///       (i + 2/3, j + 1/3) == 1/3 * (3x + 2, 3y + 1)\n        /// </remarks>\n        static IntVector2D VectorHexTop(HexCoords hex) => hex.Canon * matrixHexTop;\n\n        /// <summary>IntVector2D for bottom corner of cell Canon(i,j).</summary>\n        /// <remarks>\n        /// In first dodecant; The bottom corner for hex (i,j) is determined \n        /// (from close visual inspection) as:\n        ///       (i,j) + 1/3 * (-2,-1)\n        /// which reduces to:\n        ///       (i - 2/3, j - 1/3) == 1/3 * (3x - 2, 3y - 1)\n        /// </remarks>\n        static IntVector2D VectorHexBottom(HexCoords hex) => hex.Canon * matrixHexBottom;\n\n        #region These are here (instead of IntVector2D.cs) because they are \"upside-down\" for regular use.\n        static IntVector2D VectorMax(IntVector2D lhs,IntVector2D rhs) => lhs.GT(rhs) ? lhs : rhs;\n\n        static bool GT(this IntVector2D lhs,IntVector2D rhs) => lhs.X*rhs.Y > lhs.Y*rhs.X;\n\n        static bool LE(this IntVector2D lhs,IntVector2D rhs) => !lhs.GT(rhs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Hex.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\n\n#pragma warning disable 1587\n/// <summary>Display-technology-independent utilities for implementation of hex-grids..</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>Abstract implementation of the interface <see Cref=\"IHex\"/>.</summary>\n    [DebuggerDisplay(\"Coords: {Coords} / ElevLevel: {ElevationLevel}\")]\n    public abstract class Hex : IHex, IEquatable<Hex>  {\n        /// <summary>Construct a new Hex instance at location <paramref name=\"coords\"/>.</summary>\n        protected Hex(HexCoords coords) : this(coords,0) { }\n        /// <summary>Construct a new Hex instance at location <paramref name=\"coords\"/>.</summary>\n        protected Hex(HexCoords coords, int elevationLevel) {\n            Coords         = coords; \n            ElevationLevel = elevationLevel;\n        }\n\n        /// <inheritdoc/>\n        public          HexCoords Coords         { get; }\n\n        /// <inheritdoc/>\n        public          int       ElevationLevel { get; }\n\n        /// <summary>Default implementation, assuming no blocking hexside terrain.</summary>\n        public virtual  int       HeightHexside(Hexside hexside) => HeightTerrain;\n\n        /// <inheritdoc/>\n        public virtual  int       HeightObserver => 1;\n\n        /// <inheritdoc/>\n        public virtual  int       HeightTarget   => 1;\n\n        /// <inheritdoc/>\n        public abstract int       HeightTerrain  { get; }\n\n        /// <inheritdoc/>\n        public abstract bool      IsPassable     { get; }\n\n        /// <inheritdoc/>\n        public abstract char      TerrainType    { get; }\n\n        /// <inheritdoc/>\n        public abstract int       EntryCost(Hexside hexsideExit);\n\n        /// <inheritdoc/>\n        public abstract int       ExitCost(Hexside hexsideExit);\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is Hex other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(Hex other) => Coords == other.Coords;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Coords.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator !=(Hex lhs, Hex rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator ==(Hex lhs, Hex rhs) => lhs.Equals(rhs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/HexCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint = System.Drawing.Point;\n    using HexSize  = System.Drawing.Size;\n\n    /// <summary>Coordinate structure for hexagonal grids that abstracts the distinction \n    /// between rectangular (User) and canonical (Canon) bases (basis vectors, or reference \n    /// frame).</summary>\n    /// <remarks>\n    /// An obtuse reference frmae, with basis vectors at 120 degrees, eases most grid \n    /// calculations and movement operations; a rectangular reference frmae is easier for \n    /// most user interactions, and optimal for board storage. This structure hides the\n    /// distinction betwene them, and automatically converting from one to the other on \n    /// demand (and caching the result).\n    /// </remarks>\n    [DebuggerDisplay(\"User: {User}\")]\n    public struct HexCoords : IEquatable<HexCoords>, IFormattable  {\n        #region private static fields\n        static readonly IntMatrix2D _matrixUserToCanon = new IntMatrix2D(2, 1,  0,2,  0,0,  2);\n        static readonly IntMatrix2D _matrixCanonToUser = new IntMatrix2D(2,-1,  0,2,  0,1,  2);\n\n        static readonly IList<IntVector2D> _hexsideVectorsCanon = new List<IntVector2D>() {\n            new IntVector2D( 0,-1),   // HexSide.North\n            new IntVector2D( 1, 0),   // HexSide.NorthEast\n            new IntVector2D( 1, 1),   // HexSide.SouthEast\n            new IntVector2D( 0, 1),   // HexSide.South\n            new IntVector2D(-1, 0),   // HexSide.SouthWest\n            new IntVector2D(-1,-1)    // HexSide.NorthWest\n        }.AsReadOnly();\n\n        static readonly IList<IList<IntVector2D>> _hexsideVectorsUser = new List<IList<IntVector2D>>() {\n            new List<IntVector2D>() {\n                new IntVector2D( 0,-1),    // even x HexSide.North\n                new IntVector2D( 1, 0),    // even x HexSide.NorthEast\n                new IntVector2D( 1, 1),    // even x HexSide.SouthEast\n                new IntVector2D( 0, 1),    // even x HexSide.South\n                new IntVector2D(-1, 1),    // even x HexSide.SouthWest\n                new IntVector2D(-1, 0)     // even x HexSide.NorthWest\n            }.AsReadOnly(),\n            new List<IntVector2D>() {\n                new IntVector2D( 0,-1),    // odd x HexSide.North\n                new IntVector2D( 1,-1),    // odd x HexSide.NorthEast\n                new IntVector2D( 1, 0),    // odd x HexSide.SouthEast\n                new IntVector2D( 0, 1),    // odd x HexSide.South\n                new IntVector2D(-1, 0),    // odd x HexSide.South West\n                new IntVector2D(-1,-1)     // odd x HexSide.NorthWest\n            }.AsReadOnly()\n        }.AsReadOnly();\n        #endregion\n\n        #region Public static members\n        /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the Canon(ical) frame.</summary>\n        public static HexCoords NewCanonCoords (int x, int y)\n        => NewCanonCoords(new IntVector2D(x,y));\n\n        /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the ectangular (User) frame.</summary>\n        public static HexCoords NewUserCoords  (int x, int y)\n        => NewUserCoords(new IntVector2D(x,y));\n\n        /// <summary>Create a new instance located at the specified vector offset as interpreted in the Canon(ical) frame.</summary>\n        public static HexCoords NewCanonCoords (IntVector2D vector)\n        => new HexCoords(vector, vector * _matrixCanonToUser);\n\n        /// <summary>Create a new instance located at the specified vector offset as interpreted in the Rectangular (User) frame.</summary>\n        public static HexCoords NewUserCoords  (IntVector2D vector)\n        => new HexCoords(vector * _matrixUserToCanon, vector);\n\n        /// <summary>Origin of the Canon(ical) coordinate frame.</summary>\n        public static HexCoords EmptyCanon { get; }  = NewCanonCoords(0,0);\n        /// <summary>Origin of the Rectangular (User) coordinate frame.</summary>\n        public static HexCoords EmptyUser  { get; }  = NewUserCoords(0,0);\n\n        /// <summary>Returns the drawing origin (upper-left) for the hex with specified user components.</summary>\n        public static HexPoint HexOrigin(HexSize gridSize, int i, int j) =>\n            new HexPoint(\n                checked(i * gridSize.Width),\n                checked(j * gridSize.Height + (i+1)%2 * (gridSize.Height)/2));\n        #endregion\n\n        #region Constructors\n        \n        private HexCoords(IntVector2D canon, IntVector2D user) :this() {\n            Canon = canon;\n            User  = user;\n        }\n        #endregion\n\n        #region Properties\n        /// <summary>Returns an <c>IntVector2D</c> representing the Canonical (obtuse) coordinates of this hex.</summary>\n        public  IntVector2D Canon { get; }\n\n        /// <summary>Returns an <c>IntVector2D</c> representing the User (rectangular) coordinates of this hex.</summary>\n        public  IntVector2D User  { get; }\n\n        /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from the origin.</summary>\n        public  int         RangeFromOrigin => EmptyCanon.Range(this);\n        #endregion\n\n        #region Methods\n        /// <summary>Returns an <c>HexCoords</c> for the hex in direction <c>hexside</c> from this one.</summary>\n        public HexCoords GetNeighbour(Hexside hexside) {\n            var i = User.X & 1; \n            return new HexCoords(Canon + _hexsideVectorsCanon  [hexside]\n                                ,User  + _hexsideVectorsUser[i][hexside] );\n        }\n\n        /// <summary>Returns the drawing origin (upper-left) for the specified hex.</summary>\n        public HexPoint HexOrigin(HexSize gridSize) => HexOrigin(gridSize, User.X, User.Y); \n\n        /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from this one.</summary>\n        public int       Range(HexCoords coords) {\n            var deltaX = coords.Canon.X - Canon.X;\n            var deltaY = coords.Canon.Y - Canon.Y;\n            return ( Math.Abs(deltaX) + Math.Abs(deltaY) + Math.Abs(deltaX-deltaY) ) / 2;\n        }\n\n        /// <summary>Culture-invariant string representation of this instance's value.</summary>\n        public override string ToString() => ToString(\"g\", CultureInfo.InvariantCulture);\n\n        /// <summary>Converts the value of this instance to its equivalent string representation using the \n        /// specified format and culture-specific format information.</summary>\n        /// <param name=\"format\">Type: System.String. \n        /// \n        /// > A standard or custom numeric format string.</param>\n        /// <param name=\"formatProvider\">Type: IFormatProvider - \n        /// \n        /// > An object that supplies culture-specific formatting information.</param>\n        /// <remarks>\n        /// Format characters:\n        /// - 'C' or 'c': Canonical formatting - Int2Vector output of the Canonical coordinates for this hex;\n        /// - 'G' or 'g': General formatting - Int2Vector output of the User coordinates for this hex;\n        /// - 'R' or 'r': Range formatting - Scalar output of the Range of this hex from canonical (0,0);\n        /// In all cases the leading character of the format string is stripped off and parsed, \n        /// with the remainder passed to the formatter completing the display formatting.\n        /// \n        /// If an instance of <see cref=\"CustomCoords\"/> is passed as the <see cref=\"IFormatProvider\"/> then\n        /// two additional formats are supported:\n        /// - 'U' or 'u': Custom formatting - Int2Vector output of the Custom coordinates for this hex.\n        /// \n        /// Likewise, any additional formats supported by <paramref name=\"formatProvider\"/> can be processed.\n        /// \n        /// The lower-case format comands prefix a descriptive string on the output (ie one of \"Canon: \",\n        /// \"User: \", \"Custom: \", or \"Range: \" respectivelly), while the upper-case commands do not.\n        /// </remarks>\n        public string ToString(string format, IFormatProvider formatProvider) {\n\n            if (format==null || format.Length==0) format = \"G\";\n            if (formatProvider == null) formatProvider = CultureInfo.CurrentUICulture;\n            switch(format[0]) {\n                case 'C': \n                case 'G': \n                case 'R': return Format(format[0], format.Substring(1), formatProvider);\n                case 'c': return \"Canon: \" + Format(format[0], format.Substring(1), formatProvider);\n                case 'g': return \"User: \"  + Format(format[0], format.Substring(1), formatProvider);\n                case 'r': return \"Range: \" + Format(format[0], format.Substring(1), formatProvider);\n\n                default:  var formatter = formatProvider.GetFormat(typeof(HexCoords)) as ICustomFormatter\n                                        ?? formatProvider.GetFormat(typeof(object)) as ICustomFormatter;\n                          if (formatter == null) return string.Empty;\n                          return formatter.Format(format, this, formatProvider) ?? string.Empty;\n            }\n        }\n\n        private string Format(char formatChar, string formatRest, IFormatProvider formatProvider){\n            switch (formatChar) {\n                case 'c':\n                case 'C': return Canon.ToString(formatRest, formatProvider);\n                case 'g':\n                case 'G': return User.ToString(formatRest, formatProvider);\n                case 'r':\n                case 'R': return Range(HexCoords.EmptyCanon).ToString(\"G\" + formatRest, formatProvider);\n                default:  return string.Empty;\n            }\n        }\n        #endregion\n\n        #region Operators\n        /// <summary>Vector sum; <see cref=\"Add\"/>.</summary>\n        public static HexCoords operator + (HexCoords lhs, HexCoords rhs) =>\n            NewCanonCoords(lhs.Canon + rhs.Canon);\n        /// <summary>Vector difference; <see cref=\"Subtract\"/>.</summary>\n        public static HexCoords operator - (HexCoords lhs, HexCoords rhs) =>\n            NewCanonCoords(lhs.Canon - rhs.Canon);\n        /// <summary>(Canonical) vector sum lhs + rhs.</summary>\n        /// <param name=\"lhs\">The first term of the sum.</param>\n        /// <param name=\"rhs\">The second term of the sum.</param>\n        /// <returns>A new HexCoords struct containing the vector sum lhs + rhs calculated \n        /// in the Canonical frame of reference.</returns>\n        public static HexCoords Add(HexCoords lhs, HexCoords rhs)      => lhs + rhs;\n        /// <summary>(Canonical) vector difference lhs - rhs.</summary>\n        /// <param name=\"lhs\">The first term of the difference.</param>\n        /// <param name=\"rhs\">The second term of the difference.</param>\n        /// <returns>A new HexCoords struct containing the vector difference lhs - rhs calculated \n        /// in the Canonical frame of reference.</returns>\n        public static HexCoords Subtract(HexCoords lhs, HexCoords rhs) => lhs - rhs;\n\n        /// <summary>Returns an <c>IntVector2D</c> representing the Canonical (obtuse) coordinates of <c>this</c>.</summary>\n        public static implicit operator IntVector2D(HexCoords @this)   => @this.Canon;\n        #endregion\n\n        #region Value Equality\n        /// <inheritdoc/>\n        public override bool Equals(object obj) { \n            var other = obj as HexCoords?;\n            return other.HasValue  &&  this == other.Value;\n        }\n        /// <inheritdoc/>\n        public override int GetHashCode() => User.GetHashCode();\n\n        /// <inheritdoc/>\n        public bool Equals(HexCoords other) => this == other;\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator != (HexCoords lhs, HexCoords rhs) => ! (lhs == rhs);\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator == (HexCoords lhs, HexCoords rhs) => lhs.User == rhs.User;\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/HexGrid.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint  = System.Drawing.Point;\n    using HexPoints = IList<System.Drawing.Point>;\n    using HexSize   = System.Drawing.Size;\n\n    /// <summary>C# implementation of the hex-picking algorithm noted below.</summary>\n    /// <remarks>Mathemagically (left as exercise for the reader) our 'picking' matrices are these, assuming: \n    ///  - origin at upper-left corner of hex (0,0);\n    ///  - 'straight' hex-axis vertically down; and\n    ///  - 'oblique'  hex-axis up-and-to-right (at 120 degrees from 'straight').</remarks>\n    /// <a href=\"file://Documentation/HexGridAlgorithm.mht\">Hex-grid Algorithms</a>\n    public class Hexgrid : IHexgrid {\n        /// <summary>Return a new instance of <c>Hexgrid</c>.</summary>\n        public Hexgrid(bool isTransposed, HexSize gridSize, float scale)\n        : this(isTransposed, gridSize, scale, HexSize.Empty) { }\n\n        /// <summary>Return a new instance of <c>Hexgrid</c>.</summary>\n        public Hexgrid(bool isTransposed, HexSize gridSize, float scale, HexSize margin) {\n            GridSize     = gridSize;\n            IsTransposed = isTransposed;\n            Margin       = margin;\n            Scale        = scale;\n\n            HexCorners = new List<HexPoint>() {\n                new HexPoint(GridSize.Width*1/3,              0  ), \n                new HexPoint(GridSize.Width*3/3,              0  ),\n                new HexPoint(GridSize.Width*4/3,GridSize.Height/2),\n                new HexPoint(GridSize.Width*3/3,GridSize.Height  ),\n                new HexPoint(GridSize.Width*1/3,GridSize.Height  ),\n                new HexPoint(             0,    GridSize.Height/2),\n                new HexPoint(GridSize.Width*1/3,              0  )\n            }.AsReadOnly();\n        }\n\n        /// <inheritdoc/>\n        public HexSize   GridSize     { get; }\n        /// <inheritdoc/>\n        public HexPoints HexCorners   { get; }\n        /// <inheritdoc/>\n        public bool      IsTransposed { get; }\n        /// <inheritdoc/>\n        public HexSize   Margin       { get; set; }\n        /// <inheritdoc/>\n        public float     Scale        { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/HexPickingExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint  = System.Drawing.Point;\n    using HexPointF = System.Drawing.PointF;\n    using HexSize   = System.Drawing.Size;\n    using HexSizeF  = System.Drawing.SizeF;\n    using HexMatrix = System.Drawing.Drawing2D.Matrix;\n\n    /// <summary>.</summary>\n    public static class HexPickingExtensions {\n        /// <summary>Scroll position on the (possibly transposed) HexGrid.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"scrollPosition\"></param>\n        public static HexPoint GetScrollPosition(this IHexgrid @this, HexPoint scrollPosition)\n        => @this.IsTransposed ? TransposePoint(scrollPosition)\n                              : scrollPosition;\n\n        /// <summary>.</summary>\n        /// <param name=\"this\"></param>\n        public static HexSizeF GridSizeF(this IHexgrid @this) => @this.GridSize.Scale(@this.Scale);\n\n        /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n        /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n        static HexCoords GetHexCoords(this IHexgrid @this, HexPointF point, HexSizeF autoScroll) {\n\n            // Adjust for origin not as assumed by GetCoordinate().\n            var grid  = new HexSizeF(@this.GridSizeF().Width*2F/3F, @this.GridSizeF().Height);\n            point    -= autoScroll + grid - new HexSizeF(@this.Margin.Width,@this.Margin.Height);\n\n            return HexCoords.NewCanonCoords( @this.GetCoordinate(@this.MatrixX(), point), \n                                             @this.GetCoordinate(@this.MatrixY(), point) );\n        }\n\n        /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n        /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n        public static HexCoords GetHexCoords(this IHexgrid @this, HexPoint point, HexSize autoScroll)\n        => @this.IsTransposed ? @this.GetHexCoordsInner(TransposePoint(point), TransposeSize(autoScroll))\n                              : @this.GetHexCoordsInner(point, autoScroll);\n    \n        /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n        /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n        static HexCoords GetHexCoordsInner(this IHexgrid @this, HexPoint point, HexSize autoScroll) {\n            // Adjust for origin not as assumed by GetCoordinate().\n            var grid  = new HexSize((int)(@this.GridSizeF().Width*2F/3F), (int)@this.GridSizeF().Height);\n            point    -= autoScroll + grid - @this.Margin;\n\n            return HexCoords.NewCanonCoords( @this.GetCoordinate(@this.MatrixX(), point), \n                                             @this.GetCoordinate(@this.MatrixY(), point) );\n        }\n\n        /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        public static HexPoint HexCenterPoint(this IHexgrid @this, HexCoords coordsNewULHex)\n        => @this.IsTransposed ? TransposePoint(@this.HexCenterPointInner(coordsNewULHex))\n                              : @this.HexCenterPointInner(coordsNewULHex);\n\n        /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        static HexPoint HexCenterPointInner(this IHexgrid @this, HexCoords coordsNewULHex)\n        => @this.HexOrigin(coordsNewULHex)\n         + new HexSize((int)(@this.GridSizeF().Width*2F/3F), (int)@this.GridSizeF().Height);\n\n        /// <summary>Returns the pixel coordinates of the center of the specified hex.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\"><see cref=\"HexCoords\"/> specification for which pixel center is desired.</param>\n        /// <returns>Pixel coordinates of the center of the specified hex.</returns>\n        public static HexPoint HexOrigin(this IHexgrid @this, HexCoords coords)\n        => new HexPoint(\n                (int)(@this.GridSizeF().Width  * coords.User.X),\n                (int)(@this.GridSizeF().Height * coords.User.Y   + @this.GridSizeF().Height/2 * (coords.User.X+1)%2)\n            );\n\n        /// <summary>Calculates a (canonical X or Y) grid-coordinate for a point, from the supplied 'picking' matrix.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"matrix\">The 'picking-matrix' matrix</param>\n        /// <param name=\"point\">The screen point identifying the hex to be 'picked'.</param>\n        /// <returns>A (canonical X or Y) grid coordinate of the 'picked' hex.</returns>\n        public static int GetCoordinate (this IHexgrid @this, HexMatrix matrix, HexPoint point) {\n              var points = new HexPoint[] {point};\n              matrix.TransformPoints(points);\n\n\t\t      return (int) Math.Floor( (points[0].X + points[0].Y + 2F) / 3F );\n\t    }\n\n        /// <summary>Calculates a (canonical X or Y) grid-coordinate for a point, from the supplied 'picking' matrix.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"matrix\">The 'picking-matrix' matrix</param>\n        /// <param name=\"point\">The screen point identifying the hex to be 'picked'.</param>\n        /// <returns>A (canonical X or Y) grid coordinate of the 'picked' hex.</returns>\n        public static int GetCoordinate (this IHexgrid @this, HexMatrix matrix, HexPointF point) {\n            var points = new HexPointF[] {point};\n            matrix.TransformPoints(points);\n\n\t\t    return (int) Math.Floor( (points[0].X + points[0].Y + 2F) / 3F );\n\t    }\n\n        /// <summary><see cref=\"HexMatrix\"/> for 'picking' the <B>X</B> hex coordinate</summary>\n        public static HexMatrix MatrixX(this IHexgrid @this)\n        => new HexMatrix(\n               (3.0F/2.0F)/@this.GridSizeF().Width, (3.0F/2.0F)/@this.GridSizeF().Width,\n                     1.0F/@this.GridSizeF().Height,      -1.0F/@this.GridSizeF().Height,  -0.5F,-0.5F);\n        /// <summary><see cref=\"HexMatrix\"/> for 'picking' the <B>Y</B> hex coordinate</summary>\n        public static HexMatrix MatrixY(this IHexgrid @this)\n        => new HexMatrix(\n                                        0.0F,  (3.0F/2.0F)/@this.GridSizeF().Width,\n               2.0F/@this.GridSizeF().Height,        1.0F/@this.GridSizeF().Height,  -0.5F,-0.5F);\n\n        static HexPoint TransposePoint(HexPoint point) => new HexPoint(point.Y, point.X);\n        static HexSize  TransposeSize(HexSize  size)   => new HexSize (size.Height, size.Width);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/HexUtilities.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{013628E1-60E2-40A6-91D4-8B446F397A0A}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexUtilities</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexUtilities</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <HighEntropyVA>False</HighEntropyVA>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n    <CodeContractsAssemblyMode>1</CodeContractsAssemblyMode>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;HotPriorityQueue, TraceFoV</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Debug\\PGNapoleonics.HexUtilities.XML</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>false</Prefer32Bit>\n    <FileAlignment>512</FileAlignment>\n    <HighEntropyVA>False</HighEntropyVA>\n    <DynamicBase>False</DynamicBase>\n    <BaseAddress>255066112</BaseAddress>\n    <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>\n    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>\n    <CodeContractsRuntimeThrowOnFailure>False</CodeContractsRuntimeThrowOnFailure>\n    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>\n    <CodeContractsRuntimeSkipQuantifiers>True</CodeContractsRuntimeSkipQuantifiers>\n    <CodeContractsRunCodeAnalysis>True</CodeContractsRunCodeAnalysis>\n    <CodeContractsNonNullObligations>True</CodeContractsNonNullObligations>\n    <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>\n    <CodeContractsArithmeticObligations>True</CodeContractsArithmeticObligations>\n    <CodeContractsEnumObligations>True</CodeContractsEnumObligations>\n    <CodeContractsRedundantAssumptions>True</CodeContractsRedundantAssumptions>\n    <CodeContractsAssertsToContractsCheckBox>True</CodeContractsAssertsToContractsCheckBox>\n    <CodeContractsRedundantTests>True</CodeContractsRedundantTests>\n    <CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings>\n    <CodeContractsMissingPublicEnsuresAsWarnings>True</CodeContractsMissingPublicEnsuresAsWarnings>\n    <CodeContractsInferRequires>True</CodeContractsInferRequires>\n    <CodeContractsInferEnsures>True</CodeContractsInferEnsures>\n    <CodeContractsInferEnsuresAutoProperties>True</CodeContractsInferEnsuresAutoProperties>\n    <CodeContractsInferObjectInvariants>True</CodeContractsInferObjectInvariants>\n    <CodeContractsSuggestAssumptions>False</CodeContractsSuggestAssumptions>\n    <CodeContractsSuggestAssumptionsForCallees>True</CodeContractsSuggestAssumptionsForCallees>\n    <CodeContractsSuggestRequires>True</CodeContractsSuggestRequires>\n    <CodeContractsNecessaryEnsures>True</CodeContractsNecessaryEnsures>\n    <CodeContractsSuggestObjectInvariants>False</CodeContractsSuggestObjectInvariants>\n    <CodeContractsSuggestReadonly>True</CodeContractsSuggestReadonly>\n    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>\n    <CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>\n    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>\n    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>\n    <CodeContractsCustomRewriterAssembly />\n    <CodeContractsCustomRewriterClass />\n    <CodeContractsLibPaths />\n    <CodeContractsExtraRewriteOptions />\n    <CodeContractsExtraAnalysisOptions>-outputwarnmasks</CodeContractsExtraAnalysisOptions>\n    <CodeContractsSQLServerOption>%28LocalDb%29\\MSSQLLocalDB</CodeContractsSQLServerOption>\n    <CodeContractsBaseLineFile />\n    <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>\n    <CodeContractsSkipAnalysisIfCannotConnectToCache>False</CodeContractsSkipAnalysisIfCannotConnectToCache>\n    <CodeContractsFailBuildOnWarnings>False</CodeContractsFailBuildOnWarnings>\n    <CodeContractsBeingOptimisticOnExternal>True</CodeContractsBeingOptimisticOnExternal>\n    <CodeContractsRuntimeCheckingLevel>Pre and Post</CodeContractsRuntimeCheckingLevel>\n    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>\n    <CodeContractsAnalysisWarningLevel>2</CodeContractsAnalysisWarningLevel>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45, HotPriorityQueue</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexUtilities.xml</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>\n    <BaseAddress>255066112</BaseAddress>\n    <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>\n    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>\n    <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>\n    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>\n    <CodeContractsRuntimeSkipQuantifiers>True</CodeContractsRuntimeSkipQuantifiers>\n    <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>\n    <CodeContractsNonNullObligations>True</CodeContractsNonNullObligations>\n    <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>\n    <CodeContractsArithmeticObligations>True</CodeContractsArithmeticObligations>\n    <CodeContractsEnumObligations>True</CodeContractsEnumObligations>\n    <CodeContractsRedundantAssumptions>True</CodeContractsRedundantAssumptions>\n    <CodeContractsAssertsToContractsCheckBox>True</CodeContractsAssertsToContractsCheckBox>\n    <CodeContractsRedundantTests>True</CodeContractsRedundantTests>\n    <CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings>\n    <CodeContractsMissingPublicEnsuresAsWarnings>True</CodeContractsMissingPublicEnsuresAsWarnings>\n    <CodeContractsInferRequires>True</CodeContractsInferRequires>\n    <CodeContractsInferEnsures>True</CodeContractsInferEnsures>\n    <CodeContractsInferEnsuresAutoProperties>True</CodeContractsInferEnsuresAutoProperties>\n    <CodeContractsInferObjectInvariants>True</CodeContractsInferObjectInvariants>\n    <CodeContractsSuggestAssumptions>False</CodeContractsSuggestAssumptions>\n    <CodeContractsSuggestAssumptionsForCallees>True</CodeContractsSuggestAssumptionsForCallees>\n    <CodeContractsSuggestRequires>True</CodeContractsSuggestRequires>\n    <CodeContractsNecessaryEnsures>True</CodeContractsNecessaryEnsures>\n    <CodeContractsSuggestObjectInvariants>False</CodeContractsSuggestObjectInvariants>\n    <CodeContractsSuggestReadonly>True</CodeContractsSuggestReadonly>\n    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>\n    <CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>\n    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>\n    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>\n    <CodeContractsCustomRewriterAssembly />\n    <CodeContractsCustomRewriterClass />\n    <CodeContractsLibPaths />\n    <CodeContractsExtraRewriteOptions />\n    <CodeContractsExtraAnalysisOptions />\n    <CodeContractsSQLServerOption>%28LocalDb%29\\MSSQLLocalDB</CodeContractsSQLServerOption>\n    <CodeContractsBaseLineFile />\n    <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>\n    <CodeContractsSkipAnalysisIfCannotConnectToCache>True</CodeContractsSkipAnalysisIfCannotConnectToCache>\n    <CodeContractsFailBuildOnWarnings>False</CodeContractsFailBuildOnWarnings>\n    <CodeContractsBeingOptimisticOnExternal>True</CodeContractsBeingOptimisticOnExternal>\n    <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>\n    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>\n    <CodeContractsAnalysisWarningLevel>2</CodeContractsAnalysisWarningLevel>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>false</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45, HotPriorityQueue,TraceFoV</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>false</Prefer32Bit>\n    <BaseAddress>255066112</BaseAddress>\n    <CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>\n    <CodeContractsRuntimeOnlyPublicSurface>True</CodeContractsRuntimeOnlyPublicSurface>\n    <CodeContractsRuntimeThrowOnFailure>False</CodeContractsRuntimeThrowOnFailure>\n    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>\n    <CodeContractsRuntimeSkipQuantifiers>True</CodeContractsRuntimeSkipQuantifiers>\n    <CodeContractsRunCodeAnalysis>True</CodeContractsRunCodeAnalysis>\n    <CodeContractsNonNullObligations>True</CodeContractsNonNullObligations>\n    <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>\n    <CodeContractsArithmeticObligations>True</CodeContractsArithmeticObligations>\n    <CodeContractsEnumObligations>True</CodeContractsEnumObligations>\n    <CodeContractsRedundantAssumptions>True</CodeContractsRedundantAssumptions>\n    <CodeContractsAssertsToContractsCheckBox>True</CodeContractsAssertsToContractsCheckBox>\n    <CodeContractsRedundantTests>True</CodeContractsRedundantTests>\n    <CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings>\n    <CodeContractsMissingPublicEnsuresAsWarnings>True</CodeContractsMissingPublicEnsuresAsWarnings>\n    <CodeContractsInferRequires>True</CodeContractsInferRequires>\n    <CodeContractsInferEnsures>True</CodeContractsInferEnsures>\n    <CodeContractsInferEnsuresAutoProperties>True</CodeContractsInferEnsuresAutoProperties>\n    <CodeContractsInferObjectInvariants>True</CodeContractsInferObjectInvariants>\n    <CodeContractsSuggestAssumptions>False</CodeContractsSuggestAssumptions>\n    <CodeContractsSuggestAssumptionsForCallees>True</CodeContractsSuggestAssumptionsForCallees>\n    <CodeContractsSuggestRequires>True</CodeContractsSuggestRequires>\n    <CodeContractsNecessaryEnsures>True</CodeContractsNecessaryEnsures>\n    <CodeContractsSuggestObjectInvariants>False</CodeContractsSuggestObjectInvariants>\n    <CodeContractsSuggestReadonly>True</CodeContractsSuggestReadonly>\n    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>\n    <CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>\n    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>\n    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>\n    <CodeContractsCustomRewriterAssembly />\n    <CodeContractsCustomRewriterClass />\n    <CodeContractsLibPaths />\n    <CodeContractsExtraRewriteOptions />\n    <CodeContractsExtraAnalysisOptions />\n    <CodeContractsSQLServerOption>%28LocalDb%29\\MSSQLLocalDB</CodeContractsSQLServerOption>\n    <CodeContractsBaseLineFile />\n    <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>\n    <CodeContractsSkipAnalysisIfCannotConnectToCache>False</CodeContractsSkipAnalysisIfCannotConnectToCache>\n    <CodeContractsFailBuildOnWarnings>False</CodeContractsFailBuildOnWarnings>\n    <CodeContractsBeingOptimisticOnExternal>True</CodeContractsBeingOptimisticOnExternal>\n    <CodeContractsRuntimeCheckingLevel>Pre and Post</CodeContractsRuntimeCheckingLevel>\n    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>\n    <CodeContractsAnalysisWarningLevel>2</CodeContractsAnalysisWarningLevel>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"IBoard.cs\" />\n    <Compile Include=\"Pathfinding\\INavigableBoard.cs\" />\n    <Compile Include=\"Pathfinding\\PathTracingExtensions.cs\" />\n    <Compile Include=\"Storage\\HexBoardExtensions.cs\" />\n    <Compile Include=\"HexPickingExtensions.cs\" />\n    <Compile Include=\"IHexgridExtensions.cs\" />\n    <Compile Include=\"Storage\\IMapDisplayWinForms.cs\" />\n    <Compile Include=\"Storage\\Map.cs\" />\n    <Compile Include=\"Storage\\MapDisplay.cs\" />\n    <Compile Include=\"Storage\\MapDisplayExtensions.cs\" />\n    <Compile Include=\"Maybe.cs\" />\n    <Compile Include=\"MaybeExtensions.cs\" />\n    <Compile Include=\"NullableExtensions.cs\" />\n    <Compile Include=\"PointExtensions.cs\" />\n    <Compile Include=\"SizeExtensions.cs\" />\n    <Compile Include=\"UserCoordsRectangle.cs\" />\n    <Compile Include=\"Common\\ValueChangedEventArgs.cs\" />\n    <Compile Include=\"Common\\EventArgs.cs\" />\n    <Compile Include=\"FastLists\\AbstractFastList.cs\" />\n    <Compile Include=\"FieldOfView\\FovBoardExtensions.cs\" />\n    <Compile Include=\"IShadingMask.cs\" />\n    <Compile Include=\"Storage\\IMapDisplay.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Pathfinding\\AltPathfinder.cs\" />\n    <Compile Include=\"Pathfinding\\DirectedLandmark.cs\" />\n    <Compile Include=\"Pathfinding\\HexsideCosts.cs\" />\n    <Compile Include=\"Pathfinding\\LandmarkPopulator.cs\" />\n    <Compile Include=\"Pathfinding\\PathHalves.cs\" />\n    <Compile Include=\"Pathfinding\\PriorityQueueFactory.cs\" />\n    <Compile Include=\"Storage\\BlockedBoardStorage.cs\" />\n    <Compile Include=\"Storage\\BlockedBoardStorage32x32.cs\" />\n    <Compile Include=\"Storage\\BoardStorage.cs\" />\n    <Compile Include=\"Common\\Tracing.cs\" />\n    <Compile Include=\"Common\\EnumExtensions.cs\" />\n    <Compile Include=\"Common\\EnumHelper.cs\" />\n    <Compile Include=\"Extensions.cs\" />\n    <Compile Include=\"FastLists\\FastEnumerable.cs\" />\n    <Compile Include=\"FastLists\\FastIteratorFunctor.cs\" />\n    <Compile Include=\"FastLists\\FastList.cs\" />\n    <Compile Include=\"FastLists\\FastListExtensions.cs\" />\n    <Compile Include=\"FastLists\\Interfaces.cs\" />\n    <Compile Include=\"Common\\ImmutableStack.cs\" />\n    <Compile Include=\"IntMatrix2D.cs\" />\n    <Compile Include=\"IntVector2D.cs\" />\n    <Compile Include=\"CustomCoords.cs\" />\n    <Compile Include=\"Storage\\FlatBoardStorage.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexCoords.cs\" />\n    <Compile Include=\"Hexside.cs\" />\n    <Compile Include=\"Hexsides.cs\" />\n    <Compile Include=\"Storage\\IBoardStorage.cs\" />\n    <Compile Include=\"FieldOfView\\IFovBoard.cs\" />\n    <Compile Include=\"IHex.cs\" />\n    <Compile Include=\"IHexgrid.cs\" />\n    <Compile Include=\"Common\\NativeMethods.cs\" />\n    <Compile Include=\"Pathfinding\\DirectedPathStepHex.cs\" />\n    <Compile Include=\"Pathfinding\\BidirectionalAltPathfinder.cs\" />\n    <Compile Include=\"Pathfinding\\DictPriorityQueue.cs\" />\n    <Compile Include=\"HexGrid.cs\" />\n    <Compile Include=\"Hex.cs\" />\n    <Compile Include=\"Storage\\HexBoard.cs\" />\n    <Compile Include=\"Pathfinding\\HexKeyValuePair.cs\" />\n    <Compile Include=\"Pathfinding\\HotPriorityQueue.cs\" />\n    <Compile Include=\"Pathfinding\\HotPriorityQueueueList.cs\" />\n    <Compile Include=\"Pathfinding\\IDirectedPathCollection.cs\" />\n    <Compile Include=\"Pathfinding\\IHotPrioirtyQueueList.cs\" />\n    <Compile Include=\"Pathfinding\\NavigableBoard.cs\" />\n    <Compile Include=\"Pathfinding\\Interfaces.cs\" />\n    <Compile Include=\"Pathfinding\\IPriorityQueue.cs\" />\n    <Compile Include=\"Pathfinding\\Landmark.cs\" />\n    <Compile Include=\"Pathfinding\\DirectedPathCollection.cs\" />\n    <Compile Include=\"Pathfinding\\LandmarkCollection.cs\" />\n    <Compile Include=\"Pathfinding\\MinListHeap.cs\" />\n    <Compile Include=\"Pathfinding\\PathfinderExtensions.cs\" />\n    <Compile Include=\"Pathfinding\\StandardPathfinder.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"FieldOfView\\ArrayFieldOfView.cs\" />\n    <Compile Include=\"FieldOfView\\FovFactory.cs\" />\n    <Compile Include=\"FieldOfView\\FovCone.cs\" />\n    <Compile Include=\"FieldOfView\\FovQueue.cs\" />\n    <Compile Include=\"FieldOfView\\RiseRun.cs\" />\n    <Compile Include=\"FieldOfView\\ShadowCastingFov.cs\" />\n    <Compile Include=\"FieldOfView\\Dodecant.cs\" />\n    <Compile Include=\"FieldOfView\\ShadowCastingFov_Utilities.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"License.md\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexUtilities/Hexside.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>Enumeration of the six hexagonal directions.</summary>\n    public class Hexside {\n        #region Enum Constants & Constructor\n        /// <summary>The hexside on the top of the hex.</summary>\n        public static Hexside North     { get; } = new Hexside(0, \"North\", Hexsides.North);\n\n        /// <summary>The hexside on the upper-right of the hex.</summary>\n        public static Hexside Northeast { get; } = new Hexside(1, \"Northeast\", Hexsides.Northeast);\n\n        /// <summary>The hexside on the lower-right of the hex</summary>\n        public static Hexside Southeast { get; } = new Hexside(2, \"Southeast\", Hexsides.Southeast);\n\n        /// <summary>The hexside on the bottom of the hex.</summary>\n        public static Hexside South     { get; } = new Hexside(3, \"South\", Hexsides.South);\n\n        /// <summary>The hexside on the lower-left of the hex.</summary>\n        public static Hexside Southwest { get; } = new Hexside(4, \"Southwest\", Hexsides.Southwest);\n\n        /// <summary>The hexside on the upper-left of the hex.</summary>\n        public static readonly Hexside Northwest = new Hexside(5, \"Northwest\", Hexsides.Northwest);\n\n        private Hexside(int value, string name, Hexsides hexsides) {\n            AsHexsides = hexsides;\n            Name     = name;\n            Value    = value;\n            _reversed = (Value + 3) % 6;\n        }\n        #endregion\n\n        #region Static members\n        /// <summary><c>Static List {Hexside}</c> for enumerations.</summary>\n        public static IFastList<Hexside> HexsideList { get; } = new Hexside[] {\n            North,Northeast,Southeast,South,Southwest,Northwest }.ToFastList();\n\n        /// <summary>Performs <c>action</c> for each Enum value of <c>Hexside</c>.</summary>\n        /// <param name=\"action\"></param>\n        public static void ForEach(Action<Hexside> action) => HexsideList.ForEach(action);\n\n        /// <summary>Perform the Invoke() method of <c>functor</c> for each value of Enum <c>Hexside</c>.</summary>\n        /// <param name=\"functor\"></param>\n        public static void ForEach(FastIteratorFunctor<Hexside> functor) => HexsideList.ForEach(functor);\n\n        /// <summary>Returns the <see cref=\"Hexside\"/> with this <paramref name=\"name\"/>.</summary>\n        /// <param name=\"name\">The <see cref=\"Hexside\"/> string to be parsed and recognized.</param>\n        /// <param name=\"ignoreCase\">Specifies whether or not a case-insensitive parse is desired.</param>\n        public static Hexside ParseEnum(string name, bool ignoreCase) {\n            var index = ignoreCase ? _namesUncased.IndexOf(name.ToUpper(CultureInfo.InvariantCulture))\n                                   : _namesCased.IndexOf(name);\n            if (index == -1) throw new ArgumentOutOfRangeException(\"name\",name,\"Enum type: \" + typeof(Hexside).Name);\n\n            return HexsideList[index];;\n        }\n\n        /// <summary>Returns the single <see cref=\"Hexsides\"/> value corresponding to this <paramref name=\"hexside\"/>.</summary>\n        /// <param name=\"hexside\">The supplied <see cref=\"Hexside\"/>.</param>\n        public static implicit operator Hexsides(Hexside hexside) => hexside.AsHexsides;\n\n        /// <summary>Enables implicit casting of a <see cref=\"Hexside\"/> as a <see cref=\"int\"/>.</summary>\n        /// <param name=\"hexside\">The supplied <see cref=\"Hexside\"/>.</param>\n        public static implicit operator int(Hexside hexside) => hexside.Value;\n\n        private static readonly IList<string> _namesCased   = (from hexside in HexsideList select hexside.Name).ToList();\n        private static readonly IList<string> _namesUncased = (from name in _namesCased select name.ToUpper(CultureInfo.InvariantCulture)).ToList();\n        #endregion\n\n        #region Instance members\n        /// <summary>The <c>Hexsides</c> bit corresponding to this <c>Hexside</c>.</summary>\n        public Hexsides AsHexsides { get; }\n\n        /// <summary>The name of this enumeration constant.</summary>\n        public string   Name       { get; }\n\n        /// <summary>Returns the reversed, or opposite, <see cref=\"Hexside\"/> to this one.</summary>\n        public Hexside  Reversed   => HexsideList[_reversed]; private readonly int _reversed;\n\n        /// <summary>The integer value for this enumeration constant.</summary>\n        public int      Value      { get; }\n\n        /// <inheritdoc/>\n        public  override string ToString() => Name;\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Hexsides.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>Bit-flags for combinations of the six hexagonal directions.</summary>\n    [Flags]public enum Hexsides {\n        /// <summary>The selection of no hexsides.</summary>\n        None      = 0x00,\n        /// <summary>The hexside on the top of the hex.</summary>\n        North     = 1 << 0,\n        /// <summary>The hexside on the upper-right of the hex.</summary>\n        Northeast = 1 << 1,\n        /// <summary>The hexside on the lower-right of the hex</summary>\n        Southeast = 1 << 2,\n        /// <summary>The hexside on the bottom of the hex.</summary>\n        South     = 1 << 3,\n        /// <summary>The hexside on the lower-left of the hex.</summary>\n        Southwest = 1 << 4,\n        /// <summary>The hexside on the upper-left of the hex.</summary>\n        Northwest = 1 << 5,\n        /// <summary>SHorthand for all hexsides.</summary>\n        All       = North | Northeast | Southeast | South | Southwest | Northwest\n    }\n\n    /// <summary>Extension methods for <c>Hexsides</c>.</summary>\n    public static partial class HexsidesExtensions {\n        /// <summary>Returns true exactly if <c>this</c> has the the eponymous bit from <c>hexside</c> set.</summary>\n        /// <param name=\"this\">The Hexsides value to test.</param>\n        /// <param name=\"hexside\">Specification of the eponymous bit in <c>this</c> to test.</param>\n        public static bool IsSet(this Hexsides @this, Hexside hexside)\n        => (@this.GetValue() & ((int)hexside.AsHexsides)) != 0;\n        \n        /// <summary>TODO</summary>\n        public static int GetValue(this Hexsides @this) { return (int)@this.ValidBitsMask(); }\n        /// <summary>Tests (without boxing) if all requested bits are clear.</summary>\n        public static bool AreAllClear(this Hexsides @this, Hexsides testBits) {\n          if (@this == 0) throw new ArgumentOutOfRangeException(\"this\",\"Value must not be 0.\");\n          return (@this & testBits).ValidBitsMask() == 0;\n        }\n        /// <summary>Tests (without boxing) if all requested bits are set.</summary>\n        public static bool AreAllSet(this Hexsides @this, Hexsides testBits) {\n          if (@this == 0) throw new ArgumentOutOfRangeException(\"this\",\"Value must not be 0.\");\n          return (@this & testBits).ValidBitsMask() == testBits;\n        }\n        /// <summary>Tests (without boxing) if any requested bit is set.</summary>\n        public static bool IsAnySet(this Hexsides @this, Hexsides testBits) {\n          if (@this == 0) throw new ArgumentOutOfRangeException(\"this\",\"Value must not be 0.\");\n          return (@this & testBits).ValidBitsMask() != 0;\n        }\n\n        /// <summary>Clears specified bits in this.</summary>\n        public static Hexsides ClearBits(this Hexsides @this, Hexsides bits)\n        => (@this & ~bits).ValidBitsMask();\n        \n        /// <summary>Sets specified bits in this.</summary>\n        public static Hexsides SetBits(this Hexsides @this, Hexsides bits)\n        => (@this | bits).ValidBitsMask();\n\n        /// <summary>Returns the result of clearing all invalid bits in <c>this</c>.</summary>\n        public static Hexsides ValidBitsMask(this Hexsides @this) { return @this &= Hexsides.All; }\n\n        #region public static int BitCount(this Hexsides @this)\n        /// <summary>Returns the count of of set bit-flags in the argument.</summary>\n        /// <param name=\"this\">The Hexsides instnace of interest.</param>\n        public static int BitCount(this Hexsides @this)\n        => BitCountLookup[(int)@this];\n\n        private static readonly IList<int> BitCountLookup =\n          ( from value in Enumerable.Range(0, 1 << 6)\n            select ( from i in Enumerable.Range(0,8)\n                     select (value >> i) & 0x0001\n                   ).Sum()\n          ).ToList().AsReadOnly();     \n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IBoard.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexSize = System.Drawing.Size;\n\n    /// <summary>The basic interface defining a mapboard with hexes.</summary>\n    public interface IBoard<THex> where THex: IHex {\n        /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n        HexSize     MapSizeHexes           { get; }\n\n        /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        Maybe<THex> this[HexCoords coords] { get; }\n\n        /// <summary>Returns whether the hex at location <c>coords</c>is \"on board\".</summary>\n        bool IsOnboard(HexCoords coords);\n\n        /// <summary>Perform <paramref name=\"action\"/> for all neighbours of this hex.</summary>\n        void ForAllNeighbours(HexCoords coords, Action<THex,Hexside> action);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IHex.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nusing System;\nusing System.Drawing.Drawing2D;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>External interface exposed by individual hexes.</summary>\n    public interface IHex {\n        /// <summary>The <c>HexCoords</c> coordinates for this hex on <c>Board</c>.</summary>\n        HexCoords Coords         { get; }\n\n        /// <summary>Elevation of this hex in \"steps\" above the minimum elevation of the board.</summary>\n        int       ElevationLevel { get; }\n\n        /// <summary>Height ASL in <i>game units</i> of observer's eyes for FOV calculations.</summary>\n        int       HeightObserver { get; }\n\n        /// <summary>Height ASL in <i>game units</i> of target above ground level to be spotted.</summary>\n        int       HeightTarget   { get; }\n\n        /// <summary>Height ASL in <i>game units</i> of any blocking terrian in this hex.</summary>\n        int       HeightTerrain  { get; }\n \n        /// <summary>Char code for the tYpe of the terrain in this hex.</summary>\n        char      TerrainType    { get; }\n\n        /// <summary>Returns true exactly when thhis hex is passable.</summary>\n        bool      IsPassable     { get; }\n\n        /// <summary>Cost to extend the path with the hex located across the <c>Hexside</c> at <c>direction</c>.</summary>\n        int       EntryCost(Hexside hexsideExit);\n\n        /// <summary>Cost to extend the path with the hex located across the <c>Hexside</c> at <c>direction</c>.</summary>\n        int       ExitCost(Hexside hexsideExit);\n\n        /// <summary>Height ASL in <i>game units</i> of any blocking terrain in this hex and the specified Hexside.</summary>\n        int       HeightHexside(Hexside hexside);\n    }\n}\nnamespace PGNapoleonics.HexUtilities{\n    using HexPoint   = System.Drawing.Point;\n    using HexPointF  = System.Drawing.PointF;\n    using HexSize    = System.Drawing.Size;\n    using HexSizeF   = System.Drawing.SizeF;\n    using RectangleF = System.Drawing.RectangleF;\n\n    using CoordsRect = CoordsRectangle;\n    using ILandmarks = Pathfinding.ILandmarkCollection;\n    using IPath      = Maybe<Pathfinding.IDirectedPathCollection>;\n    using IFovBoard  = FieldOfView.IFovBoard;\n    /// <summary>.</summary>\n    public interface IPanelModel : IFovBoard {\n        /// <summary>.</summary>\n        new Maybe<IHex>  this[HexCoords coords] { get; }\n        /// <summary>.</summary>\n        IShadingMask Fov            { get;}\n        /// <summary>.</summary>\n        int         FovRadius       { get; set; }\n        /// <summary>.</summary>\n        HexCoords   GoalHex         { get; set; }\n        /// <summary>.</summary>\n        HexSize     GridSize        { get; }\n        /// <summary>.</summary>\n        IntMatrix2D GridSizePixels  { get; }\n        /// <summary>.</summary>\n        HexSize     HexCentreOffset { get; }\n        /// <summary>.</summary>\n        GraphicsPath HexgridPath    { get; }\n        /// <summary>.</summary>\n        HexCoords   HotspotHex      { get; set; }\n        /// <summary>.</summary>\n        ILandmarks  Landmarks       { get; }\n        /// <summary>.</summary>\n        int         LandmarkToShow  { get; set; }\n        /// <summary>.</summary>\n        float       MapScale        { get; set; }\n        ///// <summary>.</summary>\n        //HexSize      MapSizeHexes   { get; }\n        /// <summary>.</summary>\n        string      Name            { get; }\n        /// <summary>.</summary>\n        IPath       Path            { get; }\n        /// <summary>.</summary>\n        int         RangeCutoff     { get; set; }\n        /// <summary>.</summary>\n        byte        ShadeBrushAlpha { get; }\n        /// <summary>.</summary>\n        bool        ShowFov         { get; set; }\n        /// <summary>.</summary>\n        bool        ShowPathArrow   { get; set; }\n        /// <summary>.</summary>\n        bool        ShowRangeLine   { get; set; }\n        /// <summary>.</summary>\n        HexCoords   StartHex        { get; set; }    \n\n        ///// <summary>.</summary>\n        //int  ElevationGroundASL(HexCoords coords);\n        ///// <summary>.</summary>\n        //int  ElevationObserverASL(HexCoords coords);\n        ///// <summary>.</summary>\n        //int  ElevationTargetASL(HexCoords coords);\n\n        /// <summary>.</summary>\n        void ForEachHexSerial<THex>(Action<Maybe<THex>> action) where THex:class,IHex;\n\n        ///// <summary>.</summary>\n        //CoordsRect  GetClipInHexes(RectangleF clip);\n        ///// <summary>.</summary>\n        //CoordsRect  GetClipInHexes(HexPointF point, HexSizeF size);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IHexBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2015 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2015 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>External interface exposed by the the implementation of <see cref=\"IHexBoard{THex}\"/>.</summary>\n  public interface IHexBoard<out THex> : IBoardStorage<THex> where THex : class, IHex {\n    /// <summary>Gets the extent in pixels of hte grid on which hexes are to be laid out. </summary>\n    HexSize  GridSize    { get; }\n\n    /// <summary>Range beyond which Fast PathFinding is used instead of Stable PathFinding.</summary>\n    int      RangeCutoff { get; }\n\n    /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    new THex    this[HexCoords coords] { get; }\n\n    /// <summary>The dimensions of the board as a <see cref=\"System.Drawing.Size\"/></summary>\n    new HexSize MapSizeHexes           { get; }\n  }\n}\n"
  },
  {
    "path": "HexUtilities/IHexgrid.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoints = IList<System.Drawing.Point>;\n    using HexSize   = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public interface IHexgrid {\n        /// <summary>TODO</summary>\n        HexSize   GridSize      { get; }\n        /// <summary>TODO</summary>\n        HexPoints HexCorners    { get; }\n        /// <summary>TODO</summary>\n        bool      IsTransposed  { get; }\n        /// <summary>Offset of grid origin, from control's client-area origin.</summary>\n        HexSize   Margin        { get; set; }\n        /// <summary>TODO</summary>\n        float     Scale         { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IHexgridExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint = System.Drawing.Point;\n    using HexSize  = System.Drawing.Size;\n\n    /// <summary>.</summary>\n    public static partial class IHexgridExtensions {\n        /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n        /// <param name=\"visibleRectangle\"></param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        public static HexPoint ScrollPositionToCenterOnHex(this IHexgrid @this,\n                HexCoords coordsNewCenterHex, CoordsRectangle visibleRectangle)\n        => @this.HexCenterPoint(HexCoords.NewUserCoords(coordsNewCenterHex.User - (visibleRectangle.Size.User / 2)) );\n\n        /// <summary>TODO</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"mapSizePixels\"></param>\n        /// <param name=\"mapScale\"></param>\n        public static HexSize GetSize(this IHexgrid @this, HexSize mapSizePixels, float mapScale)\n        => HexSize.Ceiling(mapSizePixels.Scale(mapScale)); \n    }\n}\n"
  },
  {
    "path": "HexUtilities/IShadingMask.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>Structure returned by the Field-of-View factory.</summary>\n    public interface IShadingMask {\n        /// <summary>True if the hex at location <c>coords</c>c> is visible in this field-of-view.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        bool this[HexCoords coords] { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IntMatrix2D.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>Row-major order integer implementation of an immutable 2D affine transformation matrix.</summary>\n    /// <remarks> \n    /// Represents Points as row vectors and planes as column vectors.\n    /// This representation is standard for computer graphics, though opposite \n    /// to standard mathematical (and physics) representation, and treats row \n    /// vectors as contravariant and column vectors as covariant.\n    /// </remarks>\n    [DebuggerDisplay(\"(({M11},{M12}), ({M21},{M22}), ({M31},{M32}), {M33}))\")]\n    public struct IntMatrix2D : IEquatable<IntMatrix2D>, IFormattable {\n        static IntMatrix2D TransposeMatrix => new IntMatrix2D(0,1, 1,0);\n\n        /// <summary>Returns the transpose of the supplied matrix.</summary>\n        public static IntMatrix2D Transpose(IntMatrix2D matrix) => matrix * TransposeMatrix;\n\n        #region Constructors\n        /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector vector.</summary>\n        /// <param name=\"vector\">the translation vector</param>\n        public IntMatrix2D(IntVector2D vector)  : this(1,0, 0,1, vector.X,vector.Y, 1) {}\n\n        /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation (dx,dy).</summary>\n        /// <param name=\"dx\">X-translate component</param>\n        /// <param name=\"dy\">Y-translate component</param>\n        public IntMatrix2D(int dx, int dy)  : this(1,0, 0,1, dx,dy,1) {}\n\n        /// <summary> Initialies a new <code>IntMatrix2D</code> with a rotation.</summary>\n        /// <param name=\"m11\">X-scale component.</param>\n        /// <param name=\"m12\">Y-shear component</param>\n        /// <param name=\"m21\">X-shear component</param>\n        /// <param name=\"m22\">Y-scale component</param>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1025:ReplaceRepetitiveArgumentsWithParamsArray\")]\n        public IntMatrix2D(int m11, int m12, int m21, int m22) : this(m11,m12, m21,m22, 0,0, 1) {}\n\n        /// <summary>Initializes a new fully-specificed <code>IntMatrix2D</code> .</summary>\n        /// <param name=\"m11\">X-scale component.</param>\n        /// <param name=\"m12\">Y-shear component</param>\n        /// <param name=\"m21\">X-shear component</param>\n        /// <param name=\"m22\">Y-scale component</param>\n        /// <param name=\"dx\">X-translate component</param>\n        /// <param name=\"dy\">Y-translate component</param>\n        public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy) : this(m11,m12,m21,m22,dx,dy,1) {}\n\n        /// <summary>Initializes a new fully-specificed non-normed <code>IntMatrix2D</code>.</summary>\n        /// <param name=\"m11\">X-scale component.</param>\n        /// <param name=\"m12\">Y-shear component</param>\n        /// <param name=\"m21\">X-shear component</param>\n        /// <param name=\"m22\">Y-scale component</param>\n        /// <param name=\"dx\">X-translate component</param>\n        /// <param name=\"dy\">Y-translate component</param>\n        /// <param name=\"norm\">Normalization component</param>\n        public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy, int norm) : this() {\n            if (norm == 0) throw new ArgumentNullException(nameof(norm));\n            M11 = m11;  M12 = m12;\n            M21 = m21;  M22 = m22;\n            M31 = dx;   M32 = dy;   M33 = norm;\n        }\n        #endregion\n\n        #region Properties\n        /// <summary>Get the i-scale component.</summary>\n        public int M11 { get; }\n\n        /// <summary>Get the X-shear component</summary>\n        public int M12 { get; }\n\n        /// <summary>Get the j-shear component</summary>\n        public int M21 { get; }\n\n        /// <summary>Get the Y-scale component</summary>\n        public int M22 { get; }\n\n        /// <summary>Get the i-translation component</summary>\n        public int M31 { get; }\n\n        /// <summary>Get the j-translationcomponent</summary>\n        public int M32 { get; }\n\n        /// <summary>Ge the normalization component</summary>\n        public int M33 { get; }\n\n        /// <summary>Get the identity @this.</summary>\n        public static readonly IntMatrix2D Identity = new IntMatrix2D(1,0,0,1,0,0, 1);\n\n        /// <summary>todo</summary>\n        public int Determinant => M11*M22 - M21*M12;\n        #endregion\n\n        #region Operators\n        /// <summary>(Contravariant) Vector transformation by a matrix.</summary>\n        /// <param name=\"v\">IntVector2D to be transformed.</param>\n        /// <param name=\"m\">IntMatrix2D to be applied.</param>\n        /// <returns>New IntVector2D resulting from application of matrix <paramref name=\"m\"/> to vector <paramref name=\"v\"/>.</returns>\n        public static IntVector2D operator * (IntVector2D v, IntMatrix2D m)\n        => new IntVector2D (\n                v.X * m.M11 + v.Y * m.M21 + m.M31,   v.X * m.M12 + v.Y * m.M22 + m.M32,  v.W * m.M33\n           ).Normalize();\n        \n        /// <summary>(Covariant) Vector transformation by a matrix.</summary>\n        /// <param name=\"m\">IntMatrix2D to be applied.</param>\n        /// <param name=\"v\">IntVector2D to be transformed.</param>\n        /// <returns>New IntVector2D resulting from application of matrix <paramref name=\"m\"/> to vector <paramref name=\"v\"/>.</returns>\n        [Obsolete(\"The standard in PGNapoleonics is to use Contravariant (ie column) vectors.\")]\n        public static IntVector2D operator * (IntMatrix2D m, IntVector2D v)\n        => new IntVector2D (\n                v.X * m.M11 + v.Y * m.M12 + m.M31,   v.X * m.M21 + v.Y * m.M22 + m.M32,  v.W * m.M33\n           ).Normalize();\n        \n        /// <summary>Matrix multiplication.</summary>\n        /// <param name=\"m1\">Prepended transformation.</param>\n        /// <param name=\"m2\">Appended transformation.</param>\n        /// <returns></returns>\n        public static IntMatrix2D operator * (IntMatrix2D m1, IntMatrix2D m2)\n        => new IntMatrix2D (\n                m1.M11*m2.M11 + m1.M12*m2.M21,           m1.M11*m2.M12 + m1.M12*m2.M22,\n                m1.M21*m2.M11 + m1.M22*m2.M21,           m1.M21*m2.M12 + m1.M22*m2.M22,\n                m1.M31*m2.M11 + m1.M32*m2.M21 + m2.M31,  m1.M31*m2.M12 + m1.M32*m2.M22 + m2.M32,  m1.M33 * m2.M33\n           );\n        \n        /// <summary>(Contravariant) Vector transformation by a matrix.</summary>\n        public static IntVector2D Multiply(IntVector2D v, IntMatrix2D m) => v * m;\n        \n        /// <summary>(Covariant) Vector transformation by a matrix.</summary>\n        public static IntMatrix2D Multiply(IntMatrix2D m1, IntMatrix2D m2) => m1 * m2;\n        #endregion\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is IntMatrix2D other) && this.Equals(other);\n       \n        /// <inheritdoc/>\n        public bool Equals(IntMatrix2D other)\n        => other.M33*M11 == M33*other.M11  &&  other.M33*M12 == M33*other.M12\n        && other.M33*M21 == M33*other.M21  &&  other.M33*M22 == M33*other.M22\n        && other.M33*M31 == M33*other.M31  &&  other.M33*M32 == M33*other.M32;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => ((2*M11/M33)<<13) + (2*M12/M33)\n                                           ^ ((2*M21/M33)<<14) + ((2*M22/M33)<<1)\n                                           ^ ((2*M31/M33)<<15) + ((2*M32/M33)<<2);\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator != (IntMatrix2D lhs, IntMatrix2D rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator == (IntMatrix2D lhs, IntMatrix2D rhs) => lhs.Equals(rhs);\n        #endregion\n\n        /// <summary>Returns a string representation of this <see cref=\"IntMatrix2D\"/> in the Invariant Culture.</summary>\n        public override string ToString() => ToString(\"G\", CultureInfo.InvariantCulture);\n\n        /// <summary>Returns a string representation of this <see cref=\"IntMatrix2D\"/>.</summary>\n        /// <param name=\"format\">A standard or custom numeric format string.</param>\n        /// <param name=\"formatProvider\">An object that supplies culture-specific formatting information.</param>\n        public string ToString(string format, IFormatProvider formatProvider)\n        => string.Format(CultureInfo.CurrentCulture,\"(({0},{1}), ({2},{3}), ({4},{5}), {6})\",  \n            M11.ToString(format,formatProvider), M12.ToString(format,formatProvider),\n            M21.ToString(format,formatProvider), M22.ToString(format,formatProvider),\n            M31.ToString(format,formatProvider), M32.ToString(format,formatProvider), M33.ToString(format,formatProvider));\n    }\n}\n"
  },
  {
    "path": "HexUtilities/IntVector2D.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint = System.Drawing.Point;\n    using HexSize  = System.Drawing.Size;\n\n    /// <summary>Representation of an immutable integer 2D vector.</summary>\n    [DebuggerDisplay(\"({X},{Y},{W})\")]\n    public struct IntVector2D : IEquatable<IntVector2D>, IFormattable {\n        /// <summary>Returns the origin vector.</summary>\n        public static IntVector2D Empty => new IntVector2D(0,0);\n\n        #region Constructors\n        /// <summary>Construct a new instance at offset (x,y) from the origin with norm of 1.</summary>\n        /// <param name=\"x\">The horizontal coordinate of the offset for this displacement.</param>\n        /// <param name=\"y\">The vertical coordinate of the offset for this displacement.</param>\n        public IntVector2D(int x, int y) : this(x,y,1) { }\n\n        /// <summary>Construct a new instance at offset (x,y) from the origin with norm <paramref name=\"norm\"/>.</summary>\n        /// <param name=\"x\">The horizontal coordinate of the offset for this displacement.</param>\n        /// <param name=\"y\">The vertical coordinate of the offset for this displacement.</param>\n        /// <param name=\"norm\">The 'norm' of this augmented affine vector.</param>\n        internal IntVector2D(int x, int y, int norm) : this() {\n            X = x;\n            Y = y;\n            W = norm;\n        }\n        #endregion\n\n        #region Properties\n        /// <summary>The horizontal component of the vector..</summary>\n        public int X { get; }\n        /// <summary>The vertical component of the vector..</summary>\n        public int Y { get; }\n        /// <summary>Get the w-component (ie scale factor or norm) of the vector.</summary>\n        public int W { get; }\n        #endregion\n\n        /// <summary>Returns a new instance with coordinates normalized using integer arithmetic.</summary>\n        public IntVector2D Normalize() {\n            switch (W) {\n                case 1:   return this;\n                case 2:   return new IntVector2D(X / 2, Y / 2);\n                case 4:   return new IntVector2D(X / 4, Y / 4);\n                case 8:   return new IntVector2D(X / 8, Y / 8);\n\n                    // Wow! All this because integer division wasn't defined to be a field operator.\n                default:  return new IntVector2D(Math.Sign(X)*Math.Sign(W)*Math.Abs(X)/Math.Abs(W),\n                                                 Math.Sign(Y)*Math.Sign(W)*Math.Abs(Y)/Math.Abs(W));\n            }\n        }\n\n        #region Scalar operators\n        /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n        public static IntVector2D operator *(int s,IntVector2D v) => v * s;\n\n        /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n        public static IntVector2D operator *(IntVector2D v,int s) => new IntVector2D(v.X*s,v.Y*s);\n\n        /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n        public static IntVector2D operator /(IntVector2D v,int s) => DivideInner(v,s);\n\n        /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n        public static IntVector2D Multiply(int s,IntVector2D v) => v * s;\n\n        /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n        public static IntVector2D Multiply(IntVector2D v,int s) => v * s;\n\n        /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n        public static IntVector2D Divide(IntVector2D v,int s) => DivideInner(v,s);\n\n        private static IntVector2D DivideInner(IntVector2D v,int s) => new IntVector2D(v.X/s,v.Y/s);\n        #endregion\n\n        #region Vector operators\n        /// <summary>Scalar (Inner, or Dot) Product of two <code>IntVector2D</code> as an Int32.</summary>\n        public static int operator * (IntVector2D v1, IntVector2D v2) => v1.X*v2.X + v1.Y*v2.Y;\n\n        /// <summary>Z component of the 'Vector'- or Cross-Product of two <code>IntVector2D</code>s</summary>\n        /// <returns>A pseudo-scalar (it reverses sign on exchange of its arguments).</returns>\n        public static int operator ^(IntVector2D v1,IntVector2D v2) => v1.X*v2.Y - v1.Y*v2.X;\n\n        /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n        public static IntVector2D operator +(IntVector2D v1,IntVector2D v2) => new IntVector2D(v1.X+v2.X,v1.Y+v2.Y);\n\n        /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n        public static IntVector2D operator -(IntVector2D v1,IntVector2D v2) => new IntVector2D(v1.X-v2.X,v1.Y-v2.Y);\n\n        /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n        public static IntVector2D Add(IntVector2D v1,IntVector2D v2) => v1 + v2;\n\n        /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n        public static IntVector2D Subtract(IntVector2D v1,IntVector2D v2) => v1 - v2;\n\n        /// <summary>Returns the vector cross-product of v1 and v2.</summary>\n        public static int CrossProduct(IntVector2D v1,IntVector2D v2) => v1 ^ v2;\n\n        /// <summary>Returns the inner- / scalar / dot-product of v1 and v2.</summary>\n        public static int InnerProduct(IntVector2D v1,IntVector2D v2) => v1 * v2;\n\n        /// <summary>Obsolete - use InnerProduct operator instead.</summary>\n        [Obsolete(\"Deprecated (as really confusing) - use InnerProduct instead.\",true)]\n        public static int Xor (IntVector2D v1, IntVector2D v2) => InnerProduct(v1, v2);\n        #endregion\n\n        #region Casts\n        /// <summary>Returns a new instance initialized from point.</summary>\n        public static implicit operator IntVector2D(HexPoint point)\n        => new IntVector2D(point.X,point.Y);\n\n        /// <summary>Returns a new instance initialized from size.</summary>\n        public static implicit operator IntVector2D (HexSize size)\n        => new IntVector2D(size.Width, size.Height);\n\n        /// <summary>Returns a new Point instance initialized from vector.</summary>\n        public static implicit operator HexPoint (IntVector2D vector)\n        => new HexPoint(vector.X, vector.Y);\n\n        /// <summary>Returns a new Size instance initialized from vector.</summary>\n        public static implicit operator HexSize (IntVector2D vector)\n        => new HexSize(vector.X, vector.Y);\n        #endregion\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is IntVector2D other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(IntVector2D other) \n        => (other.W*X == W*other.X)  &&  (other.W*Y == W*other.Y);\n\n        /// <inheritdoc/>\n        /// <remarks>\n        /// Maps the components into 32 bits as \"00xx-xxxx xxxx-xxxx xyyy-yyyy yyyy-yyyy\"\n        /// for expected ranges of X and Y.\n        /// Doubling X and Y ensures that adjacent hexes get different hashcodes.\n        /// </remarks>\n        public override int GetHashCode() => ( (2*X/W) <<15 ) + (2*Y/W) ;\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator !=(IntVector2D lhs, IntVector2D rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator ==(IntVector2D lhs, IntVector2D rhs) => lhs.Equals(rhs);\n        #endregion\n\n        /// <summary>Culture-invariant string representation of this instance's value.</summary>\n        public override string ToString() => ToString(\"G\", CultureInfo.InvariantCulture);\n\n        /// <summary>Converts the value of this instance to its equivalent string representation using the \n        /// specified format and culture-specific format information.</summary>\n        /// <param name=\"format\">Type: System.String. \n        /// \n        /// > A standard or custom numeric format string.</param>\n        /// <param name=\"formatProvider\">Type: IFormatProvider - \n        /// \n        /// > An object that supplies culture-specific formatting information.</param>\n        /// <remarks>Format characters:\n        /// - 'V' or 'v': Vector formatting - Vector output like (nn,mm);\n        /// - 'G' or 'g': General formatting - same as 'V' or 'vector';  \n        /// - 'I' or 'i': 2-Dimensional  vector formatting as 11I + 22J;\n        /// - 'W' or 'w': 3-Dimensional  vector formatting as 11I + 22J = 33K;\n        /// In all cases the leading character of the format string is stripped off and parsed, \n        /// with the remainder passed to the formatter completing the display formatting.\n        /// \n        /// For the 2-D and 3-D vector formatting (ie 'I', 'i', 'W', or 'w'), the case of the \n        /// unit vectors follows that of the supplied formatting command character.\n        /// </remarks>\n        public string ToString(string format, IFormatProvider formatProvider) {\n            if (format==null || format.Length==0 || char.IsDigit(format[0])) format = \"G\";\n            var formatChar = format[0];\n            format = \"D\" + format.Substring(1);\n            string layout;\n            switch(formatChar) {\n                default:    throw new FormatException();\n                case 'G':\n                case 'g': \n                case 'V':\n                case 'v':   layout = \"({0}, {1})\"; break;\n                case 'I':   layout = \"{0}I + {1}J\"; break;\n                case 'i':   layout = \"{0}i + {1}j\"; break;\n                case 'W':   layout = \"{0}I + {1}J + {2}K\"; break;\n                case 'w':   layout = \"{0}i + {1}j + {2}k\"; break;\n              }\n          return string.Format(CultureInfo.CurrentCulture,layout, X.ToString(format,formatProvider),\n                                                                  Y.ToString(format,formatProvider),\n                                                                  W.ToString(format,formatProvider));\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/License.md",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "HexUtilities/Maybe.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Shared technoloiges across the library, and useful gadgets.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>A Maybe monad wrapping an instance of type <typeparamref name=\"T\"/>.</summary>\n    public struct Maybe<T> : IEquatable<Maybe<T>> {\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n        public static Maybe<T> NoValue() => default;\n\n        /// <summary>TODO</summary>\n        public Maybe(T value) : this() => Value    = value;\n\n        /// <summary>TODO</summary>\n        public  bool HasValue => Value != null;\n        private T    Value    { get; }\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        \n        public Maybe<TOut> Bind<TOut>(Func<T, Maybe<TOut>> projection)\n        => HasValue ? projection(Value) : Maybe<TOut>.NoValue();\n\n        /// <summary>TODO</summary>\n        public TOut        Match<TOut>(Func<T,TOut> projection, Func<TOut> alternate)\n        => HasValue ? projection(Value) : alternate();\n\n        /// <summary>TODO</summary>\n        public bool        ValueContract(Func<T, bool> contract) => ! HasValue || contract(Value);\n        \n        private static string PreferredName(T value) => value.ToString();\n        \n        private static string AlternateName() => \"NoValue<\" + typeof(T).Name + \">\";\n\n        /// <summary>TODO</summary>\n        public static implicit operator Maybe<T>(T value) => new Maybe<T>(value);\n\n        #region Value Equality with IEquatable<T>\n        /// <summary>Tests value-equality.</summary>\n        public override bool Equals(object obj) => (obj is Maybe<T> other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(Maybe<T> other)\n        => ( HasValue  &&  other.HasValue  &&  Value.Equals(other.Value) )\n        || (!HasValue  && !other.HasValue);\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Value.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator != (Maybe<T> lhs, Maybe<T> rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator == (Maybe<T> lhs, Maybe<T> rhs) => lhs.Equals(rhs);\n\n        /// <summary>TODO</summary>\n        public override string ToString()\n        => (HasValue && Value!=null) ? PreferredName(Value) : AlternateName();\n        #endregion\n\n        /// <summary>TODO</summary>\n        public static Maybe<V> ToMaybe<V>(Maybe<V?> maybe) where V:struct\n        => ! maybe.HasValue || ! maybe.Value.HasValue ? Maybe<V>.NoValue() : maybe.Value.Value;\n\n        /// <summary>TODO</summary>\n        public static V? ToNullable<V>(Maybe<V?> maybe) where V:struct\n        => ! maybe.HasValue || ! maybe.Value.HasValue ? (V?)null : maybe.Value.Value;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/MaybeExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n    public static class MaybeExtensions {\n        /// <summary>Returns the value of <paramref name=\"this\">this</paramref> it it has one; otherwise returns <paramref name=\"alternate\"/>().</summary>\n        /// <param name=\"this\">The <see cref=\"Maybe{T}\"/> being operated upon.</param>\n        /// <param name=\"alternate\">The action to be perrofmed if <paramref name=\"this\"/> has no value.</param>\n        public static Maybe<TOut> Else<TOut>(this Maybe<TOut> @this, Func<TOut> alternate)\n        => @this.Match(e => e, alternate); \n\n        /// <summary>Returns the value of <paramref name=\"this\">this</paramref> it it has one; otherwise returns default(<typeparamref name=\"TOut\"/>).().</summary>\n        /// <param name=\"this\">The <see cref=\"Maybe{T}\"/> being operated upon.</param>\n        public static TOut        ElseDefault<TOut>(this Maybe<TOut> @this)\n        => @this.Match(e => e, ()=>default(TOut)); \n\n        /// <summary>Executes <paramref name=\"action\"/> on <paramref name=\"this\"/> exactly if it hasn't any value.</summary>\n        /// <returns>Returns <paramref name=\"this\"/>.</returns>\n        public static Maybe<TOut> ElseDo<TOut>(this Maybe<TOut> @this, Action action)\n        => @this.Match(value => @this, () => { action(); return @this; });\n\n        /// <summary>Returns the value of <paramref name=\"this\"/> if it has one, otherwise throws an <see cref=\"InvalidOperationException\"/>.</summary>\n        /// <returns>Returns the value of <paramref name=\"this\"/>.</returns>\n        /// <exception cref=\"InvalidOperationException\"></exception>\n        public static TOut        ForceGetValue<TOut>(this Maybe<TOut> @this)\n        => @this.Match(e => e, () => { throw new InvalidOperationException(@this.ToString()); } );\n\n        /// <summary>Executes <paramref name=\"action\"/> on <paramref name=\"this\"/> exactly if it has a value.</summary>\n        /// <returns>Returns <paramref name=\"this\"/>.</returns>\n        public static Maybe<TOut> IfHasValueDo<TOut>(this Maybe<TOut> @this, Action<TOut> action)\n        => @this.Match(value => { action(value); return @this; }, () => @this);\n\n        /// <summary>Projects the value of a <see cref=\"Maybe{T}\"/> into a <see cref=\"Maybe{TOut}\"/>.</summary>\n        public static Maybe<TOut> Select<T,TOut>(this Maybe<T> @this, Func<T,TOut> projection)\n        => @this.Bind<TOut>(value => projection(value));\n\n        /// <summary>Projects the value of a <see cref=\"Maybe{T}\"/> into a <see cref=\"Maybe{TOut}\"/>.</summary>\n        [SuppressMessage( \"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\" )]\n        public static Maybe<TOut> SelectMany<T, TOut>(this Maybe<T> @this,\n                                                      Func<T, Maybe<TOut>> projection)\n        => @this.Bind(value => projection(value));\n\n        /// <summary>Projects the value of a <see cref=\"Maybe{T}\"/> into a <see cref=\"Maybe{TOut}\"/>.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public static Maybe<TOut> SelectMany<T,TMid,TOut>(this Maybe<T> @this, \n                                                    Func<T,Maybe<TMid>> maybeProjection, \n                                                    Func<T,TMid,TOut>   resultProjection)\n        => @this.Bind(                    a =>\n           maybeProjection(a).Bind<TOut>( b =>\n           resultProjection(a,b)));\n\n        /// <summary>Returns a new <see cref=\"Maybe{T}\"/> instance with value <paramref name=\"this\"/>.</summary>\n        /// <returns>Returns <see cref=\"Maybe{T}.NoValue\"/>() if <paramref name=\"this\"/> is null.</returns>\n        public static Maybe<TOut> ToMaybe<TOut>(this TOut @this) => new Maybe<TOut>(@this);\n\n        /// <summary>TODO</summary>\n        public static Maybe<TOut> Where<TOut>(this Maybe<TOut> @this, Func<TOut, bool> predicate)\n        => @this.Bind(e => predicate(e) ? e.ToMaybe() : default(Maybe<TOut>) );\n\n        /// <summary>TODO</summary>\n        public static Maybe<int> CompareTo<TOut>(this Maybe<TOut> @this, Maybe<TOut> other) where TOut:IComparable\n        => (from lhs in @this from rhs in other select lhs.CompareTo(rhs)).ElseDefault();\n\n        /// <summary>TODO</summary>\n        public static Maybe<TOut> Max<TOut>(this Maybe<TOut> @this, Maybe<TOut> other) where TOut:IComparable\n        => from lhs in @this from rhs in other select lhs.CompareTo(rhs) < 0 ? lhs : rhs;\n\n        /// <summary>TODO</summary>\n        public static T? ToNullable<T>(this Maybe<T?> maybe) where T:struct\n        => Maybe<T>.ToNullable(maybe);\n    }\n}\n "
  },
  {
    "path": "HexUtilities/NullableExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n    public static partial class NullableExtensions {\n        /// <summary>Returns the value of <paramref name=\"this\">this</paramref> it it has one; otherwise returns <paramref name=\"alternate\"/>().</summary>\n        /// <typeparam name=\"TOut\">The struct basis for the rtuern type TOut?.</typeparam>\n        /// <param name=\"this\">The <typeparamref name=\"TOut\"/>? being operated upon.</param>\n        /// <param name=\"alternate\">The action to be perrofmed if <paramref name=\"this\"/> has no value.</param>\n        public static TOut? Else<TOut>(this TOut? @this, Func<TOut> alternate) where TOut:struct\n        => @this.Match(e => e, alternate); \n\n        /// <summary>Returns the value of <paramref name=\"this\">this</paramref> it it has one; otherwise returns default(<typeparamref name=\"TOut\"/>).</summary>\n        /// <typeparam name=\"TOut\">The struct basis for the rtuern type TOut?.</typeparam>\n        /// <param name=\"this\">The <see cref=\"Maybe{T}\"/> being operated upon.</param>\n        public static TOut  ElseDefault<TOut>(this TOut? @this) where TOut:struct\n        => @this.Match(e => e, ()=>default(TOut)); \n\n        /// <summary>Executes <paramref name=\"action\"/> on <paramref name=\"this\"/> exactly if it hasn't any value.</summary>\n        /// <typeparam name=\"TOut\">The struct basis for the rtuern type TOut?.</typeparam>\n        /// <returns>Returns <paramref name=\"this\"/>.</returns>\n        public static TOut? ElseDo<TOut>(this TOut? @this, Action action) where TOut:struct\n        => @this.Match(value => @this, () => { action(); return @this; });\n\n        /// <summary>Returns the value of <paramref name=\"this\"/> if it has one, otherwise throws an <see cref=\"InvalidOperationException\"/>.</summary>\n        /// <typeparam name=\"TOut\">The struct basis for the rtuern type TOut?.</typeparam>\n        /// <returns>Returns the value of <paramref name=\"this\"/>.</returns>\n        /// <exception cref=\"InvalidOperationException\"></exception>\n        public static TOut  ForceGetValue<TOut>(this TOut? @this) where TOut:struct\n        => @this.Match(e => e, () => { throw new InvalidOperationException(@this.ToString()); } );\n\n        /// <summary>Executes <paramref name=\"action\"/> on <paramref name=\"this\"/> exactly if it has a value.</summary>\n        /// <typeparam name=\"TOut\">The struct basis for the rtuern type TOut?.</typeparam>\n        /// <returns>Returns <paramref name=\"this\"/>.</returns>\n        public static TOut? IfHasValueDo<TOut>(this TOut? @this, Action<TOut> action)\n        where TOut:struct\n        => @this.HasValue ? @this.Match(value => { action(value); return @this.Value; }, () => @this.Value)\n                          : null as TOut?;\n\n        /// <summary>Projects the value of a <see cref=\"Nullable{T}\"/> into a <see cref=\"Nullable{TOut}\"/>.</summary>\n        public static TOut? Select<T,TOut>(this T? @this, Func<T,TOut> projection)\n        where T:struct where TOut:struct\n        => @this.Bind<T,TOut>(value => projection(value));\n\n        /// <summary>Projects the value of a <see cref=\"Nullable{T}\"/> into a <see cref=\"Nullable{TOut}\"/>.</summary>\n        [SuppressMessage( \"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\" )]\n        public static TOut? SelectMany<T, TOut>(this T? @this,\n                                                Func<T, TOut?> projection)\n        where T:struct where TOut:struct\n        => @this.Bind(value => projection(value));\n\n        /// <summary>Projects the value of a <see cref=\"Nullable{T}\"/> into a <see cref=\"Nullable{TOut}\"/>.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public static TOut? SelectMany<T,TMid,TOut>(this T? @this, \n                                                    Func<T,TMid?> maybeProjection, \n                                                    Func<T,TMid,TOut> resultProjection)\n        where T:struct where TMid:struct where TOut:struct\n        => @this.Bind(                         a =>\n           maybeProjection(a).Bind<TMid,TOut>( b =>\n           resultProjection(a,b)));\n\n        /// <summary>TODO</summary>\n        public static TOut? Where<TOut>(this TOut? @this, Func<TOut, bool> predicate) where TOut:struct\n        => @this.Bind(e => predicate(e) ? e : default(TOut?) );\n\n        /// <summary>TODO</summary>\n        public static int? CompareTo<TOut>(this TOut? @this, TOut? other) where TOut : struct,IComparable\n        => (from lhs in @this from rhs in other select lhs.CompareTo(rhs)).ElseDefault();\n\n        /// <summary>TODO</summary>\n        public static TOut? Max<TOut>(this TOut? @this, TOut? other) where TOut:struct, IComparable\n        => from lhs in @this from rhs in other select lhs.CompareTo(rhs) < 0 ? lhs : rhs;\n\n        /// <summary>TODO</summary>\n        public static Maybe<T> ToMaybe<T>(this Maybe<T?> maybe) where T:struct\n        => Maybe<T>.ToMaybe(maybe);\n\n        /// <summary>TODO</summary>\n        public static TResult? Bind<TValue,TResult>(this TValue? @this, Func<TValue, TResult?> projection)\n        where TValue:struct where TResult:struct\n        => @this.HasValue ? projection(@this.Value) : null;\n\n        /// <summary>TODO</summary>\n        public static TOut  Match<T,TOut>(this T? @this, Func<T,TOut> projection, Func<TOut> alternate) where T:struct\n        => @this.HasValue ? projection(@this.Value) : alternate();\n    }\n}\n "
  },
  {
    "path": "HexUtilities/Pathfinding/AltPathfinder.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDictionary    = IDictionary<HexCoords,IDirectedPathCollection>;\n    using IDirectedPath  = IDirectedPathCollection;\n    using IPriorityQueue = IPriorityQueue<int,IDirectedPathCollection>;\n    using DirectedPath   = DirectedPathCollection;\n    using Potential      = Func<ILandmark,HexCoords,int>;\n    using SetBest        = Action<IDirectedPathCollection,IDirectedPathCollection>;\n    using StepCost       = Func<IHex,Hexside,int>;\n\n/// <summary>A fast efficient serial implementation of <b>Bidirectional ALT</b> (<b>A*</b> with <b>L</b>andmarks\n/// and <b>T</b>riangle-inequality heuristic) <b>path-finding</b> on a <see cref=\"Hexgrid\"/> map.</summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public interface IAltPathfinder<THex> where THex: class,IHex {\n        /// <summary>.</summary>\n        IDictionary          OpenSet { get; }\n\n        /// <summary>.</summary>\n        IAltPathfinder<THex> Partner { get; set; }\n\n        /// <summary>.</summary>\n        int  FrontierMinimum { get; }\n\n        /// <summary>.</summary>\n        bool IsFinished();\n\n        /// <summary>.</summary>\n        int Heuristic(HexCoords coords);\n    }\n\n    /// <summary>The shared algorithm of the forward- and backward-half-searches using ALT.</summary>\n    /// <remarks>\n    /// C# (serial) implementation of NBA* path-finding algorithm by Pijls &amp; Post (Adapted).\n    /// \n    /// Adapted to hex-grids, and using a suggestion by Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz.\n    /// \n    /// <i>Source</i> and <i>Target</i> refer to the path beginning and ending hexes from the client \n    /// perspective; <c>Start</c> and <c>Goal</c> refer to the directional beginning and ending hexes\n    /// of the path from the algorithmic perspective. In the case of a reverse half-search, such as\n    /// in the implementation of PathfinderRev, the Target becomes the Start, and the Source becomes\n    /// the Goal, rather than the usual other way around.\n    /// \n    /// <see cref=\"BidirectionalAltPathfinder\"/>\n    /// <see cref=\"PathHalves{THex}\"/>\n    /// </remarks>\n    /// See also: <a href=\"http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/GW05.pdf\">Computing Point-to-Point Shortest Paths from Extenal Memory - Andrew V. Goldberg &amp; Renato F. Werneck</a>\n    /// See also: <a href=\"http://homepages.dcc.ufmg.br/~chaimo/public/ENIA11.pdf\">PNBA*: A Parallel Bidirectional Heuristic Search Algorithm - Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz</a>\n    /// See also: <a href=\"http://repub.eur.nl/res/pub/16100/ei2009-10.pdf\">Yet Another Bidirectional Algorithm for Shortest Paths - Wim Pijls &amp; Henk Post </a>\n    /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">A* Algorithm Notes</a>\n    [DebuggerDisplay(\"\")]\n    internal class AltPathfinder<THex>: IAltPathfinder<THex> where THex:class,IHex {\n        /// <summary>.</summary>\n        /// <param name=\"pathHalves\"></param>\n        /// <param name=\"isForward\"></param>\n        public AltPathfinder(IPathHalves<THex> pathHalves, bool isForward) {\n            int exitCost (IHex hex, Hexside hexside) => hex.ExitCost(hexside);\n            int entryCost(IHex hex, Hexside hexside) => hex.EntryCost(hexside);\n\n            PathHalves   = pathHalves;\n            Board        = pathHalves.Board;\n            ClosedSet    = pathHalves.ClosedSet;\n            Start        = isForward ? pathHalves.Source : pathHalves.Target;\n            Goal         = isForward ? pathHalves.Target : pathHalves.Source;\n            StepCost     = isForward ? (StepCost)exitCost : entryCost;\n            Potential    = isForward ? (Potential)((l,c) => l.DistanceFrom(c))\n                                                : ((l,c) => l.DistanceTo(c));\n            SetBestSoFar = isForward ? (SetBest)((s,p) => PathHalves.SetBestSoFar(p,s))\n                                              : ((s,p) => PathHalves.SetBestSoFar(s,p));\n            HexsideDirection = isForward ? (Func<Hexside,Hexside>)(hexside => hexside) \n                                         : (hexside => hexside.Reversed);\n\n            OpenSet    = new Dictionary<HexCoords, IDirectedPath>();\n            Queue      = HotPriorityQueue.New<IDirectedPath>(0,256);\n\n            $\"ALT {(isForward?\"Fwd\":\"Rev\")}\".TraceFindPathDetailDirection( Goal.Coords - Start.Coords);\n\n            StartPath(Start);\n        }\n\n        public  IDictionary           OpenSet      { get; }\n        public  IAltPathfinder<THex>  Partner      { get; set; }\n        public  int                   FrontierMinimum\n                                      => Queue.TryPeek(out var item) ? item.Key : int.MaxValue;\n\n        private ILandmarkBoard<THex>  Board        { get; }\n        private ISet<HexCoords>       ClosedSet    { get; }\n        private THex                  Source       { get; }\n        private THex                  Target       { get; }\n        private int                   BestSoFar    => PathHalves.BestSoFar;\n        private ILandmarkCollection   Landmarks    => Board.Landmarks;\n        private IPathHalves<THex>     PathHalves   { get; }\n        /// <summary>The start hex for this directional path search (Source for Fwd; Target for Rev).</summary>\n        private THex                  Start        { get; }\n        /// <summary>The goal hex for this directional path search (Target for Fwd; Source for Rev).</summary>\n        private THex                  Goal         { get; }\n        private IPriorityQueue        Queue        { get; }\n        private Potential             Potential    { get; }\n        private SetBest               SetBestSoFar { get; }\n        private StepCost              StepCost     { get; }\n        private Func<Hexside,Hexside> HexsideDirection { get; }\n\n        #region Methods\n        public   bool          IsFinished(){\n            if (Queue.TryDequeue(out var item)) {\n                var path   = item.Value;\n                var coords = path.PathStep.Coords;\n\n                OpenSet.Remove(coords);\n                if (!ClosedSet.Contains(coords)) {\n                    coords.TraceFindPathDequeue(GetType().Name,path,item.Key,0);\n\n                    if (item.Key < BestSoFar\n                    &&  path.TotalCost + Partner.FrontierMinimum - Partner.Heuristic(coords) < BestSoFar\n                    ) {\n                        Hexside.ForEach(hexside => ExpandHex(path,hexside));\n                    }\n                    ClosedSet.Add(coords);\n                }\n                return !Queue.Any();\n            }\n            return true;\n        }\n\n        public   int           Heuristic(HexCoords coords) => Landmarks.Max(landmark => LandmarkHeuristic(landmark,coords));\n\n        private  void          StartPath(IHex start) {\n            var path = new DirectedPath(start);\n            OpenSet.Add(path.PathStep.Coords, path);\n\n            if(Landmarks.Where(l => l.DistanceTo(path.PathStep.Coords) > 0).Any())\n                Queue.Enqueue (0, path);\n        }\n        private  void          ExpandHex(IDirectedPath path, Hexside hexside) {\n            ( from here in Board[path.PathStep.Coords]\n              from there in Board[here.Coords.GetNeighbour(hexside)]\n              where here != null  &&  there != null\n              select new {here, there}\n            ).IfHasValueDo( tuple => ExpandHex(path, hexside, tuple.here, tuple.there) );\n        }\n        private  void          ExpandHex(IDirectedPath path, Hexside hexside, IHex here, IHex there) {\n            if ( ! ClosedSet.Contains(there.Coords) ) {\n                var cost = StepCost(here, hexside);\n                if( (cost > 0)\n                &&  (path.TotalCost+cost < BestSoFar  ||  ! OpenSet.ContainsKey(there.Coords))\n                ) {\n                    var key     = path.TotalCost + cost + Heuristic(there.Coords);\n                    var newPath = path.AddStep(there,HexsideDirection(hexside),cost);\n\n                    there.Coords.TraceFindPathEnqueue(key, 0);\n\n                    if (!OpenSet.TryGetValue(there.Coords,out var oldPath)) {\n                        OpenSet.Add(there.Coords,newPath);\n                        Queue.Enqueue(key,newPath);\n                    } else if (newPath.TotalCost < oldPath.TotalCost) {\n                        OpenSet.Remove(there.Coords);\n                        OpenSet.Add(there.Coords,newPath);\n                        Queue.Enqueue(key,newPath);\n                    }\n\n                    SetBestSoFar(newPath, GetPartnerPath(there.Coords));\n                }\n            }\n        }\n        private  IDirectedPath GetPartnerPath(HexCoords coords) {\n            Partner.OpenSet.TryGetValue(coords,out var path);\n            return path;\n        }\n        private  int           LandmarkHeuristic(ILandmark landmark,HexCoords here)\n        => Potential(landmark,here) - Potential(landmark,Goal.Coords);\n\n        #endregion\n    }\n}\n\n"
  },
  {
    "path": "HexUtilities/Pathfinding/BidirectionalAltPathfinder.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n\n    /// <summary>C# (serial) implementation of NBA* path-finding algorithm by Pijls &amp; Post (Adapted).</summary>\n    /// <remarks>\n    /// Adapted to hex-grids, and using a suggestion by Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz.\n    /// \n    /// A fast efficient serial implementation of <b>Bidirectional ALT</b> (<b>A*</b> with <b>L</b>andmarks\n    /// and <b>T</b>riangle-inequality heuristic) <b>path-finding</b> on a <see cref=\"Hexgrid\"/> map.\n    /// \n    /// <see cref=\"AltPathfinder{THex}\"/>\n    /// <see cref=\"PathHalves{THex}\"/>\n    /// </remarks>\n    /// See also: <a href=\"http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/GW05.pdf\">Computing Point-to-Point Shortest Paths from Extenal Memory - Andrew V. Goldberg &amp; Renato F. Werneck</a>\n    /// See also: <a href=\"http://homepages.dcc.ufmg.br/~chaimo/public/ENIA11.pdf\">PNBA*: A Parallel Bidirectional Heuristic Search Algorithm - Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz</a>\n    /// See also: <a href=\"http://repub.eur.nl/res/pub/16100/ei2009-10.pdf\">Yet Another Bidirectional Algorithm for Shortest Paths - Wim Pijls &amp; Henk Post </a>\n    /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">A* Algorithm Notes</a>\n    public static class BidirectionalAltPathfinder {\n \n        /// <summary>Returns an <c>IPath</c> for the optimal path from coordinates <paramref name=\"source\"/> to <paramref name=\"target\"/>.</summary>\n        /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n        /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n        /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n        /// <returns>A <see cref=\"IPath{THex}\"/> for the shortest path found, or null if no path was found.</returns>\n        /// <remarks>\n        /// <para>Note that the Heuristic provided by <paramref name=\"board\"/> must be <b>consistent</b> \n        /// in order for the algorithm to perform properly.</para>\n        /// </remarks>\n        public static IPath<THex> GetPathBiDiAlt<THex>(this ILandmarkBoard<THex> board, THex source, THex target)\n        where THex: class,IHex {\n            if (board?.Landmarks == null  ||  source == null  ||  target == null) {\n                return new Path<THex>(null,source,target,null,null);\n            } else {\n                source.TraceFindPathDetailInit(target);\n\n                var pathHalves    = board.NewPathHalves(source,target);\n                var pathfinderFwd = pathHalves.NewAltPathfinder(false);\n                var pathfinderRev = pathHalves.NewAltPathfinder(true);\n\n                // Alternate searching from each direction and calling the other direction\n                pathfinderFwd.Partner = pathfinderRev;\n                var pathfinder        = pathfinderRev.Partner\n                                      = pathfinderFwd;\n\n                while (! pathfinder.IsFinished())  pathfinder = pathfinder.Partner; \n\n                pathHalves.ClosedSet.Count.TraceFindPathDone();\n                return new Path<THex>(pathHalves.PathFwd,source,target,pathHalves.ClosedSet,null);\n            }\n        }\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"board\"></param>\n        /// <param name=\"source\"></param>\n        /// <param name=\"target\"></param>\n        /// <returns></returns>\n        internal static IPathHalves<THex> NewPathHalves<THex>(this ILandmarkBoard<THex> board, THex source, THex target)\n        where THex: class,IHex\n        => new PathHalves<THex>(board, source, target);\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"this\"></param>\n        /// <param name=\"isForward\"></param>\n        /// <returns></returns>\n        internal static IAltPathfinder<THex> NewAltPathfinder<THex>(this IPathHalves<THex> @this, bool isForward)\n        where THex: class,IHex\n        => new AltPathfinder<THex>(@this, isForward);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/DictPriorityQueue.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>Stable (insertion-order preserving for equal-priority elements) PriorityQueue implementation.</summary>\n    /// <remarks>Eric Lippert's C# implementation of PriorityQueue for use by the A* algorithm.</remarks>\n    /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/08/path-finding-using-a-in-c-3-0-part-three.aspx\">Path Finding Using A* Part Three</a>\n    /// <typeparam name=\"TPriority\">Type of the queue-item prioirty.</typeparam>\n    /// <typeparam name=\"TValue\">Type of the queue-item value.</typeparam>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    [DebuggerDisplay(\"Count={Count}\")]\n    public sealed class DictionaryPriorityQueue<TPriority,TValue> : IPriorityQueue<TPriority,TValue>\n    where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority> {\n        IDictionary<TPriority,Queue<TValue>> _dictionary = new SortedDictionary<TPriority,Queue<TValue>>();\n\n        /// <inheritdoc/>\n        bool IPriorityQueue<TPriority,TValue>.Any() => this.Any;\n\n        /// <summary>Returns true exactly when the queue is not empty.</summary>\n        public bool Any => this.Count > 0;\n\n        /// <inheritdoc/>\n        public int Count => _dictionary.Count;\n\n        /// <inheritdoc/>\n        public void Enqueue(TPriority priority,TValue value) => Enqueue(HexKeyValuePair.New(priority,value));\n\n        /// <inheritdoc/>\n        public void Enqueue(HexKeyValuePair<TPriority,TValue> item) {\n            if (!_dictionary.TryGetValue(item.Key,out var queue)) {\n                queue = new Queue<TValue>();\n                _dictionary.Add(item.Key,queue);\n            }\n            queue.Enqueue(item.Value);    // Only not-null values enqueued; so assumptions below valid.\n        }\n\n        /// <inheritdoc/>\n        public bool TryDequeue(out HexKeyValuePair<TPriority,TValue> result) {\n            if (_dictionary.Count > 0)  {\n                var list = _dictionary.First();    \n                var v    = list.Value.Dequeue();   \n                result   = HexKeyValuePair.New(list.Key, v);\n                if( list.Value.Count == 0)  _dictionary.Remove(list.Key);\n                return true;\n            }\n            result = default;\n            return false;\n        }\n\n        /// <inheritdoc/>\n        public bool TryPeek(out HexKeyValuePair<TPriority,TValue> result) {\n            if (_dictionary.Count > 0)  {\n                var list = _dictionary.First();   \n                var v    = list.Value.Peek();      \n                result   = HexKeyValuePair.New(list.Key, v);\n                return true;\n            }\n            result = default;\n            return false;\n        }\n\n        /// <summary>TODO</summary>\n        public void Clear() => _dictionary.Clear();\n\n        /// <summary>TODO</summary>\n        public bool Contains(TValue value) => Enumerable().Select(i => i.Value).Contains(value);\n\n        /// <summary>TODO</summary>\n        public HexKeyValuePair<TPriority,TValue> Dequeue() {\n            if (TryDequeue(out var result)) return result;\n            throw new InvalidOperationException();\n        }\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public IEnumerator<HexKeyValuePair<TPriority,TValue>> GetEnumerator() {\n            foreach(var item in Enumerable()) yield return item;\n        }\n\n        /// <summary>TODO</summary>\n        public HexKeyValuePair<TPriority,TValue> Peek() {\n            if (TryPeek(out var result)) return result;\n            throw new InvalidOperationException();\n        }\n\n        /// <summary>TODO</summary>\n        public HexKeyValuePair<TPriority,TValue>[] ToArray() => Enumerable().ToArray();\n\n        IEnumerable<HexKeyValuePair<TPriority,TValue>> Enumerable()\n        => from list in _dictionary\n           from item in list.Value\n           select HexKeyValuePair.New(list.Key,item);\n\n        #region Not implemented yet - Synchronization and Clone\n#if false\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public bool IsSynchronized { get { return false; } }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public object SyncRoot     { get { return null; } }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public object Clone() { throw new NotSupportedException(); }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public void TrimExcess() { throw new NotSupportedException(); }\n#endif\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/DirectedLandmark.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using HexSize = System.Drawing.Size;\n\n    //internal sealed partial class DirectedLandmark : IDirectedLandmark {\n    //    public static DirectedLandmark New(HexCoords hexCoords,HexSize mapSizeHexes,\n    //        Func<IPriorityQueue<int,HexCoords>> queueFactory,\n    //        TryDirectedCost tryDirectedCosts\n    //    ) =>  new DirectedLandmark(hexCoords,mapSizeHexes,queueFactory,tryDirectedCosts);\n\n    //    /// <summary>Populates and returns a new landmark at the specified board coordinates.</summary>\n    //    /// <param name=\"hexCoords\"><see cref=\"HexCoords\"/> for the landmark to be created.</param>\n    //    /// <param name=\"mapSizeHexes\">Hex dimensions of the IBoard{IHex} on which the landmark is to be created.</param>\n    //    /// <param name=\"queueFactory\">Factory that creates empty instances of <c>IPriorityQueue</c>.</param>\n    //    /// <param name=\"tryDirectedCosts\">TODO</param>\n    //    private DirectedLandmark(HexCoords hexCoords,HexSize mapSizeHexes,\n    //        Func<IPriorityQueue<int,HexCoords>> queueFactory,\n    //        TryDirectedCost tryDirectedCosts\n    //    ) => _backingStore = new LandmarkPopulatorFunctor(hexCoords,mapSizeHexes,queueFactory,tryDirectedCosts).Fill();\n\n    //    ///// <summary>Board coordinates for the landmark location.</summary>\n    //    //public  HexCoords Coords      { get {return _hex.Coords;} } \n    //    ///// <summary>Board coordinates for the landmark location.</summary>\n    //    //public  IHex      Hex         { get {return _hex;} } readonly IHex _hex;\n    //    /// <inheritdoc/>\n    //    public int Distance(HexCoords coords) => _backingStore[coords];\n\n    //    internal readonly BoardStorage<int>     _backingStore;\n    //}\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/DirectedPathCollection.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDirectedPath = IDirectedPathCollection;\n\n    /// <summary>A directed sequence of <see cref=\"Hex\"/>steps comprising a travel path.</summary>\n    [DebuggerDisplay(\"TotalCost={TotalCost} / TotalSteps={TotalSteps}\")]\n    internal sealed class DirectedPathCollection : IDirectedPath {\n        /// <summary>Returns a DirectedPath composed by extending this DirectedPath by one hex.</summary>\n        public DirectedPathCollection(IHex start)\n        : this(null, new DirectedPathStepHex(start, Hexside.North), 0) { }\n\n        /// <summary>Returns a DirectedPath composed by extending this DirectedPath by one hex.</summary>\n        public DirectedPathCollection(IDirectedPath pathSoFar, DirectedPathStepHex pathStep, int stepCost) {\n            PathStep   = pathStep;\n            PathSoFar  = pathSoFar;\n            TotalCost  = (pathSoFar?.TotalCost ?? 0) + stepCost;\n            TotalSteps = (pathSoFar?.TotalSteps??-1) + 1;\n        }\n\n        /// <inheritdoc/>\n        public Hexside              HexsideExit => PathStep.HexsideExit;\n        /// <inheritdoc/>\n        public IDirectedPath        PathSoFar   { get; }\n        /// <inheritdoc/>\n        public DirectedPathStepHex  PathStep    { get; }\n        /// <inheritdoc/>\n        public string               StatusText  => $\"Path Length: {TotalCost}/{TotalSteps}\";\n        /// <inheritdoc/>\n        public HexCoords            StepCoords  => PathStep.Coords;\n        /// <inheritdoc/>\n        public int                  TotalCost   { get; }\n        /// <inheritdoc/>\n        public int                  TotalSteps  { get; }\n\n        /// <inheritdoc/>\n        public override string ToString()\n        => PathSoFar == null\n            ? $\"Hex: {PathStep.Coords} arrives with TotalCost={TotalCost}\"\n            : $\"Hex: {PathStep.Coords} exits {PathStep.HexsideEntry} with TotalCost={TotalCost}\";\n\n        /// <summary>Returns the ordered sequence of sub-paths comprising this DirectedPath.</summary>\n        public IEnumerator<IDirectedPath> GetEnumerator() {\n            yield return this;\n            for (var p = (IDirectedPath)this; p.PathSoFar != null; p = p.PathSoFar) {\n                yield return p.PathSoFar;\n            }\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n    }\n\n    /// <summary>.</summary>\n    internal static partial class PathExtensions {\n        /// <summary>Returns a new instance composed by extending this DirectedPath by one hex.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"hex\"></param>\n        /// <param name=\"hexsideExit\"></param>\n        /// <param name=\"stepCost\"></param>\n        public static IDirectedPath AddStep(this IDirectedPath @this, IHex hex, Hexside hexsideExit, int stepCost)\n        => @this.AddStep(new DirectedPathStepHex(hex,hexsideExit),stepCost);\n\n        /// <summary>Returns a new instance composed by extending this DirectedPath by one hex.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"stepHex\"></param>\n        /// <param name=\"stepCost\"></param>\n        public static IDirectedPath AddStep(this IDirectedPath @this, DirectedPathStepHex stepHex, int stepCost)\n        => new DirectedPathCollection(@this,stepHex,stepCost);\n    }\n\n    /// <summary>.</summary>\n    internal class Path<THex>: IPath<THex> where THex: IHex {\n        /// <summary>.</summary>\n        public Path(Maybe<IDirectedPath> path, THex source, THex target, ISet<HexCoords> closedSet, ISet<HexCoords> openSet) {\n            DirectedPath = path;\n            Source       = source;\n            Target       = target;\n            ClosedSet    = closedSet;\n            OpenSet      = openSet;\n        }\n\n        /// <inheritdoc/>\n        public Maybe<IDirectedPath> DirectedPath { get; }\n\n        /// <inheritdoc/>\n        public THex Source { get; }\n        /// <inheritdoc/>\n        public THex Target { get; }\n\n        /// <inheritdoc/>\n        public ISet<HexCoords> OpenSet   { get; }\n        /// <inheritdoc/>\n        public ISet<HexCoords> ClosedSet { get; }\n    }\n\n    /// <summary>.</summary>\n    public interface IPath<THex>where THex: IHex {\n        /// <summary>.</summary>\n        Maybe<IDirectedPath> DirectedPath { get; }\n\n        /// <summary>.</summary>\n        THex Source { get; }\n        /// <summary>.</summary>\n        THex Target { get; }\n\n        /// <summary>.</summary>\n        ISet<HexCoords> OpenSet   { get; }\n        /// <summary>.</summary>\n        ISet<HexCoords> ClosedSet { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/DirectedPathStepHex.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>A <see cref=\"DirectedPathCollection\"/>Step with a board location and travel direction.</summary>\n    [DebuggerDisplay(\"NeighbourHex: {Hex.Coords} enters from {HexsideEntry}\")]\n    public struct DirectedPathStepHex : IEquatable<DirectedPathStepHex> {\n        /// <summary>Creates a new <see cref=\"DirectedPathStepHex\"/> instance at <paramref name=\"hex\"/> exiting through <see cref=\"Hexside.North\"/>.</summary>\n        /// <param name=\"hex\"></param>\n        /// <remarks>\n        /// This is usually only used as the initial step for a new <see cref=\"DirectedPathCollection\"/>.\n        /// </remarks>\n        /// <summary>TODO</summary>\n        public DirectedPathStepHex(IHex hex) : this(hex, Hexside.North) {}\n\n        /// <summary>Creates a new <see cref=\"DirectedPathStepHex\"/> instance at <paramref name=\"hex\"/> exiting through <paramref name=\"hexsideExit\"/>.</summary>\n        /// <param name=\"hex\"></param>\n        /// <param name=\"hexsideExit\"></param>\n        /// <remarks>\n        /// This is usually only used as the initial step for a new <see cref=\"DirectedPathCollection\"/>.\n        /// </remarks>\n        public DirectedPathStepHex(IHex hex, Hexside hexsideExit) : this() {\n            Hex         = hex;\n            HexsideExit = hexsideExit;\n        }\n\n        /// <summary>The <see cref=\"HexCoords\"/> of the <see cref=\"DirectedPathCollection\"/>Step.</summary>\n        public HexCoords Coords    => Hex.Coords;\n\n        /// <summary>The Hex</summary>\n        public IHex    Hex          { get; }\n\n        /// <summary>The hexside of the neighbour through which the agent enters from this hex.</summary>\n        public Hexside HexsideEntry => HexsideExit.Reversed;\n\n        /// <summary>The hexside of this hex through which the agent exits to the neighbour.</summary>\n        public Hexside HexsideExit { get; }\n\n        #region Value Equality with IEquatable<T> - on Hex and HexsideExit fields only\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is DirectedPathStepHex other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(DirectedPathStepHex other)\n        => Coords == other.Coords  &&  HexsideExit == other.HexsideExit;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Coords.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator !=(DirectedPathStepHex lhs, DirectedPathStepHex rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator ==(DirectedPathStepHex lhs, DirectedPathStepHex rhs) =>  lhs.Equals(rhs);\n        #endregion\n\n        /// <inheritdoc/>\n        public override string ToString() => $\"NeighbourHex: {Coords} enters from {HexsideEntry}\";\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/HexKeyValuePair.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>Builder for <see cref=\"HexKeyValuePair{TKey,TValue}\"/>.</summary>\n    public static class HexKeyValuePair {\n        /// <summary>Constructs a new <see cref=\"HexKeyValuePair{TKey,TValue}\"/> instance, with type inference.</summary>\n        /// <typeparam name=\"TKey\"></typeparam>\n        /// <typeparam name=\"TValue\"></typeparam>\n        /// <param name=\"key\"></param>\n        /// <param name=\"value\"></param>\n        internal static HexKeyValuePair<TKey,TValue> New<TKey,TValue>(TKey key, TValue value)\n        where TKey : struct, IEquatable<TKey>,IComparable<TKey>\n        => new HexKeyValuePair<TKey,TValue>(key,value);\n    }\n\n    /// <summary>An immutable struct representing an associated Key and Value pair with equality\n    /// and  comparabilitye of instances defined by the supplied TKey type.</summary>\n    public struct HexKeyValuePair<TKey,TValue> \n    : IEquatable<HexKeyValuePair<TKey,TValue>>, \n      IComparable<HexKeyValuePair<TKey,TValue>>\n    where TKey : struct, IEquatable<TKey>,IComparable<TKey> {\n        /// <summary>Constructs a new HexKeyValuePair instance.</summary>\n        internal HexKeyValuePair(TKey key, TValue value) : this() {\n            Key   = key;\n            Value = value;\n        }\n\n        /// <summary>TODO</summary>\n        public TKey   Key     { get; }\n\n        /// <summary>TODO</summary>\n        public TValue Value   { get; }\n\n        #region IComparable implementation\n        /// <summary>Tests whether lhs &lt; rhs.</summary>\n        public static bool operator <(HexKeyValuePair<TKey,TValue> lhs,HexKeyValuePair<TKey,TValue> rhs)\n        => lhs.CompareTo(rhs) < 0;\n\n        /// <summary>Tests whether lhs &lt;= rhs.</summary>\n        public static bool operator <= (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs)\n        => lhs.CompareTo(rhs) <= 0;\n\n        /// <summary>Tests whether lhs &gt;= rhs.</summary>\n        public static bool operator >=(HexKeyValuePair<TKey,TValue> lhs,HexKeyValuePair<TKey,TValue> rhs)\n        => lhs.CompareTo(rhs) >= 0;\n\n        /// <summary>Tests whether lhs &gt; rhs.</summary>\n        public static bool operator >(HexKeyValuePair<TKey,TValue> lhs,HexKeyValuePair<TKey,TValue> rhs)\n        => lhs.CompareTo(rhs) > 0;\n\n        /// <inheritdoc/>\n        public int CompareTo(HexKeyValuePair<TKey,TValue> other) => Key.CompareTo(other.Key);\n        #endregion\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj)\n        => (obj is HexKeyValuePair<TKey,TValue> other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(HexKeyValuePair<TKey,TValue> other) => CompareTo(other) == 0;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Key.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator != (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs)\n        => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator == (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs)\n        => lhs.Equals(rhs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/HexsideCosts.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>TODO</summary>\n    public class HexsideCosts : ReadOnlyCollection<int?> {\n        /// <summary>TODO</summary>\n        public static HexsideCosts ExitCosts<THex>(BoardStorage<Maybe<THex>> boardHexes,HexCoords hexCoords)\n        where THex : IHex\n        => new HexsideCosts(hexside => DirectedCost(boardHexes,hexCoords,hexside));\n\n        /// <summary>TODO</summary>\n        public static HexsideCosts EntryCosts<THex>(BoardStorage<Maybe<THex>> boardHexes,HexCoords hexCoords)\n        where THex : IHex\n        => new HexsideCosts(hexside => DirectedCost(boardHexes,hexCoords.GetNeighbour(hexside),hexside.Reversed));\n\n        /// <summary>TODO</summary>\n        public static int? DirectedCost<THex>(BoardStorage<Maybe<THex>> boardHexes,HexCoords hexCoords,Hexside hexside)\n        where THex : IHex\n        => boardHexes[hexCoords].Bind<int?>(hex => hex.EntryCost(hexside)).ToNullable();\n\n        private HexsideCosts(Func<Hexside,int?> directedCostToExit) : base(Generator(directedCostToExit)) { }\n\n        static List<int?> Generator(Func<Hexside,int?> directedCostToExit)\n        => ( from hexsideExit in Hexside.HexsideList\n             select directedCostToExit(hexsideExit)\n           ).ToList();\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/HotPriorityQueue.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>Factory class for <see cref=\"HotPriorityQueue{TValue}\"/></summary>\n    [SuppressMessage(\"Microsoft.Naming\",\"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n            Justification = \"The suffix 'PriorityQueue' has an unambiguous meaning in the application domain.\")]\n    public static class HotPriorityQueue {\n        private static IDictionary<int,IHotPriorityQueueList<int,TValue>> _factory<TValue>()\n        => new SortedList<int,IHotPriorityQueueList<int,TValue>>();\n\n        /// <summary>Constructs a new instance with a preferenceWidth of 0 bits and initialSize of 32 elements.</summary>\n        /// <remarks>PreferenceWidth is the number of low-order bits on the key that are for \n        /// alignment, the remainder being the actual left-shifted distance estimate.</remarks>\n        public static IPriorityQueue<int,TValue> New<TValue>()\n        => New<TValue>(0,32);\n\n        /// <summary>returns a new instance with a preferenceWidth of 0 bits and initialSize as specified.</summary>\n        /// <remarks></remarks>\n        /// <param name=\"initialSize\">Maximum size of the _heap-On-Top; initial Pool size will be set\n        /// at 7/8 of this value. Powers of 2 work best for a value; the value must be at least 32.</param>\n        public static IPriorityQueue<int,TValue> New<TValue>(int initialSize)\n        => New<TValue>(0,initialSize);\n\n        /// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n        /// <remarks></remarks>\n        /// <param name=\"preferenceWidth\">the number of low-order bits on \n        /// the key that are for alignment, the remainder being the actual left-shifted distance \n        /// estimate.</param>\n        /// <param name=\"initialSize\">Maximum size of the _heap-On-Top; initial Pool size will be \n        /// set at 7/8 of this value. Powers of 2 work best for a value.</param>\n        public static IPriorityQueue<int,TValue> New<TValue>(int preferenceWidth,int initialSize)\n        => New(preferenceWidth,initialSize,_factory<TValue>);\n\n        /// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n        /// <param name=\"preferenceWidth\">the number of low-order bits on \n        /// the key that are for alignment, the remainder being the actual left-shifted distance \n        /// estimate.</param>\n        /// <param name=\"initialSize\">Maximum size of the _heap-On-Top; initial Pool size will be set\n        /// at 7/8 of this value. Powers of 2 work best for a value; the value must be at least 32.</param>\n        /// <param name=\"factory\"></param>\n        /// <remarks>\n        /// Out-of-the-box implementations of IDictionary{int, IHotPriorityQueueList{int,TValue}} include:\n        ///   - () => new SortedList{int, IHotPriorityQueueList{int,TValue}}()\n        ///   - () => new SortedDictionary{int, IHotPriorityQueueList{int,TValue}}()\n        /// </remarks>\n        [SuppressMessage(\"Microsoft.Design\",\"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public static IPriorityQueue<int,TValue> New<TValue>(int preferenceWidth,int initialSize,\n            Func<IDictionary<int,IHotPriorityQueueList<int,TValue>>> factory)\n        => new HotPriorityQueue<TValue>(preferenceWidth,initialSize,factory);\n    }\n\n    /// <summary>_heap-On-Top (HOT) Priority _heap implementation with a key of type <c>int</c>.</summary>\n    /// <typeparam name=\"TValue\">Type of the queue-item value.</typeparam>\n    /// <remarks>\n    /// \n    /// </remarks>\n    /// <a href=\"http://en.wikipedia.org/wiki/Heapsort\">Wikepedia - Heapsort</a>/>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n            Justification=\"The suffix 'PriorityQueue' has an unambiguous meaning in the application domain.\")]\n    [DebuggerDisplay(\"Count={Count}\")]\n    public sealed class HotPriorityQueue<TValue> : IPriorityQueue<int,TValue> {\n        /// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n        /// <remarks></remarks>\n        /// <param name=\"preferenceWidth\">the number of low-order bits on \n        /// the key that are for alignment, the remainder being the actual left-shifted distance \n        /// estimate.</param>\n        /// <param name=\"initialSize\">Maximum size of the _heap-On-Top; initial Pool size will be \n        /// set at 7/8 of this value. Powers of 2 work best for a value.</param>\n        /// <param name=\"factory\"></param>\n        public HotPriorityQueue(int preferenceWidth, int initialSize,\n            Func<IDictionary<int, IHotPriorityQueueList<int, TValue>>> factory\n        ) {\n            PoolSize         = initialSize * 7 / 8;\n            _baseIndex       = 0;\n            PreferenceWidth = preferenceWidth; \n            _heap           = new MinListHeap<int,TValue>(initialSize);\n            _lists           = factory();\n        }\n\n        ///// <summary>Constructs a new instance with a preferenceWidth of 0 bits.</summary>\n        ///// <remarks>PreferenceWidth is the number of low-order bits on the key that are for \n        ///// alignment, the remainder being the actual left-shifted distance estimate.</remarks>\n        //public HotPriorityQueue() : this(0) {}\n        ///// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n        ///// <remarks></remarks>\n        ///// <paramref name=\"preferenceWidth\">the number of low-order bits on \n        ///// the key that are for alignment, the remainder being the actual left-shifted distance \n        ///// estimate.</paramref>\n        //public HotPriorityQueue(int preferenceWidth) : this(preferenceWidth, 2048) {}\n        ///// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n        ///// <remarks></remarks>\n        ///// <param name=\"preferenceWidth\">the number of low-order bits on \n        ///// the key that are for alignment, the remainder being the actual left-shifted distance \n        ///// estimate.</param>\n        ///// <param name=\"initialSize\">Maximum size of the _heap-On-Top; initial Pool size will be \n        ///// set at 7/8 of this value. Powers of 2 work best for a value.</param>\n        //public HotPriorityQueue(int preferenceWidth, int initialSize) { \n        //    PoolSize         = initialSize >> 3 * 7;\n        //    _baseIndex       = 0;\n        //    PreferenceWidth = preferenceWidth; \n        //    _heap           = new HotPriorityQueueList<int,TValue>(initialSize).PriorityQueue;\n        //#if UseSortedDictionary\n        //    _lists = new SortedDictionary<int, HotPriorityQueueList<int, TValue>>();\n        //#else\n        //    _lists = new SortedList<int, HotPriorityQueueList<int,TValue>>();\n        //#endif\n        //}\n\n        /// <summary>Returns whether any elements exist in the heap.</summary>\n        public bool Any => _heap.Count > 0  ||  _lists.Count > 0;\n\n        /// <summary>Returns the number of elements in the (on-top) heap.</summary>\n        public int Count => _heap.Count;\n\n        /// <summary>The number of elements which are handled by a straight HeapPriorityQueue.</summary>\n        /// <remarks>\n        /// When the number of elements exceeds this value, additional lists are created \n        /// to handle the overflow elements of lower priority (higher <c>TKey</c> values.\n        /// </remarks>\n        public int  PoolSize { get; }\n\n        /// <summary>.</summary>\n        public int  PreferenceWidth { get; }\n\n        /// <inheritdoc/>\n        bool IPriorityQueue<int,TValue>.Any() => Any;\n\n        /// <inheritdoc/>\n        public void Enqueue(int priority,TValue value)\n        => Enqueue(new HexKeyValuePair<int,TValue>(priority,value));\n\n        /// <inheritdoc/>\n        public void Enqueue(HexKeyValuePair<int,TValue> item) {\n            var index = item.Key >> PreferenceWidth;\n            if (index <= _baseIndex) {\n                _heap.Enqueue(item);\n            } else if (_lists.Count == 0  &&  _heap.Count < PoolSize) {\n                _baseIndex = index;\n                _heap.Enqueue(item);\n            } else {\n                //HotPriorityQueueList<int,TValue> list;\n                if( ! _lists.TryGetValue(index, out var list) ) {\n                  list = new HotPriorityQueueList<int,TValue>();\n                  _lists.Add(index, list);\n                }\n                list.Add(item);\n            }\n        }\n\n        /// <inheritdoc/>\n        public bool TryDequeue(out HexKeyValuePair<int,TValue> result) {\n            if (_heap.TryDequeue(out result)) return true;\n            else if (_lists.Count > 0)         return (_heap = GetNextQueue()).TryDequeue(out result);\n            else                               return false;\n        }\n\n        /// <inheritdoc/>\n        public bool TryPeek(out HexKeyValuePair<int,TValue> result) {\n            if (_heap.TryPeek(out result)) return true;\n            else if (_lists.Count > 0)      return (_heap = GetNextQueue()).TryPeek(out result);\n            else                            return false;\n        }\n\n        /// <summary>TODO</summary>\n        private IPriorityQueue<int,TValue> GetNextQueue() {\n            var list   = _lists.First();\n            _lists.Remove(list.Key);\n            _baseIndex = list.Key;\n\n            return new MinListHeap<int,TValue>(list.Value);\n        }\n\n        int _baseIndex;\n        IPriorityQueue<int,TValue> _heap { get; set; }\n        IDictionary<int,IHotPriorityQueueList<int,TValue>> _lists { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/HotPriorityQueueueList.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>_heap-On-Top (HOT) Priority _heap implementation.</summary>\n    /// <typeparam name=\"TKey\">Struct type for the keys used to prioritize values..</typeparam>\n    /// <typeparam name=\"TValue\">Type of the queue elements.</typeparam>\n    /// <remarks>\n    /// See: <a href=\"http://en.wikipedia.org/wiki/Heapsort\">Wikepedia - Heapsort</a>/>\n    /// </remarks>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix 'List' has an unambiguous meaning in the application domain.\")]\n    [DebuggerDisplay(\"Count={Count}\")]\n    internal sealed class HotPriorityQueueList<TKey, TValue>: IHotPriorityQueueList<TKey, TValue>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey> {\n       /// <summary>Create a new instance with a capacity of 1024.</summary>\n        public HotPriorityQueueList() : this(1024) {}\n\n       /// <summary>Create a new instance with the specified capacity.</summary>\n       /// <param name=\"capacity\"></param>\n        public HotPriorityQueueList(int capacity)\n        => List = new List<HexKeyValuePair<TKey,TValue>>(capacity);\n\n        /// <inheritdoc/>\n        public int Count => List.Count;\n\n        List<HexKeyValuePair<TKey,TValue>> List { get; }  // < backing store\n\n        /// <inheritdoc/>\n        public void Add(HexKeyValuePair<TKey,TValue> item) => List.Add(item);\n\n        /// <inheritdoc/>\n        public IEnumerator<HexKeyValuePair<TKey,TValue>> GetEnumerator() => List.GetEnumerator();\n\n        /// <inheritdoc/>\n        IEnumerator IEnumerable.GetEnumerator() => List.GetEnumerator();\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/IDirectedPathCollection.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDirectedPath = IDirectedPathCollection;\n    using PathStepHex   = DirectedPathStepHex;\n\n    /// <summary>Structure returned by the A* Path Finding utility.</summary>\n    public interface IDirectedPathCollection : IEnumerable<IDirectedPathCollection>, IEnumerable { \n        /// <summary>The <see cref=\"Hexside\"/> through which an agent must move in taking the first step of this path.</summary>\n        Hexside       HexsideExit { get; }\n\n        /// <summary>The coordinates of the first step on this path.</summary>\n        HexCoords     StepCoords  { get; }\n\n        /// <summary>The total movement cost for this path.</summary>\n        int           TotalCost   { get; }\n\n        /// <summary>The total number of movement steps for this path.</summary>\n        int           TotalSteps  { get; }\n\n        /// <summary>The first step on this path.</summary>\n        PathStepHex   PathStep    { get; }\n\n        /// <summary>The remaining steps of this path, as an <see cref=\"IDirectedPathCollection\"/> instance.</summary>\n        IDirectedPath PathSoFar   { get; }\n\n        /// <summary>Returns a descriptive text suitable for the Status Bar.</summary>\n        string        StatusText  { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/IHotPrioirtyQueueList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"TKey\"></typeparam>\n    /// <typeparam name=\"TValue\"></typeparam>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n        Justification=\"The suffix 'List' has an unambiguous meaning in the application domain.\")]\n    public interface IHotPriorityQueueList<TKey, TValue> : IEnumerable<HexKeyValuePair<TKey, TValue>>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey> {\n        /// <summary>TODO</summary>\n        void Add(HexKeyValuePair<TKey,TValue> item);\n    }\n}"
  },
  {
    "path": "HexUtilities/Pathfinding/INavigableBoard.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>Interface required to make use of A* Path Finding utility.</summary>\n    public interface INavigableBoard<THex>: IBoard<IHex> where THex : IHex {\n        /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n        /// <remarks>Returning the supplied range multiplied by the cheapest movement \n        /// cost for a single hex is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic \n        /// in order for the algorithm to perform properly and reliably return an optimum path.</remarks>\n        int? Heuristic(int range);\n\n        /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n        /// <remarks>Returning the supplied range multiplied by the cheapest movement \n        /// cost for a single hex is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic \n        /// in order for the algorithm to perform properly and reliably return an optimum path.</remarks>\n        int? Heuristic(HexCoords source, HexCoords target);\n\n        /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n        /// <remarks>Returning the supplied range multiplied by the cheapest movement \n        /// cost for a single hex is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic \n        /// in order for the algorithm to perform properly and reliably return an optimum path.</remarks>\n        int? Heuristic(IHex source, IHex target);\n\n        ///// <summary>Cost to move by exiting <paramref name=\"hex\"/> through <paramref name=\"hexsideExit\"/>.</summary>\n        //int  ExitCost(IHex hex, Hexside hexsideExit);\n\n        ///// <summary>Cost to move by exiting <paramref name=\"hex\"/> through <paramref name=\"hexsideExit\"/>.</summary>\n        //int  EntryCost(IHex hex, Hexside hexsideExit);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/IPriorityQueue.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n        Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n    public interface IPriorityQueue<TPriority,TValue> \n    where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority> {\n        /// <summary>The number of items in the queue.</summary>\n        int  Count { get; }\n\n        /// <summary>Returns whether any elements exist in the heap.</summary>\n        bool Any();\n\n        /// <summary>Creates and adds an entry with the specified <c>priority</c> and <c>value</c> to the queue.></summary>\n        /// <param name=\"priority\">The <c>TPriority</c> value for the new entry.</param>\n        /// <param name=\"value\">The <c>TValue</c> value for the new entry.</param>\n        void Enqueue(TPriority priority, TValue value);\n\n        /// <summary>Adds the specified <c>HexKeyValuePair</c> to the queue.</summary>\n        /// <param name=\"item\">The <c>HexKeyValuePair {Tpriority,TValue}</c> entry to be added to the queue. </param>\n        void Enqueue(HexKeyValuePair<TPriority,TValue> item);\n\n        /// <summary>Returns whether the top queue entry has been successfully stored in <c>result</c> \n        /// and removed from the queue.</summary>\n        bool TryDequeue(out HexKeyValuePair<TPriority,TValue> result);\n\n        /// <summary>Returns whether the top queue entry has been successfully stored in <c>result</c>.</summary>\n        bool TryPeek(out HexKeyValuePair<TPriority,TValue> result);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/Interfaces.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using HexSize       = System.Drawing.Size;\n    using IDirectedPath = IDirectedPathCollection;\n    using ILandmarks    = ILandmarkCollection;\n \n    /// <summary>TODO</summary>\n    public enum Direction {\n        ///<summary>TODO</summary>\n        ToHex   = 0,\n        ///<summary>TODO</summary>\n        FromHex = 1\n    }\n\n    /// <summary>TODO</summary>\n    public interface IPathfinder {\n        /// <summary>Returns an <c>IDirectedPath</c> for the optimal path from <paramref name=\"source\"/> to <paramref name=\"target\"/>.</summary>\n        /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n        /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n        /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n        /// <returns>A <c>IDirectedPathCollection</c>  for the shortest path found, or null if no path was found.</returns>\n        Maybe<IDirectedPath> GetPath(ILandmarkBoard board, IHex source, IHex target);\n    }\n\n    /// <summary>TODO</summary>\n    public interface ILandmark {\n        /// <summary>Board coordinates for the landmark location.</summary>\n        HexCoords Coords { get; }\n\n        /// <summary>Returns the shortest-path directed-distance from the specified hex to the landmark.</summary>\n        int  DistanceFrom(HexCoords coords);\n        /// <summary>Returns the shortest-path directed-distance to the specified hex from the landmark.</summary>\n        int  DistanceTo  (HexCoords coords);\n    }\n\n    /// <summary>TODO</summary>\n    public interface IDirectedLandmark {\n        /// <summary>Returns the shortest-path directed-distance from the specified hex to the landmark.</summary>\n        int  Distance(HexCoords coords);\n    }\n\n    /// <summary>An <see cref=\"IList\"/> of defined <see cref=\"ILandmark\"/> locations.</summary>\n    public interface ILandmarkCollection : IFastList<ILandmark> {\n    }\n\n    public static partial class LandmarkExtensions {\n        ///// <summary>TODO</summary>\n        //public static ILandmark DictionaryPriorityQueueLandmark(this INavigableBoard board, HexCoords coords) {\n        //    var backingStore = BackingStore(board, coords, PriorityQueueFactory.NewDictionaryQueue<int,HexCoords>);\n        //    return new Landmark(coords, backingStore);\n        //}\n\n        ///// <summary>TODO</summary>\n        //public static ILandmark HotPriorityQueueLandmark(this INavigableBoard board, HexCoords coords) {\n        //    var backingStore = BackingStore(board, coords, PriorityQueueFactory.NewHotPriorityQueue<HexCoords>);\n        //    return new Landmark(coords, backingStore);\n        //}\n\n        ///// <param name=\"coords\">The <see cref=\"HexCoords\"/> for this landmark.</param>\n        ///// <param name=\"board\">IBoard{IHex} on which the landmark is to be created.</param>\n        ///// <param name=\"queueFactory\">Function that returns a new <see cref=\"IPriorityQueue{TPriority,TValue}\"</param>\n        //private static IList<DirectedLandmark> BackingStore(this INavigableBoard board, HexCoords coords,\n        //    Func<IPriorityQueue<int,HexCoords>> queueFactory)\n        //=> new List<DirectedLandmark> {\n        //        DirectedLandmark.New(coords, board.MapSizeHexes, queueFactory, board.TryEntryCost),\n        //        DirectedLandmark.New(coords, board.MapSizeHexes, queueFactory, board.TryExitCost)\n        //}.AsReadOnly();\n\n        /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\">Type HexCoords - Hex for which to return Landmark distanace.</param>\n        /// <param name=\"landmarkToShow\">Type int - Index of the Landmark from which to display distances.</param>\n        public static string DistanceFrom(this ILandmarks @this,HexCoords coords, int landmarkToShow)\n        => $\"{@this?[landmarkToShow]?.DistanceFrom(coords),3}\";\n\n        /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\">Type HexCoords - Hex for which to return Landmark distanace.</param>\n        /// <param name=\"landmarkToShow\">Type int - Index of the Landmark from which to display distances.</param>\n        public static string DistanceTo(this ILandmarks @this,HexCoords coords, int landmarkToShow)\n        => $\"{@this?[landmarkToShow]?.DistanceTo(coords),3}\";\n    }\n\n    /// <summary>Interface required to make use of A* Path Finding utility.</summary>\n    public interface INavigableBoard {\n        /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n        HexSize MapSizeHexes           { get; }\n\n        /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n        /// <remarks>\n        /// Returning the supplied range multiplied by the cheapest movement cost for a single hex\n        /// is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic in order \n        /// for the algorithm to perform properly and reliably return an optimum path.\n        /// </remarks>\n        int?  Heuristic(IHex source, IHex target);\n\n        ///// <summary>TODO</summary>\n        //int  TryExitCost(HexCoords hex, Hexside hexside);\n        ///// <summary>TODO</summary>\n        //int  TryEntryCost(HexCoords hex, Hexside hexside);\n    }\n\n    /// <summary>Interface required to make use of A* Path Finding utility with Landmark heuristic.</summary>\n    public interface ILandmarkBoard : INavigableBoard {\n        /// <summary>TODO</summary>\n        ILandmarks Landmarks { get; }\n\n        /// <summary>TODO</summary>\n        Maybe<IHex> Neighbour(IHex hex, Hexside hexside);\n\n        /// <summary>TODO</summary>\n        Task<Exception> ResetLandmarksAsync();\n\n        /// <summary>TODO</summary>\n        void ResetLandmarks();\n    }\n  \n    /// <summary>Interface of common data structures exposed by <see cref=\"BidirectionalAltPathfinder\"/> to <see cref=\"AltPathfinder\"/>s.</summary>\n    public interface IPathHalves<THex> where THex: class,IHex {\n        /// <summary>Retrieves the cost of the shortest path found so far.</summary>\n        int              BestSoFar { get; }\n\n         /// <summary>.</summary>\n       ILandmarkBoard<THex>  Board { get; }\n\n        /// <summary>.</summary>\n        ISet<HexCoords>  ClosedSet { get; }\n\n        /// <summary>.</summary>\n        THex             Source    { get; }\n\n        /// <summary>.</summary>\n        THex             Target    { get; }\n\n        /// <summary>.</summary>\n        Maybe<IDirectedPath> PathFwd   { get; }\n\n        /// <summary>.</summary>\n        void             SetBestSoFar(IDirectedPath pathRev, IDirectedPath pathFwd);\n    }\n\n    /// <summary>.</summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public interface ILandmarkBoard<THex>: ILandmarkBoard, INavigableBoard<THex> where THex: IHex {\n    }\n\n    ///// <summary>TODO</summary>\n    //public interface ILandmarkPopulator {\n    //    /// <summary>TODO</summary>\n    //    BoardStorage<int> Fill();\n    //}\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/Landmark.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics;\n\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>A board location storing shortest-path distances to every board hex.</summary>\n    /// <remarks>\n    /// A board location that stores shortest-path distances for every board hex, for use in \n    /// computing an accurate A* heuristic. A simple Dijkstra implementation is used to generate\n    /// the distances upon creation.\n    /// </remarks>\n    [DebuggerDisplay(\"Coords={Coords}\")]\n    public sealed partial class Landmark : ILandmark {\n        internal Landmark(HexCoords coords, IBoardStorage<int> distanceTo, IBoardStorage<int> distanceFrom) {\n            Coords       = coords;\n            BackingStore = new IBoardStorage<int>[] { distanceTo, distanceFrom };\n        }\n\n        /// <inheritdoc/>\n        public  HexCoords Coords { get; }\n\n        /// <summary>TODO</summary>\n        private IBoardStorage<int>[] BackingStore { get; }\n\n        /// <inheritdoc/>\n        public int DistanceTo(HexCoords coords)  => BackingStore[(int)Direction.ToHex][coords];\n\n        /// <inheritdoc/>\n        public int DistanceFrom(HexCoords coords) => BackingStore[(int)Direction.FromHex][coords];\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/LandmarkCollection.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IFastEnumerable = IFastEnumerable<ILandmark>;\n    using IFastEnumerator = IFastEnumerator<ILandmark>;\n\n     /// <summary>A <b>ReadOnlyCollection</b> of defined <see cref=\"Landmark\"/> locations.</summary>\n    public sealed class LandmarkCollection : ILandmarkCollection {\n        internal LandmarkCollection(IEnumerable<ILandmark> items)\n        => _fastList = items.ToFastList();\n\n        #region IFastList implemenation\n        /// <inheritdoc/>\n        public IEnumerator<ILandmark>   GetEnumerator() => ((IEnumerable<ILandmark>)_fastList).GetEnumerator();\n        IEnumerator         IEnumerable.GetEnumerator() => GetEnumerator();\n        IFastEnumerator IFastEnumerable.GetEnumerator() => ((IFastEnumerable)_fastList).GetEnumerator();\n\n        /// <inheritdoc/>\n        public void ForEach(Action<ILandmark> action) => _fastList.ForEach(action);\n        /// <inheritdoc/>\n        public void ForEach(FastIteratorFunctor<ILandmark> functor) => _fastList.ForEach(functor);\n\n        /// <inheritdoc/>\n        public int       Count           => _fastList.Count;\n        /// <inheritdoc/>\n        public ILandmark this[int index] => _fastList[index];\n\n        /// <inheritdoc/>\n        public int IndexOf(ILandmark item) => _fastList.IndexOf(item);\n\n        IFastList<ILandmark> _fastList;\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/LandmarkPopulator.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using Queue    = IPriorityQueue<int,IHex>;\n    using StepCost = Func<IHex,Hexside,int>; \n\n    /// <summary>Static methods to populate a <see cref=\"ILandmarkCollection\"/> for a <see cref=\"INavigableBoard{THex}\"/>\"/></summary>\n    public static class LandmarkPopulator {\n        /// <summary>.</summary>\n        /// <param name=\"board\"></param>\n        /// <param name=\"landmarkCoords\"></param>\n        public static ILandmarkCollection CreateLandmarksDictQueue(this IBoard<IHex> board,\n            IFastList<HexCoords> landmarkCoords)\n        => board.CreateLandmarks(landmarkCoords, PriorityQueueFactory.NewDictionaryQueue<int,IHex>);\n\n        /// <summary>.</summary>\n        /// <param name=\"board\"></param>\n        /// <param name=\"landmarkCoords\"></param>\n        public static ILandmarkCollection CreateLandmarksHotQueue(this IBoard<IHex> board,\n            IFastList<HexCoords> landmarkCoords)\n        => board.CreateLandmarks(landmarkCoords, PriorityQueueFactory.NewHotPriorityQueue<IHex>);\n\n        /// <summary>Creates a populated <see cref=\"Collection{T}\"/> of <see cref=\"Landmark\"/>\n        /// instances.</summary>\n        /// <param name=\"board\">The board on which the collection of landmarks is to be instantiated.</param>\n        /// <param name=\"queueGenerator\"></param>\n        /// <param name=\"landmarkCoords\">Board coordinates of the desired landmarks</param>\n        public static ILandmarkCollection CreateLandmarks(this IBoard<IHex> board,\n            IFastList<HexCoords> landmarkCoords, Func<Queue> queueGenerator)\n        => new LandmarkCollection(\n            from coords in ( landmarkCoords ?? new List<HexCoords>().ToFastList() )\n                           .AsParallel()\n                           .WithDegreeOfParallelism(Math.Max(1, Environment.ProcessorCount - 2))\n            select ( from landmark in board[coords]\n                     where landmark != null\n                     select new Landmark(coords,\n                           board?.PopulateLandmark(EntryCost,queueGenerator,landmark),\n                           board?.PopulateLandmark(ExitCost, queueGenerator,landmark) )\n                   ).ElseDefault()\n        );\n\n        static int EntryCost(IHex hex, Hexside hexside) => hex.EntryCost(hexside);\n        static int ExitCost (IHex hex, Hexside hexside) => hex.ExitCost(hexside);\n\n        static IBoardStorage<int> PopulateLandmark(this IBoard<IHex> board,\n                StepCost directedStepCost, Func<Queue> queueGenerator, IHex landmark\n        ) {\n            TraceNewLine($\"Find distances from {landmark.Coords}\");\n\n            var costs = new BlockedBoardStorage32x32<int>(board.MapSizeHexes, c => -1);\n            var queue = queueGenerator();\n            queue.Enqueue (0, landmark);\n\n            while (queue.TryDequeue(out var item)) {\n                var here = item.Value;\n                var key  = item.Key;\n                if (costs[here.Coords] > 0) continue;\n\n                Trace($\"Dequeue Path at {here} w/ cost={key,4}.\");\n\n                costs.SetItem(here.Coords,key);\n\n                void SetHexside(Hexside hexside)\n                => board.ExpandNode(directedStepCost,costs,queue,here,key,hexside);\n                Hexside.ForEach(SetHexside);\n            }\n\n            return costs;\n        }\n\n        static void ExpandNode(this IBoard<IHex> board,StepCost directedStepCost,\n            BoardStorage<int> costs,Queue queue,IHex here,int key,Hexside hexside\n        ) {\n            var neighbourCoords = here.Coords.GetNeighbour(hexside);\n\n            board[neighbourCoords].IfHasValueDo(neighbour => {\n                var cost = directedStepCost(here, hexside);\n                if (cost > 0  &&  costs[neighbourCoords] < 0) {\n\n                    Trace($\"   Enqueue {neighbourCoords}: {cost,4}\");\n\n                    queue.Enqueue(key + cost,neighbour);\n                }\n            });\n            //if (neighbourHex != null) {\n            //    var cost = directedStepCost(here, hexside);\n            //    if (cost > 0  &&  costs[neighbourCoords] < 0) {\n\n            //        Trace($\"   Enqueue {neighbourCoords}: {cost,4}\");\n\n            //        queue.Enqueue(key + cost,neighbourHex);\n            //    }\n            //}\n        }\n\n        #region Tracing partial methods\n        [Conditional(\"TRACE\")]\n        static void Trace(string format,params object[] paramArgs)\n        => Tracing.FindPathDetail.Trace(format,paramArgs);\n\n        [Conditional(\"TRACE\")]\n        static void TraceNewLine(string format,params object[] paramArgs)\n        => Tracing.FindPathDetail.Trace(true,format,paramArgs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/MinListHeap.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>List implementation of a binary MinHeap PriorityQueue.</summary>    \n    internal sealed class MinListHeap<TKey,TValue> : IPriorityQueue<TKey,TValue>\n        where TKey : struct, IEquatable<TKey>, IComparable<TKey> {\n        /// <summary>Construct a new heap with the specified capacity.</summary>\n        public MinListHeap(int capacity) => _items = new List<HexKeyValuePair<TKey,TValue>>(capacity);\n\n        /// <summary>Construct a new heap from <paramref name=\"list\"/>.</summary>\n        public MinListHeap(IEnumerable<HexKeyValuePair<TKey,TValue>> list) {\n            _items = list?.ToList()??throw new ArgumentNullException(\"list\");\n            for(var start = (_items.Count-1) / 2; start >=0; start--) MinHeapifyDown(start);\n        }\n\n        /// <summary>Returns true exactly when the heap has at least one element.</summary>\n        public bool Any => _items.Count > 0;\n\n        /// <inheritdoc/>\n        public int Count => _items.Count;\n\n        /// <inheritdoc/>\n        bool IPriorityQueue<TKey,TValue>.Any() => Any;\n\n        /// <inheritdoc/>\n        public void Clear() => _items.Clear();\n\n        /// <inheritdoc/>\n        public void Enqueue(TKey key,TValue value) => Enqueue(HexKeyValuePair.New(key,value));\n\n        /// <inheritdoc/>\n        public void Enqueue(HexKeyValuePair<TKey,TValue> item) {            \n            _items.Add(item);\n            var child  = _items.Count-1;\n            var parent = (child-1) / 2;\n\n            while (child > 0  &&  _items[parent] > _items[child]) {\n                var heap = _items[parent];  _items[parent] = _items[child];  _items[child] = heap;\n                child  = parent;\n                parent = (child-1) / 2;\n            }\n        }\n\n        /// <inheritdoc/>\n        public bool TryDequeue(out HexKeyValuePair<TKey,TValue> result) {\n            if (_items.Count == 0) {\n                result = default;\n                return false;\n            }\n\n            result = _items[0];\n\n            // Remove the first item if neighbour will only be 0 or 1 items left after doing so.  \n            if (_items.Count <= 2) \n                _items.RemoveAt(0);\n            else { \n                // Remove the first item and move the last item to the front.\n                _items[0] = _items[_items.Count - 1];\n                _items.RemoveAt(_items.Count - 1);\n\n                MinHeapifyDown(0);\n            }\n            return true;\n        }\n\n        /// <inheritdoc/>\n        public bool TryPeek(out HexKeyValuePair<TKey,TValue> result) {\n            if (_items.Count == 0) {\n                result = default; \n                return false;\n            } \n\n            result = _items[0];\n            return true;\n        }\n\n        private List<HexKeyValuePair<TKey,TValue>> _items;  //!< backing store\n\n        /// <summary>Min-Heapify by sifting-down from last parent in heap.</summary>\n        private void MinHeapifyDown(int currentIndex) {\n            int leftChildIndex;\n            while ( (leftChildIndex = 2*currentIndex + 1) < _items.Count) {\n                // identify smallest of parent and both children\n                var smallestIndex   = _items[leftChildIndex] < _items[currentIndex] ? leftChildIndex \n                                                                                    : currentIndex;\n                var rightChildIndex = leftChildIndex + 1;\n                if (rightChildIndex < _items.Count && _items[rightChildIndex] < _items[smallestIndex])\n                  smallestIndex = rightChildIndex;\n\n                // if nothing to swap, ... then the tree is a heap\n                if (currentIndex == smallestIndex)  break;\n          \n                // swap smallest value up\n                var tempValue         = _items[currentIndex];\n                _items[currentIndex]  = _items[smallestIndex];\n                _items[smallestIndex] = tempValue;\n\n                // follow swapped value down and repeat until the tree is a heap\n                currentIndex = smallestIndex;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/NavigableBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using HexSize   = System.Drawing.Size;\n    using StepCosts = IBoardStorage<Maybe<HexsideCosts>>;\n\n    /// <summary>TODO</summary>\n    public class NavigableBoard : INavigableBoard {\n        /// <summary>TODO</summary>\n        public NavigableBoard(HexSize mapSizeHexes, StepCosts entryCosts, StepCosts exitCosts)\n        : this(mapSizeHexes, entryCosts, exitCosts, 1) { }\n        /// <summary>TODO</summary>\n        public NavigableBoard(HexSize mapSizeHexes, StepCosts entryCosts, StepCosts exitCosts, int minimumCost) {\n            MapSizeHexes = mapSizeHexes;\n            _entryCosts   = entryCosts;\n            _exitCosts    = exitCosts;\n            _minimumCost  = minimumCost;\n        }\n\n        /// <summary>TODO</summary>\n        public HexSize MapSizeHexes { get; }\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\",\n                MessageId = \"2*range\", Justification=\"No map is big enough to overflow,\")]\n        public int? Heuristic(IHex here, IHex target) =>\n            MapSizeHexes.IsOnboard(target.Coords)  &&  MapSizeHexes.IsOnboard(here.Coords)\n                ? here.Range(target) * _minimumCost\n                : default;\n\n        /// <summary>TODO</summary>\n        public int TryExitCost(HexCoords hexCoords, Hexside hexside) =>\n            (from x in _exitCosts[hexCoords] select x[hexside]).ElseDefault() ?? -1;\n\n        /// <summary>TODO</summary>\n        public int TryEntryCost(HexCoords hexCoords, Hexside hexside) =>\n            (from x in _entryCosts[hexCoords] select x[hexside]).ElseDefault() ?? -1;\n\n        readonly StepCosts _entryCosts;\n        readonly StepCosts _exitCosts;\n        readonly int       _minimumCost;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/PathHalves.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDirectedPath = IDirectedPathCollection;\n\n    /// <summary>This class manages the to unidirectional searches, and merges the resulting optimal path.</summary>\n    /// <remarks>\n    /// Adapted to hex-grids, and using a suggestion by Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz.\n    /// See also: <a href=\"http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/GW05.pdf\">Computing Point-to-Point Shortest Paths from Extenal Memory - Andrew V. Goldberg &amp; Renato F. Werneck</a>\n    /// See also: <a href=\"http://homepages.dcc.ufmg.br/~chaimo/public/ENIA11.pdf\">PNBA*: A Parallel Bidirectional Heuristic Search Algorithm - Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz</a>\n    /// See also: <a href=\"http://repub.eur.nl/res/pub/16100/ei2009-10.pdf\">Yet Another Bidirectional Algorithm for Shortest Paths - Wim Pijls &amp; Henk Post </a>\n    /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">A* Algorithm Notes</a>\n    /// </remarks>\n    internal sealed class PathHalves<THex>: IPathHalves<THex>\n    where THex: class,IHex {\n        /// <summary>.</summary>\n        /// <param name=\"board\">Board on which this path search is taking place.</param>\n        /// <param name=\"source\">Start hex for this half of the bidirectional path search.</param>\n        /// <param name=\"target\">Goal hex for this this half of the bidirectional path search.</param>\n        public PathHalves(ILandmarkBoard<THex> board, THex source, THex target) {\n            Board     = board;\n            Source    = source;\n            Target    = target;\n            ClosedSet = new HashSet<HexCoords>();\n            BestSoFar = int.MaxValue;\n        }\n\n        /// <inheritdoc/>\n        public int                  BestSoFar { get; private set; }\n        /// <inheritdoc/>\n        public ILandmarkBoard<THex> Board     { get; }\n        /// <inheritdoc/>\n        public ISet<HexCoords>      ClosedSet { get; }\n        /// <inheritdoc/>\n        public THex                 Source    { get; }\n        /// <inheritdoc/>\n        public THex                 Target    { get; }\n\n        /// <summary>Retrieve the found path in walking order: first step at top of stack to target at bottom.</summary>\n        /// <see cref=\"IDirectedPath\"/>\n        public Maybe<IDirectedPath> PathFwd => _pathRev.MergePaths<THex>(_pathFwd);\n\n        /// <summary>Updates the record of the shortest path found so far.</summary>\n        /// <param name=\"pathFwd\">The half-path obtained by searching backward from the target (so stacked forwards).</param>\n        /// <param name=\"pathRev\">The half-path obtained by searching forward from the source (so stacked backwards).</param>\n        public void    SetBestSoFar(IDirectedPath pathRev, IDirectedPath pathFwd) {\n            if (pathFwd==null  ||  pathRev==null) return;\n\n            if( pathFwd.TotalCost + pathRev.TotalCost < BestSoFar) {\n                _pathRev  = pathRev; \n                _pathFwd  = pathFwd; \n                BestSoFar = _pathRev.TotalCost + _pathFwd.TotalCost;\n\n                pathFwd.TraceFindPathDetailBestSoFar(pathRev, BestSoFar);\n            }\n        }\n\n        /// <summary>The half-path obtained by searching backward from the target (so stacked forwards).</summary>\n        private IDirectedPath _pathFwd = null;\n        /// <summary>The half-path obtained by searching forward from the source (so stacked backwards).</summary>\n        private IDirectedPath _pathRev = null;\n    }\n}\n\n"
  },
  {
    "path": "HexUtilities/Pathfinding/PathTracingExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDirectedPath = IDirectedPathCollection;\n\n    /// <summary>.</summary>\n    public static class PathTracingExtensions {\n        /// <summary>If the conditional constant TRACE is defined: writes the search start- and goal-coords to the trace log.</summary>\n        /// <param name=\"start\"></param>\n        /// <param name=\"goal\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDetailInit(this IHex start, IHex goal)\n        => Tracing.FindPathDetail.Trace(true, \"Fwd: Find path from {0} to {1}:\", start.Coords, goal.Coords);\n        \n        /// <summary>If the conditional constant TRACE is defined: writes the search-direction initialization details to the trace log.</summary>\n        /// <param name=\"searchDirection\"></param>\n        /// <param name=\"vectorGoal\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDetailDirection(this string searchDirection,\n                IntVector2D vectorGoal)\n        => Tracing.FindPathDetail.Trace(\"   {0} Search uses: vectorGoal = {1}\", searchDirection, vectorGoal);\n        \n        /// <summary>If the conditional constant TRACE is defined: writes the search-direction initialization details to the trace log.</summary>\n        /// <param name=\"searchDirection\"></param>\n        /// <param name=\"vectorGoal\"></param>\n        /// <param name=\"landmarkCoords\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDetailDirection(this string searchDirection,\n                IntVector2D vectorGoal, HexCoords landmarkCoords)\n        => Tracing.FindPathDetail.Trace(\"   {0} Search uses: vectorGoal = {1}; and landmark at {2}\", \n                                        searchDirection, vectorGoal, landmarkCoords);\n        /// <summary>If the conditional constant TRACE is defined: writes the current direction pairing to the trace log.</summary>\n        /// <param name=\"pathFwd\"></param>\n        /// <param name=\"pathRev\"></param>\n        /// <param name=\"bestSoFar\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDetailBestSoFar(this IDirectedPath pathFwd, IDirectedPath pathRev,\n                int bestSoFar)\n        => Tracing.FindPathDetail.Trace(\n            $\"   SetBestSoFar: pathFwd at {pathFwd.PathStep.Coords}; pathRev at {pathRev.PathStep.Coords}; Cost = {bestSoFar}\");\n        /// <summary>If the conditional constant TRACE is defined: writes the enqueue details to the trace log.</summary>\n        /// <param name=\"coords\"></param>\n        /// <param name=\"priority\"></param>\n        /// <param name=\"preference\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathEnqueue(this HexCoords coords,int priority, int preference)\n        => Tracing.FindPathEnqueue.Trace(\n              \"   Enqueue {0}: estimate={1,4}:{2,4}\",coords, priority, preference);\n\n        /// <summary>If the conditional constant TRACE is defined: writes the dequeue details to the trace log.</summary>\n        /// <param name=\"searchDirection\"></param>\n        /// <param name=\"hex\"></param>\n        /// <param name=\"path\"></param>\n        /// <param name=\"priority\"></param>\n        /// <param name=\"preference\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDequeue(this IHex hex,\n                string searchDirection, IDirectedPath path, int priority, int preference)\n        => Tracing.FindPathDequeue.Trace(\n                \"{0} Dequeue Path at {1} w/ cost={2,4} at {3,-9}; estimate={4,4}:{5,4}.\", \n                searchDirection, hex.Coords, path.TotalCost, path.HexsideExit, priority, preference);\n\n        /// <summary>If the conditional constant TRACE is defined: writes the dequeue details to the trace log.</summary>\n        /// <param name=\"searchDirection\"></param>\n        /// <param name=\"coords\"></param>\n        /// <param name=\"path\"></param>\n        /// <param name=\"priority\"></param>\n        /// <param name=\"preference\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDequeue(this HexCoords coords,\n                string searchDirection, IDirectedPath path, int priority, int preference)\n        => Tracing.FindPathDequeue.Trace(\n                $\"{searchDirection} Dequeue Path at {coords} w/ cost={path.TotalCost,4} at {path.HexsideExit,-9}; estimate={priority,4}:{preference,4}.\");\n        /// <summary>If the conditional constant TRACE is defined: writes the dequeue details to the trace log.</summary>\n        /// <param name=\"count\"></param>\n        [Conditional(\"TRACE\")]\n        public static void TraceFindPathDone(this int count)\n        => Tracing.FindPathDequeue.Trace($\"Closed: {count,7}\");\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/PathfinderExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using IDirectedPath = IDirectedPathCollection;\n\n    /// <summary>.</summary>\n    public static class PathfinderExtensions {\n        /// <summary>Returns the result of stacking <paramref name=\"mergePath\"/> onto <paramref name=\"targetPath\"/></summary>\n        public static Maybe<IDirectedPath> MergePaths<THex>(this IDirectedPath targetPath, IDirectedPath mergePath)\n        where THex: class,IHex {\n            if (mergePath != null) {\n                while (mergePath.PathSoFar != null) {\n                    var hexside = mergePath.PathStep.HexsideExit;\n                    var cost    = mergePath.TotalCost - (mergePath = mergePath.PathSoFar).TotalCost;\n                    targetPath  = targetPath.AddStep(mergePath.PathStep.Hex, hexside, cost);\n                }\n            }\n            return targetPath.ToMaybe();\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/PriorityQueueFactory.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    /// <summary>TODO</summary>\n    public static class PriorityQueueFactory {\n        /// <summary>TODO</summary>\n        internal static IPriorityQueue<TPriority,TValue> NewDictionaryQueue<TPriority, TValue>()\n        where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority>\n        => new DictionaryPriorityQueue<TPriority,TValue>();\n\n        /// <summary>Returns a new <see cref=\"HotPriorityQueue\"/> with size 256.</summary>\n        internal static IPriorityQueue<int,TValue> NewHotPriorityQueue<TValue>()\n        => NewHotPriorityQueue<TValue>(256);\n\n        /// <summary>Returns a new <see cref=\"HotPriorityQueue\"/> with size <paramref name=\"initialSize\"/>.</summary>\n        internal static IPriorityQueue<int,TValue> NewHotPriorityQueue<TValue>(int initialSize)\n        => HotPriorityQueue.New<TValue>(0,initialSize);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Pathfinding/StandardPathfinder.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n    using DirectedPath   = DirectedPathCollection;\n    using IDirectedPath  = IDirectedPathCollection;\n\n    /// <summary>(Adapted) C# implementation of A* path-finding algorithm by Eric Lippert.</summary>\n    /// <remarks>\n    /// <para>\n    /// \"A nice property of the A* algorithm is that it finds the optimal path in a reasonable \n    /// amount of time provided that:\n    ///   • the estimating function never overestimates the distance to the goal. \n    ///     (Think about what happens if the estimating function sometimes overestimates the distance;\n    ///     if the optimal path is one of the ones overestimated then it will possibly not make it to \n    ///     the front of the priority queue before a nonoptimal solution is found.)\n    ///   • calling the estimating function does not take very long.\n    /// </para><para>\n    /// \"One way to ensure that the estimating function never overestimates the distance is to always \n    /// estimate zero. If you do so then this becomes Dijkstra's algorithm. However, the better your \n    /// estimating function can get without going over (this really should have been called the \n    /// \"The Price Is Right\" algorithm...) the faster this will identify the truly optimal path.\n    /// </para><para>\n    /// \"Unfortunately, the space complexity of this algorithm can be really quite high on complicated \n    /// graphs. There are more complex versions of this algorithm which can deal with the space complexity.\"\n    /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/10/path-finding-using-a-in-c-3-0-part-four.aspx\">\n    /// Eric Lippert's A* path-finding agorithm\n    /// </a>\n    /// </para><para>\n    /// Adapted to hex-grids, and to weight the most direct path favourably for better (visual) \n    /// behaviour on a hexgrid.\n    /// </para><para>\n    /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">Notes - A-star Algorithm</a>\n    /// <seealso cref=\"BidirectionalAltPathfinder\"/>\n    /// </para>\n    /// </remarks>\n    public static class StandardPathfinderExtensions {\n        /// <summary>Returns an <see cref=\"IPath{THex}\"/> for the optimal path using a standard A* algorithm.</summary>\n        /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n        /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n        /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n        /// <returns>A <see cref=\"IPath{THex}\"/> for the shortest path found, or null if no path was found.</returns>\n        /// <remarks>\n        /// <para>Note that the Heuristic provided by <paramref name=\"board\"/> <b>must</b> be monotonic in order for the algorithm to perform properly.</para>\n        /// </remarks>\n        public static IPath<THex> GetPathStandardAStar<THex>(this INavigableBoard<THex> board,\n                THex source, THex target)\n        where THex: IHex\n        => board.GetPath(source,target,new DictionaryPriorityQueue<int, IDirectedPath>(),new HashSet<HexCoords>());\n\n        /// <summary>Returns an <see cref=\"IPath{THex}\"/> for the optimal path using a standard A* algorithm.</summary>\n        /// <param name=\"board\">An object satisfying the interface <see cref=\"INavigableBoard{THex}\"/>.</param>\n        /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n        /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n        /// <param name=\"queue\"></param>\n        /// <param name=\"closedSet\"></param>\n        /// <returns>A <see cref=\"IPath{THex}\"/> for the shortest path found, or null if no path was found.</returns>\n        /// <remarks>\n        /// <para>Note that the Heuristic provided by <paramref name=\"board\"/> <b>must</b> be monotonic in order for the algorithm to perform properly.</para>\n        /// </remarks>\n        public static IPath<THex> GetPath<THex>(this INavigableBoard<THex> board, THex source, THex target,\n                IPriorityQueue<int,IDirectedPath> queue, ISet<HexCoords> closedSet)\n        where THex: IHex {\n            source.TraceFindPathDetailInit(target);\n\n            var vectorGoal = target.Coords.Canon - source.Coords.Canon;\n            queue.Enqueue (0, new DirectedPath(target));\n\n            while (queue.TryDequeue(out var item)) {\n                var path = item.Value;\n                var step = path.PathStep;\n\n                if (closedSet.Contains(step.Coords)) continue;\n\n                step.Hex.TraceFindPathDequeue(\"A* Rev\", path, item.Key>>16, (int)(item.Key & 0xFFFFu) - 0x7FFF);\n\n                if(step.Hex == (IHex)source)\n                    return new Path<THex>(path.ToMaybe(),source,target,closedSet,null);\n\n                closedSet.Add(step.Coords);\n\n                Hexside.HexsideList.ForEach(hexside => {\n                    board[step.Coords.GetNeighbour(hexside)].IfHasValueDo(neighbour => {\n                        var cost = step.Hex.TryDirectedCost(hexside);\n                        if (cost > 0 ) {\n                            var newPath = path.AddStep(neighbour, hexside.Reversed, cost);\n                            board.Estimate(vectorGoal, source, neighbour, newPath.TotalCost)\n                                 .IfHasValueDo(key => {\n                                     neighbour.Coords.TraceFindPathEnqueue(key>>16, (int)(key & 0xFFFFu));\n\n                                     queue.Enqueue(key, newPath);\n                                 } );\n                        }\n                    });\n                } );\n            }\n\n            return null;\n        }\n\n        static int? Estimate<THex>(this INavigableBoard<THex> board, IntVector2D vectorGoal,\n                IHex start, IHex hex, int totalCost)\n        where THex: IHex\n        => from heuristic in board.Heuristic(start,hex) as int? select ((heuristic + totalCost) << 16)\n        + Preference(vectorGoal, start.Coords.Canon - hex.Coords.Canon);\n\n        static int TryDirectedCost(this IHex hex, Hexside hexside) => hex.EntryCost(hexside);\n\n        static int Preference(IntVector2D vectorGoal, IntVector2D vectorHex)\n        => (0xFFFF & Math.Abs(vectorGoal ^ vectorHex));\n    }\n}\n"
  },
  {
    "path": "HexUtilities/PointExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPointF = System.Drawing.PointF;\n    using HexPoint  = System.Drawing.Point;\n\n    /// <summary>TODO</summary>\n    public static class PointExtensions {\n        /// <summary>TODO</summary>\n        public static HexPoint Scale(this HexPoint @this,int value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexPoint Scale(this HexPoint @this,int valueX,int valueY)\n        => new HexPoint(@this.X * valueX,@this.Y * valueY);\n\n        /// <summary>TODO</summary>\n        public static HexPointF Scale(this HexPoint @this,float value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexPointF Scale(this HexPoint @this,float valueX,float valueY)\n        => new HexPointF(@this.X,@this.Y).Scale(valueX,valueY);\n\n        /// <summary>TODO</summary>\n        public static HexPointF Scale(this HexPointF @this,float value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexPointF Scale(this HexPointF @this,float valueX,float valueY)\n        => new HexPointF(@this.X * valueX,@this.Y * valueY);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexUtilities\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexUtilities\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a1e55325-42d1-4c8f-8bcc-9fea6112318e\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "HexUtilities/SizeExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexSizeF = System.Drawing.SizeF;\n    using HexSize  = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public static class SizeExtensions {\n        /// <summary>TODO</summary>\n        public static HexSize Scale(this HexSize @this,int value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexSize Scale(this HexSize @this,int valueX,int valueY)\n        => new HexSize(@this.Width * valueX,@this.Height * valueY);\n\n        /// <summary>TODO</summary>\n        public static HexSizeF Scale(this HexSize @this,float value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexSizeF Scale(this HexSize @this,float valueX,float valueY)\n        => new HexSizeF(@this).Scale(valueX,valueY);\n\n        /// <summary>TODO</summary>\n        public static HexSizeF Scale(this HexSizeF @this,float value)\n        => @this.Scale(value,value);\n\n        /// <summary>TODO</summary>\n        public static HexSizeF Scale(this HexSizeF @this,float valueX,float valueY)\n        => new HexSizeF(@this.Width * valueX,@this.Height * valueY);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/BlockedBoardStorage.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize     = System.Drawing.Size;\n\n    /// <summary>A <c>BoardStorage</c> implementation optimized for large maps by blocking \n    /// 32 i 32 arrays of hexes for improved memory caching.</summary>\n    /// <remarks>This <c>BoardStorage</c> implementation stores the board cells in blocks\n    /// that are 32 i 32 cells to provide better localization for the Path-Finding and\n    /// Field-of-View algorithms.</remarks>\n    internal abstract class BlockedBoardStorage<T> : BoardStorage<T> {\n        /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n        /// initialized using <paramref name=\"tFactory\"/>.</summary>\n        [SuppressMessage(\"Microsoft.Usage\", \"CA2214:DoNotCallOverridableMethodsInConstructors\",\n          Justification=\"This is safe because all sub-classes are SEALED INTERNAL and both properties (BlockMask & BlockSide) are just aliases for constants.\")]\n        internal BlockedBoardStorage(HexSize sizeHexes, Func<HexCoords,T> tFactory, int threadCount) \n        : base (sizeHexes) {\n\n            var rangeY    = ( MapSizeHexes.Height + BlockMask ) / BlockSide;\n            var rangeX    = ( MapSizeHexes.Width + BlockMask  ) / BlockSide;\n            _backingStore = InitializeStore(tFactory, threadCount, rangeY, rangeX);\n        }\n\n        /// <summary>TODO</summary>\n        protected abstract int BlockExponent { get; }\n        /// <summary>TODO</summary>\n        protected abstract int BlockMask { get; }\n        /// <summary>TODO</summary>\n        protected abstract int BlockSide { get; }\n\n        internal IFastList<IFastList<IFastListX<T>>> InitializeStore(\n            Func<HexCoords,T> tFactory, int threadCount, int rangeY, int rangeX\n        ) {\n            if (threadCount < 1) threadCount = 1;\n            var threadRange = ( rangeY + (threadCount-1) ) / threadCount;\n            return ( from thread in ParallelEnumerable.Range(0, threadCount).AsOrdered()\n                     from i in Enumerable.Range(0,threadRange)\n                     let y = thread*threadRange + i\n                     where y < rangeY\n                     let block_j = y * BlockSide\n                     select ( from x in Enumerable.Range(0, rangeX)\n                              select InitializeBlock(tFactory, block_j, x * BlockSide)\n                            ).ToArray().ToFastList()\n                   ).ToArray().ToFastList();\n        }\n        private IFastListX<T> InitializeBlock(Func<HexCoords,T> tFactory, int block_j, int block_i)\n        => ( from j in Enumerable.Range(0, BlockSide)\n             from i in Enumerable.Range(0, BlockSide)\n             let coords = HexCoords.NewUserCoords(block_i + i, block_j + j)\n             select MapSizeHexes.IsOnboard(coords) ? tFactory(coords) : default\n           ).ToArray().ToFastListX();\n\n        /// <inheritdoc/>>\n        public override void ForEach(Action<T> action)\n        => BackingStore.AsParallel().WithMergeOptions(ParallelMergeOptions.FullyBuffered)\n                       .ForAll(row => row.ForEach(lh => lh.ForEach(action)));\n\n        /// <inheritdoc/>>\n        public override void ForEach(FastIteratorFunctor<T> functor)\n        => BackingStore.AsParallel().WithMergeOptions(ParallelMergeOptions.FullyBuffered)\n                       .ForAll(row => row.ForEach(lh => lh.ForEach(functor)));\n\n        /// <summary>TOTO</summary>\n        public override void ForEachSerial(Action<T> action)\n        => BackingStore.ForEach(row => row.ForEach(lh => lh.ForEach(action)));\n\n        /// <summary>TOTO</summary>\n        public override void ForEachSerial(FastIteratorFunctor<T> functor)\n        => BackingStore.ForEach(row => row.ForEach(lh => lh.ForEach(functor)));\n\n        protected IFastList<IFastList<IFastListX<T>>> BackingStore => _backingStore;\n        protected readonly IFastList<IFastList<IFastListX<T>>> _backingStore;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/BlockedBoardStorage32x32.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize     = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    public static class BlockedBoardStorage {\n        private static int DefaultProcessorsToUse { get {\n            var processors = Environment.ProcessorCount;\n            #if DEBUG\n                return 1;\n            #else\n                return processors > 3 ? processors - 2 : 1;\n            #endif\n        } }\n\n        /// <summary>TODO</summary>\n        public static BoardStorage<T> New32x32<T>(HexSize sizeHexes, Func<HexCoords, T> factory)\n        =>  new BlockedBoardStorage32x32<T>(sizeHexes, factory, DefaultProcessorsToUse);\n    }\n\n    /// <summary>A <c>BoardStorage</c> implementation optimized for large maps by blocking \n    /// 32 x 32 arrays of hexes for improved memory caching.</summary>\n    /// <remarks>This <c>BoardStorage</c> implementation stores the board cells in blocks\n    /// that are 32 i 32 cells to provide better localization for the Path-Finding and\n    /// Field-of-View algorithms.</remarks>\n    internal sealed class BlockedBoardStorage32x32<T> : BlockedBoardStorage<T> {\n        const int _blockExponent = 5;\n        const int _blockSide     = 1 << _blockExponent;\n        const int _blockMask     = _blockSide - 1;\n\n        /// <summary>TODO</summary>\n        protected override int BlockExponent => _blockExponent;\n        /// <inheritdoc/>\n        protected override int BlockMask => _blockMask;\n        /// <inheritdoc/>\n        protected override int BlockSide => _blockSide;\n\n        /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n        /// initialized using <paramref name=\"tFactory\"/>.</summary>\n        internal BlockedBoardStorage32x32(HexSize sizeHexes, Func<HexCoords,T> tFactory, int threadCount = 1) \n        : base (sizeHexes, tFactory, threadCount) {\n        }\n\n        /// <inheritdoc/>>\n        protected override T ItemInner(int x, int y) {\n        #if DIVIDE\n            var index = (y & _blockMask) * _blockSide  +  (x & _blockMask);\n            var block = BackingStore[y/_blockSide][x/_blockSide];\n        #else\n            var index = (y & _blockMask) * _blockSide  +  (x & _blockMask);\n            var block = BackingStore[y >> _blockExponent][x >> _blockExponent];\n        #endif\n        return block[index];\n        }\n\n        /// <inheritdoc/>>\n        protected override void SetItemInner(int x, int y, T value) {\n        #if DIVIDE\n            var index = (y & _blockMask) * _blockSide  +  (x & _blockMask);\n            var block = BackingStore[y/_blockSide][x/_blockSide];\n        #else\n            var index = (y & _blockMask) * _blockSide  +  (x & _blockMask);\n            var block = BackingStore[y >> _blockExponent][x >> _blockExponent];\n        #endif\n            block.SetItem(index, value);\n        }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/BoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize     = System.Drawing.Size;\n\n    /// <summary>Abstract specification and partial implementation of the <c>BoardStorage</c> required by <c>HexBoard</c>.</summary>\n    /// <typeparam name=\"T\">The type of the information being stored. \n    /// If {T} implements IDisposable then the Dispose() method will dispose all elements.\n    /// </typeparam>\n    public abstract class BoardStorage<T> : IBoardStorage<T>, IForEachable<T>, IForEachable2<T> {\n        /// <summary>Initializes a new instance with the specified hex extent.</summary>\n        /// <param name=\"sizeHexes\"></param>\n        protected BoardStorage(HexSize sizeHexes) {\n              MapSizeHexes   = sizeHexes;\n        }\n\n        /// <inheritdoc/>\n        public       HexSize MapSizeHexes           { get; }\n\n        /// <summary>Returns the <c>THex</c> instance at the specified coordinates.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        public          T    this[HexCoords coords] => this[coords.User];\n\n        /// <summary>Returns the <c>THex</c> instance at the specified user coordinates.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        public virtual  T    this[IntVector2D userCoords] =>\n            MapSizeHexes.IsOnboard(userCoords) ? ItemInner (userCoords.X,userCoords.Y) : default(T);\n\n        #pragma warning disable 3008\n        /// <summary>TODO</summary>\n        /// <param name=\"x\"></param>\n        /// <param name=\"y\"></param>\n        protected abstract T ItemInner(int x, int y);\n\n        /// <summary>TOTO</summary>\n        /// <param name=\"x\"></param>\n        /// <param name=\"y\"></param>\n        /// <param name=\"value\"></param>\n        protected abstract void SetItemInner(int x, int y, T value);\n        #pragma warning restore 3008\n\n        /// <inheritdoc/>\n        public          void ForAllNeighbours(HexCoords coords, Action<T,Hexside> action)\n        =>  Hexside.ForEach( hexside =>\n                action(this[coords.GetNeighbour(hexside)], hexside)\n            );\n\n        /// <inheritdoc/>\n        void IBoardStorage<T>.ForAllNeighbours(HexCoords coords, Action<T, Hexside> action) =>\n            ForAllNeighbours(coords, action);\n\n        /// <inheritdoc/>\n        public          T    Neighbour(HexCoords coords, Hexside hexside) =>\n           this[coords.GetNeighbour(hexside)]; \n\n\n        /// <summary>Perform the specified <paramref name=\"action\"/> in parallel on all hexes.</summary>\n        public abstract void ForEach(Action<T> action);\n\n        /// <summary>Perform the Invoke action of the specified <paramref name=\"functor\"/> in parallel on all hexes.</summary>\n        public abstract void ForEach(FastIteratorFunctor<T> functor);\n\n        /// <summary>Perform the specified <paramref name=\"action\"/> serially on all hexes.</summary>\n        public abstract void ForEachSerial(Action<T> action);\n\n        /// <summary>Perform the Invoke action of the specified <paramref name=\"functor\"/> serially on all hexes.</summary>\n        public abstract void ForEachSerial(FastIteratorFunctor<T> functor);\n\n        /// <summary>Sets the location to the specified value.</summary>\n        /// <remarks>Use carefully - can interfere with iterators.</remarks>\n        internal virtual void SetItem(HexCoords coords, T value) {\n            if(MapSizeHexes.IsOnboard(coords)) SetItemInner(coords.User.X, coords.User.Y, value);\n        }\n\n        //#region IDisposable implementation with Finalizeer\n        ///// <summary>Clean up any resources being used, and suppress finalization.</summary>\n        //public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n        ///// <summary>True if already Disposed.</summary>\n        //private bool _isDisposed = false;\n        ///// <summary>Clean up any resources being used.</summary>\n        ///// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        //protected virtual void Dispose(bool disposing) {\n        //    if (!_isDisposed) {\n        //        if (disposing) {\n        //            if (typeof(T).GetInterfaces().Contains(typeof(IDisposable))) {\n        //                ForEach(i => { var item = i as IDisposable; if(item != null) item.Dispose(); i = default(T);} );\n        //            }\n        //        }\n        //        _isDisposed = true;\n        //    }\n        //}\n        ///// <summary>Finalize this instance.</summary>\n        //~BoardStorage() { Dispose(false); }\n        //#endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/FlatBoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize     = System.Drawing.Size;\n\n    /// <summary>A row-major <c>BoardStorage</c> implementation optimized for small maps, \n    /// providing both serial and parallel initialization.</summary>\n    public sealed class FlatBoardStorage<T> : BoardStorage<T> {\n        /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n        /// initialized using <paramref name=\"factory\"/>.</summary>\n        /// <param name=\"sizeHexes\"><c>Size</c> structure speccifying the Width and Height of \n        /// the desired board storage.</param>\n        /// <param name=\"factory\"></param>\n        /// <param name=\"inParallel\">Boolean indicating how the board should be initialized: \n        /// in parallel or serially.</param>\n        public FlatBoardStorage(HexSize sizeHexes, Func<HexCoords,T> factory, bool inParallel) \n        : base (sizeHexes) {\n          var rowRange = inParallel ? ParallelEnumerable.Range(0,sizeHexes.Height).AsOrdered()\n                                    : Enumerable.Range(0,sizeHexes.Height);\n          BackingStore = InitializeStoreX(sizeHexes, factory, rowRange);\n        }\n\n        private static IFastList<IFastListX<T>> InitializeStoreX(HexSize sizeHexes,\n                Func<HexCoords, T> tFactory, IEnumerable<int> rowRange)\n        => ( from y in rowRange\n             select ( from x in Enumerable.Range(0, sizeHexes.Width)\n                      select tFactory(HexCoords.NewUserCoords(x,y))\n                    ).ToArray().ToFastListX()\n           ).ToArray().ToFastList();\n\n        /// <inheritdoc/>>\n        protected override T ItemInner(int x, int y) => BackingStore[y][x];\n\n        /// <inheritdoc/>>\n        public override void ForEach(Action<T> action)\n        =>  BackingStore.AsParallel().WithMergeOptions(ParallelMergeOptions.FullyBuffered)\n                        .ForAll(row => row.ForEach(action));\n        \n        /// <inheritdoc/>>\n        public override void ForEach(FastIteratorFunctor<T> functor) \n        =>  BackingStore.AsParallel().WithMergeOptions(ParallelMergeOptions.FullyBuffered)\n                        .ForAll(row => row.ForEach(functor));\n\n        /// <inheritdoc/>>\n        public override void ForEachSerial(Action<T> action)\n        =>  BackingStore.ForEach(row => row.ForEach(action));\n       \n        /// <inheritdoc/>>\n        public override void ForEachSerial(FastIteratorFunctor<T> functor)\n        =>  BackingStore.ForEach(row => row.ForEach(functor));\n\n        /// <summary>TODO</summary>\n        /// <remarks>Use carefully - can interfere with iterators.</remarks>\n        protected override void SetItemInner(int x,int y,T value) \n        =>  BackingStore[y].SetItem(x, value);\n\n        private IFastList<IFastListX<T>> BackingStore { get; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/HexBoard.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\nusing PGNapoleonics.HexUtilities.FieldOfView;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexPoint   = System.Drawing.Point;\n    using HexSize    = System.Drawing.Size;\n    using ILandmarks = ILandmarkCollection;\n\n    /// <summary>Abstract implementation of a hexgrid map-board.</summary>\n    /// <typeparam name=\"THex\">TODO</typeparam>\n    /// <remarks>No Finalizer is implemented as the class possesses no unmanaged resources.</remarks>\n    public abstract class HexBoard<THex> : ILandmarkBoard, ILandmarkBoard<THex>, IFovBoard\n    where THex:IHex {\n        /// <summary>By default, landmark all four corners and midpoints of all 4 sides.</summary>\n        /// <remarks>Pre-processing time on start-up can be reduced by decreasing the number of landmarks,\n        /// though at the possible expense of longer path-finding times.</remarks>\n        /// <param name=\"size\"></param>\n        protected static IFastList<HexCoords> DefaultLandmarks(HexSize size)\n        => ( from point in new HexPoint[] { new HexPoint(           0,             0),  // top-left\n                                            new HexPoint(           0, size.Height/2),  // middle-left\n                                            new HexPoint(           0, size.Height-1),  // bottom-left\n                                            new HexPoint(size.Width/2, size.Height-1),  // bottom-centre\n                                            new HexPoint(size.Width-1, size.Height-1),  // bottom-right\n                                            new HexPoint(size.Width-1, size.Height/2),  // middle-right\n                                            new HexPoint(size.Width-1,             0),  // top-right\n                                            new HexPoint(size.Width/2,             0),  // top-centre\n                                          }\n             select HexCoords.NewUserCoords(point)\n           ).ToArray().ToFastList();\n\n        /// <summary>Signals completion of a ResetLandmarks request.</summary>\n        public event EventHandler<EventArgs<ILandmarks>> LandmarksReady;\n\n        #region Constructors\n        /// <summary>Initializes the internal contents of <see cref=\"BoardStorage{T}\"/> with landmarks as specified for pathfinding.</summary>\n        /// <param name=\"sizeHexes\">Extent in hexes of the board being initialized, as a <see cref=\"HexSize\"/>.</param>\n        /// <param name=\"gridSize\">Extent in pixels of the layout grid for the hexagons, as a <see cref=\"HexSize\"/>.</param>\n        /// <param name=\"boardHexes\">TODO</param>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        protected HexBoard(HexSize sizeHexes, HexSize gridSize, BoardStorage<Maybe<THex>> boardHexes) {\n            BoardHexes      = boardHexes;\n            MapScale        = 1.00F;\n            IsTransposed    = false;\n            MapSizeHexes    = sizeHexes;\n            GridSize        = gridSize;\n            HexCentreOffset = new HexSize(GridSize.Width * 2/3, GridSize.Height /2);\n            GridSizePixels  = new IntMatrix2D(GridSize.Width,                0, \n                                                           0,   GridSize.Height, \n                                            GridSize.Width/3, GridSize.Height/2);\n        }\n\n        /// <inheritdoc/>\n        public async Task<Exception> ResetLandmarksAsync()\n        => await Task.Run(() => ResetLandmarks(LandmarkCoords));\n\n        /// <inheritdoc/>\n        public void  ResetLandmarks() => ResetLandmarks(LandmarkCoords);\n\n        /// <summary>TODO</summary>\n        /// <param name=\"landmarkCoords\"><see cref=\"IFastList{HexCoords}\"/> of the hexes to be used as Path-Finding landmarks.</param>\n        /// <returns></returns>\n        protected Exception ResetLandmarks(IFastList<HexCoords> landmarkCoords) {\n            try {\n                #if true\n                Landmarks = (this as IBoard<IHex>).CreateLandmarksHotQueue(landmarkCoords);\n                #else\n                Landmarks = LandmarkCollection.New(this, landmarkCoords);\n                #endif\n                OnLandmarksReady(new EventArgs<ILandmarks>(Landmarks));\n                return null;\n            } \n            catch (Exception ex) { return ex; }\n        }\n\n        /// <inheritdoc/>\n        protected virtual void OnLandmarksReady(EventArgs<ILandmarks> e) => LandmarksReady?.Invoke(this,e);\n        #endregion\n\n        /// <inheritdoc/>\n        protected virtual IFastList<HexCoords> LandmarkCoords { get; }\n\n        #region Properties & Fields\n        /// <summary>TODO</summary>\n        public BoardStorage<Maybe<THex>> BoardHexes { get; }\n        /// <inheritdoc/>\n        public    abstract int         ElevationBase   { get; }\n        /// <inheritdoc/>\n        public    abstract int         ElevationStep   { get; }\n        /// <inheritdoc/>\n        public    virtual  int         FovRadius       { get; set; }\n        /// <summary>TODO </summary>\n        public    virtual  int         HeightOfMan     => 1;   //!< Height in metres.\n        /// <inheritdoc/>\n        public             IHexgrid    Hexgrid         => new Hexgrid(IsTransposed,GridSize,MapScale);\n        /// <summary>Gets the extent in pixels of the grid on which hexes are to be laid out. </summary>\n        public             HexSize     GridSize        { get; }\n        /// <summary>TODO</summary>\n        public             IntMatrix2D GridSizePixels  { get; }\n        /// <summary>Offset of hex centre from upper-left corner, as a <see cref=\"HexSize\"/> struct.</summary>\n        public             HexSize     HexCentreOffset { get; }\n         ///  <inheritdoc/>\n        public             bool        IsTransposed    { get; set; }\n        /// <inheritdoc/>\n        public             ILandmarks  Landmarks       { get; private set; }\n        ///  <inheritdoc/>\n        public             float       MapScale        { get; set; }\n        /// <summary>The dimensions of the board as a <see cref=\"HexSize\"/></summary>\n        public             HexSize     MapSizeHexes    { get; }\n        \n        /// <summary>Range beyond which Fast PathFinding is used instead of Stable PathFinding.</summary>\n        public             int         RangeCutoff     { get; set; }\n\n        /// <summary>TODO</summary>\n        protected virtual  int         MinimumStepCost => 2;\n\n        Maybe<IHex> IBoard<IHex>.this[HexCoords coords] => this[coords].Bind<IHex>(h=>h);\n\n        /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        public             Maybe<THex> this[HexCoords coords] => BoardHexes[coords];\n\n        Maybe<IHex> IFovBoard.this[HexCoords coords] => this[coords].Bind(v => new Maybe<IHex>(v));\n        #endregion\n\n        #region Methods\n        /// <summary>Perform <paramref name=\"action\"/> for all neighbours of <paramref name=\"coords\"/>.</summary>\n        /// <param name=\"coords\"></param>\n        /// <param name=\"action\"></param>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public  void ForAllNeighbours(HexCoords coords, Action<Maybe<THex>,Hexside> action)\n        => BoardHexes.ForAllNeighbours(coords,action);\n\n        /// <inheritdoc/>\n        public abstract  int? Heuristic(HexCoords source, HexCoords target);\n\n        /// <inheritdoc/>\n        public           Maybe<THex> Neighbour(HexCoords coords, Hexside hexside)\n        => BoardHexes.Neighbour(coords,hexside);\n\n        /// <inheritdoc/>\n        public Maybe<IHex> Neighbour(IHex hex, Hexside hexside)\n        => Neighbour(hex.Coords,hexside).Bind(h => (h as IHex).ToMaybe());\n        #endregion\n\n        /// <inheritdoc/>\n        public abstract int? Heuristic(int range);\n        /// <inheritdoc/>\n        public abstract int? Heuristic(IHex source,IHex target);\n        /// <inheritdoc/>\n        public bool IsOnboard(HexCoords coords) => this[coords].HasValue;\n        /// <inheritdoc/>\n        public void ForAllNeighbours(HexCoords coords,Action<THex,Hexside> action)\n            => ForAllNeighbours(coords,(maybe,hexside) => maybe.IfHasValueDo(hex=>action(hex,hexside)));\n\n        void IBoard<IHex>.ForAllNeighbours(HexCoords coords,Action<IHex,Hexside> action)\n        => BoardHexes.ForAllNeighbours(coords, (hex,hexside) => action(hex as IHex, hexside));\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/HexBoardExtensions.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexPoint   = System.Drawing.Point;\n    using HexSize    = System.Drawing.Size;\n    using RectangleF = System.Drawing.RectangleF;\n    using Matrix     = System.Drawing.Drawing2D.Matrix;\n    using CoordsRect = CoordsRectangle;\n\n    /// <summary>.</summary>\n    public static partial class HexBoardExtensions {\n        /// <summary>Returns the translation transform-@this for the upper-left corner of the specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">Type: HexCoords - Coordinates of the hex to be tanslated.</param>\n        public static Matrix TranslateToHex<THex>(this HexBoard<THex> @this, HexCoords coords)\n        where THex:IHex {\n            var offset  = @this.UpperLeftOfHex(coords);\n            return new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n        }\n\n        /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">The {HexCoords} of the hex of current interest.</param>\n        /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n        public static HexPoint UpperLeftOfHex<THex>(this HexBoard<THex> @this, HexCoords coords)\n        where THex:IHex\n        => new HexPoint(\n            coords.User.X * @this.GridSize.Width,\n            coords.User.Y * @this.GridSize.Height + (coords.User.X + 1) % 2 * @this.GridSize.Height / 2\n        );\n\n        /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">The {HexCoords} of the hex of current interest.</param>\n        /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n        public static HexPoint CentreOfHex<THex>(this HexBoard<THex> @this, HexCoords coords)\n        where THex:IHex\n        => @this.UpperLeftOfHex(coords) + @this.HexCentreOffset;\n\n        /// <summary>Returns the location and extent in hexes, as a <see cref=\"CoordsRect\"/>, of the current clipping region.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"visibleClipBounds\"></param>\n        /// <param name=\"boardSizeHexes\"></param>\n        public static CoordsRect GetClipInHexes<THex>(this HexBoard<THex> @this,\n                RectangleF visibleClipBounds, HexSize boardSizeHexes)\n        where THex:IHex {\n            var left   = Math.Max((int)visibleClipBounds.Left   / @this.GridSize.Width  - 1, 0);\n            var top    = Math.Max((int)visibleClipBounds.Top    / @this.GridSize.Height - 1, 0);\n            var right  = Math.Min((int)visibleClipBounds.Right  / @this.GridSize.Width  + 1, boardSizeHexes.Width);\n            var bottom = Math.Min((int)visibleClipBounds.Bottom / @this.GridSize.Height + 1, boardSizeHexes.Height); \n            return new CoordsRect(left, top, right-left, bottom-top);\n        }\n\n        /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        public static HexSize MapSizePixels<THex>(this HexBoard<THex> @this)\n        where THex:IHex\n        => @this.MapSizeHexes * @this.GridSizePixels;\n\n        ///// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n        ///// <param name=\"this\">The current {HexBoard}.</param>\n        ///// <param name=\"action\"></param>\n        //public static void ForEachHex<THex,TBoard>(this TBoard @this, Action<Maybe<THex>> action)\n        //where THex:class,IHex where TBoard:HexBoard<THex>\n        //=> @this.BoardHexes.ForEachSerial(hex => action(from h in hex select h as THex));\n    }\n}\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexPoint   = System.Drawing.Point;\n    using HexPointF  = System.Drawing.PointF;\n    using HexSize    = System.Drawing.Size;\n    using HexSizeF   = System.Drawing.SizeF;\n    using Matrix     = System.Drawing.Drawing2D.Matrix;\n    using RectangleF = System.Drawing.RectangleF;\n\n    using CoordsRect = CoordsRectangle;\n\n    /// <summary>.</summary>\n    public static partial class PanelModelExtensions {\n        /// <summary>Returns the translation transform-@this for the upper-left corner of the specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">Type: HexCoords - Coordinates of the hex to be tanslated.</param>\n        public static Matrix TranslateToHex(this IPanelModel @this, HexCoords coords) {\n            var offset  = @this.UpperLeftOfHex(coords);\n            return new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n        }\n\n        /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">The {HexCoords} of the hex of current interest.</param>\n        /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n        public static HexPoint UpperLeftOfHex(this IPanelModel @this, HexCoords coords)\n        => new HexPoint(\n            coords.User.X * @this.GridSize.Width,\n            coords.User.Y * @this.GridSize.Height + (coords.User.X + 1) % 2 * @this.GridSize.Height / 2\n        );\n\n        /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"coords\">The {HexCoords} of the hex of current interest.</param>\n        /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n        public static HexPoint CentreOfHex(this IPanelModel @this, HexCoords coords)\n        => @this.UpperLeftOfHex(coords) + @this.HexCentreOffset;\n\n        /// <summary>Returns the location and extent in hexes, as a <see cref=\"CoordsRect\"/>, of the current clipping region.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"point\"></param>\n        /// <param name=\"size\"></param>\n        /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n        public static CoordsRect GetClipInHexes(this IPanelModel @this,HexPointF point, HexSizeF size)\n        => @this.GetClipInHexes(new RectangleF(point, size), @this.MapSizeHexes);\n\n        /// <summary>Returns the location and extent in hexes, as a <see cref=\"CoordsRect\"/>, of the current clipping region.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"visibleClipBounds\"></param>\n        /// <param name=\"boardSizeHexes\"></param>\n        public static CoordsRect GetClipInHexes(this IPanelModel @this,\n                RectangleF visibleClipBounds, HexSize boardSizeHexes) {\n            var left   = Math.Max((int)visibleClipBounds.Left   / @this.GridSize.Width  - 1, 0);\n            var top    = Math.Max((int)visibleClipBounds.Top    / @this.GridSize.Height - 1, 0);\n            var right  = Math.Min((int)visibleClipBounds.Right  / @this.GridSize.Width  + 1, boardSizeHexes.Width);\n            var bottom = Math.Min((int)visibleClipBounds.Bottom / @this.GridSize.Height + 1, boardSizeHexes.Height); \n            return new CoordsRect(left, top, right-left, bottom-top);\n        }\n\n        /// <summary>Returns the location and extent in hexes, as a <see cref=\"CoordsRect\"/>, of the current clipping region.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"visibleClipBounds\"></param>\n        public static CoordsRect GetClipInHexes(this IPanelModel @this, RectangleF visibleClipBounds)\n        => @this.GetClipInHexes(visibleClipBounds, @this.MapSizeHexes);\n\n        /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        public static HexSize MapSizePixels(this IPanelModel @this)\n        => @this.MapSizeHexes * @this.GridSizePixels;\n\n        /// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n        /// <param name=\"this\">The current {HexBoard}.</param>\n        /// <param name=\"action\"></param>\n        public static void ForEachHex<THex,TBoard>(this IPanelModel @this, Action<Maybe<THex>> action)\n        where THex:class,IHex where TBoard:Storage.HexBoard<THex>\n        => @this.ForEachHexSerial<IHex>(hex => action(from h in hex select h as THex));\n    }\n}"
  },
  {
    "path": "HexUtilities/Storage/IBoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize  = System.Drawing.Size;\n\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\">The Type being stored.</typeparam>\n    public interface IBoardStorage<out T> {\n        /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n        HexSize MapSizeHexes     { get; }\n\n        /// <summary>Returns the <c>THex</c> instance at the specified coordinates.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        T this[HexCoords coords] { get; }\n        /// <summary>Returns the <c>THex</c> instance at the specified user coordinates.</summary>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        T this[IntVector2D userCoords] { get; }\n\n        /// <summary>Perform <paramref name=\"action\"/> for all neighbours of <paramref name=\"coords\"/>.</summary>\n        void ForAllNeighbours(HexCoords coords, Action<T,Hexside> action);\n\n        /// <summary>Perform the specified <c>action</c> serially on all hexes.</summary>\n        void ForEach(Action<T> action);\n\n        ///// <summary>Returns whether the hex with <see cref=\"HexCoords\"/> <c>coords</c> is \n        ///// within the extent of the board.</summary>\n        //bool IsOnboard(HexCoords coords);\n\n        /// <summary>TODO</summary>\n        /// <param name=\"coords\"></param>\n        /// <param name=\"hexside\"></param>\n        /// <returns></returns>\n        T Neighbour(HexCoords coords, Hexside hexside);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/IMapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexSize = System.Drawing.Size;\n    using IDirectedPath = IDirectedPathCollection;\n\n    /// <summary>(Technology-independent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n    public interface IMapDisplay<THex> where THex:IHex {\n        /// <summary>TODO</summary>\n        BoardStorage<Maybe<THex>> BoardHexes { get; }\n\n        /// <summary>TODO</summary>\n        int       FovRadius        { get; set; }\n\n        /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the goal hex for path-fnding.</summary>\n        HexCoords GoalHex          { get; set; }\n\n        /// <summary>Gets the extent in pixels of the grid upon whch hexes are to be laid out.</summary>\n        /// <remarks>>Width is 3/4 of the point-to-point width of each hex, and Height is the full height.\n        /// Hexes should be defined assumed flat-topped and pointy-sided, and the entire board transposed \n        /// if necessary.</remarks>\n        HexSize   GridSize         { get; }\n\n        /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the hex currently under the mouse.</summary>\n        HexCoords HotspotHex       { get; set; }\n\n        /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n        bool      IsTransposed     { get; set; }\n\n        /// <summary>Gets or sets the index (-1 for none) of the path-finding <see cref=\"ILandmark\"/> to show.</summary>\n        int       LandmarkToShow   { get; set; }\n\n        /// <summary>Current scaling factor for map display.</summary>\n        float     MapScale         { get; set; }\n\n        /// <summary>TODO</summary>\n        IntMatrix2D GridSizePixels { get; }\n\n        /// <summary>The dimensions of the board as a <see cref=\"HexSize\"/></summary>\n        HexSize     MapSizeHexes   { get; }\n\n        /// <summary>Gets the display name for this HexgridPanel host.</summary>\n        string    Name             { get; }\n\n        /// <summary>Gets the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n        Maybe<IDirectedPath> Path  { get; }\n\n        /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the start hex for path-finding.</summary>\n        HexCoords StartHex         { get; set; }\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/IMapDisplayWinForms.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using GraphicsPath = System.Drawing.Drawing2D.GraphicsPath;\n    using HexPointF    = System.Drawing.PointF;\n    using HexSize      = System.Drawing.Size;\n    using HexSizeF     = System.Drawing.SizeF;\n    using ILandmarks   = ILandmarkCollection;\n    using RectangleF   = System.Drawing.RectangleF;\n\n    /// <summary>(Technology-dependent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n    public interface IMapDisplayWinForms<THex> : IMapDisplay<THex> where THex:IHex {\n        /// <summary>Gets or sets the Field-of-View for the current HotspotHex, as an <see cref=\"IShadingMask\"/> object.</summary>\n        IShadingMask Fov                    { get; }\n        /// <summary>.</summary>/>\n        GraphicsPath HexgridPath            { get; }\n        /// <summary>Offset of hex centre from upper-left corner, as a <see cref=\"HexSize\"/> struct.</summary>\n        HexSize      HexCentreOffset        { get; }\n        /// <summary>.</summary>\n        ILandmarks   Landmarks              { get;}\n        /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        byte         ShadeBrushAlpha        { get; }\n        /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n        bool         ShowPathArrow          { get; }\n        /// <summary>Gets or sets whether to display a range line from the selected hex to the hover hex.</summary>\n        bool         ShowRangeLine          { get; }\n\n        /// <summary>Returns the <see cref=\"Maybe{IHex}\"/> at location <c>coords</c>.</summary>\n        Maybe<THex>  this[HexCoords coords] { get; }\n\n        /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n        /// <param name=\"point\">Upper-left corner in pixels of the clipping region.</param>\n        /// <param name=\"size\">Width and height of the clipping region in pixels.</param>\n        CoordsRectangle GetClipInHexes(HexPointF point, HexSizeF size);\n\n        /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n        /// <param name=\"visibleClipBounds\">Rectangular extent in pixels of the clipping region.</param>\n        CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds);\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/Map.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    /// <summary>TODO</summary>\n    public delegate MapDisplay<THex> MapExtractor<THex>() where THex:class,IHex;\n\n    /// <summary>TODO</summary>\n    public class Map<THex> : IEquatable<Map<THex>> where THex: class,IHex {\n        /// <summary>TODO</summary>\n        public Map(string mapName, MapExtractor<THex> mapSource) {\n            MapName   = mapName;\n            MapSource = mapSource;\n        }\n\n        /// <summary>TODO</summary>\n        public  string             MapName   { get; }\n        /// <summary>TODO</summary>\n        public  MapDisplay<THex>   MapBoard  => MapSource(); \n        \n        private MapExtractor<THex> MapSource { get; }\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is Map<THex> other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(Map<THex> other) => MapName == other.MapName;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => MapName.GetHashCode();\n\n        /// <summary>Tests value-inequality.</summary>\n        public static bool operator !=(Map<THex> lhs, Map<THex> rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value-equality.</summary>\n        public static bool operator ==(Map<THex> lhs, Map<THex> rhs) => lhs.Equals(rhs);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/MapDisplay.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FastList;\nusing PGNapoleonics.HexUtilities.FieldOfView;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexPoint      = System.Drawing.Point;\n    using HexPointF     = System.Drawing.PointF;\n    using HexSize       = System.Drawing.Size;\n    using HexSizeF      = System.Drawing.SizeF;\n    using Matrix        = System.Drawing.Drawing2D.Matrix;\n    using RectangleF    = System.Drawing.RectangleF;\n    using GraphicsPath  = System.Drawing.Drawing2D.GraphicsPath;\n    using IDirectedPath = IDirectedPathCollection;\n    using Int32ValueEventArgs = EventArgs<int>;\n\n    using static System.Drawing.Drawing2D.PathPointType;\n\n    /// <summary>.</summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public abstract class MapDisplayFlat<THex> : MapDisplay<THex>, IDisposable\n    where THex:class,IHex {\n        /// <summary>Creates a new instance of the MapDisplay class.</summary>\n        protected MapDisplayFlat(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex)\n        : base(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes),\n              new FlatBoardStorage<Maybe<THex>>(sizeHexes, coords => initializeHex(coords), false)) { }\n    }\n\n    /// <summary>.</summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public abstract class MapDisplayBlocked<THex> : MapDisplay<THex>\n    where THex:class,IHex {\n        /// <summary>Creates a new instance of the MapDisplay class.</summary>\n        protected MapDisplayBlocked(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex)\n        : base(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes),\n              BlockedBoardStorage.New32x32<Maybe<THex>>(sizeHexes, coords => initializeHex(coords))) { }\n    }\n\n    /// <summary>Abstract class representing the basic game board.</summary>\n    /// <typeparam name=\"THex\">Type of the hex for which a game board is desired.</typeparam>\n    public abstract class MapDisplay<THex> : HexBoard<THex>, IMapDisplayWinForms<THex>,\n        IFovBoard, IPanelModel\n    where THex: class,IHex {\n\n        /// <summary>TODO</summary>\n        protected delegate THex InitializeHex(HexCoords coords);\n\n        /// <summary>An array of PathTypes enum constants describing the elements of <see cref=\"MapDisplay{THex}.HexgridPathPoints\"/>.</summary>\n        private static readonly byte[] _hexgridPathPointTypes = {\n                (byte)Start, (byte)Line, (byte)Line,\n                (byte)Line,  (byte)Line, (byte)Line|(byte)CloseSubpath\n            };\n\n        /// <summary>Returns an array of six <see cref=\"HexPoint\"/>s describing the corners of a hex on this <see cref=\"HexBoard{THex}\"/>.</summary>\n        /// <param name=\"gridSize\">Dimensions of a hex on this <see cref=\"HexBoard{THex}\"/> in pixels.</param>\n        private static HexPoint[] HexgridPathPoints(HexSize gridSize)\n        => new HexPoint[] { new HexPoint(gridSize.Width*1/3,               0  ),\n                            new HexPoint(gridSize.Width*3/3,               0  ),\n                            new HexPoint(gridSize.Width*4/3, gridSize.Height/2),\n                            new HexPoint(gridSize.Width*3/3, gridSize.Height  ),\n                            new HexPoint(gridSize.Width*1/3, gridSize.Height  ),\n                            new HexPoint(             0,     gridSize.Height/2)\n                          };\n\n        /// <summary>Creates a new instance of the MapDisplay class.</summary>\n        protected MapDisplay(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex,\n                IFastList<HexCoords> landmarkCoords, BoardStorage<Maybe<THex>> storage)\n        : base(sizeHexes, gridSize, storage) {\n            GoalHex         =\n            HotspotHex      =\n            StartHex        = HexCoords.EmptyUser;\n            ShadeBrushAlpha = 78;\n            ShowFov         = true;\n            ShowHexgrid     = true;\n            ShowPath        = true;\n            ShowPathArrow   = true;\n            HexgridPath     = Extensions.InitializeDisposable(() =>\n                     new GraphicsPath(HexgridPathPoints(gridSize), _hexgridPathPointTypes));\n\n            LandmarkCoords  = landmarkCoords;\n        }\n\n        /// <inheritdoc/>\n        protected override IFastList<HexCoords> LandmarkCoords { get; }\n\n        #region Properties\n        /// <summary>Gets or sets the Field-of-View for the current <see cref=\"HotspotHex\"/>, as an <see cref=\"IFov\"/> object.</summary>\n        public virtual  IShadingMask Fov {\n            get           => _fov ?? (_fov = this.GetFieldOfView(ShowRangeLine ? StartHex : HotspotHex, FovRadius));\n            protected set => _fov = value;\n        } IShadingMask _fov;\n        /// <inheritdoc/>\n        public override int          FovRadius { set { RangeCutoff = base.FovRadius = value; Fov = null; } }\n        /// <inheritdoc/>\n        public virtual  HexCoords    GoalHex {\n            get => _goalHex;\n            set { _goalHex = value; PathSet(); }\n        } HexCoords _goalHex = HexCoords.EmptyUser;\n        ///  <inheritdoc/>\n        public          GraphicsPath HexgridPath { get; }\n        /// <inheritdoc/>\n        public virtual HexCoords     HotspotHex {\n            get => _hotSpotHex;\n            set { if (MapSizeHexes.IsOnboard(value)) _hotSpotHex = value; if (!ShowRangeLine) _fov = null; }\n        } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n        /// <inheritdoc/>\n        public          int          LandmarkToShow  { get; set; }\n        /// <inheritdoc/>\n        public          string       Name => \"MapDisplay\";\n        /// <inheritdoc/>\n        public          Maybe<IDirectedPath> Path => _path; Maybe<IDirectedPath> _path;\n        /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        public          byte         ShadeBrushAlpha { get; set; }\n        /// <summary>Gets or sets whether to display the FIeld-of-View for <see cref=\"HotspotHex\"/>.</summary>\n        public          bool         ShowFov         { get; set; }\n        /// <summary>Gets or sets whether to display the hexgrid.</summary>\n        public          bool         ShowHexgrid     { get; set; }\n        /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n        public          bool         ShowPath        { get; set; }\n        /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n        public          bool         ShowPathArrow   { get; set; }\n        /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n        public          bool         ShowRangeLine {\n            get => _showRangeLine;\n            set { _showRangeLine = value; if (_showRangeLine) Fov = null; }\n        } bool _showRangeLine = false;\n        /// <inheritdoc/>\n        public virtual  HexCoords    StartHex {\n            get => _startHex;\n            set { if (MapSizeHexes.IsOnboard(value)) _startHex = value; PathSet(); ; if (ShowRangeLine) _fov = null; }\n        } HexCoords _startHex = HexCoords.EmptyUser;\n\n        Maybe<IHex> IPanelModel.this[HexCoords coords] => BoardHexes[coords].Bind<IHex>(hex => hex);\n        #endregion\n\n        /// <summary>TODO</summary>\n        public void PathSet()\n        => _path = this[StartHex].Bind(source =>\n                   this[GoalHex].Bind(target => {\n                       if(! source.IsPassable || ! target.IsPassable) return null;\n                       return source.Range(target) <= RangeCutoff\n                            ? this.GetPathStandardAStar(source, target).DirectedPath\n                            : this.GetPathBiDiAlt(source,target).DirectedPath;\n                   } ));\n\n        /// <summary>TODO</summary>\n        public void PathClear() => _path = Maybe<IDirectedPath>.NoValue();\n\n        #region Painting\n        /// <inheritdoc/>\n        public CoordsRectangle GetClipInHexes(HexPointF point, HexSizeF size)\n        => this.GetClipInHexes(new RectangleF(point, size), MapSizeHexes);\n\n        /// <inheritdoc/>\n        public CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds)\n        => this.GetClipInHexes(visibleClipBounds, MapSizeHexes);\n        #endregion\n\n        /// <inheritdoc/>\n        [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\", MessageId = \"2*range\")]\n        public override int? Heuristic(HexCoords source, HexCoords target)\n        => 2 * source.Range(target);\n\n        /// <summary>TODO</summary>\n        private void Host_FovRadiusChanged(object sender, Int32ValueEventArgs e)\n        => FovRadius = RangeCutoff = e.Value;\n\n        /// <summary>TODO</summary>\n        private void Host_RangeCutoffChanged(object sender, Int32ValueEventArgs e)\n        => RangeCutoff = e.Value;\n\n        /// <inheritdoc/>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n        Maybe<THex> IMapDisplayWinForms<THex>.this[HexCoords coords]\n        => BoardHexes[coords];\n\n        /// <inheritdoc/>\n        void IPanelModel.ForEachHexSerial<THex>(Action<Maybe<THex>> action)\n        => BoardHexes.ForEachSerial(hex => action(hex.Bind<THex>(h => h as THex)));\n\n        #region Derived IDisposable implementation\n        public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n        /// <summary>True if already Disposed.</summary>\n        private bool _isDisposed = false;\n        /// <summary>Clean up any resources being used.</summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected virtual void Dispose(bool disposing) {\n            if (!_isDisposed) {\n                if (disposing) {\n                    HexgridPath?.Dispose();\n                }\n                _isDisposed = true;\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexUtilities/Storage/MapDisplayExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities.Storage {\n    using HexPoint = System.Drawing.Point;\n    using HexSize  = System.Drawing.Size;\n    using Matrix   = System.Drawing.Drawing2D.Matrix;\n\n    /// <summary>Non-painting extension metohds for <see cref=\"IMapDisplayWinForms{T}\"/></summary>\n    public static partial class MapDisplayExtensions {\n        /// <summary>Returns the translation transform of @this for the upper-left corner of the specified hex.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\">Type: HexCoords - Coordinates of the hex to be painted next.</param>\n        public static Matrix TranslateToHex<THex>(this IMapDisplayWinForms<THex> @this, HexCoords coords)\n        where THex:IHex {\n            var offset  = @this.UpperLeftOfHex<THex>(coords);\n            return new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n        }\n\n        /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\"></param>\n        /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n        public static HexPoint UpperLeftOfHex<THex>(this IMapDisplayWinForms<THex> @this, HexCoords coords)\n        where THex:IHex\n        => new HexPoint(\n            coords.User.X * @this.GridSize.Width,\n            coords.User.Y * @this.GridSize.Height + (coords.User.X + 1) % 2 * @this.GridSize.Height / 2\n        );\n\n        /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"coords\"></param>\n        /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n        public static HexPoint CentreOfHex<THex>(this IMapDisplayWinForms<THex> @this, HexCoords coords)\n        where THex:IHex\n        => @this.UpperLeftOfHex(coords) + @this.HexCentreOffset;\n\n        /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n        /// <param name=\"this\">The current <see cref=\"IMapDisplay{THex}\"/>.</param>\n        public static HexSize MapSizePixels<THex>(this IMapDisplay<THex> @this)\n        where THex:IHex\n        => @this.MapSizeHexes * @this.GridSizePixels;\n    }\n}\n"
  },
  {
    "path": "HexUtilities/UserCoordsRectangle.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexRectangle = System.Drawing.Rectangle;\n\n    /// <summary>Stores a rectangular board region as a a location and extent of <see cref=\"HexCoords\"/>.</summary>\n    [DebuggerDisplay(\"({Location}):({Size})\")]\n    public struct CoordsRectangle : IEquatable<CoordsRectangle> {\n        /// <summary>Returns a new <see cref=\"CoordsRectangle\"/> from the specified location and dimensions.</summary>\n        /// <param name=\"location\">The upper left corner as a <see cref=\"HexCoords\"/> object.</param>\n        /// <param name=\"size\">The dimensions as a <see cref=\"HexCoords\"/> object.</param>\n        public CoordsRectangle(HexCoords location, HexCoords size)\n        : this(new HexRectangle(location.User, size.User)) { }\n\n        /// <summary>Returns a new <see cref=\"CoordsRectangle\"/> from the specified location and dimensions.</summary>\n        /// <param name=\"x\">X-coordinate of the upper left corner.</param>\n        /// <param name=\"y\">Y-coordinate of the upper left corner.</param>\n        /// <param name=\"width\">X extent of the size.</param>\n        /// <param name=\"height\">Y extent of the size.</param>\n        public CoordsRectangle(int x, int y, int width, int height)\n        : this(new HexRectangle(x,y,width,height)) { }\n\n        /// <summary>Initializes a new <see cref=\"CoordsRectangle\"/>.</summary>\n        private CoordsRectangle(HexRectangle rectangle) : this() => Rectangle = rectangle;\n\n        /// <summary>Gets the <see cref=\"HexCoords\"/> of the upper-left corner for this CoordsRectangle</summary>\n        public HexCoords Location => HexCoords.NewUserCoords(Rectangle.Location);\n\n        /// <summary>Gets the <see cref=\"HexCoords\"/> of the dimensions for this CoordsRectangle</summary>\n        public HexCoords Size => HexCoords.NewUserCoords(Rectangle.Size);\n\n        /// <summary>Gets the underlying hex-coordinates as a <see cref=\"HexRectangle\"/>.</summary>\n        internal HexRectangle Rectangle { get; }\n\n        /// <summary>Returns true exactly when the test hex is inside this rectangle.</summary>\n        /// <param name=\"hexCoords\">Location as a <see cref=\"HexCoords\"/> of the hex to be tested.</param>\n        public bool EncompassesHex(HexCoords hexCoords)\n        =>  Rectangle.Left <= hexCoords.User.X  &&  hexCoords.User.X <= Rectangle.Right\n        &&  Rectangle.Top  <= hexCoords.User.Y  &&  hexCoords.User.Y <= Rectangle.Bottom;\n\n        /// <summary>Gets the underlying hex-coordinates as a <see cref=\"HexRectangle\"/>.</summary>\n        public static implicit operator HexRectangle(CoordsRectangle rectangle) => rectangle.Rectangle;\n\n        /// <summary>Gets the underlying hex-coordinates as a <see cref=\"CoordsRectangle\"/>.</summary>\n        public static implicit operator CoordsRectangle(HexRectangle rectangle) => new CoordsRectangle(rectangle);\n\n        #region Value Equality with IEquatable<T>\n        /// <inheritdoc/>\n        public override bool Equals(object obj) => (obj is CoordsRectangle other) && this.Equals(other);\n\n        /// <inheritdoc/>\n        public bool Equals(CoordsRectangle other) => Rectangle == other.Rectangle;\n\n        /// <inheritdoc/>\n        public override int GetHashCode() => Rectangle.GetHashCode();\n\n        /// <summary>Tests value inequality of two CoordsRectangle instances.</summary>\n        public static bool operator !=(CoordsRectangle lhs, CoordsRectangle rhs) => ! lhs.Equals(rhs);\n\n        /// <summary>Tests value equality of two CoordsRectangle instances.</summary>\n        public static bool operator ==(CoordsRectangle lhs, CoordsRectangle rhs) => lhs.Equals(rhs);\n        #endregion\n\n        /// <inheritdoc/>\n        public override string ToString() => string.Format(CultureInfo.CurrentCulture,\n                $\"({Rectangle.X},{Rectangle.Y}):({Rectangle.Width},{Rectangle.Height})\");\n    }\n\n    public static partial class Extensions {\n        /// <summary>TODO</summary>\n        public static int Bottom(this CoordsRectangle @this) => @this.Rectangle.Bottom;\n        /// <summary>TODO</summary>\n        public static int Height(this CoordsRectangle @this) => @this.Rectangle.Height;\n        /// <summary>TODO</summary>\n        public static int Left(this CoordsRectangle @this)   => @this.Rectangle.Left;\n        /// <summary>TODO</summary>\n        public static int Right(this CoordsRectangle @this)  => @this.Rectangle.Right;\n        /// <summary>TODO</summary>\n        public static int Top(this CoordsRectangle @this)    => @this.Rectangle.Top;\n        /// <summary>TODO</summary>\n        public static int Width(this CoordsRectangle @this)  => @this.Rectangle.Width;\n        /// <summary>TODO</summary>\n        public static int X(this CoordsRectangle @this)      => @this.Rectangle.X;\n        /// <summary>TODO</summary>\n        public static int Y(this CoordsRectangle @this)      => @this.Rectangle.Y;\n\n        /// <summary>TODO</summary>\n        public static HexCoords UpperLeft(this CoordsRectangle @this)  => HexCoords.NewUserCoords(@this.Left(),@this.Top());\n        /// <summary>TODO</summary>\n        public static HexCoords UpperRight(this CoordsRectangle @this) => HexCoords.NewUserCoords(@this.Right(),@this.Top());\n        /// <summary>TODO</summary>\n        public static HexCoords LowerLeft(this CoordsRectangle @this)  => HexCoords.NewUserCoords(@this.Left(),@this.Bottom());\n        /// <summary>TODO</summary>\n        public static HexCoords LowerRight(this CoordsRectangle @this) => HexCoords.NewUserCoords(@this.Right(),@this.Bottom());\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/App.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n   <startup>\n      <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.7.1\"/>\n   </startup>\n</configuration>\n"
  },
  {
    "path": "HexgridExampleWinforms/HexgridExampleWinforms.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleWinforms</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexgridExampleWinforms</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>CODE_ANALYSIS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1587,1607</NoWarn>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexgridExampleWinforms.xml</DocumentationFile>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>PGNapoleonics.HexgridExampleWinforms.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>false</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>true</Prefer32Bit>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"IMapView.cs\" />\n    <Compile Include=\"IMapViewModel.cs\" />\n    <Compile Include=\"MapModel.cs\" />\n    <Compile Include=\"MapViewModel.cs\" />\n    <Compile Include=\"MDIParent.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"MDIParent.Designer.cs\">\n      <DependentUpon>MDIParent.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"MDIParent.resx\">\n      <DependentUpon>MDIParent.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexgridExampleWinforms/IMapView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexgridPanel;\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    public interface IMapView {\n        event EventHandler<HexEventArgs> GoalHexChanged;\n        event EventHandler<HexEventArgs> StartHexChanged;\n        event EventHandler<HexEventArgs> HotSpotHexChanged;\n\n        event EventHandler<bool> TransposeMapToggled;\n        event EventHandler<bool> ShowRangeLineToggled;\n        event EventHandler<bool> ShowPathArrowToggled;\n        event EventHandler<bool> ShowFieldOfViewToggled;\n\n        event EventHandler<int> LandmarkSelected;\n\n        event EventHandler<MouseEventArgs> MouseMoved;\n\n        event EventHandler ResizeBegin;\n        event EventHandler Resize;\n        event EventHandler ResizeEnd;\n\n        void SetLandmarkMenu(ILandmarkCollection landmarks);\n\n        bool IsTransposed { get; set; }\n\n        void Refresh();\n\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/IMapViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexgridPanel;\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    public interface IMapViewModel {\n        event EventHandler<HexEventArgs> GoalHexChanged;\n        event EventHandler<HexEventArgs> StartHexChanged;\n        event EventHandler<HexEventArgs> HotSpotHexChanged;\n\n        //event EventHandler<bool> TransposeMapToggled;\n        event EventHandler<bool> ShowRangeLineToggled;\n        event EventHandler<bool> ShowPathArrowToggled;\n        event EventHandler<bool> ShowFieldOfViewToggled;\n\n        event EventHandler<int> LandmarkSelected;\n\n        event EventHandler<MouseEventArgs> MouseMoved;\n\n        //event EventHandler ResizeBegin;\n        //event EventHandler Resize;\n        //event EventHandler ResizeEnd;\n\n        void SetLandmarkMenu(ILandmarkCollection landmarks);\n\n        bool IsTransposed { get; set; }\n\n        void Refresh();\n\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/MDIParent.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridExampleWinforms {\n    partial class MdiParent {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">True if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void InitializeComponent() {\n            this.components = new System.ComponentModel.Container();\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MdiParent));\n            this.menuStrip = new System.Windows.Forms.MenuStrip();\n            this.fileMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n            this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n            this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.printSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();\n            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.editMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();\n            this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\n            this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.viewMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.statusBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.windowsMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.newWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.tileVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.tileHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.arrangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.helpMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\n            this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStrip = new System.Windows.Forms.ToolStrip();\n            this.newToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.openToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n            this.printToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n            this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.statusStrip = new System.Windows.Forms.StatusStrip();\n            this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();\n            this.toolTip = new System.Windows.Forms.ToolTip(this.components);\n            this.menuStrip.SuspendLayout();\n            this.toolStrip.SuspendLayout();\n            this.statusStrip.SuspendLayout();\n            this.SuspendLayout();\n            // \n            // menuStrip\n            // \n            this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.fileMenu,\n            this.editMenu,\n            this.viewMenu,\n            this.toolsMenu,\n            this.windowsMenu,\n            this.helpMenu});\n            this.menuStrip.Location = new System.Drawing.Point(0, 0);\n            this.menuStrip.MdiWindowListItem = this.windowsMenu;\n            this.menuStrip.Name = \"menuStrip\";\n            this.menuStrip.Size = new System.Drawing.Size(632, 24);\n            this.menuStrip.TabIndex = 0;\n            this.menuStrip.Text = \"MenuStrip\";\n            // \n            // fileMenu\n            // \n            this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripMenuItem,\n            this.openToolStripMenuItem,\n            this.toolStripSeparator3,\n            this.saveToolStripMenuItem,\n            this.saveAsToolStripMenuItem,\n            this.toolStripSeparator4,\n            this.printToolStripMenuItem,\n            this.printPreviewToolStripMenuItem,\n            this.printSetupToolStripMenuItem,\n            this.toolStripSeparator5,\n            this.exitToolStripMenuItem});\n            this.fileMenu.ImageTransparentColor = System.Drawing.SystemColors.ActiveBorder;\n            this.fileMenu.Name = \"fileMenu\";\n            this.fileMenu.Size = new System.Drawing.Size(37, 20);\n            this.fileMenu.Text = \"&File\";\n            // \n            // newToolStripMenuItem\n            // \n            this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripMenuItem.Image\")));\n            this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.newToolStripMenuItem.Name = \"newToolStripMenuItem\";\n            this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));\n            this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.newToolStripMenuItem.Text = \"&New\";\n            this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // openToolStripMenuItem\n            // \n            this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripMenuItem.Image\")));\n            this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.openToolStripMenuItem.Name = \"openToolStripMenuItem\";\n            this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\n            this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.openToolStripMenuItem.Text = \"&Open\";\n            this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile);\n            // \n            // toolStripSeparator3\n            // \n            this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n            this.toolStripSeparator3.Size = new System.Drawing.Size(143, 6);\n            // \n            // saveToolStripMenuItem\n            // \n            this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripMenuItem.Image\")));\n            this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.saveToolStripMenuItem.Name = \"saveToolStripMenuItem\";\n            this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));\n            this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.saveToolStripMenuItem.Text = \"&Save\";\n            // \n            // saveAsToolStripMenuItem\n            // \n            this.saveAsToolStripMenuItem.Name = \"saveAsToolStripMenuItem\";\n            this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.saveAsToolStripMenuItem.Text = \"Save &As\";\n            this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click);\n            // \n            // toolStripSeparator4\n            // \n            this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n            this.toolStripSeparator4.Size = new System.Drawing.Size(143, 6);\n            // \n            // printToolStripMenuItem\n            // \n            this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripMenuItem.Image\")));\n            this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printToolStripMenuItem.Name = \"printToolStripMenuItem\";\n            this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));\n            this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printToolStripMenuItem.Text = \"&Print\";\n            // \n            // printPreviewToolStripMenuItem\n            // \n            this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripMenuItem.Image\")));\n            this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printPreviewToolStripMenuItem.Name = \"printPreviewToolStripMenuItem\";\n            this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printPreviewToolStripMenuItem.Text = \"Print Pre&view\";\n            // \n            // printSetupToolStripMenuItem\n            // \n            this.printSetupToolStripMenuItem.Name = \"printSetupToolStripMenuItem\";\n            this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printSetupToolStripMenuItem.Text = \"Print Setup\";\n            // \n            // toolStripSeparator5\n            // \n            this.toolStripSeparator5.Name = \"toolStripSeparator5\";\n            this.toolStripSeparator5.Size = new System.Drawing.Size(143, 6);\n            // \n            // exitToolStripMenuItem\n            // \n            this.exitToolStripMenuItem.Name = \"exitToolStripMenuItem\";\n            this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.exitToolStripMenuItem.Text = \"E&xit\";\n            this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click);\n            // \n            // editMenu\n            // \n            this.editMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.undoToolStripMenuItem,\n            this.redoToolStripMenuItem,\n            this.toolStripSeparator6,\n            this.cutToolStripMenuItem,\n            this.copyToolStripMenuItem,\n            this.pasteToolStripMenuItem,\n            this.toolStripSeparator7,\n            this.selectAllToolStripMenuItem});\n            this.editMenu.Name = \"editMenu\";\n            this.editMenu.Size = new System.Drawing.Size(39, 20);\n            this.editMenu.Text = \"&Edit\";\n            // \n            // undoToolStripMenuItem\n            // \n            this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"undoToolStripMenuItem.Image\")));\n            this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.undoToolStripMenuItem.Name = \"undoToolStripMenuItem\";\n            this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));\n            this.undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.undoToolStripMenuItem.Text = \"&Undo\";\n            // \n            // redoToolStripMenuItem\n            // \n            this.redoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"redoToolStripMenuItem.Image\")));\n            this.redoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.redoToolStripMenuItem.Name = \"redoToolStripMenuItem\";\n            this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));\n            this.redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.redoToolStripMenuItem.Text = \"&Redo\";\n            // \n            // toolStripSeparator6\n            // \n            this.toolStripSeparator6.Name = \"toolStripSeparator6\";\n            this.toolStripSeparator6.Size = new System.Drawing.Size(161, 6);\n            // \n            // cutToolStripMenuItem\n            // \n            this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"cutToolStripMenuItem.Image\")));\n            this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.cutToolStripMenuItem.Name = \"cutToolStripMenuItem\";\n            this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));\n            this.cutToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.cutToolStripMenuItem.Text = \"Cu&t\";\n            this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click);\n            // \n            // copyToolStripMenuItem\n            // \n            this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"copyToolStripMenuItem.Image\")));\n            this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.copyToolStripMenuItem.Name = \"copyToolStripMenuItem\";\n            this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));\n            this.copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.copyToolStripMenuItem.Text = \"&Copy\";\n            this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click);\n            // \n            // pasteToolStripMenuItem\n            // \n            this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"pasteToolStripMenuItem.Image\")));\n            this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.pasteToolStripMenuItem.Name = \"pasteToolStripMenuItem\";\n            this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));\n            this.pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.pasteToolStripMenuItem.Text = \"&Paste\";\n            this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click);\n            // \n            // toolStripSeparator7\n            // \n            this.toolStripSeparator7.Name = \"toolStripSeparator7\";\n            this.toolStripSeparator7.Size = new System.Drawing.Size(161, 6);\n            // \n            // selectAllToolStripMenuItem\n            // \n            this.selectAllToolStripMenuItem.Name = \"selectAllToolStripMenuItem\";\n            this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));\n            this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.selectAllToolStripMenuItem.Text = \"Select &All\";\n            // \n            // viewMenu\n            // \n            this.viewMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolBarToolStripMenuItem,\n            this.statusBarToolStripMenuItem});\n            this.viewMenu.Name = \"viewMenu\";\n            this.viewMenu.Size = new System.Drawing.Size(44, 20);\n            this.viewMenu.Text = \"&View\";\n            // \n            // toolBarToolStripMenuItem\n            // \n            this.toolBarToolStripMenuItem.CheckOnClick = true;\n            this.toolBarToolStripMenuItem.Name = \"toolBarToolStripMenuItem\";\n            this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(180, 22);\n            this.toolBarToolStripMenuItem.Text = \"&Toolbar\";\n            this.toolBarToolStripMenuItem.Visible = false;\n            this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click);\n            // \n            // statusBarToolStripMenuItem\n            // \n            this.statusBarToolStripMenuItem.CheckOnClick = true;\n            this.statusBarToolStripMenuItem.Name = \"statusBarToolStripMenuItem\";\n            this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(180, 22);\n            this.statusBarToolStripMenuItem.Text = \"&Status Bar\";\n            this.statusBarToolStripMenuItem.Click += new System.EventHandler(this.StatusBarToolStripMenuItem_Click);\n            // \n            // toolsMenu\n            // \n            this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.optionsToolStripMenuItem});\n            this.toolsMenu.Name = \"toolsMenu\";\n            this.toolsMenu.Size = new System.Drawing.Size(47, 20);\n            this.toolsMenu.Text = \"&Tools\";\n            // \n            // optionsToolStripMenuItem\n            // \n            this.optionsToolStripMenuItem.Name = \"optionsToolStripMenuItem\";\n            this.optionsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);\n            this.optionsToolStripMenuItem.Text = \"&Options\";\n            // \n            // windowsMenu\n            // \n            this.windowsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newWindowToolStripMenuItem,\n            this.cascadeToolStripMenuItem,\n            this.tileVerticalToolStripMenuItem,\n            this.tileHorizontalToolStripMenuItem,\n            this.closeAllToolStripMenuItem,\n            this.arrangeIconsToolStripMenuItem});\n            this.windowsMenu.Name = \"windowsMenu\";\n            this.windowsMenu.Size = new System.Drawing.Size(68, 20);\n            this.windowsMenu.Text = \"&Windows\";\n            // \n            // newWindowToolStripMenuItem\n            // \n            this.newWindowToolStripMenuItem.Name = \"newWindowToolStripMenuItem\";\n            this.newWindowToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.newWindowToolStripMenuItem.Text = \"&New Window\";\n            this.newWindowToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // cascadeToolStripMenuItem\n            // \n            this.cascadeToolStripMenuItem.Name = \"cascadeToolStripMenuItem\";\n            this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.cascadeToolStripMenuItem.Text = \"&Cascade\";\n            this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.CascadeToolStripMenuItem_Click);\n            // \n            // tileVerticalToolStripMenuItem\n            // \n            this.tileVerticalToolStripMenuItem.Name = \"tileVerticalToolStripMenuItem\";\n            this.tileVerticalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.tileVerticalToolStripMenuItem.Text = \"Tile &Vertical\";\n            this.tileVerticalToolStripMenuItem.Click += new System.EventHandler(this.TileVerticalToolStripMenuItem_Click);\n            // \n            // tileHorizontalToolStripMenuItem\n            // \n            this.tileHorizontalToolStripMenuItem.Name = \"tileHorizontalToolStripMenuItem\";\n            this.tileHorizontalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.tileHorizontalToolStripMenuItem.Text = \"Tile &Horizontal\";\n            this.tileHorizontalToolStripMenuItem.Click += new System.EventHandler(this.TileHorizontalToolStripMenuItem_Click);\n            // \n            // closeAllToolStripMenuItem\n            // \n            this.closeAllToolStripMenuItem.Name = \"closeAllToolStripMenuItem\";\n            this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.closeAllToolStripMenuItem.Text = \"C&lose All\";\n            this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.CloseAllToolStripMenuItem_Click);\n            // \n            // arrangeIconsToolStripMenuItem\n            // \n            this.arrangeIconsToolStripMenuItem.Name = \"arrangeIconsToolStripMenuItem\";\n            this.arrangeIconsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.arrangeIconsToolStripMenuItem.Text = \"&Arrange Icons\";\n            this.arrangeIconsToolStripMenuItem.Click += new System.EventHandler(this.ArrangeIconsToolStripMenuItem_Click);\n            // \n            // helpMenu\n            // \n            this.helpMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.contentsToolStripMenuItem,\n            this.indexToolStripMenuItem,\n            this.searchToolStripMenuItem,\n            this.toolStripSeparator8,\n            this.aboutToolStripMenuItem});\n            this.helpMenu.Name = \"helpMenu\";\n            this.helpMenu.Size = new System.Drawing.Size(44, 20);\n            this.helpMenu.Text = \"&Help\";\n            // \n            // contentsToolStripMenuItem\n            // \n            this.contentsToolStripMenuItem.Name = \"contentsToolStripMenuItem\";\n            this.contentsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1)));\n            this.contentsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.contentsToolStripMenuItem.Text = \"&Contents\";\n            // \n            // indexToolStripMenuItem\n            // \n            this.indexToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"indexToolStripMenuItem.Image\")));\n            this.indexToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.indexToolStripMenuItem.Name = \"indexToolStripMenuItem\";\n            this.indexToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.indexToolStripMenuItem.Text = \"&Index\";\n            // \n            // searchToolStripMenuItem\n            // \n            this.searchToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"searchToolStripMenuItem.Image\")));\n            this.searchToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.searchToolStripMenuItem.Name = \"searchToolStripMenuItem\";\n            this.searchToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.searchToolStripMenuItem.Text = \"&Search\";\n            // \n            // toolStripSeparator8\n            // \n            this.toolStripSeparator8.Name = \"toolStripSeparator8\";\n            this.toolStripSeparator8.Size = new System.Drawing.Size(165, 6);\n            // \n            // aboutToolStripMenuItem\n            // \n            this.aboutToolStripMenuItem.Name = \"aboutToolStripMenuItem\";\n            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.aboutToolStripMenuItem.Text = \"&About ... ...\";\n            // \n            // toolStrip\n            // \n            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripButton,\n            this.openToolStripButton,\n            this.saveToolStripButton,\n            this.toolStripSeparator1,\n            this.printToolStripButton,\n            this.printPreviewToolStripButton,\n            this.toolStripSeparator2,\n            this.helpToolStripButton});\n            this.toolStrip.Location = new System.Drawing.Point(0, 24);\n            this.toolStrip.Name = \"toolStrip\";\n            this.toolStrip.Size = new System.Drawing.Size(632, 25);\n            this.toolStrip.TabIndex = 1;\n            this.toolStrip.Text = \"ToolStrip\";\n            this.toolStrip.Visible = false;\n            // \n            // newToolStripButton\n            // \n            this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripButton.Image\")));\n            this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.newToolStripButton.Name = \"newToolStripButton\";\n            this.newToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.newToolStripButton.Text = \"New\";\n            this.newToolStripButton.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // openToolStripButton\n            // \n            this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripButton.Image\")));\n            this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.openToolStripButton.Name = \"openToolStripButton\";\n            this.openToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.openToolStripButton.Text = \"Open\";\n            this.openToolStripButton.Click += new System.EventHandler(this.OpenFile);\n            // \n            // saveToolStripButton\n            // \n            this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripButton.Image\")));\n            this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.saveToolStripButton.Name = \"saveToolStripButton\";\n            this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.saveToolStripButton.Text = \"Save\";\n            // \n            // toolStripSeparator1\n            // \n            this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n            // \n            // printToolStripButton\n            // \n            this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.printToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripButton.Image\")));\n            this.printToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printToolStripButton.Name = \"printToolStripButton\";\n            this.printToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.printToolStripButton.Text = \"Print\";\n            // \n            // printPreviewToolStripButton\n            // \n            this.printPreviewToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.printPreviewToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripButton.Image\")));\n            this.printPreviewToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printPreviewToolStripButton.Name = \"printPreviewToolStripButton\";\n            this.printPreviewToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.printPreviewToolStripButton.Text = \"Print Preview\";\n            // \n            // toolStripSeparator2\n            // \n            this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n            // \n            // helpToolStripButton\n            // \n            this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"helpToolStripButton.Image\")));\n            this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.helpToolStripButton.Name = \"helpToolStripButton\";\n            this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.helpToolStripButton.Text = \"Help\";\n            // \n            // statusStrip\n            // \n            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripStatusLabel});\n            this.statusStrip.Location = new System.Drawing.Point(0, 431);\n            this.statusStrip.Name = \"statusStrip\";\n            this.statusStrip.Size = new System.Drawing.Size(632, 22);\n            this.statusStrip.TabIndex = 2;\n            this.statusStrip.Text = \"StatusStrip\";\n            // \n            // toolStripStatusLabel\n            // \n            this.toolStripStatusLabel.Name = \"toolStripStatusLabel\";\n            this.toolStripStatusLabel.Size = new System.Drawing.Size(39, 17);\n            this.toolStripStatusLabel.Text = \"Status\";\n            // \n            // MdiParent\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            //this.ClientSize = new System.Drawing.Size(632, 453);\n            this.Controls.Add(this.statusStrip);\n            this.Controls.Add(this.toolStrip);\n            this.Controls.Add(this.menuStrip);\n            this.IsMdiContainer = true;\n            this.MainMenuStrip = this.menuStrip;\n            this.Name = \"MdiParent\";\n            this.Size = new System.Drawing.Size(1472,1046);\n            this.Text = \"HexgridExampleWinforms\";\n            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MdiParent_FormClosing);\n            this.menuStrip.ResumeLayout(false);\n            this.menuStrip.PerformLayout();\n            this.toolStrip.ResumeLayout(false);\n            this.toolStrip.PerformLayout();\n            this.statusStrip.ResumeLayout(false);\n            this.statusStrip.PerformLayout();\n            this.statusStrip.Visible = statusBarToolStripMenuItem.Checked;\n            this.ResumeLayout(false);\n            this.PerformLayout();\n\n    }\n    #endregion\n\n\n        private System.Windows.Forms.MenuStrip menuStrip;\n        private System.Windows.Forms.ToolStrip toolStrip;\n        private System.Windows.Forms.StatusStrip statusStrip;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;\n        private System.Windows.Forms.ToolStripMenuItem printSetupToolStripMenuItem;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;\n        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;\n        private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem tileHorizontalToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem fileMenu;\n        private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem editMenu;\n        private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem viewMenu;\n        private System.Windows.Forms.ToolStripMenuItem toolBarToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem statusBarToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem toolsMenu;\n        private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem windowsMenu;\n        private System.Windows.Forms.ToolStripMenuItem newWindowToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem cascadeToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem tileVerticalToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem closeAllToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem arrangeIconsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem helpMenu;\n        private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;\n        private System.Windows.Forms.ToolStripButton newToolStripButton;\n        private System.Windows.Forms.ToolStripButton openToolStripButton;\n        private System.Windows.Forms.ToolStripButton saveToolStripButton;\n        private System.Windows.Forms.ToolStripButton printToolStripButton;\n        private System.Windows.Forms.ToolStripButton printPreviewToolStripButton;\n        private System.Windows.Forms.ToolStripButton helpToolStripButton;\n        private System.Windows.Forms.ToolTip toolTip;\n    }\n}\n\n\n\n"
  },
  {
    "path": "HexgridExampleWinforms/MDIParent.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.Example;\n\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    /// <summary>TODO</summary>\n    public partial class MdiParent : Form {\n        private int childFormNumber = 0;\n\n        private static string FileExtensionMask = Properties.Resources.FileExtensionMask;\n\n        /// <summary>TODO</summary>\n        public MdiParent() {\n            InitializeComponent();\n\n            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n            SetStyle(ControlStyles.Opaque, true);\n            CreateDefaultChildren();\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void CreateDefaultChildren() {\n            ShowChild(new HexgridBufferedPanelExample());\n//            ShowChild(new HexgridPanelExample());\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void ShowChild(Form child) {\n            child.MdiParent = this;\n            child.WindowState = FormWindowState.Maximized;\n            components.Add(child);\n            child.Show();\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void ShowNewForm(object sender, EventArgs e) {\n            var child = new Form();\n            child.MdiParent = this;\n            child.Text = \"Window \" + childFormNumber++;\n            components.Add(child);\n            child.Show();\n        }\n\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n        private void OpenFile(object sender, EventArgs e) {\n            using(var openFileDialog = new OpenFileDialog()) {\n                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n                openFileDialog.Filter = FileExtensionMask;\n                if (openFileDialog.ShowDialog(this) == DialogResult.OK) {\n                    string FileName = openFileDialog.FileName;\n                }\n            }\n        }\n\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) {\n            using(var saveFileDialog = new SaveFileDialog()) {\n                saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n                saveFileDialog.Filter = FileExtensionMask;\n                if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {\n                    string FileName = saveFileDialog.FileName;\n                }\n            }\n        }\n\n        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e) => this.Close();\n\n        private void CutToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void CopyToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void PasteToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  toolStrip.Visible = toolBarToolStripMenuItem.Checked;\n\n        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  statusStrip.Visible = statusBarToolStripMenuItem.Checked;\n\n        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.Cascade);\n\n        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.TileVertical);\n\n        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.TileHorizontal);\n\n        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.ArrangeIcons);\n\n        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) {\n            foreach (var childForm in MdiChildren) { childForm.Close(); }\n        }\n\n        private void MdiParent_FormClosing(object sender, FormClosingEventArgs e) {\n            foreach (var child in MdiChildren) { child.Hide(); child?.Close(); }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/MDIParent.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"menuStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"newToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"undoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGmSURBVDhPvZHdS5MBFMb3p3TX6E7c1BTHUIc2xUbEqGUz\n        LaV5s6ViRvhuul0M9lFshFjmjV/bKLVajRAid6N3KYg3FkHDiWvNmXt3++udDiMd4nthD5ybc57nx+Ec\n        xbkqGM0TfCcysSgyuyQSlioSFymOT5d/QaRQnjmR4VAO+1SOlx8PASUhnkiKmZXDQSH05E2erkCGBtsK\n        NV0xKu9EaRz8xlisBKDQGJ7aYeKziD0k8vRtHrN3G51tGc39RdS3X9Fgfc/l9lmM7gzTkq8Y/au+sW16\n        nu/zYDzHTe8e1XejVHUsSOHwgdkwFKPsxiS6h5s4pnMnAZ3+JM0jaW759hkYT6NsDqBqCx0ZL2gFND1x\n        dANfcYRLAK45t6jo+86VkdTBJh3eHwiTv/4FWOLohSTOUoC6wQTa3g2qLcuo2j9QZnqNsuXZkbHCPE+t\n        ZQmD6ye20cRJwHEdv/RFfUBaf5Pu4C4+6b3F9tlVde8T191ZjMIXeWGzfxetdZWrriytj9a5ZHghD9D0\n        OCGFf9PUv0a5KSJ/dZP01vr+DdRtc/LD/0EKxR+XdBDBXAMPDQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"redoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGVSURBVDhPzZHdK0NhHMf3p7jBknbBNpqbc+FtttrUrBim\n        LEJeRo0lzMsK2S6M5D3vJjXFJinhZu64WolQu9FaXjrnuf56nrOl5kTIhW99L56e7/dzfuf3yP5MO+cE\n        /jOCLeqlY4KJgADnioDk9ddiZebFI4KBdQGD2wLcOwJ6VimEOhn7XKw8e0hQ4nxAXt0BNLYQuNYwbD4e\n        9gUB9sUEZPOCgOuMSIEbpwTm0SeoLcsobAtAVbMrWm3dRz2FNM7yaKGQJZoraAqL0yarCbk2BBR13yKz\n        bALGvkPxUlXjR65lC9nGeVSMvYqTNM/xUFqD0glcfga4Q4bWizSu/z2grN6GXDcJx0IcFg8P3VAcioo1\n        KWCYAnQDjzTsSwFMBQmY2Ze1QzGou+4h109LAR0zUZS748ip3E0BsIVp6D8rrSEoTOtiOb14XArw7BE0\n        +J5R5Lihe5hMCUgW9pnM/Zcwjb4g33byvcJHZdFtG3ojMIy8gGu/Qq33+ecgBtE7r2F08yjtjf5uEiad\n        K4Yq+mzJ47+WTPYGxTcHtykTmrAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"cutToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGhSURBVDhPYyAG/AcCKJMwWLlp///ZyzbBNYA033nw9H91\n        6xTiDJk8d83/nmmL/1e1zgRr+Pb9x//Vm/b8T8mpIt4Vk2av/D95zmqQ5f+fvXjzPy2/5r+YEB8J3ti4\n        73/X5IX/T5y5+P/gsXP/w+KzSTNg4aod/7unLPrfO23h//LGvv8+QdHEawaBzokL/5c09P1Pzqv7Hxqb\n        +d/NO4g0A0AgIa/lf1hC4f+QtLb//gktxBsQ3fHuf0Tn6/8hzQ/+e5ed+u9Tfva/X9Xl/z6lp/+7Ze/E\n        b1BE+6v/kT3v/gc33PlvHT3vv2lQ33+3vH3//auv/ncFaraKmY/fgLD25//D2p7+d0zbANZsGtT737vk\n        1H//yqv/nTI2/TcJ7sdvQGjLo/9Bjff+O6Vu+m8c0A02IABou2/F2f8WEdP+aztk4TcguOnef/+yS//t\n        ktf8N/SBBJx3yfH/dkmr/mvaJP+XkdfEb4Bf5cX/9kmrgbZ3/Vc3CwcnHvuUNf+1rBP+q5tH/Df2b8dv\n        gHPGlv9mIZP+a1jF/jf0qsGvmDqAgQEAkYXpGFtqYpEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"copyToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHgSURBVDhPvZHdS1pxGMfPn7IKieq63Y/RKw0aFF1ssEEv\n        dOVFXXUVFQ3Wlg4H2dSo7A21jnUiKiPFylwttMy9GXMNNgUrzinLrGN98zxaVgu7GOwLn5vf+X0/D8/v\n        MP8cbuEbJFiblzDMuDDAfcQbLYfklfSRyrejn3CirnUID0tr7peYrd5kLZHY2Tm6hudgcXjxrEF5v8Qw\n        66aixQew64DHL+C9fhrskgDTAg+jnUffLA/V+B7xojNwUzjAOUkg5eQ0BuEgikAoTILbaR/ZQX6tg0jW\n        GUZnstPHXscpFDMCWtg/aOz3Y3h+l86vp0ETArciIK9qgiCBOr6vtPdRRMQOH8F2YB9f/LvQTQWp1MHG\n        CM/WPl4qgsitmkROxSiyywcTAmnf46h4NVmu86Fe/RnvjNskuIxwKGLr9zEcmwfQsGuQPelJCYRwFF9/\n        huD+HoDT8wu2Tz/Q2pv4vc0jYcjVQTx/68PTtg1Cw65CVtqdEuSXVP9Fo2qDBGJ8vRAvYtN/BKtLgHlx\n        Dx9GncgqUqUe8q7UtK+Q4PrkS7pNy8gsUKQXVDbZETk5g27cBa15DZqxVZosldWGJWQ8fp1eUCS3xF/b\n        SGSX6yEr0yKruAuZhcp4uQMPHr1KL/hPYZgL78LfVeQiZg4AAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"pasteToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJXSURBVDhPtZJdSFNhHMYPdGE3RR/UVVcF0U0UEVQXGYWt\n        sNlikdii5SK2SckmS9tGas0cunRzadoW+THUprMSpUnREBqOvmdsRh8SOSPXsnY2N+eyeDrn3UaujCDo\n        gYcD73mf3/+Dl/ovcvZr4bihQW+LCrL8fUgez6+edgPmuqX2CIL+DkT8V+EbqUGJmANDpQKXdWoYK4uJ\n        k9GE2FCMtiEe6kYs2AlLkwLRyTaUSHh4MaTE2VNcKEWb4Xcew6R9NWTC/b8D2HA8ZEWj9ijcrhrQ7+sx\n        MaLGW9dx9Jl5kAgy0VG6Ck8NFAoO/zJSd1ttAkBfh65UiHJFHtSFuThTwIdCzINcxIVUkIU62RoCyMvO\n        TAd0NuswQ3dhJmBCdLwKgeeF8LYtJ/a0LoO7aREeGTNImHXWto3pAItJi+lAC6bHKhB9eRKRZwdB9y+G\n        vtWOKlMvzl3qglJngVxjhkRlhLCoOh3Q3KDBlM+IyIgYU4+5CN/fhI+3VpBwSvHZbwiGYhibCCJXeh45\n        +eqfELO+DPSrCoQfchAeXI/QwEr4WilSmVXzTSexyeqAZ9RPwneHvNjDFyUgDdUqfB4+jZBjHejbSxGw\n        ZWD0GkXa/jr7HV/CTOUPQXje+OEafodsgRwcJrxr7wFkbt8Bqu5CMQIPpEx4CT71LMR4+wJ4GynImJnZ\n        tlMdXGE6qLcMoG/QS76st25YC+pieRF5IKktpyxmFja38j3XaxK23XHDan+SDtCXnWBeGA8i/m7k7NxC\n        frDbZmdOVZvPBPAnHWK2zV74m5PX/1UU9QOTNfjZ1V1+MwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"indexToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"searchToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALGSURBVDhPldL/T01xHMfx/hczs8VmmC/zg1i7oa6pOXVL\n        Jbrqlm5fbrluSqV7uynpdq/qtoh7C9Ei3eu0fBnKl6yFmSRkWF93VUZ2Q/Z0P2OuxmZe2/ntvB/nfD7v\n        V8Dvya2UEY+hwk2+VcZY28n+Cheph86jKWzm52t/T15VBwdtMs6ubq6+7EMe7sA5VESGnIRkOklirhN1\n        XuPfkQMWGZNDprX/Mg8+PGFgdpScthIsL/JJuaRkg7mcGFMP0YYGEvQn5iN68bs2N3W9VjrGHdyc6qVv\n        pp8Br4eWERdJdjMK+1PW2NpYW6NGyqxkR1atHxFAsVPG/rCcmiE9jrc2nMNmah87ST3TgqZukpiK1yw9\n        G8Hi06GsN6YTlVblB7LL2qlzv8EkW9h7fyuZvWHoHAZymnzHOn4Rk7UBQ3kl8dYUAqsVBJaFE6Ep9wMZ\n        5jbqr8xSWF+P8qyCLXI06lor1Y0urnXdZszzjrfjHpoutBOXp2VBSQjKRJMf0Bpbsbq9HGjyEG9QE1q/\n        G11TMZ03uhD5Ogcfvd8YnZrD1nCeddoINscX+IG9h1rIrHmF9vhnNNYhwnO1vnUeYWTC82t4/P1XBke+\n        4Op+RkRcLMHRBj+QUnSO1NJbJB77RIJlimjjHfaXmhiemPwxPD3nG/5Mz6CXutYetkmRBEk6PyAaJkqy\n        q+QBqsPjKIp6kYw62jtvMDbt+/LoF+4993K5b4Y0fQFh0k6K87P9gIhoWJzeSdTBOyzNNrNMF0uyLosT\n        zW7augewX+ghbV8BkartNFtiabenU2XKmY+IhqnSq9mUYSVYnYpSY0ZKLkTasYtwSUVM5DZsuo2MnVLw\n        7W4CjqNZfyKiYaIkYs9iVeK2xYWJM8cog0kOW8GjgpUM24OYdEWyL2nrfOBfEUBS6HKu61ezJ2QJqtBV\n        /weICGTdskWErF3oGw4I+A4LpgTtu1iCBgAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"toolStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>125, 17</value>\n  </metadata>\n  <data name=\"newToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"helpToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"statusStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>223, 17</value>\n  </metadata>\n  <metadata name=\"toolTip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>332, 17</value>\n  </metadata>\n  <metadata name=\"$this.TrayHeight\" type=\"System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>51</value>\n  </metadata>\n</root>"
  },
  {
    "path": "HexgridExampleWinforms/MapModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nusing PGNapoleonics.HexgridPanel;\n\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    using HexSize = System.Drawing.Size;\n\n    public abstract class MapModel : MapDisplayBlocked<Hex> {\n        protected MapModel( HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex, IMapViewModel viewModel)\n        : base(sizeHexes, gridSize, initializeHex){\n            ViewModel = ViewModel;\n            AttachViewModel();\n        }\n\n        IMapViewModel ViewModel { get; }\n\n        void AttachViewModel() {\n            ViewModel.GoalHexChanged            += GoalHexChanged;\n            ViewModel.StartHexChanged           += StartHexChange;\n            ViewModel.HotSpotHexChanged         += HotSpotHexChange;\n\n            //ViewModel.TransposeMapToggled       += TransposeMapToggled;\n            ViewModel.ShowRangeLineToggled      += ShowRangeLineToggled;\n            ViewModel.ShowPathArrowToggled      += ShowPathArrowToggled;\n            ViewModel.ShowFieldOfViewToggled    += ShowFieldOfViewToggled;\n\n            ViewModel.LandmarkSelected          += LandmarkSelected;\n\n            ViewModel.MouseMoved                += MouseMoved;\n        }\n\n        void GoalHexChanged(object sender, HexEventArgs e)   => RefreshAfter(()=>{GoalHex = e.Coords;});\n        void StartHexChange(object sender, HexEventArgs e)   => RefreshAfter(()=>{StartHex = e.Coords;});\n        void HotSpotHexChange(object sender, HexEventArgs e) => RefreshAfter(()=>{HotspotHex = e.Coords;});\n\n        //void TransposeMapToggled(object sender, bool isChecked)  => ViewModel.IsTransposed = isChecked;\n        void ShowRangeLineToggled(object sender, bool isChecked) { }\n        void ShowPathArrowToggled(object sender, bool isChecked) { }\n        void ShowFieldOfViewToggled(object sender, bool isChecked) { }\n\n        void LandmarkSelected(object sender, int value) { }\n\n        void MouseMoved(object sender, MouseEventArgs value) { }\n\n        void RefreshAfter(Action action) { action?.Invoke(); ViewModel.Refresh(); }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/MapViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexgridPanel;\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    public class MapViewModel : IMapViewModel {\n        public MapViewModel(IMapView view) {\n            View = view;\n            AttachView();\n        }\n\n        public event EventHandler<HexEventArgs> GoalHexChanged;\n        public event EventHandler<HexEventArgs> StartHexChanged;\n        public event EventHandler<HexEventArgs> HotSpotHexChanged;\n\n        public event EventHandler<bool> TransposeMapToggled;\n        public event EventHandler<bool> ShowRangeLineToggled;\n        public event EventHandler<bool> ShowPathArrowToggled;\n        public event EventHandler<bool> ShowFieldOfViewToggled;\n\n        public event EventHandler<int> LandmarkSelected;\n\n        public event EventHandler<MouseEventArgs> MouseMoved;\n\n        public void SetLandmarkMenu(ILandmarkCollection landmarks){ }\n\n        public bool IsTransposed { get; set; }\n\n        public void Refresh()=> View.Refresh();\n\n        IMapView View { get; }\n\n        void AttachView() {\n            View.GoalHexChanged             += OnGoalHexChanged;\n            View.StartHexChanged            += OnStartHexChanged;\n            View.HotSpotHexChanged          += OnHotSpotHexChanged;\n\n            View.TransposeMapToggled       += OnTransposeMapToggled;\n            View.ShowRangeLineToggled      += OnShowRangeLineToggled;\n            View.ShowPathArrowToggled      += OnShowPathArrowToggled;\n            View.ShowFieldOfViewToggled    += OnShowFieldOfViewToggled;\n\n            View.LandmarkSelected          += OnLandmarkSelected;\n\n            View.MouseMoved                += OnMouseMoved;\n        }\n\n        void OnGoalHexChanged(object sender, HexEventArgs e)    => RefreshAfter(()=>{GoalHexChanged?.Invoke(sender,e);});\n        void OnStartHexChanged(object sender, HexEventArgs e)   => RefreshAfter(()=>{StartHexChanged?.Invoke(sender,e);});\n        void OnHotSpotHexChanged(object sender, HexEventArgs e) => RefreshAfter(()=>{HotSpotHexChanged?.Invoke(sender,e);});\n\n        void OnTransposeMapToggled(object sender, bool isChecked)  => View.IsTransposed = isChecked;\n        void OnShowRangeLineToggled(object sender, bool isChecked) { }\n        void OnShowPathArrowToggled(object sender, bool isChecked) { }\n        void OnShowFieldOfViewToggled(object sender, bool isChecked) { }\n\n        void OnLandmarkSelected(object sender, int value) { }\n\n        void OnMouseMoved(object sender, MouseEventArgs value) { }\n\n        void RefreshAfter(Action action) { action?.Invoke(); View.Refresh(); }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridScrollable.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(vector=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n   [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", \n      MessageId = \"0\", Justification=\"Research suggests the Code Analysis message is incorrect.\")] \n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\n#pragma warning disable 1587\n/// <summary>Example usage of <see cref=\"HexUtilities\"/> with <see cref=\"HexUtilities.HexgridPanel\"/> \n/// in a simple <see cref=\"WinForms\"/> application.</summary>\n#pragma warning restore 1587\n[assembly:CLSCompliant(true)]\nnamespace PGNapoleonics.HexgridExampleWinforms {\n    static class Program {\n        /// <summary>The main entry point for the application.</summary>\n        [STAThread]\n        static void Main()      {\n            Application.EnableVisualStyles();\n            Application.SetCompatibleTextRenderingDefault(false);\n            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;\n\n            Application.Run(new MdiParent());\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\nusing System.Resources;\n\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinforms\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinforms\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4a8c8786-a6f8-4d6e-829a-9fea0edb6a23\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\n\n"
  },
  {
    "path": "HexgridExampleWinforms/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWinforms.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleWinforms.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Text Files (*.txt)|*.txt|All Files (*.*)|*.*.\n        /// </summary>\n        internal static string FileExtensionMask {\n            get {\n                return ResourceManager.GetString(\"FileExtensionMask\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to &quot;Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}&quot;.\n        /// </summary>\n        internal static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"FileExtensionMask\" xml:space=\"preserve\">\n    <value>Text Files (*.txt)|*.txt|All Files (*.*)|*.*</value>\n  </data>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>\"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\"</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridExampleWinforms/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWinforms.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"15.9.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "HexgridExampleWinforms/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "HexgridExampleWinforms2/HexgridExampleWinforms2.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleWinforms2</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexgridExampleWinforms2</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"HexgridScrollViewer.xaml.cs\">\n      <DependentUpon>HexgridScrollViewer.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridScrollViewerViewModel.cs\" />\n    <Compile Include=\"HexgridViewModel.cs\" />\n    <Compile Include=\"IMapDisplayWpf.cs\" />\n    <Compile Include=\"MapDisplayPainter.cs\" />\n    <Compile Include=\"MDIParent.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"MDIParent.Designer.cs\">\n      <DependentUpon>MDIParent.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"TiltAwareScrollViewer.cs\" />\n    <Compile Include=\"ViewModelBase.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"HexgridScrollViewer.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"MDIParent.resx\">\n      <DependentUpon>MDIParent.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexgridExampleWinforms2/HexgridScrollViewer.xaml",
    "content": "﻿<UserControl\n   xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n   xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n   xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n   xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n   xmlns:local=\"clr-namespace:PGNapoleonics.HexgridExampleWinforms2\" \n   x:Class=\"PGNapoleonics.HexgridPanel.ScrollViewer\" \n   mc:Ignorable=\"d\" \n   d:DesignHeight=\"300\" Width=\"447\">\n   <UserControl.DataContext>\n        <local:HexgridScrollViewerViewModel/>\n   </UserControl.DataContext>\n    <local:HexgridScrollViewer HorizontalAlignment=\"Left\" Height=\"280\" Margin=\"10,10,0,0\" \n           VerticalAlignment=\"Top\" Width=\"427\" >\n        <local:HexgridScrollViewer.DataContext>\n            <local:HexgridScrollViewerViewModel/>\n      </local:HexgridScrollViewer.DataContext>\n   </local:HexgridScrollViewer>\n</UserControl>\n"
  },
  {
    "path": "HexgridExampleWinforms2/HexgridScrollViewer.xaml.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    /// <summary>Sub-class implementation of a <b>WPF</b> Scrollable with integrated <see cref=\"TransposableHexgrid\"/> support.</summary>\n    public partial class HexgridScrollViewer : Canvas { //, IHexgridHost {\n        /// <summary>Creates a new instance of HexgridScrollable.</summary>\n        public HexgridScrollViewer() : base() {\n    //      InitializeComponent();\n        }\n\n        public event EventHandler<RenderingEventArgs> Render;\n\n        protected override void OnRender(DrawingContext dc) {\n            Render?.Invoke(this, new RenderingEventArgs(dc));\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"scrollPosition\"></param>\n        public void SetScrollPosition(Point scrollPosition) {\n    //      ScrollInfo.SetHorizontalOffset(scrollPosition.X);\n    //      ScrollInfo.SetVerticalOffset(scrollPosition.Y);\n        }\n\n    //    #region Events\n    //    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    //    public event EventHandler<HexEventArgs> HotspotHexChange;\n    //    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    //    public event EventHandler<HexEventArgs> MouseAltClick;\n    //    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n    //    public event EventHandler<HexEventArgs> MouseCtlClick;\n    //    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n    //    public event EventHandler<HexEventArgs> MouseLeftClick;\n    //    /// <summary>Announces a mouse right-click. </summary>\n    //    public event EventHandler<HexEventArgs> MouseRightClick;\n    //    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    //    public event EventHandler<EventArgs>    ScaleChange;\n//    #endregion\n\n    //    #region Properties\n    //    /// <summary>Mimic WinForms ScrollPosition to simpliify conversion.</summary>\n    //    private HexPoint ScrollPosition { \n    //      get { return new HexPoint((int)HorizontalOffset,(int)VerticalOffset); } \n    //      set { ScrollInfo.SetHorizontalOffset(value.X); ScrollInfo.SetVerticalOffset(value.Y); } \n    //    }\n    //    /// <summary>Mimic WinForms ClientSize to simpliify conversion.</summary>\n    //    private HexSize  ClientSize         { get {return new HexSize((int)ViewportWidth,(int)ViewportHeight);} }\n\n    ////    /// <summary>TODO</summary>\n    //    public HexgridViewModel        DataContext       { get; set; }\n    //    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    //    public         Size            GridSizeF         { get { return DataContext.Model.GridSize.Scale(MapScale).ToSize().ToWpfSize(); } }\n    //    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    //    public         HexCoords       HotspotHex        { get { return DataContext.HotspotHex; } }\n    //    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    //    public static  bool            IsAltKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Alt); } }\n    //    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    //    public static  bool            IsCtlKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control); } }\n    //    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    //    public static  bool            IsShiftKeyDown    { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Shift); } }\n    //    /// <summary>TODO</summary>\n    //    public         bool            IsMapDirty        { \n    //      get { return _isMapDirty; }\n    //      set { \n    //        _isMapDirty = value; \n    //        if(_isMapDirty) { IsUnitsDirty = true; } \n    //      }\n    //    } bool _isMapDirty;\n    //    /// <summary>TODO</summary>\n    //    public         bool            IsUnitsDirty      { \n    //      get { return _isUnitsDirty; }\n    //      set { \n    //        _isUnitsDirty = value; \n    //        if(_isUnitsDirty) { InvalidateVisual(); }\n    //      }\n    //    } bool _isUnitsDirty;\n    //    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    //    public         bool            IsTransposed      { \n    //      get { return DataContext.IsTransposed; }\n    //      set { DataContext.IsTransposed = value;  SetScrollLimits(DataContext.Model); }\n    //    }\n    //    /// <inheritdoc/>\n    //    public         HexSize         MapSizePixels     { get { return DataContext.Model.MapSizePixels; } } // + MapMargin.Scale(2);} }\n    //    /// <summary>Current scaling factor for map display.</summary>\n    //    public         float           MapScale          { get { return DataContext.MapScale; } }\n    ////    /// <summary>MapBoard hosting this panel.</summary>\n    ////    public         IMapDisplay     Model             { get { return DataContext.Model; } }\n    //    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    //    public         HexCoords       PanelCenterHex    { \n    ////      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ); }\n    //      get { return GetHexCoords( this.PointFromScreen(new WpfPoint(ViewportWidth *0.50, ViewportHeight * 0.50)).ToHexPoint()); }\n    //    }\n    //    /// <summary>TODO</summary>\n    //    public WpfInput.ICommand       RefreshCmd        { get; private set; }\n    //    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    //    public virtual int     ScaleIndex    { \n    //      get { return _scaleIndex; }\n    //      set { var newValue = Math.Max(0, Math.Min(ScaleList.Count-1, value));\n    //            if( _scaleIndex != newValue) {\n    //              _scaleIndex = newValue;\n    ////              MapScale    = ScaleList[ScaleIndex];\n\n    //              OnScaleChange(EventArgs.Empty); \n    //            }\n    //          } \n    //    } int _scaleIndex;\n\n    //    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    //    public ReadOnlyCollection<float>     ScaleList        { get; private set; }\n    //    #endregion\n\n    //    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    //    public virtual CoordsRectangle VisibleRectangle  {\n    //      get { return GetClipInHexes( ScrollPosition.Scale(-1.0F/MapScale).ToWpfPoint(), \n    //                                         ClientSize.Scale( 1.0F/MapScale).ToWpfSize() );\n    //      }\n    //    }\n\n    //    public System.Windows.Media.Color BackColor { get; set; }\n\n    //    #region Methods\n    //    /// <summary>TODO</summary>\n    //    public         void CenterOnHex(HexCoords coords) {\n    //      ScrollPosition = ScrollPositionToCenterOnHex(coords);\n    ////      IsMapDirty = true;\n    //      InvalidateScrollInfo();\n//    }\n\n    //    /// <summary>TODO</summary>\n    //        CoordsRectangle GetClipInHexes(WpfPoint point, WpfSize size) { return DataContext.Model.GetClipInHexes(point, size); }\n    //    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    //    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    //    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    //    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    //    public    HexCoords GetHexCoords(HexPoint point) {\n    //      return DataContext.Hexgrid.GetHexCoords(point, new HexSize(ScrollPosition));\n    //    }\n    //    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    //    public virtual void SetMapDirty() { InvalidateVisual(); }\n\n    //    /// <summary>TODO</summary>\n    //    public         void SetModel(IMapDisplayWpf model) {\n    //      SetScrollLimits(DataContext.Model);   \n    //      DataContext.SetModel(model);\n    //      SetMapDirty();\n    //    }\n\n    //    /// <summary>TODO</summary>\n    //    public         void SetPanelSize() {\n    ////      if(DesignMode || !IsHandleCreated) return;\n    ////      DebugTracing.Trace(Traces.Sizing,\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n    //      SetScroll(PanelCenterHex);\n    //    }\n\n    //    /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n    //    public virtual void SetScroll(HexCoords newCenterHex) {\n    ////      if(DesignMode || !IsHandleCreated) return;\n    ////      DebugTracing.Trace(Traces.Sizing,\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n    //      SetScrollLimits(DataContext.Model);\n\n    //      CenterOnHex(newCenterHex);\n    //    }\n\n    //    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    //    public virtual void SetScrollLimits(IMapDisplayWpf model) {\n    ////      if (model == null  ||  !AutoScroll) return;\n    //      //var smallChange              = HexSize.Ceiling(model.GridSize.Scale(MapScale));\n    //      //HorizontalScroll.SmallChange = smallChange.Width;\n    //      //VerticalScroll.SmallChange   = smallChange.Height;\n\n    //      //var largeChange              = HexSize.Round(ClientSize.Scale(0.75F));\n    //      //HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n    //      //VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n    //      //var size                     = DataContext.Hexgrid.GetSize(MapSizePixels,MapScale)\n    //      //                             + Margin.Size;\n    //      //if (AutoScrollMinSize != size) {\n    //      //  AutoScrollMinSize          = size;\n    //      //  HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, Margin.Horizontal \n    //      //                             + size.Width  - ClientSize.Width));\n    //      //  VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, Margin.Vertical \n    //      //                             + size.Height - ClientSize.Height));\n    //      //  Invalidate();\n    //      //}\n    //    }\n    //    #endregion\n\n    //    #region Grid Coordinates\n    //    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    //    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    //    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    //    public HexPoint HexCenterPoint(HexCoords coordsNewULHex) {\n    //      return DataContext.Hexgrid.HexCenterPoint(coordsNewULHex);\n    //    }\n    //    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    //    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    //    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    //    protected HexPoint ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n    //      return DataContext.Hexgrid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n    //    }\n    //    #endregion\n\n    //    #region Painting\n    //    /// <inheritdoc/>\n    ////    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n    //    /// <inheritdoc/>\n    //    //protected override void OnPaint(PaintEventArgs e) {\n    //    //  if (e==null) throw new ArgumentNullException(nameof(e));\n\n    //    //  if(!IsHandleCreated) return;\n    //    //  var dc      = e.Graphics;\n    //    //  if (DesignMode) { dc.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n    //    //  dc.Clip = new Region(e.ClipRectangle);\n    //    //  if (IsTransposed) { dc.Transform = TransposeMatrix; }\n\n    //    //  var scroll = DataContext.Hexgrid.GetScrollPosition(ScrollPosition);\n    //    //  dc.TranslateTransform(scroll.X, scroll.Y);\n    //    //  dc.TranslateTransform(Margin.Left,Margin.Top);\n    //    //  dc.ScaleTransform(MapScale,MapScale);\n    //    //  TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n    //    //  var state = dc.Save();\n    //    //  RenderMap(dc);\n\n    //    //  dc.Restore(state); state = dc.Save();\n    //    //  RenderUnits(dc);\n\n    //    //  dc.Restore(state); state = dc.Save();\n    //    //  RenderHighlight(dc);\n\n    //    //  dc.Restore(state);\n    //    //}\n    //    protected override void OnRender(DrawingContext dc) {\n    //      if (dc==null) throw new ArgumentNullException(\"dc\");\n\n    ////      dc.Clip = new Region(e.ClipRectangle);\n    //      if (IsTransposed) { dc.PushTransform(TransposeMatrix); }\n    //      OnRenderDetail (dc);\n    //      if (IsTransposed) dc.Pop();\n    //    }\n    //    protected virtual void OnRenderDetail(DrawingContext dc) {\n    //      if (dc==null) throw new ArgumentNullException(\"dc\");\n\n    //      var scroll = DataContext.Hexgrid.GetScrollPosition(ScrollPosition);\n    //      dc.PushTransform(new TranslateTransform(scroll.X, scroll.Y));\n    //      dc.PushTransform(new TranslateTransform(Margin.Left,Margin.Top));\n    //      dc.PushTransform(new ScaleTransform(MapScale,MapScale));\n    ////      TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n    //      RenderMap(dc);\n    //      RenderUnits(dc);\n    //      RenderHighlight(dc);\n\n    //      dc.Pop();dc.Pop();dc.Pop();\n    //    }\n\n    //    /// <summary>TODO</summary>\n    //    protected virtual void RenderMap(DrawingContext dc) {\n    //      if (dc == null) throw new ArgumentNullException(\"dc\");\n\n    //      var rectangle = new Rect(new WpfPoint(),new Vector(ActualWidth,ActualHeight));\n    //      var brush = new SolidColorBrush(this.BackColor);\n    //      dc.DrawRectangle(brush,null, rectangle);\n    //      DataContext.Model.PaintMap(dc);\n    //    }\n    //    /// <summary>TODO</summary>\n    //    protected virtual void RenderUnits(DrawingContext dc) {\n    //      if (dc == null) throw new ArgumentNullException(\"dc\");\n    //      DataContext.Model.PaintUnits(dc);\n    //    }\n    //    /// <summary>TODO</summary>\n    //    protected virtual void RenderHighlight(DrawingContext dc) {\n    //      if (dc == null) throw new ArgumentNullException(\"dc\");\n    //      DataContext.Model.PaintHighlight(dc);\n    //    }\n\n    //    /// <summary>TODO</summary>\n    //    static protected readonly Transform TransposeMatrix = new MatrixTransform(new Matrix(0F,1F, 1F,0F, 0F,0F));\n    //    #endregion\n\n    //    private ModifierKeys ModifierKeys(object o) {\n    //      return Keyboard.Modifiers;\n    //    }\n\n    //    #region Mouse event handlers\n    //    /// <inheritdoc/>\n    //    protected virtual void OnMouseClick(MouseEventArgs e) {\n    //      if (e==null) throw new ArgumentNullException(nameof(e));\n    //      //TraceFlags.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n    //      //                                Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n    //      var coords    = GetHexCoords(Mouse.GetPosition(this).ToHexPoint());\n    //      // TODO - remap this in ViewModel\n    //      //var eventArgs = new HexEventArgs(coords, e, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n    //      //     if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n    //      //else if (e.Button == MouseButtons.Right)    this.OnMouseRightClick(eventArgs);\n    //      //else if (IsAltKeyDown  && !IsCtlKeyDown)    this.OnMouseAltClick(eventArgs);\n    //      //else if (IsCtlKeyDown)                      this.OnMouseCtlClick(eventArgs);\n    //      //else                                        this.OnMouseLeftClick(eventArgs);\n    //    }\n    //    /// <inheritdoc/>\n    //    protected override void OnMouseMove(MouseEventArgs e) {\n    //      if (e==null) throw new ArgumentNullException(nameof(e));\n    //      var coords    = GetHexCoords(Mouse.GetPosition(this).ToHexPoint());\n    //      // TODO - remap this in ViewModel\n    ////      OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n    //      base.OnMouseMove(e);\n    //    }\n\n    //    /// <summary>Raise the MouseAltClick event.</summary>\n    //    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick?.Invoke(this,e); }\n    //    /// <summary>Raise the MouseCtlClick event.</summary>\n    //    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n    //      if (e==null) throw new ArgumentNullException(nameof(e));\n    //      DataContext.Model.GoalHex = e.Coords;\n    //      MouseCtlClick?.Invoke(this,e);\n    ////      Refresh();\n    //    }\n    //    /// <summary>Raise the MouseLeftClick event.</summary>\n    //    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n    //      if (e==null) throw new ArgumentNullException(nameof(e));\n    //      DataContext.Model.StartHex = e.Coords;\n    //      MouseLeftClick?.Invoke(this,e);\n    ////      Refresh();\n    //    }\n    //    /// <summary>Raise the MouseRightClick event.</summary>\n    //    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick?.Invoke(this,e); }\n    //   /// <summary>Raise the HotspotHexChange event.</summary>\n    //    protected virtual void OnHotspotHexChange(HexEventArgs e) {\n    //      if (e==null) throw new ArgumentNullException(nameof(e));\n    //      DataContext.Model.HotspotHex = e.Coords;\n    //      HotspotHexChange?.Invoke(this,e);\n    ////      Refresh();\n    //    }\n\n    //    /// <summary>Raise the ScaleChange event.</summary>\n    //    protected virtual void OnScaleChange(EventArgs e) {\n    //      SetMapDirty();\n    //      OnRenderSizeChanged(new SizeChangedInfo(this,new WpfSize(),true,true));\n    //      InvalidateVisual();\n    //      ScaleChange?.Invoke(this, e);\n    //    }\n\n    //    /// <inheritdoc/>\n    //    protected override void OnRenderSizeChanged(SizeChangedInfo info) {\n    //      SetScrollLimits(DataContext.Model);\n    //      base.OnRenderSizeChanged(info);\n    //    }\n    //    #endregion\n\n    //    #region MouseWheel & Scroll event handlers\n    //    ///// <inheritdoc/>\n    //    //protected virtual void OnMouseWheel(MouseEventArgs e) {\n    //    //  if (e == null) throw new ArgumentNullException(nameof(e));\n    //    //  TraceFlags.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Name, e.ToString());\n\n    //    //  //if (Control.ModifierKeys.HasFlag(Keys.Control)) ScaleIndex += Math.Sign(e.Delta);\n    //    //  //else if (IsShiftKeyDown)                        base.OnMouseHWheel(e);\n    //    //  //else                                            base.OnMouseWheel(e);\n    //    //}\n\n    //    /// <summary>TODO</summary>\n    //    public void ScrollPanelVertical(bool isPage, int sign) {\n    //      ScrollPanelCommon(false, isPage, sign);\n    //    }\n    //    /// <summary>TODO</summary>\n    //    public void ScrollPanelHorizontal(bool isPage, int sign) {\n    //      ScrollPanelCommon(true, isPage, sign);\n    //    }\n    //    /// <summary>TODO</summary>\n    //    private void ScrollPanelCommon(bool  isHorizontal, bool isPage, int sign) {\n    //      if (sign == 0) return;\n    //      switch (sign) {\n    //        case -1: if(isPage) if(isHorizontal) PageLeft(); else PageUp(); else if(isHorizontal) LineLeft(); else LineUp(); break;\n    //        case +1: if(isPage) if(isHorizontal) PageRight(); else PageDown(); else if(isHorizontal) LineRight(); else LineDown(); break;\n    //        default: break;\n    //      }\n    //    }\n    //    #endregion\n\n    //    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    //    public ReadOnlyCollection<float>     Scales        { get; private set; }\n    //    public void SetScales (IList<float> scales) { Scales = new ReadOnlyCollection<float>(scales); }\n    }\n\n    public class RenderingEventArgs : RoutedEventArgs {\n        public RenderingEventArgs(DrawingContext dc) : base()\n        =>  DrawingContext = dc;\n\n        public DrawingContext DrawingContext { get; private set; }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/HexgridScrollViewerViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Storage;\n\nusing PGNapoleonics.HexgridExampleCommon;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    using HexPoint = System.Drawing.Point;\n    using HexSize = System.Drawing.Size;\n    using MapGridHex = IHex;\n\n    public class HexgridScrollViewerViewModel : ViewModelBase {\n        public HexgridScrollViewerViewModel() : base(\"HexgridExampleWinforms2 Test (WPF)\") {\n          View.Render += HexgridScrollViewer_Rendering;\n        }\n\n        #region Properties\n        public Color BackColor { get; set; }\n        /// <summary>Mimic WinForms ScrollPosition to simpliify conversion.</summary>\n        private Point ScrollPosition { \n          get => new Point(0,0); //View.HorizontalOffset,View.VerticalOffset); } \n          set => View.SetScrollPosition(value);\n        }\n        /// <summary>MapBoard hosting this panel.</summary>\n        public MapDisplay<MapGridHex> Model    { \n          get => _model;\n          set {  if (_model != null) _model.Dispose();  _model = value;  }\n        } MapDisplay<MapGridHex> _model = EmptyBoard.TheOne;\n\n        /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n        public        HexCoords HotspotHex     { get; private set; }\n\n        /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n        protected static  bool  IsAltKeyDown   => Keyboard.Modifiers.HasFlag(ModifierKeys.Alt);\n        /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n        protected static  bool  IsCtlKeyDown   => Keyboard.Modifiers.HasFlag(ModifierKeys.Control);\n        /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n        protected static  bool  IsShiftKeyDown => Keyboard.Modifiers.HasFlag(ModifierKeys.Shift);\n\n        /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n        public     bool         IsTransposed  { \n          get => Model.IsTransposed;\n          set => Model.IsTransposed = value; //SetScrollLimits(Model); }\n        }\n\n        /// <inheritdoc/>\n        public     Size         MapSizePixels { get {return MapSizePixels;} }\n\n        /// <summary>Current scaling factor for map display.</summary>\n        public     float        MapScale      { \n          get => Model.MapScale;\n          private set { Model.MapScale = value; } // SetScrollLimits(Model); } \n        }\n\n        /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n        public     HexCoords    PanelCenterHex\n          => GetHexCoords( View.PointFromScreen(new Point(View.Width*0.50, View.Height*0.50)) );\n\n        /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n        public virtual int      ScaleIndex    { \n          get => _scaleIndex;\n          set { var newValue = Math.Max(0, Math.Min(ScaleList.Count-1, value));\n                if( _scaleIndex != newValue) {\n                  _scaleIndex = newValue;\n                  MapScale    = ScaleList[ScaleIndex];\n\n    //              OnScaleChange(EventArgs.Empty); \n                }\n              } \n        } int _scaleIndex;\n\n        /// <summary>Array of supported map scales  as IList {float}.</summary>\n        public IList<float>     ScaleList        { get; private set; }\n\n        private HexgridScrollViewer View { get; set; }\n        #endregion\n  \n        #region Grid Coordinates\n        /// <inheritdoc/>\n        protected IHexgrid    Hexgrid         { get {return Model.Hexgrid;} }\n        /// <summary><c>HexCoords</c> for a selected hex.</summary>\n        /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n        /// <returns>Coordinates for a hex specified by a screen point.</returns>\n        /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n        public HexCoords GetHexCoords(Point point)\n        => Hexgrid.GetHexCoords(new HexPoint((int)point.X, (int)point.Y), \n                                new HexSize((int)ScrollPosition.X,(int)ScrollPosition.Y));\n        \n        /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n        /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        public Point HexCenterPoint(HexCoords coordsNewULHex) {\n            var point = Hexgrid.HexCenterPoint(coordsNewULHex);\n            return new Point(point.X,point.Y);\n        }\n        #endregion\n\n        #region Painting\n        /// <summary>TODO</summary>\n        /// <param name=\"dc\"></param>\n        protected void HexgridScrollViewer_Rendering(object sender, RenderingEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n\n            var dc = e.DrawingContext;\n    //        dc.Clip = new Region(e.ClipRectangle);\n            if (IsTransposed) { dc.PushTransform(TransposeMatrix); }\n            OnRenderViewDetail (dc);\n            if (IsTransposed) dc.Pop();\n            View.InvalidateVisual();\n        }\n        /// <summary>TODO</summary>\n        /// <param name=\"dc\"></param>\n        protected virtual void OnRenderViewDetail(DrawingContext dc) {\n            if (dc==null) throw new ArgumentNullException(\"dc\");\n\n            Point scroll; // = Hexgrid.GetScrollPosition(ScrollPosition);\n            if (IsTransposed) scroll = ScrollPosition; \n            else scroll = new Point(ScrollPosition.Y, ScrollPosition.X);\n            dc.PushTransform(new TranslateTransform(scroll.X, scroll.Y));\n            dc.PushTransform(new TranslateTransform(View.Margin.Left,View.Margin.Top));\n            dc.PushTransform(new ScaleTransform(MapScale,MapScale));\n            //TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n            RenderMap(dc);\n            RenderUnits(dc);\n            RenderHighlight(dc);\n\n            dc.Pop();dc.Pop();dc.Pop();\n        }\n        /// <summary>TODO</summary>\n        protected virtual void RenderMap(DrawingContext dc) {\n            if (dc == null) throw new ArgumentNullException(nameof(dc));\n\n            var rectangle = new Rect(new Point(),new Vector(View.ActualWidth,View.ActualHeight));\n            var brush = new SolidColorBrush(BackColor);\n            dc.DrawRectangle(brush,null, rectangle);\n            Model.PaintMap(dc, true, Model.BoardHexes, Model.Landmarks);\n        }\n        /// <summary>TODO</summary>\n        protected virtual void RenderUnits(DrawingContext dc) {\n            if (dc == null) throw new ArgumentNullException(nameof(dc));\n            Model.PaintUnits(dc);\n        }\n        /// <summary>TODO</summary>\n        protected virtual void RenderHighlight(DrawingContext dc) {\n            if (dc == null) throw new ArgumentNullException(nameof(dc));\n            Model.PaintHighlight(dc, Model.ShowRangeLine);\n        }\n\n        static readonly Transform TransposeMatrix = new MatrixTransform(new Matrix(0F,1F, 1F,0F, 0F,0F));\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Windows;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n  using WpfInput  = System.Windows.Input;\n\n  using HexPoint  = System.Drawing.Point;\n  using HexSize   = System.Drawing.Size;\n  using WpfPoint  = System.Windows.Point;\n  using WpfSize   = System.Windows.Size;\n\n//  /// <summary>TODO</summary>\n//  public class HexgridViewModel : IHexgridHost {\n//    /// <summary>TODO</summary>\n//    public HexgridViewModel(HexgridExampleWinforms2 viewer) {\n//      HotspotHex    = HexCoords.EmptyUser;\n\n//      Viewer        = viewer;\n\n//      Viewer.HotspotHexChange  += HotspotHexChange;\n////      Panel.MouseAltClick     += MouseAltClick;\n////      Panel.MouseCtlClick     += GoalHexChange;\n////      Panel.MouseRightClick   += MouseRightClick;\n////      Panel.ScaleChange       += ScaleChange;\n\n//      Scales        = new List<float>() {1.000F}.AsReadOnly();\n//      SetModel(new EmptyBoard());\n//      Hexgrid       = GetHexgrid();\n//    }\n\n//    HexgridExampleWinforms2 Viewer { get; set; }\n\n//    ///// <summary>Return new ScrollPosition for applied muse-wheel scroll.</summary>\n//    //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n//    //  Func<int,Point> newAutoScroll)\n//    //{\n//    //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n//    //  var steps = (delta+remainder) \n//    //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n//    //  remainder = (delta+remainder) \n//    //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n//    //  return newAutoScroll(scroll.SmallChange * steps);\n//    //}\n//    ///// <summary>TODO</summary>\n//    //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n//    //  return new ScrollEventArgs(\n//    //    ScrollEventType.ThumbTrack,\n//    //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n//    //    isHorizontal ? -newScroll.X : -newScroll.Y,\n//    //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n//    //  );\n//    //}\n\n//    /// <summary>TODO</summary>\n//    public void SetModel(IMapDisplayWpf model) {\n//      Model = model;   \n//    }\n\n//    Hexgrid GetHexgrid() { \n//      var margin          = HexSize.Empty; // Margin.OffsetSize();\n//      return IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale),margin) \n//                          : new Hexgrid(Model.GridSize.Scale(MapScale),margin);     \n//    }\n\n//    #region Properties\n//    ///// <summary>TODO</summary>\n//    //public WpfInput.ICommand RefreshCmd { \n//    //  get { return _refreshCmd; } private set {_refreshCmd = value; } \n//    //} WpfInput.ICommand _refreshCmd;\n\n//    /// <summary>MapBoard hosting this panel.</summary>\n//    public IMapDisplayWpf Model           { get; private set; }\n\n//    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n//    public HexCoords   HotspotHex      { get; set; }\n\n//    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsAltKeyDown   { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Alt); } }\n//    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsCtlKeyDown   { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Control); } }\n//    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsShiftKeyDown { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Shift); } }\n\n//    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n//    public bool        IsTransposed    { \n//      get { return _isTransposed; }\n//      set { _isTransposed = value;  \n//            Hexgrid = GetHexgrid();\n////            if (Viewer.IsHandleCreated) \n//              Viewer.SetScrollLimits(Model);   \n//          }\n//    } bool _isTransposed;\n\n//    /// <inheritdoc/>\n//    public HexSize  MapSizePixels   { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n//    /// <summary>Current scaling factor for map display.</summary>\n//    public float       MapScale      { \n//      get { return Model.MapScale; } \n//      private set { Model.MapScale = value; } \n//    }\n\n//    /// <inheritdoc/>\n//    //public Padding  Margin     { \n//    //  get { return _margin; } \n//    //  set { _margin = value; Hexgrid.Margin = new Size(_margin.Left, _margin.Top); }\n//    //} Padding _margin;\n\n//    /// <summary>TODO</summary>\n//    public    bool   IsMapDirty   { \n//      get { return _isMapDirty; }\n//      set { \n//        _isMapDirty = value; \n//        if(_isMapDirty) { IsUnitsDirty = true; } \n//      }\n//    } bool _isMapDirty;\n//    /// <summary>TODO</summary>\n//    public    bool   IsUnitsDirty { \n//      get { return _isUnitsDirty; }\n//      set { \n//        _isUnitsDirty = value; \n//        if(_isUnitsDirty) { Viewer.InvalidateVisual(); }\n//      }\n//    } bool _isUnitsDirty;\n\n//    /// <summary>Array of supported map scales  as IList {float}.</summary>\n//    public ReadOnlyCollection<float> Scales        { get; private set; }\n//    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n//    public virtual int ScaleIndex    { \n//      get { return _scaleIndex; }\n//      set { var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n//            if( _scaleIndex != newValue) {\n//              _scaleIndex = newValue;\n//              MapScale    = Scales[ScaleIndex];\n//              Hexgrid     = IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale)) \n//                                         : new Hexgrid(Model.GridSize.Scale(MapScale)); \n//              ScaleChange?.Invoke(this, EventArgs.Empty);\n//            }\n//          } \n//    } int _scaleIndex;\n//    #endregion\n\n//    /// <summary>TODO</summary>\n//    public void SetScales (IList<float> scales) {\n////      if (scales == null) throw new ArgumentNullException(\"scales\");\n//      Scales = new ReadOnlyCollection<float>(scales);\n//    }\n//    #region Events\n\n//    /// <summary>Announces that the mouse is now over a new hex.</summary>\n//    void HotspotHexChange(object sender, HexEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(nameof(e));\n//      if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n//    }\n\n////    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n////    public event EventHandler<HexEventArgs> GoalHexChange;\n////    /// <summary>Announces that the Path-Start hex has changed.</summary>\n////    public event EventHandler<HexEventArgs> StartHexChange;\n////    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n////    public event EventHandler<HexEventArgs> MouseAltClick;\n////    /// <summary>Announces a mouse right-click. </summary>\n////    public event EventHandler<HexEventArgs> MouseRightClick;\n//    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n//    public event EventHandler<EventArgs>    ScaleChange;\n//    #endregion\n\n//    #region Grid Coordinates\n//    /// <inheritdoc/>\n//    public Hexgrid    Hexgrid        { get; set; }\n//    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n//    public SizeF      GridSizeF      { get { return Model.GridSize.Scale(MapScale); } }\n\n//    //CoordsRectangle  GetClipInHexes(PointF point, SizeF size) {\n//    //  return Model.GetClipInHexes(point, size);\n//    //}\n\n//    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n//    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n//    /// <returns>Pixel coordinates in Client reference frame.</returns>\n//    public HexPoint  HexCenterPoint(HexCoords coordsNewULHex) {\n//      return Hexgrid.HexCenterPoint(coordsNewULHex);\n//    }\n//    #endregion\n//  }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/IMapDisplayWpf.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows;\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n  using HexRectF  = System.Drawing.RectangleF;\n\n  /// <summary>(Technology-dependent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplayWpf : IMapDisplay<IHex> {\n\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"point\">Upper-left corner in pixels of the clipping region.</param>\n    /// <param name=\"size\">Width and height of the clipping region in pixels.</param>\n    CoordsRectangle GetClipInHexes(Point point, Size size);\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"visibleClipBounds\">Rectangular extent in pixels of the clipping region.</param>\n    CoordsRectangle GetClipInHexes(HexRectF visibleClipBounds);\n\n    /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n    /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n    void  PaintHighlight(DrawingContext graphics);\n\n    /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n    void  PaintMap(DrawingContext graphics);\n    /// <summary>Paint the intermediate layer of the display, graphics that changes infrequently between refreshes.</summary>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    void  PaintUnits(DrawingContext graphics);\n  }\n}\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n  using HexPoint  = System.Drawing.Point;\n  using HexPointF = System.Drawing.PointF;\n  using HexSize   = System.Drawing.Size;\n  using HexSizeF  = System.Drawing.SizeF;\n\n  using WpfPoint  = System.Windows.Point;\n  using WpfSize   = System.Windows.Size;\n\n  public static partial class PointExtensions {\n    public static HexPoint ToHexPoint(this WpfPoint @this) {\n      return new HexPoint((int)@this.X, (int)@this.Y);\n    }\n    public static WpfPoint ToWpfPoint(this HexPoint @this) {\n      return new WpfPoint(@this.X, @this.Y);\n    }\n    public static WpfPoint ToWpfPoint(this HexPointF @this) {\n      return new WpfPoint(@this.X,@this.Y);\n    }\n  }\n\n  public static partial class SizeExtensions {\n    public static HexSize ToHexSize(this WpfSize @this) {\n      return new HexSize((int)@this.Width, (int)@this.Height);\n    }\n    public static WpfSize ToWpfSize(this HexSize @this) {\n      return new WpfSize(@this.Width, @this.Height);\n    }\n    public static WpfSize ToWpfSize(this HexSizeF @this) {\n      return new WpfSize(@this.Width, @this.Height);\n    }\n  }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/MDIParent.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridExampleWinforms2 {\n    partial class MdiParent {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void InitializeComponent() {\n            this.components = new System.ComponentModel.Container();\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MdiParent));\n            this.menuStrip = new System.Windows.Forms.MenuStrip();\n            this.fileMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n            this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n            this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.printSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();\n            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.editMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();\n            this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\n            this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.viewMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.statusBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.windowsMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.newWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.tileVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.tileHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.arrangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.helpMenu = new System.Windows.Forms.ToolStripMenuItem();\n            this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\n            this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStrip = new System.Windows.Forms.ToolStrip();\n            this.newToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.openToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n            this.printToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n            this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();\n            this.statusStrip = new System.Windows.Forms.StatusStrip();\n            this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();\n            this.toolTip = new System.Windows.Forms.ToolTip(this.components);\n            this.menuStrip.SuspendLayout();\n            this.toolStrip.SuspendLayout();\n            this.statusStrip.SuspendLayout();\n            this.SuspendLayout();\n            // \n            // menuStrip\n            // \n            this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.fileMenu,\n            this.editMenu,\n            this.viewMenu,\n            this.toolsMenu,\n            this.windowsMenu,\n            this.helpMenu});\n            this.menuStrip.Location = new System.Drawing.Point(0, 0);\n            this.menuStrip.MdiWindowListItem = this.windowsMenu;\n            this.menuStrip.Name = \"menuStrip\";\n            this.menuStrip.Size = new System.Drawing.Size(1457, 24);\n            this.menuStrip.TabIndex = 0;\n            this.menuStrip.Text = \"MenuStrip\";\n            // \n            // fileMenu\n            // \n            this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripMenuItem,\n            this.openToolStripMenuItem,\n            this.toolStripSeparator3,\n            this.saveToolStripMenuItem,\n            this.saveAsToolStripMenuItem,\n            this.toolStripSeparator4,\n            this.printToolStripMenuItem,\n            this.printPreviewToolStripMenuItem,\n            this.printSetupToolStripMenuItem,\n            this.toolStripSeparator5,\n            this.exitToolStripMenuItem});\n            this.fileMenu.ImageTransparentColor = System.Drawing.SystemColors.ActiveBorder;\n            this.fileMenu.Name = \"fileMenu\";\n            this.fileMenu.Size = new System.Drawing.Size(37, 20);\n            this.fileMenu.Text = \"&File\";\n            // \n            // newToolStripMenuItem\n            // \n            this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripMenuItem.Image\")));\n            this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.newToolStripMenuItem.Name = \"newToolStripMenuItem\";\n            this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));\n            this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.newToolStripMenuItem.Text = \"&New\";\n            this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // openToolStripMenuItem\n            // \n            this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripMenuItem.Image\")));\n            this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.openToolStripMenuItem.Name = \"openToolStripMenuItem\";\n            this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\n            this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.openToolStripMenuItem.Text = \"&Open\";\n            this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile);\n            // \n            // toolStripSeparator3\n            // \n            this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n            this.toolStripSeparator3.Size = new System.Drawing.Size(143, 6);\n            // \n            // saveToolStripMenuItem\n            // \n            this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripMenuItem.Image\")));\n            this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.saveToolStripMenuItem.Name = \"saveToolStripMenuItem\";\n            this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));\n            this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.saveToolStripMenuItem.Text = \"&Save\";\n            // \n            // saveAsToolStripMenuItem\n            // \n            this.saveAsToolStripMenuItem.Name = \"saveAsToolStripMenuItem\";\n            this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.saveAsToolStripMenuItem.Text = \"Save &As\";\n            this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click);\n            // \n            // toolStripSeparator4\n            // \n            this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n            this.toolStripSeparator4.Size = new System.Drawing.Size(143, 6);\n            // \n            // printToolStripMenuItem\n            // \n            this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripMenuItem.Image\")));\n            this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printToolStripMenuItem.Name = \"printToolStripMenuItem\";\n            this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));\n            this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printToolStripMenuItem.Text = \"&Print\";\n            // \n            // printPreviewToolStripMenuItem\n            // \n            this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripMenuItem.Image\")));\n            this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printPreviewToolStripMenuItem.Name = \"printPreviewToolStripMenuItem\";\n            this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printPreviewToolStripMenuItem.Text = \"Print Pre&view\";\n            // \n            // printSetupToolStripMenuItem\n            // \n            this.printSetupToolStripMenuItem.Name = \"printSetupToolStripMenuItem\";\n            this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.printSetupToolStripMenuItem.Text = \"Print Setup\";\n            // \n            // toolStripSeparator5\n            // \n            this.toolStripSeparator5.Name = \"toolStripSeparator5\";\n            this.toolStripSeparator5.Size = new System.Drawing.Size(143, 6);\n            // \n            // exitToolStripMenuItem\n            // \n            this.exitToolStripMenuItem.Name = \"exitToolStripMenuItem\";\n            this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n            this.exitToolStripMenuItem.Text = \"E&xit\";\n            this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click);\n            // \n            // editMenu\n            // \n            this.editMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.undoToolStripMenuItem,\n            this.redoToolStripMenuItem,\n            this.toolStripSeparator6,\n            this.cutToolStripMenuItem,\n            this.copyToolStripMenuItem,\n            this.pasteToolStripMenuItem,\n            this.toolStripSeparator7,\n            this.selectAllToolStripMenuItem});\n            this.editMenu.Name = \"editMenu\";\n            this.editMenu.Size = new System.Drawing.Size(39, 20);\n            this.editMenu.Text = \"&Edit\";\n            // \n            // undoToolStripMenuItem\n            // \n            this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"undoToolStripMenuItem.Image\")));\n            this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.undoToolStripMenuItem.Name = \"undoToolStripMenuItem\";\n            this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));\n            this.undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.undoToolStripMenuItem.Text = \"&Undo\";\n            // \n            // redoToolStripMenuItem\n            // \n            this.redoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"redoToolStripMenuItem.Image\")));\n            this.redoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.redoToolStripMenuItem.Name = \"redoToolStripMenuItem\";\n            this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));\n            this.redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.redoToolStripMenuItem.Text = \"&Redo\";\n            // \n            // toolStripSeparator6\n            // \n            this.toolStripSeparator6.Name = \"toolStripSeparator6\";\n            this.toolStripSeparator6.Size = new System.Drawing.Size(161, 6);\n            // \n            // cutToolStripMenuItem\n            // \n            this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"cutToolStripMenuItem.Image\")));\n            this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.cutToolStripMenuItem.Name = \"cutToolStripMenuItem\";\n            this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));\n            this.cutToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.cutToolStripMenuItem.Text = \"Cu&t\";\n            this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click);\n            // \n            // copyToolStripMenuItem\n            // \n            this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"copyToolStripMenuItem.Image\")));\n            this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.copyToolStripMenuItem.Name = \"copyToolStripMenuItem\";\n            this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));\n            this.copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.copyToolStripMenuItem.Text = \"&Copy\";\n            this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click);\n            // \n            // pasteToolStripMenuItem\n            // \n            this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"pasteToolStripMenuItem.Image\")));\n            this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.pasteToolStripMenuItem.Name = \"pasteToolStripMenuItem\";\n            this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));\n            this.pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.pasteToolStripMenuItem.Text = \"&Paste\";\n            this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click);\n            // \n            // toolStripSeparator7\n            // \n            this.toolStripSeparator7.Name = \"toolStripSeparator7\";\n            this.toolStripSeparator7.Size = new System.Drawing.Size(161, 6);\n            // \n            // selectAllToolStripMenuItem\n            // \n            this.selectAllToolStripMenuItem.Name = \"selectAllToolStripMenuItem\";\n            this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));\n            this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n            this.selectAllToolStripMenuItem.Text = \"Select &All\";\n            // \n            // viewMenu\n            // \n            this.viewMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolBarToolStripMenuItem,\n            this.statusBarToolStripMenuItem});\n            this.viewMenu.Name = \"viewMenu\";\n            this.viewMenu.Size = new System.Drawing.Size(44, 20);\n            this.viewMenu.Text = \"&View\";\n            // \n            // toolBarToolStripMenuItem\n            // \n            this.toolBarToolStripMenuItem.Checked = true;\n            this.toolBarToolStripMenuItem.CheckOnClick = true;\n            this.toolBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;\n            this.toolBarToolStripMenuItem.Name = \"toolBarToolStripMenuItem\";\n            this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(126, 22);\n            this.toolBarToolStripMenuItem.Text = \"&Toolbar\";\n            this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click);\n            // \n            // statusBarToolStripMenuItem\n            // \n            this.statusBarToolStripMenuItem.CheckOnClick = true;\n            this.statusBarToolStripMenuItem.Name = \"statusBarToolStripMenuItem\";\n            this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(126, 22);\n            this.statusBarToolStripMenuItem.Text = \"&Status Bar\";\n            this.statusBarToolStripMenuItem.Click += new System.EventHandler(this.StatusBarToolStripMenuItem_Click);\n            // \n            // toolsMenu\n            // \n            this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.optionsToolStripMenuItem});\n            this.toolsMenu.Name = \"toolsMenu\";\n            this.toolsMenu.Size = new System.Drawing.Size(47, 20);\n            this.toolsMenu.Text = \"&Tools\";\n            // \n            // optionsToolStripMenuItem\n            // \n            this.optionsToolStripMenuItem.Name = \"optionsToolStripMenuItem\";\n            this.optionsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);\n            this.optionsToolStripMenuItem.Text = \"&Options\";\n            // \n            // windowsMenu\n            // \n            this.windowsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newWindowToolStripMenuItem,\n            this.cascadeToolStripMenuItem,\n            this.tileVerticalToolStripMenuItem,\n            this.tileHorizontalToolStripMenuItem,\n            this.closeAllToolStripMenuItem,\n            this.arrangeIconsToolStripMenuItem});\n            this.windowsMenu.Name = \"windowsMenu\";\n            this.windowsMenu.Size = new System.Drawing.Size(68, 20);\n            this.windowsMenu.Text = \"&Windows\";\n            // \n            // newWindowToolStripMenuItem\n            // \n            this.newWindowToolStripMenuItem.Name = \"newWindowToolStripMenuItem\";\n            this.newWindowToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.newWindowToolStripMenuItem.Text = \"&New Window\";\n            this.newWindowToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // cascadeToolStripMenuItem\n            // \n            this.cascadeToolStripMenuItem.Name = \"cascadeToolStripMenuItem\";\n            this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.cascadeToolStripMenuItem.Text = \"&Cascade\";\n            this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.CascadeToolStripMenuItem_Click);\n            // \n            // tileVerticalToolStripMenuItem\n            // \n            this.tileVerticalToolStripMenuItem.Name = \"tileVerticalToolStripMenuItem\";\n            this.tileVerticalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.tileVerticalToolStripMenuItem.Text = \"Tile &Vertical\";\n            this.tileVerticalToolStripMenuItem.Click += new System.EventHandler(this.TileVerticalToolStripMenuItem_Click);\n            // \n            // tileHorizontalToolStripMenuItem\n            // \n            this.tileHorizontalToolStripMenuItem.Name = \"tileHorizontalToolStripMenuItem\";\n            this.tileHorizontalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.tileHorizontalToolStripMenuItem.Text = \"Tile &Horizontal\";\n            this.tileHorizontalToolStripMenuItem.Click += new System.EventHandler(this.TileHorizontalToolStripMenuItem_Click);\n            // \n            // closeAllToolStripMenuItem\n            // \n            this.closeAllToolStripMenuItem.Name = \"closeAllToolStripMenuItem\";\n            this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.closeAllToolStripMenuItem.Text = \"C&lose All\";\n            this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.CloseAllToolStripMenuItem_Click);\n            // \n            // arrangeIconsToolStripMenuItem\n            // \n            this.arrangeIconsToolStripMenuItem.Name = \"arrangeIconsToolStripMenuItem\";\n            this.arrangeIconsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n            this.arrangeIconsToolStripMenuItem.Text = \"&Arrange Icons\";\n            this.arrangeIconsToolStripMenuItem.Click += new System.EventHandler(this.ArrangeIconsToolStripMenuItem_Click);\n            // \n            // helpMenu\n            // \n            this.helpMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.contentsToolStripMenuItem,\n            this.indexToolStripMenuItem,\n            this.searchToolStripMenuItem,\n            this.toolStripSeparator8,\n            this.aboutToolStripMenuItem});\n            this.helpMenu.Name = \"helpMenu\";\n            this.helpMenu.Size = new System.Drawing.Size(44, 20);\n            this.helpMenu.Text = \"&Help\";\n            // \n            // contentsToolStripMenuItem\n            // \n            this.contentsToolStripMenuItem.Name = \"contentsToolStripMenuItem\";\n            this.contentsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1)));\n            this.contentsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.contentsToolStripMenuItem.Text = \"&Contents\";\n            // \n            // indexToolStripMenuItem\n            // \n            this.indexToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"indexToolStripMenuItem.Image\")));\n            this.indexToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.indexToolStripMenuItem.Name = \"indexToolStripMenuItem\";\n            this.indexToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.indexToolStripMenuItem.Text = \"&Index\";\n            // \n            // searchToolStripMenuItem\n            // \n            this.searchToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"searchToolStripMenuItem.Image\")));\n            this.searchToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n            this.searchToolStripMenuItem.Name = \"searchToolStripMenuItem\";\n            this.searchToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.searchToolStripMenuItem.Text = \"&Search\";\n            // \n            // toolStripSeparator8\n            // \n            this.toolStripSeparator8.Name = \"toolStripSeparator8\";\n            this.toolStripSeparator8.Size = new System.Drawing.Size(165, 6);\n            // \n            // aboutToolStripMenuItem\n            // \n            this.aboutToolStripMenuItem.Name = \"aboutToolStripMenuItem\";\n            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n            this.aboutToolStripMenuItem.Text = \"&About ... ...\";\n            // \n            // toolStrip\n            // \n            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripButton,\n            this.openToolStripButton,\n            this.saveToolStripButton,\n            this.toolStripSeparator1,\n            this.printToolStripButton,\n            this.printPreviewToolStripButton,\n            this.toolStripSeparator2,\n            this.helpToolStripButton});\n            this.toolStrip.Location = new System.Drawing.Point(0, 24);\n            this.toolStrip.Name = \"toolStrip\";\n            this.toolStrip.Size = new System.Drawing.Size(1457, 25);\n            this.toolStrip.TabIndex = 1;\n            this.toolStrip.Text = \"ToolStrip\";\n            // \n            // newToolStripButton\n            // \n            this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripButton.Image\")));\n            this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.newToolStripButton.Name = \"newToolStripButton\";\n            this.newToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.newToolStripButton.Text = \"New\";\n            this.newToolStripButton.Click += new System.EventHandler(this.ShowNewForm);\n            // \n            // openToolStripButton\n            // \n            this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripButton.Image\")));\n            this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.openToolStripButton.Name = \"openToolStripButton\";\n            this.openToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.openToolStripButton.Text = \"Open\";\n            this.openToolStripButton.Click += new System.EventHandler(this.OpenFile);\n            // \n            // saveToolStripButton\n            // \n            this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripButton.Image\")));\n            this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.saveToolStripButton.Name = \"saveToolStripButton\";\n            this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.saveToolStripButton.Text = \"Save\";\n            // \n            // toolStripSeparator1\n            // \n            this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n            // \n            // printToolStripButton\n            // \n            this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.printToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripButton.Image\")));\n            this.printToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printToolStripButton.Name = \"printToolStripButton\";\n            this.printToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.printToolStripButton.Text = \"Print\";\n            // \n            // printPreviewToolStripButton\n            // \n            this.printPreviewToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.printPreviewToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripButton.Image\")));\n            this.printPreviewToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.printPreviewToolStripButton.Name = \"printPreviewToolStripButton\";\n            this.printPreviewToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.printPreviewToolStripButton.Text = \"Print Preview\";\n            // \n            // toolStripSeparator2\n            // \n            this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n            // \n            // helpToolStripButton\n            // \n            this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n            this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"helpToolStripButton.Image\")));\n            this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n            this.helpToolStripButton.Name = \"helpToolStripButton\";\n            this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);\n            this.helpToolStripButton.Text = \"Help\";\n            // \n            // statusStrip\n            // \n            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripStatusLabel});\n            this.statusStrip.Location = new System.Drawing.Point(0, 1011);\n            this.statusStrip.Name = \"statusStrip\";\n            this.statusStrip.Size = new System.Drawing.Size(1457, 22);\n            this.statusStrip.TabIndex = 2;\n            this.statusStrip.Text = \"StatusStrip\";\n            this.statusStrip.Visible = statusBarToolStripMenuItem.Checked;\n            // \n            // toolStripStatusLabel\n            // \n            this.toolStripStatusLabel.Name = \"toolStripStatusLabel\";\n            this.toolStripStatusLabel.Size = new System.Drawing.Size(39, 17);\n            this.toolStripStatusLabel.Text = \"Status\";\n            // \n            // MdiParent\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(1457, 1033);\n            this.Controls.Add(this.statusStrip);\n            this.Controls.Add(this.toolStrip);\n            this.Controls.Add(this.menuStrip);\n            this.IsMdiContainer = true;\n            this.MainMenuStrip = this.menuStrip;\n            this.Name = \"MdiParent\";\n            this.Text = \"HexgridExampleWinforms2\";\n            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MdiParent_FormClosing);\n            this.menuStrip.ResumeLayout(false);\n            this.menuStrip.PerformLayout();\n            this.toolStrip.ResumeLayout(false);\n            this.toolStrip.PerformLayout();\n            this.statusStrip.ResumeLayout(false);\n            this.statusStrip.PerformLayout();\n            this.ResumeLayout(false);\n            this.PerformLayout();\n\n        }\n        #endregion\n\n\n        private System.Windows.Forms.MenuStrip menuStrip;\n        private System.Windows.Forms.ToolStrip toolStrip;\n        private System.Windows.Forms.StatusStrip statusStrip;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;\n        private System.Windows.Forms.ToolStripMenuItem printSetupToolStripMenuItem;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;\n        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;\n        private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem tileHorizontalToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem fileMenu;\n        private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem editMenu;\n        private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem viewMenu;\n        private System.Windows.Forms.ToolStripMenuItem toolBarToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem statusBarToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem toolsMenu;\n        private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem windowsMenu;\n        private System.Windows.Forms.ToolStripMenuItem newWindowToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem cascadeToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem tileVerticalToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem closeAllToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem arrangeIconsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem helpMenu;\n        private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;\n        private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;\n        private System.Windows.Forms.ToolStripButton newToolStripButton;\n        private System.Windows.Forms.ToolStripButton openToolStripButton;\n        private System.Windows.Forms.ToolStripButton saveToolStripButton;\n        private System.Windows.Forms.ToolStripButton printToolStripButton;\n        private System.Windows.Forms.ToolStripButton printPreviewToolStripButton;\n        private System.Windows.Forms.ToolStripButton helpToolStripButton;\n        private System.Windows.Forms.ToolTip toolTip;\n    }\n}\n\n\n\n"
  },
  {
    "path": "HexgridExampleWinforms2/MDIParent.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.Example;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    /// <summary>TODO</summary>\n    public partial class MdiParent : Form {\n        private int childFormNumber = 0;\n\n        private static string FileExtensionMask = Properties.Resources.FileExtensionMask;\n\n        /// <summary>TODO</summary>\n        public MdiParent() {\n            InitializeComponent();\n\n            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n            SetStyle(ControlStyles.Opaque, true);\n            CreateDefaultChildren();\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void CreateDefaultChildren() {\n            ShowChild (new HexgridBufferedPanelExample());\n            ShowChild (new HexgridPanelExample());\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void ShowChild(Form child) {\n            child.MdiParent = this;\n            child.WindowState = FormWindowState.Maximized;\n            components.Add(child);\n            child.Show();\n        }\n\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void ShowNewForm(object sender, EventArgs e) {\n            var child = new Form();\n            child.MdiParent = this;\n            child.Text = \"Window \" + childFormNumber++;\n            components.Add(child);\n            child.Show();\n        }\n\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n        private void OpenFile(object sender, EventArgs e) {\n            using(var openFileDialog = new OpenFileDialog()) {\n                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n                openFileDialog.Filter = FileExtensionMask;\n                if (openFileDialog.ShowDialog(this) == DialogResult.OK) {\n                    string FileName = openFileDialog.FileName;\n                }\n            }\n        }\n\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) {\n            using(var saveFileDialog = new SaveFileDialog()) {\n                saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n                saveFileDialog.Filter = FileExtensionMask;\n                if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {\n                    string FileName = saveFileDialog.FileName;\n                }\n            }\n        }\n\n        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e) => Close();\n\n        private void CutToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void CopyToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void PasteToolStripMenuItem_Click(object sender, EventArgs e) { }\n\n        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  toolStrip.Visible = toolBarToolStripMenuItem.Checked;\n\n        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  statusStrip.Visible = statusBarToolStripMenuItem.Checked;\n\n        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.Cascade);\n\n        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.TileVertical);\n\n        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.TileHorizontal);\n\n        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)\n        =>  LayoutMdi(MdiLayout.ArrangeIcons);\n\n        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) {\n            foreach (var childForm in MdiChildren) { childForm.Close(); }\n        }\n\n        private void MdiParent_FormClosing(object sender, FormClosingEventArgs e) {\n            foreach (var child in this.MdiChildren) { child.Hide(); if (child!=null) child.Close(); }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/MDIParent.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"menuStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"newToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"undoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGmSURBVDhPvZHdS5MBFMb3p3TX6E7c1BTHUIc2xUbEqGUz\n        LaV5s6ViRvhuul0M9lFshFjmjV/bKLVajRAid6N3KYg3FkHDiWvNmXt3++udDiMd4nthD5ybc57nx+Ec\n        xbkqGM0TfCcysSgyuyQSlioSFymOT5d/QaRQnjmR4VAO+1SOlx8PASUhnkiKmZXDQSH05E2erkCGBtsK\n        NV0xKu9EaRz8xlisBKDQGJ7aYeKziD0k8vRtHrN3G51tGc39RdS3X9Fgfc/l9lmM7gzTkq8Y/au+sW16\n        nu/zYDzHTe8e1XejVHUsSOHwgdkwFKPsxiS6h5s4pnMnAZ3+JM0jaW759hkYT6NsDqBqCx0ZL2gFND1x\n        dANfcYRLAK45t6jo+86VkdTBJh3eHwiTv/4FWOLohSTOUoC6wQTa3g2qLcuo2j9QZnqNsuXZkbHCPE+t\n        ZQmD6ye20cRJwHEdv/RFfUBaf5Pu4C4+6b3F9tlVde8T191ZjMIXeWGzfxetdZWrriytj9a5ZHghD9D0\n        OCGFf9PUv0a5KSJ/dZP01vr+DdRtc/LD/0EKxR+XdBDBXAMPDQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"redoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGVSURBVDhPzZHdK0NhHMf3p7jBknbBNpqbc+FtttrUrBim\n        LEJeRo0lzMsK2S6M5D3vJjXFJinhZu64WolQu9FaXjrnuf56nrOl5kTIhW99L56e7/dzfuf3yP5MO+cE\n        /jOCLeqlY4KJgADnioDk9ddiZebFI4KBdQGD2wLcOwJ6VimEOhn7XKw8e0hQ4nxAXt0BNLYQuNYwbD4e\n        9gUB9sUEZPOCgOuMSIEbpwTm0SeoLcsobAtAVbMrWm3dRz2FNM7yaKGQJZoraAqL0yarCbk2BBR13yKz\n        bALGvkPxUlXjR65lC9nGeVSMvYqTNM/xUFqD0glcfga4Q4bWizSu/z2grN6GXDcJx0IcFg8P3VAcioo1\n        KWCYAnQDjzTsSwFMBQmY2Ze1QzGou+4h109LAR0zUZS748ip3E0BsIVp6D8rrSEoTOtiOb14XArw7BE0\n        +J5R5Lihe5hMCUgW9pnM/Zcwjb4g33byvcJHZdFtG3ojMIy8gGu/Qq33+ecgBtE7r2F08yjtjf5uEiad\n        K4Yq+mzJ47+WTPYGxTcHtykTmrAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"cutToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGhSURBVDhPYyAG/AcCKJMwWLlp///ZyzbBNYA033nw9H91\n        6xTiDJk8d83/nmmL/1e1zgRr+Pb9x//Vm/b8T8mpIt4Vk2av/D95zmqQ5f+fvXjzPy2/5r+YEB8J3ti4\n        73/X5IX/T5y5+P/gsXP/w+KzSTNg4aod/7unLPrfO23h//LGvv8+QdHEawaBzokL/5c09P1Pzqv7Hxqb\n        +d/NO4g0A0AgIa/lf1hC4f+QtLb//gktxBsQ3fHuf0Tn6/8hzQ/+e5ed+u9Tfva/X9Xl/z6lp/+7Ze/E\n        b1BE+6v/kT3v/gc33PlvHT3vv2lQ33+3vH3//auv/ncFaraKmY/fgLD25//D2p7+d0zbANZsGtT737vk\n        1H//yqv/nTI2/TcJ7sdvQGjLo/9Bjff+O6Vu+m8c0A02IABou2/F2f8WEdP+aztk4TcguOnef/+yS//t\n        ktf8N/SBBJx3yfH/dkmr/mvaJP+XkdfEb4Bf5cX/9kmrgbZ3/Vc3CwcnHvuUNf+1rBP+q5tH/Df2b8dv\n        gHPGlv9mIZP+a1jF/jf0qsGvmDqAgQEAkYXpGFtqYpEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"copyToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHgSURBVDhPvZHdS1pxGMfPn7IKieq63Y/RKw0aFF1ssEEv\n        dOVFXXUVFQ3Wlg4H2dSo7A21jnUiKiPFylwttMy9GXMNNgUrzinLrGN98zxaVgu7GOwLn5vf+X0/D8/v\n        MP8cbuEbJFiblzDMuDDAfcQbLYfklfSRyrejn3CirnUID0tr7peYrd5kLZHY2Tm6hudgcXjxrEF5v8Qw\n        66aixQew64DHL+C9fhrskgDTAg+jnUffLA/V+B7xojNwUzjAOUkg5eQ0BuEgikAoTILbaR/ZQX6tg0jW\n        GUZnstPHXscpFDMCWtg/aOz3Y3h+l86vp0ETArciIK9qgiCBOr6vtPdRRMQOH8F2YB9f/LvQTQWp1MHG\n        CM/WPl4qgsitmkROxSiyywcTAmnf46h4NVmu86Fe/RnvjNskuIxwKGLr9zEcmwfQsGuQPelJCYRwFF9/\n        huD+HoDT8wu2Tz/Q2pv4vc0jYcjVQTx/68PTtg1Cw65CVtqdEuSXVP9Fo2qDBGJ8vRAvYtN/BKtLgHlx\n        Dx9GncgqUqUe8q7UtK+Q4PrkS7pNy8gsUKQXVDbZETk5g27cBa15DZqxVZosldWGJWQ8fp1eUCS3xF/b\n        SGSX6yEr0yKruAuZhcp4uQMPHr1KL/hPYZgL78LfVeQiZg4AAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"pasteToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJXSURBVDhPtZJdSFNhHMYPdGE3RR/UVVcF0U0UEVQXGYWt\n        sNlikdii5SK2SckmS9tGas0cunRzadoW+THUprMSpUnREBqOvmdsRh8SOSPXsnY2N+eyeDrn3UaujCDo\n        gYcD73mf3/+Dl/ovcvZr4bihQW+LCrL8fUgez6+edgPmuqX2CIL+DkT8V+EbqUGJmANDpQKXdWoYK4uJ\n        k9GE2FCMtiEe6kYs2AlLkwLRyTaUSHh4MaTE2VNcKEWb4Xcew6R9NWTC/b8D2HA8ZEWj9ijcrhrQ7+sx\n        MaLGW9dx9Jl5kAgy0VG6Ck8NFAoO/zJSd1ttAkBfh65UiHJFHtSFuThTwIdCzINcxIVUkIU62RoCyMvO\n        TAd0NuswQ3dhJmBCdLwKgeeF8LYtJ/a0LoO7aREeGTNImHXWto3pAItJi+lAC6bHKhB9eRKRZwdB9y+G\n        vtWOKlMvzl3qglJngVxjhkRlhLCoOh3Q3KDBlM+IyIgYU4+5CN/fhI+3VpBwSvHZbwiGYhibCCJXeh45\n        +eqfELO+DPSrCoQfchAeXI/QwEr4WilSmVXzTSexyeqAZ9RPwneHvNjDFyUgDdUqfB4+jZBjHejbSxGw\n        ZWD0GkXa/jr7HV/CTOUPQXje+OEafodsgRwcJrxr7wFkbt8Bqu5CMQIPpEx4CT71LMR4+wJ4GynImJnZ\n        tlMdXGE6qLcMoG/QS76st25YC+pieRF5IKktpyxmFja38j3XaxK23XHDan+SDtCXnWBeGA8i/m7k7NxC\n        frDbZmdOVZvPBPAnHWK2zV74m5PX/1UU9QOTNfjZ1V1+MwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"indexToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"searchToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALGSURBVDhPldL/T01xHMfx/hczs8VmmC/zg1i7oa6pOXVL\n        Jbrqlm5fbrluSqV7uynpdq/qtoh7C9Ei3eu0fBnKl6yFmSRkWF93VUZ2Q/Z0P2OuxmZe2/ntvB/nfD7v\n        V8Dvya2UEY+hwk2+VcZY28n+Cheph86jKWzm52t/T15VBwdtMs6ubq6+7EMe7sA5VESGnIRkOklirhN1\n        XuPfkQMWGZNDprX/Mg8+PGFgdpScthIsL/JJuaRkg7mcGFMP0YYGEvQn5iN68bs2N3W9VjrGHdyc6qVv\n        pp8Br4eWERdJdjMK+1PW2NpYW6NGyqxkR1atHxFAsVPG/rCcmiE9jrc2nMNmah87ST3TgqZukpiK1yw9\n        G8Hi06GsN6YTlVblB7LL2qlzv8EkW9h7fyuZvWHoHAZymnzHOn4Rk7UBQ3kl8dYUAqsVBJaFE6Ep9wMZ\n        5jbqr8xSWF+P8qyCLXI06lor1Y0urnXdZszzjrfjHpoutBOXp2VBSQjKRJMf0Bpbsbq9HGjyEG9QE1q/\n        G11TMZ03uhD5Ogcfvd8YnZrD1nCeddoINscX+IG9h1rIrHmF9vhnNNYhwnO1vnUeYWTC82t4/P1XBke+\n        4Op+RkRcLMHRBj+QUnSO1NJbJB77RIJlimjjHfaXmhiemPwxPD3nG/5Mz6CXutYetkmRBEk6PyAaJkqy\n        q+QBqsPjKIp6kYw62jtvMDbt+/LoF+4993K5b4Y0fQFh0k6K87P9gIhoWJzeSdTBOyzNNrNMF0uyLosT\n        zW7augewX+ghbV8BkartNFtiabenU2XKmY+IhqnSq9mUYSVYnYpSY0ZKLkTasYtwSUVM5DZsuo2MnVLw\n        7W4CjqNZfyKiYaIkYs9iVeK2xYWJM8cog0kOW8GjgpUM24OYdEWyL2nrfOBfEUBS6HKu61ezJ2QJqtBV\n        /weICGTdskWErF3oGw4I+A4LpgTtu1iCBgAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"toolStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>125, 17</value>\n  </metadata>\n  <data name=\"newToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"helpToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"statusStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>223, 17</value>\n  </metadata>\n  <metadata name=\"toolTip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>332, 17</value>\n  </metadata>\n  <metadata name=\"$this.TrayHeight\" type=\"System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>51</value>\n  </metadata>\n</root>"
  },
  {
    "path": "HexgridExampleWinforms2/MapDisplayPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    using ILandmarks = ILandmarkCollection;\n    using Hexes      = BoardStorage<Maybe<IHex>>;\n\n    public static partial class MapDisplayPainter {\n        /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n        /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n        /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n        /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n        public static void PaintMap<THex>(this MapDisplay<THex> @this, DrawingContext dc,\n                bool showHexgrid, Hexes boardHexes, ILandmarks landmarks)\n        where THex:class,IHex {\n            ;\n        }\n\n        /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n        /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n        /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n        public static void PaintHighlight<THex>(this MapDisplay<THex> @this, DrawingContext dc,\n                bool showRangeLine)\n        where THex:class,IHex {\n            ;\n        }\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n        /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n        public static void PaintUnits<THex>(this MapDisplay<THex> @this, DrawingContext dc)\n        where THex:class,IHex {\n            ;\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridScrollable.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(vector=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n   [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", \n      MessageId = \"0\", Justification=\"Research suggests the Code Analysis message is incorrect.\")] \n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\n#pragma warning disable 1587\n/// <summary>Example usage of <see cref=\"HexUtilities\"/> with <see cref=\"HexUtilities.HexgridPanel\"/> \n/// in a simple <see cref=\"WinForms\"/> application.</summary>\n#pragma warning restore 1587\n[assembly:CLSCompliant(true)]\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    static class Program {\n        /// <summary>The main entry point for the application.</summary>\n        [STAThread]\n        static void Main()      {\n            Application.EnableVisualStyles();\n            Application.SetCompatibleTextRenderingDefault(false);\n            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;\n\n            Application.Run(new MdiParent());\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinforms2\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinforms2\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4ab4311c-e92f-4ff6-93c5-e08005d414b6\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "HexgridExampleWinforms2/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWinforms2.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleWinforms2.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Text Files (*.txt)|*.txt|All Files (*.*)|*.*.\n        /// </summary>\n        internal static string FileExtensionMask {\n            get {\n                return ResourceManager.GetString(\"FileExtensionMask\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"FileExtensionMask\" xml:space=\"preserve\">\n    <value>Text Files (*.txt)|*.txt|All Files (*.*)|*.*</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridExampleWinforms2/TiltAwareScrollViewer.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    /// <summary>Interaction logic for HexgridScrollableViewer.xaml</summary>\n    public partial class TiltAwareScrollViewer : ScrollViewer {\n        /// <summary>TODO</summary>\n        public TiltAwareScrollViewer() : base() {\n    //      InitializeComponent();\n        }\n\n        #region Mouse Tilt Wheel (MouseHWheel) event implementation\n        /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n        public event EventHandler<MouseEventArgs> MouseHWheel;\n\n        private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n\n        /// <summary>Scrolls horizontally and raises the MouseHWheel event</summary>\n        /// <param name=\"e\"></param>\n        protected virtual void OnMouseHWheel(MouseWheelEventArgs e) {\n          if (e == null) throw new ArgumentNullException(nameof(e));\n            if (CanContentScroll) {\n                ScrollToHorizontalOffset(HorizontalOffset + e.Delta);\n\n                if (MouseHWheel != null) MouseHWheel?.Invoke(this, e);\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWinforms2/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridExampleWinforms2 {\n    /// <summary>TODO</summary>\n    public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n        /// <summary>TODO</summary>\n        protected ViewModelBase(string displayName) => DisplayName = displayName;\n\n        /// <summary>TODO</summary>\n        public            string DisplayName                { get; }\n        /// <summary>TODO</summary>\n        protected virtual bool   ThrowOnInvalidPropertyName => true;\n\n        /// <summary>Raised when a property on this object has a new value.</summary>\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        /// <summary>Raises this object's PropertyChanged event.</summary>\n        /// <param name=\"propertyName\">The property that has a new value.</param>\n        protected virtual void OnPropertyChanged(string propertyName) {\n            VerifyPropertyName(propertyName);\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n        }\n\n        /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n        [Conditional(\"DEBUG\"), DebuggerStepThrough]\n        public void VerifyPropertyName(string propertyName) {\n            if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n                string msg = \"Invalid property name: \" + propertyName;\n                if (ThrowOnInvalidPropertyName) throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n                Debug.Fail(msg);\n            }\n        }\n\n        #region IDisposable implementation with Finalizeer\n        bool _isDisposed = false;\n        /// <inheritdoc/>\n        public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n        /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n        protected virtual void Dispose(bool disposing) {\n          if (!_isDisposed) {\n            if (disposing) {\n            }\n            _isDisposed = true;\n          }\n        }\n        /// <summary>Finalize this instance.</summary>\n        ~ViewModelBase() { Dispose(false); }\n        #endregion\n    }\n\n    /// <summary>TODO</summary>\n    public class CommandViewModel : ViewModelBase { \n        /// <summary>TODO</summary>\n        public CommandViewModel(string displayName, ICommand command) : base(displayName)\n        =>  Command = command??throw new ArgumentNullException(\"command\"); \n\n        /// <summary>TODO</summary>\n        public ICommand Command { get; } \n    }\n\n    /// <summary>TODO</summary>\n    public class RelayCommand : ICommand { \n        /// <summary>TODO</summary>\n        public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n        /// <summary>TODO</summary>\n        public RelayCommand(Action<object> execute, Predicate<object> canExecute) {\n            _execute    = execute??throw new ArgumentNullException(\"execute\"); \n            _canExecute = canExecute??throw new ArgumentNullException(\"canExecute\");\n        } \n  \n        /// <summary>TODO</summary>\n        [DebuggerStepThrough] \n        public bool CanExecute(object parameter) => _canExecute(parameter);\n\n        /// <summary>TODO</summary>\n        public event EventHandler CanExecuteChanged { \n            add    { CommandManager.RequerySuggested += value; } \n            remove { CommandManager.RequerySuggested -= value; } \n        }\n\n        /// <summary>TODO</summary>\n        public void Execute(object parameter) => _execute(parameter);\n\n        readonly Action<object>    _execute; \n        readonly Predicate<object> _canExecute; \n    }\n\n  ///// <summary>TODO</summary>\n  //public class RelayCommand<T> : ICommand { \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n  //    if (execute == null) throw new ArgumentNullException(\"execute\");\n  //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n  //    _execute    = execute; \n  //    _canExecute = canExecute;\n  //  } \n  \n  //  /// <summary>TODO</summary>\n  //  [DebuggerStepThrough] \n  //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n  //  /// <summary>TODO</summary>\n  //  public event EventHandler CanExecuteChanged { \n  //    add    { CommandManager.RequerySuggested += value; } \n  //    remove { CommandManager.RequerySuggested -= value; } \n  //  }\n  \n  //  /// <summary>TODO</summary>\n  //  public void Execute(T parameter) { _execute(parameter); }\n\n  //  readonly Action<T>    _execute; \n  //  readonly Predicate<object> _canExecute; \n  //}\n\n    /// <summary>TODO</summary>\n    public abstract class WorkspaceViewModel : ViewModelBase {\n        /// <summary>TODO</summary>\n        protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n        /// <summary>TODO</summary>\n        protected WorkspaceViewModel(string displayName) : base(displayName)\n        => CloseCommand = new RelayCommand(param => OnRequestClose());\n\n        /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n        public virtual ICommand CloseCommand { get; }\n\n        /// <summary>Raised when this workspace should be removed from the UI.</summary>\n        public event EventHandler RequestClose;\n\n        void OnRequestClose() => RequestClose?.Invoke(this,EventArgs.Empty);\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/App.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.7.1\"/>\n    </startup>\n</configuration>\n"
  },
  {
    "path": "HexgridExampleWpf/App.xaml",
    "content": "﻿<Application x:Class=\"HexgridExampleWpf.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             StartupUri=\"MainWindow.xaml\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "HexgridExampleWpf/App.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Data;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridExampleWpf {\n    /// <summary>\n    /// Interaction logic for App.xaml\n    /// </summary>\n    public partial class App : Application {\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/CommandComboBox.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridExampleWpf {\n    public sealed partial class CommandComboBox : ComboBox, ICommandSource {\n        public CommandComboBox() : base() { ; }\n\n        #region Dependency Property (static) Backing Stores\n        // Using DependencyProperties as the backing store enables animation, styling, binding, etc...\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandProperty =\n                DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(CommandComboBox),\n                    new UIPropertyMetadata(null,new PropertyChangedCallback(CommandChanged)));\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandParameterProperty =\n                DependencyProperty.Register(\"CommandParameter\", typeof(object), typeof(CommandComboBox), \n                    new UIPropertyMetadata(null));\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandTargetProperty =\n                DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(CommandComboBox),\n                    new UIPropertyMetadata(null));\n        #endregion\n\n        public ICommand      Command {\n            get => (ICommand)GetValue(CommandProperty);\n            set => SetValue(CommandProperty, value);\n        }\n        public object        CommandParameter {\n            get => GetValue(CommandParameterProperty);\n            set => SetValue(CommandParameterProperty, value);\n        }\n        public IInputElement CommandTarget {\n            get => (IInputElement)GetValue(CommandTargetProperty);\n            set => SetValue(CommandTargetProperty, value);\n        }\n\n        #region Event Handlers\n        /// <summary>Command dependency property change callback.</summary>\n        private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        =>  ((CommandComboBox)d).HookUpCommand((ICommand)e.OldValue, (ICommand)e.NewValue);\n\n        /// <inheritdoc/>\n        /// <remarks>\n        /// If Command is defined, moving the slider will invoke the command; \n        /// Otherwise, the slider will behave normally. \n        /// </remarks>\n        protected override void OnSelectionChanged(SelectionChangedEventArgs e) {\n            base.OnSelectionChanged(e);\n\n            if (Command != null) {\n                if(Command is RoutedCommand routedCmd) {\n                    routedCmd.Execute(CommandParameter, CommandTarget);\n                }  else {\n                    Command.Execute(CommandParameter);\n                }\n            }\n        }\n        /// <inheritdoc/>\n        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) {\n            base.OnMouseLeftButtonUp(e);\n\n            var command = Command;\n            var parameter = CommandParameter;\n            var target = CommandTarget;\n\n            if(command is RoutedCommand routedCmd && routedCmd.CanExecute(parameter, target)) {\n                routedCmd.Execute(parameter, target);\n            } else if(command != null && command.CanExecute(parameter)) {\n                command.Execute(parameter);\n            }\n        }\n        /// <summary>.</summary>\n        private void CanExecuteChanged(object sender, EventArgs e) {\n            if (Command != null)    {\n                if(Command is RoutedCommand routedCmd) {\n                    IsEnabled = routedCmd.CanExecute(CommandParameter, CommandTarget);\n                }  else {\n                    IsEnabled = Command.CanExecute(CommandParameter);\n                }\n            }\n        }\n        #endregion\n\n        /// <summary>Add a new command to the Command Property. </summary>\n        private void HookUpCommand(ICommand oldCommand, ICommand newCommand) {\n            if (oldCommand != null)   oldCommand.CanExecuteChanged -= this.CanExecuteChanged;\n            if (newCommand != null)   newCommand.CanExecuteChanged += this.CanExecuteChanged;\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/CommandSlider.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridExampleWpf {\n    public sealed partial class CommandSlider : Slider, ICommandSource {\n        public CommandSlider() : base() { ; }\n\n        #region Dependency Property (static) Backing Stores\n        // Using DependencyProperties as the backing store enables animation, styling, binding, etc...\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandProperty =\n                DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(CommandSlider),\n                      new UIPropertyMetadata(null,new PropertyChangedCallback(CommandChanged)));\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandParameterProperty =\n                DependencyProperty.Register(\"CommandParameter\", typeof(object), typeof(CommandSlider), \n                      new UIPropertyMetadata(null));\n        /// <summary>TODO</summary>\n        public static readonly DependencyProperty CommandTargetProperty =\n                DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(CommandSlider),\n                      new UIPropertyMetadata(null));\n        #endregion\n\n        public ICommand      Command {\n            get => (ICommand)GetValue(CommandProperty);\n            set => SetValue(CommandProperty, value);\n        }\n        public object        CommandParameter {\n            get => GetValue(CommandParameterProperty);\n            set => SetValue(CommandParameterProperty, value);\n        }\n        public IInputElement CommandTarget {\n            get => (IInputElement)GetValue(CommandTargetProperty);\n            set => SetValue(CommandTargetProperty, value);\n        }\n\n        #region Event Handlers\n        /// <summary>Command dependency property change callback.</summary>\n        private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        =>  ((CommandSlider)d).HookUpCommand((ICommand)e.OldValue, (ICommand)e.NewValue);\n\n        /// <inheritdoc/>\n        /// <remarks>\n        /// If Command is defined, moving the slider will invoke the command; \n        /// Otherwise, the slider will behave normally. \n        /// </remarks>\n        protected override void OnValueChanged(double oldValue, double newValue) {\n            base.OnValueChanged(oldValue, newValue);\n\n            if (Command != null) {\n                if(Command is RoutedCommand routedCmd) {\n                    routedCmd.Execute(CommandParameter, CommandTarget);\n                }  else {\n                    Command.Execute(CommandParameter);\n                }\n            }\n        }\n        /// <inheritdoc/>\n        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) {\n            base.OnMouseLeftButtonUp(e);\n\n            var command = Command;\n            var parameter = CommandParameter;\n            var target = CommandTarget;\n\n            if(command is RoutedCommand routedCmd && routedCmd.CanExecute(parameter, target)) {\n                routedCmd.Execute(parameter, target);\n            } else if(command != null && command.CanExecute(parameter)) {\n                command.Execute(parameter);\n            }\n        }\n        /// <summary>TODO</summary>\n        private void CanExecuteChanged(object sender, EventArgs e) {\n            if (Command != null)    {\n                if(Command is RoutedCommand routedCmd) {\n                    IsEnabled = routedCmd.CanExecute(CommandParameter, CommandTarget);\n                } else {\n                    IsEnabled = Command.CanExecute(CommandParameter);\n                }\n            }\n        }\n        #endregion\n\n        /// <summary>Add a new command to the Command Property. </summary>\n        private void HookUpCommand(ICommand oldCommand, ICommand newCommand) {\n            if (oldCommand != null)   oldCommand.CanExecuteChanged -= CanExecuteChanged;\n            if (newCommand != null)   newCommand.CanExecuteChanged += CanExecuteChanged;\n        }\n    }\n}"
  },
  {
    "path": "HexgridExampleWpf/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n           <Word>Alt</Word>\n           <Word>coloured</Word>\n           <Word>Coords</Word>\n           <Word>Ctl</Word>\n           <Word>Eachable</Word>\n           <Word>Fov</Word>\n           <Word>Fwd</Word>\n           <Word>functor</Word>      <Word>functors</Word>\n           <Word>hexgrid</Word>\n           <Word>HexgridUtilities</Word>\n           <Word>hexside</Word>      <Word>hexsides</Word>\n           <Word>Hotspot</Word>\n           <Word>lhs</Word>\n           <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n           <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n           <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n           <Word>Napoleonics</Word>\n           <Word>Neighbour</Word>    <Word>Neighbours</Word>\n           <Word>rhs</Word>\n           <Word>c</Word>\n           <Word>f</Word>\n           <Word>g</Word>\n           <Word>h</Word>\n           <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n           <Word>m</Word>\n           <Word>p</Word>\n           <Word>Pathfinding</Word>\n           <Word>s</Word>\n           <Word>v</Word>\n           <Word>w</Word>\n           <Word>x</Word>      <Word>dx</Word>\n           <Word>y</Word>      <Word>dy</Word>\n           <Word>z</Word>      <Word>dz</Word>\n           <Word>wParam</Word>\n           <Word>lParam</Word>\n           <Word>params</Word>\n         </Recognized>\n         <Deprecated>\n           <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n           <Acronym>ASL</Acronym>\n           <Acronym>Fov</Acronym>\n           <Acronym>PG</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "HexgridExampleWpf/HexgridExampleWpf.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{6CEB2C15-1E1A-446C-92C6-77BC49833742}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleWpf</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexgridExampleWpf</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexGridExampleWpf\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>false</Prefer32Bit>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexGridExampleWpf\\bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>false</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>HexgridExampleWpf.App</StartupObject>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"WindowsFormsIntegration\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"App.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n      <CustomToolNamespace>PGNapoleonics.HexGridExample2</CustomToolNamespace>\n    </ApplicationDefinition>\n    <Compile Include=\"App.xaml.cs\">\n      <DependentUpon>App.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"CommandComboBox.cs\" />\n    <Compile Include=\"CommandSlider.cs\" />\n    <Page Include=\"MainWindow.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"MainWindow.xaml.cs\">\n      <DependentUpon>MainWindow.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\">\n      <CustomToolNamespace>PGNapoleonics.HexGridExample2</CustomToolNamespace>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexgridExampleWpf/MainWindow.xaml",
    "content": "﻿<Window x:Class=\"PGNapoleonics.HexgridExampleWpf.MainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:local=\"clr-namespace:PGNapoleonics.HexgridExampleWpf\"\n        mc:Ignorable=\"d\"\n        xmlns:Properties=\"clr-namespace:PGNapoleonics.HexgridExampleWpf.Properties\" \n        xmlns:HexgridPanel=\"clr-namespace:PGNapoleonics.HexgridPanel;assembly=PGNapoleonics.HexgridPanel\" \n        xmlns:HexCommon=\"clr-namespace:PGNapoleonics.HexgridExampleCommon;assembly=HexgridExampleCommon\"\n        Title=\"Hexgrid Utilities WPF Example\" Height=\"422\" Width=\"782\" Loaded=\"Window_Loaded\" \n        SizeToContent=\"WidthAndHeight\" ScrollViewer.VerticalScrollBarVisibility=\"Disabled\"\n        >\n    <Window.Resources>\n        <CollectionViewSource Source=\"{Binding MapSelectionItems}\" x:Key=\"mapSelectionItems\" />\n    </Window.Resources>\n\n    <Window.CommandBindings>\n        <CommandBinding Command=\"Refresh\" Executed=\"RefreshCmdExecuted\" CanExecute=\"RefreshCmdCanExecute\"/>\n    </Window.CommandBindings>\n\n    <DockPanel x:Name=\"_dockPanel\" Cursor=\"Arrow\" \n\t\tScrollViewer.VerticalScrollBarVisibility=\"Disabled\" >\n        <StackPanel Name=\"toolbarControls\" DockPanel.Dock=\"Top\" \n\t\t\tHeight=\"25\" \n\t\t\tVerticalAlignment=\"Top\" \n\t\t\tOrientation=\"Horizontal\" >\n            <StackPanel.Background>\n                <LinearGradientBrush EndPoint=\"0.5,1\" MappingMode=\"RelativeToBoundingBox\" StartPoint=\"0.5,0\">\n                    <GradientStop Color=\"White\" Offset=\"0\"/>\n                    <GradientStop Color=\"#994040A0\" Offset=\"1\"/>\n                </LinearGradientBrush>\n            </StackPanel.Background>\n            <ToggleButton x:Name=\"buttonTransposeMap\" \n\t\t\t\t    Content=\"Transpose\" \n\t\t\t\t    Width=\"75\" \n\t\t\t\t    ClickMode=\"Press\" \n                    Focusable=\"False\"\n                    IsChecked=\"{Binding HexgridPanel.IsTransposed, Mode=TwoWay, FallbackValue=False, UpdateSourceTrigger=PropertyChanged}\"\n\t\t\t\t    ToolTip=\"Toggles transposition of the current map.\" Margin=\"3,0\"/>\n            <ToggleButton x:Name=\"buttonRangeLine\" \n\t\t\t\t    Content=\"Range Line\" \n\t\t\t\t    Width=\"75\" \n\t\t\t\t    ClickMode=\"Press\" \n                    Focusable=\"False\"\n                    IsChecked=\"{Binding Model.ShowRangeLine, Mode=TwoWay, FallbackValue=False, UpdateSourceTrigger=PropertyChanged}\"\n                    Command=\"Refresh\"\n\t\t\t\t    ToolTip=\"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex and Hotspot-Hex.\" \n                    Margin=\"3,0\">\n            </ToggleButton>\n            <ToggleButton x:Name=\"buttonPathArrow\" \n\t\t\t\t      Content=\"Path Arrow\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n                      Focusable=\"False\"\n                      IsChecked=\"{Binding Model.ShowPathArrow, Mode=TwoWay, FallbackValue=True, UpdateSourceTrigger=PropertyChanged}\"\n                      Command=\"Refresh\"\n\t\t\t\t      ToolTip=\"Toggle display of Path Arrow.\" \n              Margin=\"3,0\"/>\n            <ToggleButton x:Name=\"buttonFieldOfView\" \n\t\t\t\t      Content=\"FOV\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n                      Focusable=\"False\"\n                      IsChecked=\"{Binding Model.ShowFov, Mode=TwoWay, FallbackValue=True, UpdateSourceTrigger=PropertyChanged}\"\n                      Command=\"Refresh\"\n\t\t\t\t      ToolTip=\"Toggles display of current Field-of-View\" Margin=\"3,0,0,0\" \n            />\n            <local:CommandSlider x:Name=\"sliderFovRadius\" Width=\"116\" TickFrequency=\"5\" \n      \t              Maximum=\"60\" SmallChange=\"1\" LargeChange=\"5\" \n      \t              Focusable=\"False\" AutoToolTipPlacement=\"TopLeft\"\n      \t              Value=\"{Binding Model.FovRadius, FallbackValue=20, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n      \t              Command=\"Refresh\"\n      \t              CommandParameter=\"SetMapDirty\"\n      \t              ToolTip=\"Range beyond which Fast PathFinding is used instead of Stable PathFinding.\" \n      \t              Margin=\"0,0,3,0\" TickPlacement=\"TopLeft\" Background=\"#FFE0E0E0\" Foreground=\"#FF6C6C6C\" \n              />\n            <ComboBox x:Name=\"comboBoxMapSelection\" \n\t\t\t      Width=\"90\" \n                  Margin=\"3,0\" \n                  Focusable=\"False\"\n\t\t\t      ToolTip=\"Selects map to display.\"\n                  SelectedIndex=\"{Binding SelectedMapIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n              >\n                <ListBoxItem x:Name=\"TerrainMap\" Content=\"Terrain Map\"/>\n                <ListBoxItem x:Name=\"MazeMap\"    Content=\"Maze Map\"/>\n            </ComboBox>\n            <Label Content=\"Landmark to Show:\" HorizontalContentAlignment=\"Right\" Width=\"115\" Margin=\"3,0,0,0\"/>\n            <local:CommandComboBox x:Name=\"menuItemLandmarks\" Width=\"60\" Margin=\"0,0,3,0\"\n                Focusable=\"False\"\n                ItemsSource=\"{Binding LandmarkItems}\"\n                SelectedIndex=\"{Binding Model.LandmarkToShow, Mode=TwoWay}\"\n                Command=\"Refresh\" CommandParameter=\"SetMapDirty\"\n              />\n        </StackPanel>\n        <StackPanel DockPanel.Dock=\"Bottom\"  \n\t\t\tHeight=\"25\" \n\t\t\tVerticalAlignment=\"Top\">\n            <StackPanel.Background>\n                <LinearGradientBrush EndPoint=\"0.5,1\" StartPoint=\"0.5,0\">\n                    <GradientStop Color=\"#664040A0\" Offset=\"1\"/>\n                    <GradientStop Color=\"#994040A0\"/>\n                </LinearGradientBrush>\n            </StackPanel.Background>\n            <Label x:Name=\"statusLabel\" Content=\"Status display\"/>\n        </StackPanel>\n        <ScrollViewer \n\t\t\tx:Name=\"_scrollViewer\" \n\t\t\tClipToBounds=\"True\" \n\t\t\tHorizontalContentAlignment=\"Stretch\" \n\t\t\tVerticalContentAlignment=\"Stretch\" \n\t\t\tVerticalScrollBarVisibility=\"Disabled\">\n            <WindowsFormsHost x:Name=\"_host\" \n\t\t\t\tScrollViewer.VerticalScrollBarVisibility=\"Disabled\" \n\t\t\t\tScrollViewer.CanContentScroll=\"True\">\n                <HexgridPanel:HexgridBufferedPanel \n                  AutoScrollMinSize=\"200,100\" \n                  Margin=\"5, 5, 5, 5\" \n                  Size=\"1445,920\" \n                  />\n            </WindowsFormsHost>\n        </ScrollViewer>\n    </DockPanel>\n</Window>\n"
  },
  {
    "path": "HexgridExampleWpf/MainWindow.xaml.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Interop;\n\nusing PGNapoleonics.HexgridExampleCommon;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridExampleWpf {\n    using MapGridDisplay = IMapDisplayWinForms<IHex>;\n    using MyMapDisplay   = MapDisplayBlocked<TerrainGridHex>;\n    using HexgridPanel   = HexgridPanel.HexgridPanel;\n\n    /// <summary>Interaction logic for MainWindow.xaml.</summary>\n    public partial class MainWindow : Window {\n        public MainWindow() {\n            InitializeComponent();\n            DataContext = this; }\n\n        void RefreshCmdExecuted(object target, ExecutedRoutedEventArgs e) { \n            if (e.Parameter != null) HexgridPanel.SetMapDirty();\n            HexgridPanel.Refresh();  \n        }\n        public void RefreshCmdCanExecute(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = true;\n\n        private void Window_Loaded(object sender, RoutedEventArgs e) {\n            HexgridPanel = (HexgridPanel)_host.Child;\n            _host.Child.Focus();\n\n            HexgridPanel.ScaleIndex   = HexgridPanel.Scales\n                                                    .Select((f,i) => new {value=f, index=i})\n                                                    .Where(s => s.value==1.0F)\n                                                    .Select(s => s.index).FirstOrDefault(); \n            HexgridPanel.MouseMove   += HexgridPanel_MouseMove;\n\n            if(sender is IKeyboardInputSink sink) {\n                ((IKeyboardInputSink)sender).TabInto(new TraversalRequest(FocusNavigationDirection.First));\n            }\n            SelectedMapIndex     = 0;\n        }\n\n        /// <summary>TODO</summary>\n        public   HexgridPanel      HexgridPanel { get; private set; }\n\n        /// <summary>TODO</summary>\n        public   IPanelModel       Model        => HexgridPanel.DataContext.Model;\n\n        /// <summary>TODO</summary>\n        public   int               SelectedMapIndex  { \n            get => _selectedMapIndex;\n            set {\n                _selectedMapIndex = value;\n                var mapName = ((ListBoxItem)comboBoxMapSelection.Items[_selectedMapIndex]).Name;\n                switch (mapName) {\n                    case \"MazeMap\":    HexgridPanel.SetModel(SetMapBoard(HexgridExampleCommon.MazeMap.New(),     Model.FovRadius)); break;\n                    case \"TerrainMap\": HexgridPanel.SetModel(SetMapBoard(HexgridExampleCommon.TerrainMap.New(),  Model.FovRadius)); break;\n                    case \"A* Bug Map\": HexgridPanel.SetModel(SetMapBoard(HexgridExampleCommon.AStarBugMap.New(), Model.FovRadius)); break;\n                    default:           break;\n                }\n                sliderFovRadius.Value = Model.FovRadius;\n\n                HexgridPanel.Refresh();\n            }\n        } int _selectedMapIndex = 0;\n\n        IPanelModel SetMapBoard(IPanelModel mapBoard, int fovRadius) {\n            mapBoard.FovRadius  = fovRadius;\n            RefreshLandmarkMenu(mapBoard);\n\n            var customCoords = new CustomCoords(new IntMatrix2D(2,0, 0,-2, 0,2*mapBoard.MapSizeHexes.Height-1, 2));\n            return mapBoard;\n        }\n\n        /// <summary>TODO</summary>\n        public ObservableCollection<ListBoxItem> LandmarkItems { get; }\n                = new ObservableCollection<ListBoxItem>()\n                        { new ListBoxItem() { Name = \"None\", Content = \"None\" } };\n\n        void RefreshLandmarkMenu(IPanelModel model) {\n            Model.LandmarkToShow = 0;\n            while(LandmarkItems.Count > 1) LandmarkItems.RemoveAt(1);\n\n            if (model.Landmarks != null) {\n                foreach(var item in model.Landmarks?.Select((l,i) => new ListBoxItem\n                                       { Name = $\"No_{i}\", Content = $\"{l.Coords}\" } ) )\n                { LandmarkItems.Add(item); }\n            }\n            HexgridPanel.SetMapDirty();\n        }\n\n        void HexgridPanel_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {\n            var hotHex = Model.HotspotHex;\n            var vector = Model.StartHex - hotHex;\n            var cost = Model.Path.ElseDefault()?.TotalCost ?? -1;\n            statusLabel.Content =\n                $\"Hotspot Hex: {hotHex:gi3} / {hotHex:uI4} / {hotHex:c5}; {vector:r6}; Path Length = {cost}\";\n        }\n    }\n}"
  },
  {
    "path": "HexgridExampleWpf/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridExampleWpf.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridExampleWpf.WinForms {\n    /// <summary>Extern declarations from the Win32 API.</summary>\n    internal static partial class NativeMethods {\n        /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n        /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n        /// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n        /// <returns>Window handle (hWnd).</returns>\n        [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n            Justification=\"Research suggests the Code Analysis message is incorrect.\")]\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        [DllImport(\"user32.dll\")]\n        public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n        /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n        /// <param name=\"hWnd\">Window handle</param>\n        /// <param name=\"msg\">Windows message</param>\n        /// <param name=\"wParam\">WParam</param>\n        /// <param name=\"lParam\">LParam</param>\n        /// <returns></returns>\n        [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n        public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n[assembly: CLSCompliant(true)]\n[assembly: NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWpf\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexgridExampleWpf\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n  //(used if a resource is not found in the page, \n  // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n  //(used if a resource is not found in the page, \n  // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "HexgridExampleWpf/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWpf.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleWpf.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "HexgridExampleWpf/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWpf.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"15.9.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridExampleWpf/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "HexgridPanel/AbstractModelDisplayPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridPanel {\n    using HexPoint   = System.Drawing.Point;\n\n    /// <summary></summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public abstract class AbstractModelDisplayPainter<THex>: IMapDisplayPainter where THex:IHex {\n        /// <summary></summary>\n        /// <param name=\"model\">The map to be painted, as a <see cref=\"IMapDisplayWinForms{THex}\"/>.</param>\n        public AbstractModelDisplayPainter(IPanelModel model)\n        =>  Model = model??throw new ArgumentNullException(nameof(model));\n\n        protected IPanelModel Model { get; }\n\n        /// <inheritdoc/>\n        public virtual void PaintMap(Graphics graphics, bool showHexgrid)\n        =>  graphics?.Contain( g => {\n                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;\n                PaintForEachHex(graphics, coords => {\n                    Model[coords].IfHasValueDo(h => {\n                        if(h is THex hex) Paint(graphics, Model.HexgridPath, GetHexBrush(hex));\n                    });\n                    if (showHexgrid) graphics.DrawPath(Pens.Black, Model.HexgridPath);\n                } );\n            } );\n\n        /// <inheritdoc/>\n        public virtual void PaintLabels(Graphics graphics, Func<HexCoords,string> hexText)\n        =>  graphics?.Contain( g => {\n                var font       = LabelFont;\n                var textOffset = new Point((Model.GridSize.Scale(0.50F)\n                               - new SizeF(font.Size,font.Size).Scale(0.8F)).ToSize());\n                PaintForEachHex(graphics, coords => {\n                    graphics.DrawString(hexText(coords), font, TextBrush, textOffset);\n                } );\n            } );\n\n        /// <inheritdoc/>\n        public virtual void PaintHighlight(Graphics graphics) {\n            graphics?.Contain(g => {\n                g.Transform = Model.TranslateToHex(Model.StartHex);\n                g.DrawPath(Pens.Red, Model.HexgridPath);\n            } );\n\n            if (Model.Path != null) {\n                graphics.Contain(g => { PaintPath(g); });\n            }\n\n            if (Model.ShowRangeLine) {\n                graphics.Contain(g => {\n                    var target = Model.CentreOfHex(Model.HotspotHex);\n                    graphics.DrawLine(Pens.Red, Model.CentreOfHex(Model.StartHex), target);\n                    graphics.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n                    graphics.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n                } );\n            }\n        }\n\n        /// <inheritdoc/>\n        public virtual void PaintShading(Graphics graphics, IShadingMask isNotShaded)\n        =>  graphics?.Contain(g => {\n                if (isNotShaded == null) return;\n                graphics.CompositingMode = CompositingMode.SourceOver;\n                using (var shadeBrush = new SolidBrush(Color.FromArgb(Model.ShadeBrushAlpha,ShadeColor))) {\n                    PaintForEachHex(graphics,coords => {\n                        if (!isNotShaded[coords]) { graphics.FillPath(shadeBrush,Model.HexgridPath); }\n                    });\n                }\n            } );\n\n        /// <inheritdoc/>\n        public virtual void PaintUnits(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n\n            /* NO-OP - Not implemented in examples. */\n        }\n\n        /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n        /// for each hex on <paramref name=\"graphics\"/>.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"paintAction\">The paint action to be performed for each hex as a <see cref=\"Action{HexCoords}\"/>.</param>\n        public virtual void PaintForEachHex(Graphics graphics, Action<HexCoords> paintAction) {\n            var clipRectangle = Model.GetClipInHexes(graphics.VisibleClipBounds);\n            ForEachHex(clipRectangle, hex => {\n                graphics.Transform = Model.TranslateToHex(hex.Coords);\n                paintAction(hex.Coords);\n            } );\n        }\n\n        /// <summary>Paint the current shortese path.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// A directed path (ie linked-list> of hexes to be painted.</param>\n        public virtual void PaintPath(Graphics graphics) {\n            if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n            var path = Model.Path.ElseDefault();\n            using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n                while (path != null) {\n                    var coords = path.PathStep.Coords;\n                    graphics.Transform = Model.TranslateToHex(coords);\n                    graphics.FillPath(brush, Model.HexgridPath);\n\n                    if (Model.ShowPathArrow) PaintPathDetail(graphics, path);\n\n                    path = path.PathSoFar;\n                }\n            }\n        }\n\n        /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"path\">Type: <see cref=\"IDirectedPathCollection\"/> - \n        /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>\n        protected virtual void PaintPathDetail(Graphics graphics, IDirectedPathCollection path) {\n            graphics.TranslateTransform(Model.HexCentreOffset.Width, Model.HexCentreOffset.Height);\n            if (path.PathSoFar == null) PaintPathDestination(graphics);\n            else                        PaintPathArrow(graphics, path.PathStep.HexsideExit);\n        }\n\n        /// <summary>Paint the direction arrow for each hex of the current shortest path.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"hexside\">Type: <see cref=\"Hexside\"/> - \n        /// Direction from this hex in which the next step is made.</param>\n        /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n        protected void PaintPathArrow(Graphics graphics, Hexside hexside) {\n            var unit = Model.GridSize.Height/8.0F;\n            graphics.RotateTransform(60 * hexside.Reversed);\n            graphics.DrawLine(Pens.Black, 0,unit*4,       0,  -unit);\n            graphics.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n            graphics.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n        }\n\n        /// <summary>Paint the destination indicator for the current shortest path.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n        protected void PaintPathDestination(Graphics graphics) {\n            var unit = Model.GridSize.Height/8.0F;\n            graphics.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n            graphics.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n        }\n\n        /// <summary>Performs the specified <see cref=\"Action{THex}\"/> for each hex of <paramref name=\"this\"/> in <paramref name=\"clipRectangle\"/>.</summary>\n        /// <param name=\"clipRectangle\">The rectangular extent of hexes to be painted as a <see cref=\"CoordsRectangle\"/>.</param>\n        /// <param name=\"action\">The <see cref=\"Action{THex}\"/> to be performed with each hex.</param>\n        protected void ForEachHex(CoordsRectangle clipRectangle, Action<IHex> action)\n        =>  Model.ForEachHexSerial<IHex>(maybe =>\n                maybe.IfHasValueDo(hex => { if (clipRectangle.EncompassesHex(hex.Coords)) action(hex); } )\n            );\n\n        /// <summary>TODO</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"path\">The closed <see cref=\"GraphicsPath\"/> outlining the hex to be painted.</param>\n        /// <param name=\"brush\">The <see cref=\"Brush\"/> to be used in filling this hex.</param>\n        protected void Paint(Graphics graphics, GraphicsPath path, Brush brush)\n        =>  graphics.FillPath(brush, path);\n\n        /// <summary>.</summary>\n        /// <param name=\"hex\"></param>\n        /// <remarks>\n        /// Returns clones to avoid inter-thread contention.\n        /// </remarks>\n        protected abstract Brush GetHexBrush(THex hex);\n\n        /// <summary>Gets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        protected abstract Color ShadeColor { get; }\n\n        /// <summary>Gets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        protected abstract Brush TextBrush  { get; }\n\n        /// <summary>Gets the <see cref=\"Font\"/> to be used by <see cref=\"PaintLabels(Graphics, Func{HexCoords, string})\"/.></summary>\n        protected abstract Font  LabelFont  { get; }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/BitmapExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n\n    /// <summary>TODO</summary>/>\n    public static partial class BitmapExtensions {\n        /// <summary>Renders the supplied <see cref=\"Image\"/> <paramref name=\"source\"/> to the specified\n        /// <see cref=\"Image\"/> <paramref name=\"target\"/>, translated.</summary>\n        /// <param name=\"target\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"source\">Source <see cref=\"Image\"/> to be rendered.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render the <paramref name=\"source\"/>.</param>\n        public static void Render(this Image target, Image source, Point point)\n        =>  Render(target, source, point, 1.0F);\n\n        /// <summary>Renders the supplied <see cref=\"Image\"/> <paramref name=\"source\"/> to the specified\n        /// <see cref=\"Image\"/> <paramref name=\"target\"/>, scaled and translated.</summary>\n        /// <param name=\"target\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"source\">Source <see cref=\"Image\"/> to be rendered.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render the <paramref name=\"source\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn</param>\n        public static void Render(this Image target, Image source, Point point, float scale) {\n            if (source == null) throw new ArgumentNullException(\"source\");\n            if (target == null) throw new ArgumentNullException(\"target\");\n            Tracing.Paint.Trace($\"Render source to {target.Tag}:\");\n\n            using (var graphics = Graphics.FromImage(target)) graphics.Render(source, point, scale);\n        }\n\n        /// <summary>Renders the supplied <see cref=\"Image\"/> <paramref name=\"source\"/> to the specified\n        /// <see cref=\"Graphics\"/> <paramref name=\"graphics\"/>, scaled and translated.</summary>\n        /// <param name=\"graphics\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"source\">Source <see cref=\"Image\"/> to be rendered.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render the <paramref name=\"source\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn</param>\n        public static void Render(this Graphics graphics, Image source, Point point, float scale) {\n            if (source == null) throw new ArgumentNullException(\"source\");\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n\n            graphics.Clear(Color.Black);\n            graphics.PageUnit = GraphicsUnit.Pixel;\n            graphics.TranslateTransform(point.X, point.Y);\n            graphics.ScaleTransform(scale, scale);\n            graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;\n            graphics.DrawImage(source, Point.Empty);\n        }\n\n        /// <summary>Renders, scaled and translated, first the supplied <see cref=\"Image\"/> <paramref name=\"source\"/> to the specified\n        /// <see cref=\"Graphics\"/> <paramref name=\"target\"/> and then the specified <paramref name=\"action\"/>.</summary>\n        /// <param name=\"target\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"source\">Source <see cref=\"Image\"/> to be rendered.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render the <paramref name=\"source\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn</param>\n        /// <param name=\"action\">The drawing action to be overlain to target.</param>\n        public static void Render(this Image target, Image source, Point point, float scale,\n                                Action<Graphics> action) {\n            if (target == null) throw new ArgumentNullException(\"target\");\n            if (action == null) throw new ArgumentNullException(\"action\");\n            Tracing.Paint.Trace($\"Render cache to {target.Tag}:\");\n\n            using (var graphics = Graphics.FromImage(target)) {\n                if (source != null) { graphics.DrawImageUnscaled(source, Point.Empty); }\n                graphics.PageUnit = GraphicsUnit.Pixel;\n                graphics.TranslateTransform(point.X, point.Y);\n                graphics.ScaleTransform(scale,scale);\n\n                action(graphics);\n            }\n        }\n\n        /// <summary>Paints, scaled and translated, the supplied <see cref=\"Graphics\"/> <paramref name=\"action\"/> to the\n        /// specified <see cref=\"Image\"/> <paramref name=\"target\"/>.</summary>\n        /// <param name=\"target\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render <paramref name=\"action\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn</param>\n        /// <param name=\"action\">The drawing action to be performed.</param>\n        public static void Paint(this Image target, Point point, float scale, Action<Graphics> action)\n        =>  Paint(target, point, scale, action, Color.Black);\n\n        /// <summary>Paints, scaled and translated, the supplied <see cref=\"Graphics\"/> <paramref name=\"action\"/> to the\n        /// specified <see cref=\"Image\"/> <paramref name=\"target\"/>.</summary>\n        /// <param name=\"target\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render <paramref name=\"action\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn</param>\n        /// <param name=\"action\">The drawing action to be performed.</param>\n        /// <param name=\"background\"><seealso cref=\"Color\"/> with which to paint the background.</param>\n        public static void Paint(this Image target, Point point, float scale, Action<Graphics> action,\n                                Color background) {\n            if (target == null) throw new ArgumentNullException(\"target\");\n            Tracing.Paint.Trace($\"Paint Buffer-{target.Tag}:\");\n\n            using (var graphics = Graphics.FromImage(target)) {\n                graphics.Clear(background);\n                graphics.Paint(point, scale, action);\n            }\n        }\n\n        /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n        /// <param name=\"paintAction\">The painting <see cref=\"Action{Graphics}\"/> to be performed. </param>\n        /// <param name=\"getBitmap\">A <see cref=\"Func{T}\"/> that prouces the <typeparamref name=\"T\"/> drawing target.</param>\n        /// <param name=\"clipBounds\"></param>\n        public static T ToBitmap<T>(this Action<Graphics> paintAction, Func<T> getBitmap,\n                                      Rectangle clipBounds) where T:Image {\n            T bitmap = null, temp = null;\n            try {\n                temp = getBitmap();\n                using(var graphics = Graphics.FromImage(temp)) {\n                    graphics.Clip = new Region(clipBounds);\n                    graphics.Contain(paintAction);\n                }\n\n                bitmap = temp;\n                temp   = null;\n            } finally { if(temp != null) temp.Dispose(); }\n\n            return bitmap;\n        }\n\n        /// <summary>Returns a new empty allocated bitmap of the specified size.</summary>\n        /// <param name=\"size\">The {Size} of the bitmap to be allocated.</param>\n        public static Bitmap AllocateBitmap(this Size size) {\n            Bitmap temp = null, buffer = null;\n            try {\n                temp   = new Bitmap(Math.Max(1,size.Width), Math.Max(1,size.Height));\n                buffer = temp;\n                temp   = null;\n            } finally { if (temp != null) temp.Dispose(); }\n            return buffer;\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/CustomDictionary.xsd",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n   <xs:element name=\"Dictionary\">\n      <xs:complexType>\n         <xs:sequence>\n            <xs:element name=\"Words\">\n               <xs:complexType>\n                  <xs:sequence>\n                     <xs:element name=\"Unrecognized\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element name=\"Word\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"Recognized\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Word\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"Deprecated\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element name=\"Term\">\n                                 <xs:complexType>\n                                    <xs:simpleContent>\n                                       <xs:extension base=\"xs:string\">\n                                          <xs:attribute name=\"PreferredAlternate\" type=\"xs:string\" use=\"required\" />\n                                       </xs:extension>\n                                    </xs:simpleContent>\n                                 </xs:complexType>\n                              </xs:element>\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"DiscreteExceptions\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Term\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                  </xs:sequence>\n               </xs:complexType>\n            </xs:element>\n            <xs:element name=\"Acronyms\">\n               <xs:complexType>\n                  <xs:sequence>\n                     <xs:element name=\"CasingExceptions\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Acronym\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                  </xs:sequence>\n               </xs:complexType>\n            </xs:element>\n         </xs:sequence>\n      </xs:complexType>\n   </xs:element>\n</xs:schema>"
  },
  {
    "path": "HexgridPanel/Example/HexGridPanelExample.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2019 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridPanel.Example {\n    partial class HexgridPanelExample {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void InitializeComponent() {\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridPanelExample));\n\n            this.StatusBarToolStrip = new PGNapoleonics.HexgridPanel.Example.StatusBarToolStrip();\n            this.MenuBarToolStrip = new PGNapoleonics.HexgridPanel.Example.MenuBarToolStrip();\n\n            this.SuspendLayout();\n\n            // \n            // ToolStripContainer.TopToolStripPanel\n            // \n            this.ToolStripContainer.TopToolStripPanel.Controls.Add(this.MenuBarToolStrip.ToolStrip);\n            // \n            // ToolStripContainer.BottomToolStripPanel\n            // \n            this.ToolStripContainer.BottomToolStripPanel.Controls.Add(this.StatusBarToolStrip.ToolStrip);\n            // \n            // StatusBarToolStrip\n            // \n            this.StatusBarToolStrip.Location = new System.Drawing.Point(0, 0);\n            this.StatusBarToolStrip.Name = \"StatusBarToolStrip\";\n            this.StatusBarToolStrip.Size = new System.Drawing.Size(609, 25);\n            this.StatusBarToolStrip.StatusLabelText = \"toolStripLabel2\";\n            this.StatusBarToolStrip.TabIndex = 0;\n            // \n            // MenuBarToolStrip\n            // \n            this.MenuBarToolStrip.Location = new System.Drawing.Point(3, 0);\n            this.MenuBarToolStrip.Name = \"MenuBarToolStrip\";\n            this.MenuBarToolStrip.Size = new System.Drawing.Size(744, 25);\n            this.MenuBarToolStrip.TabIndex = 0;\n\n            this.MenuBarToolStrip.TextPathCutoverChanged += TextPathCutoverChanged;\n            this.MenuBarToolStrip.SelectedLandmarkChanged += SelectedLandmarkChanged;\n            this.MenuBarToolStrip.MapChanged += MapChanged;\n            this.MenuBarToolStrip.ShowFovToggled += ShowFovToggled;\n            this.MenuBarToolStrip.ShowPathArrowToggled += ShowPathArrowToggled;\n            this.MenuBarToolStrip.ShowRangeLineToggled += ShowRangeLineToggled;\n            this.MenuBarToolStrip.IsTransposedToggled += IsTransposedToggled;\n            // \n            // HexgridPanelExample\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(770, 420);\n            this.Name = \"HexgridPanelExample\";\n            this.Text = \"Hexgrid Panel Example (WinForms)\";\n            this.ResumeLayout(false);\n\n        }\n\n        #endregion\n\n        private PGNapoleonics.HexgridPanel.Example.StatusBarToolStrip StatusBarToolStrip;\n        private PGNapoleonics.HexgridPanel.Example.MenuBarToolStrip MenuBarToolStrip;\n    }\n}"
  },
  {
    "path": "HexgridPanel/Example/HexGridPanelExample.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FieldOfView;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.Storage;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\nusing PGNapoleonics.HexgridExampleCommon;\n\nnamespace PGNapoleonics.HexgridPanel.Example {\n    using MapGridDisplay = MapDisplay<IHex>;\n\n    /// <summary>An example <see cref=\"Form\"/> extending <see cref=\"HexgridPanelForm\"/>.</summary>\n    public sealed partial class HexgridPanelExample : HexgridPanelForm {\n        private bool           _isPanelResizeSuppressed = false;\n\n        public HexgridPanelExample() {\n            InitializeComponent();\n\n            MenuBarToolStrip.LoadTraceMenu();\n            MenuBarToolStrip.LoadMapList(MapList.Maps.Select(item => item.MapName).ToArray());\n        }\n\n        protected override CreateParams CreateParams => this.SetCompositedStyle(base.CreateParams);\n\n        #region Event handlers\n        protected override void OnResizeBegin(EventArgs e) {\n            base.OnResizeBegin(e);\n            _isPanelResizeSuppressed = true;\n        }\n        protected override void OnResize(EventArgs e) {\n            base.OnResize(e);\n            if (IsHandleCreated && ! _isPanelResizeSuppressed) HexgridPanel.SetScrollLimits(MapBoard);\n        }\n        protected override void OnResizeEnd(EventArgs e) {\n            base.OnResizeEnd(e);\n            _isPanelResizeSuppressed = false;\n            HexgridPanel.SetScrollLimits(MapBoard);\n        }\n\n        private void TextPathCutoverChanged(object sender, EventArgs<int> e)\n        =>  RefreshAfter(() => {\n                MapBoard.FovRadius   =\n                MapBoard.RangeCutoff = e.Value;\n            }); \n\n        private void SelectedLandmarkChanged(object sender, EventArgs<int> e)\n        => RefreshAfter(() => {\n            MapBoard.LandmarkToShow = e.Value;\n            HexgridPanel.SetMapDirty();\n        });\n\n        private void MapChanged(object sender, EventArgs<string> e)\n        =>  SetMapBoard(ParseMapName(e.Value));\n\n        private void ShowFovToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => MapBoard.ShowFov = e.Value);\n\n        private void ShowPathArrowToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => MapBoard.ShowPathArrow = e.Value);\n\n        private void ShowRangeLineToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => {\n            MapBoard.ShowRangeLine = e.Value;\n            HexgridPanel.SetMapDirty();\n            MapBoard.StartHex = MapBoard.StartHex; // Indirect, but it works.\n        } );\n\n        private void IsTransposedToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => {\n            HexgridPanel.IsTransposed = e.Value;\n        });\n\n        protected override void HexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n            var hotHex       = MapBoard.HotspotHex;\n            base.HexgridPanel_MouseMove(sender,e);\n            StatusBarToolStrip.StatusLabelText = string.Format(CustomCoords,\n                    Properties.Resources.StatusLabelText,\n                    hotHex, hotHex, hotHex,\n                    MapBoard.StartHex - hotHex, MapBoard.Path.Match(path=>path.TotalCost, ()=>0))\n                + $\"  Elevation: Ground={MapBoard.ElevationGroundASL(hotHex)};\"\n                + $\" Observer={MapBoard.ElevationObserverASL(hotHex)};\"\n                + $\" Target={MapBoard.ElevationTargetASL(hotHex)}\"; \n        }\n\n        private void MenuItemHelpContents_Click(object sender, EventArgs e) {\n    //      helpProvider1.SetShowHelp(this,true);\n        }\n\n        private static IPanelModel ParseMapName(string mapName)\n        =>  MapList.Maps.First(item => item.MapName == mapName).MapBoard;\n\n        private void SetMapBoard(IPanelModel mapBoard) {\n            HexgridPanel.SetModel( MapBoard = mapBoard);\n            MapBoard.ShowPathArrow = MenuBarToolStrip.ShowPathArrow;\n            MapBoard.ShowFov       = MenuBarToolStrip.ShowFieldOfView;\n            MapBoard.FovRadius     =\n            MapBoard.RangeCutoff   = MenuBarToolStrip.PathCutover;\n            MenuBarToolStrip.LoadLandmarkMenu(MapBoard.Landmarks);\n\n            CustomCoords = new CustomCoords(new IntMatrix2D(2,0, 0,-2, 0,2*MapBoard.MapSizeHexes.Height-1, 2));\n \n            HexgridPanel.Focus();\n       }\n\n        private void LandmarksReady(object sender,EventArgs<ILandmarkCollection> e) {\n            if (InvokeRequired) {\n                Invoke ((Action) delegate { MenuBarToolStrip.LoadLandmarkMenu(e.Value); });\n            } else {\n                MenuBarToolStrip.LoadLandmarkMenu(e.Value);\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/HexGridPanelExample.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridPanel/Example/HexgridBufferedPanelExample.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2019 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridPanel.Example {\n    partial class HexgridBufferedPanelExample {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n        private void InitializeComponent() {\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridBufferedPanelExample));\n\n            this.StatusBarToolStrip = new PGNapoleonics.HexgridPanel.Example.StatusBarToolStrip();\n            this.MenuBarToolStrip = new PGNapoleonics.HexgridPanel.Example.MenuBarToolStrip();\n\n            this.SuspendLayout();\n\n            // \n            // ToolStripContainer.TopToolStripPanel\n            // \n            this.ToolStripContainer.TopToolStripPanel.Controls.Add(this.MenuBarToolStrip.ToolStrip);\n            // \n            // ToolStripContainer.BottomToolStripPanel\n            // \n            this.ToolStripContainer.BottomToolStripPanel.Controls.Add(this.StatusBarToolStrip.ToolStrip);\n            // \n            // StatusBarToolStrip\n            // \n            this.StatusBarToolStrip.Location = new System.Drawing.Point(0, 0);\n            this.StatusBarToolStrip.Name = \"StatusBarToolStrip\";\n            this.StatusBarToolStrip.Size = new System.Drawing.Size(609, 25);\n            this.StatusBarToolStrip.StatusLabelText = \"toolStripLabel2\";\n            this.StatusBarToolStrip.TabIndex = 0;\n            // \n            // MenuBarToolStrip\n            // \n            this.MenuBarToolStrip.Location = new System.Drawing.Point(3, 0);\n            this.MenuBarToolStrip.Name = \"MenuBarToolStrip\";\n            this.MenuBarToolStrip.Size = new System.Drawing.Size(744, 25);\n            this.MenuBarToolStrip.TabIndex = 0;\n\n            this.MenuBarToolStrip.TextPathCutoverChanged += TextPathCutoverChanged;\n            this.MenuBarToolStrip.SelectedLandmarkChanged += SelectedLandmarkChanged;\n            this.MenuBarToolStrip.MapChanged += MapChanged;\n            this.MenuBarToolStrip.ShowFovToggled += ShowFovToggled;\n            this.MenuBarToolStrip.ShowPathArrowToggled += ShowPathArrowToggled;\n            this.MenuBarToolStrip.ShowRangeLineToggled += ShowRangeLineToggled;\n            this.MenuBarToolStrip.IsTransposedToggled += IsTransposedToggled;\n            // \n            // HexgridBufferedPanelForm\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(770, 420);\n            this.Name = \"HexgridBufferedPanelForm\";\n            this.Text = \"HexgridScrollableExample (Buffered-Winforms)\";\n            this.ResumeLayout(false);\n\n        }\n\n        private PGNapoleonics.HexgridPanel.Example.StatusBarToolStrip StatusBarToolStrip;\n        private PGNapoleonics.HexgridPanel.Example.MenuBarToolStrip MenuBarToolStrip;\n        #endregion\n    }\n}"
  },
  {
    "path": "HexgridPanel/Example/HexgridBufferedPanelExample.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.FieldOfView;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.Storage;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\nusing PGNapoleonics.HexgridExampleCommon;\n\nnamespace PGNapoleonics.HexgridPanel.Example {\n    using MapGridDisplay = Map<TerrainGridHex>;\n\n    public sealed partial class HexgridBufferedPanelExample : HexgridBufferedPanelForm {\n        private bool           _isPanelResizeSuppressed = false;\n\n        public HexgridBufferedPanelExample() {\n            InitializeComponent();\n\n            MenuBarToolStrip.LoadTraceMenu();\n            MenuBarToolStrip.LoadMapList(MapList.Maps.Select(item => item.MapName).ToArray());\n        }\n        protected override CreateParams CreateParams => this.SetCompositedStyle(base.CreateParams);\n\n        #region Event handlers\n        protected override void OnResizeBegin(EventArgs e) {\n            base.OnResizeBegin(e);\n            _isPanelResizeSuppressed = true;\n        }\n        protected override void OnResize(EventArgs e) {\n            base.OnResize(e);\n            if (IsHandleCreated && ! _isPanelResizeSuppressed) HexgridPanel.SetScrollLimits(MapBoard);\n        }\n        protected override void OnResizeEnd(EventArgs e) {\n            base.OnResizeEnd(e);\n            _isPanelResizeSuppressed = false;\n            HexgridPanel.SetScrollLimits(MapBoard);\n        }\n\n        private void TextPathCutoverChanged(object sender, EventArgs<int> e)\n        =>  RefreshAfter(() => {\n                MapBoard.FovRadius   =\n                MapBoard.RangeCutoff = e.Value;\n            }); \n\n        private void SelectedLandmarkChanged(object sender, EventArgs<int> e)\n        => RefreshAfter(() => {\n            MapBoard.LandmarkToShow = e.Value;\n            HexgridPanel.SetMapDirty();\n        });\n\n        private void MapChanged(object sender, EventArgs<string> e)\n        =>  SetMapBoard(ParseMapName(e.Value));\n\n        private void ShowFovToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => MapBoard.ShowFov = e.Value);\n\n        private void ShowPathArrowToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => MapBoard.ShowPathArrow = e.Value);\n\n        private void ShowRangeLineToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => {\n            MapBoard.ShowRangeLine = e.Value;\n            HexgridPanel.SetMapDirty();\n            MapBoard.StartHex = MapBoard.StartHex; // Indirect, but it works.\n        } );\n\n        private void IsTransposedToggled(object sender, EventArgs<bool> e)\n        =>  RefreshAfter(() => {\n            HexgridPanel.IsTransposed = e.Value;\n        });\n\n        protected override void HexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n            var hotHex       = MapBoard.HotspotHex;\n            base.HexgridPanel_MouseMove(sender,e);\n            StatusBarToolStrip.StatusLabelText = string.Format(CustomCoords,\n                    Properties.Resources.StatusLabelText,\n                    hotHex, hotHex, hotHex,\n                    MapBoard.StartHex - hotHex, MapBoard.Path.Match(path=>path.TotalCost, ()=>0))\n                + $\"  Elevation: Ground={MapBoard.ElevationGroundASL(hotHex)};\"\n                + $\" Observer={MapBoard.ElevationObserverASL(hotHex)};\"\n                + $\" Target={MapBoard.ElevationTargetASL(hotHex)}\"; \n        }\n\n        private void MenuItemHelpContents_Click(object sender, EventArgs e) {\n    //      helpProvider1.SetShowHelp(this,true);\n        }\n\n        private static IPanelModel ParseMapName(string mapName)\n        =>  MapList.Maps.First(item => item.MapName == mapName).MapBoard;\n\n        private void SetMapBoard(IPanelModel mapBoard) {\n            HexgridPanel.SetModel( MapBoard = mapBoard);\n            MapBoard.ShowPathArrow = MenuBarToolStrip.ShowPathArrow;\n            MapBoard.ShowFov       = MenuBarToolStrip.ShowFieldOfView;\n            MapBoard.FovRadius     =\n            MapBoard.RangeCutoff   = MenuBarToolStrip.PathCutover;\n            MenuBarToolStrip.LoadLandmarkMenu(MapBoard.Landmarks);\n\n            CustomCoords = new CustomCoords(new IntMatrix2D(2,0, 0,-2, 0,2*MapBoard.MapSizeHexes.Height-1, 2));\n \n            HexgridPanel.Focus();\n       }\n\n        private void LandmarksReady(object sender,EventArgs<ILandmarkCollection> e) {\n            if (InvokeRequired) {\n                Invoke ((Action) delegate { MenuBarToolStrip.LoadLandmarkMenu(e.Value); });\n            } else {\n                MenuBarToolStrip.LoadLandmarkMenu(e.Value);\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/HexgridBufferedPanelExample.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridPanel/Example/MenuBarToolStrip.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel.Example {\n    partial class MenuBarToolStrip {\n        /// <summary> \n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary> \n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Component Designer generated code\n\n        /// <summary> \n        /// Required method for Designer support - do not modify \n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent() {\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridPanelExample));\n\n            components = new System.ComponentModel.Container();\n\n            this.toolStrip = new System.Windows.Forms.ToolStrip();\n            this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n            this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n            this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n            this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n            this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n            this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n            this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n            this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n            this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n            this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n            this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n            this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n            this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n\n            this.SuspendLayout();\n\n            // \n            // toolStrip2\n            // \n            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;\n            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n                this.buttonTransposeMap,\n                this.buttonRangeLine,\n                this.buttonFieldOfView,\n                this.buttonPathArrow,\n                this.comboBoxMapSelection,\n                this.lblPathCutover,\n                this.txtPathCutover,\n                this.toolStripSeparator2,\n                this.lblLandmark,\n                this.menuItemLandmarks,\n                this.toolStripSeparator1,\n                this.menuItemDebug,\n                this.toolStripSeparator3,\n                this.menuItemHelp\n            });\n            this.toolStrip.Location = new System.Drawing.Point(3, 0);\n            this.toolStrip.Name = \"toolStrip2\";\n            this.toolStrip.Size = new System.Drawing.Size(744, 25);\n            this.toolStrip.TabIndex = 0;\n            // \n            // buttonTransposeMap\n            // \n            this.buttonTransposeMap.AutoSize = false;\n            this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n            this.buttonTransposeMap.CheckOnClick = true;\n            this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n            this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n            this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n            this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n            this.buttonTransposeMap.Text = \"Transpose\";\n            this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n            this.buttonTransposeMap.Click += this.ButtonTransposeMap_Click;\n            // \n            // buttonRangeLine\n            // \n            this.buttonRangeLine.AutoSize = false;\n            this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n            this.buttonRangeLine.CheckOnClick = true;\n            this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n            this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.buttonRangeLine.Name = \"buttonRangeLine\";\n            this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n            this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n            this.buttonRangeLine.Text = \"Range Line\";\n            this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n            this.buttonRangeLine.CheckedChanged += this.ButtonRangeLine_Click;\n            // \n            // buttonFieldOfView\n            // \n            this.buttonFieldOfView.AutoSize = false;\n            this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n            this.buttonFieldOfView.Checked = true;\n            this.buttonFieldOfView.CheckOnClick = true;\n            this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n            this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n            this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n            this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n            this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n            this.buttonFieldOfView.Text = \"FOV\";\n            this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n            this.buttonFieldOfView.Click += this.ButtonFieldOfView_Click;\n            // \n            // buttonPathArrow\n            // \n            this.buttonPathArrow.AutoSize = false;\n            this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n            this.buttonPathArrow.Checked = true;\n            this.buttonPathArrow.CheckOnClick = true;\n            this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n            this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n            this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.buttonPathArrow.Name = \"buttonPathArrow\";\n            this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n            this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n            this.buttonPathArrow.Text = \"Path Arrow\";\n            this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n            this.buttonPathArrow.CheckedChanged += this.ButtonPathArrow_Click;\n            // \n            // comboBoxMapSelection\n            // \n            this.comboBoxMapSelection.AutoSize = false;\n            this.comboBoxMapSelection.CausesValidation = false;\n            this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n            this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n            this.comboBoxMapSelection.Text = \"Map:\";\n            this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n            this.comboBoxMapSelection.SelectedIndexChanged += this.ComboBoxMapSelection_SelectionChanged;\n            // \n            // lblPathCutover\n            // \n            this.lblPathCutover.Name = \"lblPathCutover\";\n            this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n            this.lblPathCutover.Text = \"Path Cutover:\";\n            this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n            // \n            // txtPathCutover\n            // \n            this.txtPathCutover.Name = \"txtPathCutover\";\n            this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n            this.txtPathCutover.Tag = 20;\n            this.txtPathCutover.Text = \"20\";\n            this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n            this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n            this.txtPathCutover.TextChanged += this.TxtPathCutover_TextChanged;\n            // \n            // toolStripSeparator2\n            // \n            this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n            // \n            // lblLandmark\n            // \n            this.lblLandmark.Name = \"lblLandmark\";\n            this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n            this.lblLandmark.Text = \"Landmark:\";\n            this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n            // \n            // menuItemLandmarks\n            // \n            this.menuItemLandmarks.AutoSize = false;\n            this.menuItemLandmarks.Items.AddRange(new object[] {\n                    \"None\"});\n            this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n            this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n            this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n            // \n            // toolStripSeparator1\n            // \n            this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n            // \n            // menuItemDebug\n            // \n            this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.menuItemDebug.Name = \"menuItemDebug\";\n            this.menuItemDebug.Size = new System.Drawing.Size(86, 22);\n            this.menuItemDebug.Text = \"&Debug Trace\";\n            this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n            // \n            // toolStripSeparator3\n            // \n            this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n            this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n            // \n            // menuItemHelp\n            // \n            this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n            this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n            this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n            this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n            this.menuItemHelp.Name = \"menuItemHelp\";\n            this.menuItemHelp.ShowDropDownArrow = false;\n            this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n            this.menuItemHelp.Text = \"&Help\";\n            this.menuItemHelp.Visible = false;\n            // \n            // menuItemHelpContents\n            // \n            this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n            this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n            this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n            this.menuItemHelpContents.Text = \"&Contents\";\n            this.menuItemHelpContents.Click += new System.EventHandler(this.MenuItemHelpContents_Click);\n            // \n            // toolStripSeparator4\n            // \n            this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n            this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n            // \n            // menuItemHelpAbout\n            // \n            this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n            this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n            this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n            // \n            // MenuBarToolStrip\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(770, 420);\n            this.Name = \"HexgridPanelExample\";\n            this.Text = \"Hexgrid Panel Example (WinForms)\";\n            this.ResumeLayout(false);\n        }\n\n        #endregion\n\n        private System.Windows.Forms.ToolStrip toolStrip;\n        private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n        private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n        private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n        private System.Windows.Forms.ToolStripLabel lblPathCutover;\n        private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n        private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n        private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n        private System.Windows.Forms.ToolStripLabel lblLandmark;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n        private System.Windows.Forms.ToolStripButton buttonPathArrow;\n        private System.Windows.Forms.ToolStripButton buttonRangeLine;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n        private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n        private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n        private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/MenuBarToolStrip.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Windows.Forms;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexgridPanel.Example {\n    using HexSize = System.Drawing.Size;\n\n    public partial class MenuBarToolStrip: UserControl {\n        public MenuBarToolStrip() => InitializeComponent();\n\n        public event EventHandler<EventArgs<int>>    TextPathCutoverChanged;\n        public event EventHandler<EventArgs<int>>    SelectedLandmarkChanged;\n        public event EventHandler<EventArgs<string>> MapChanged;\n        public event EventHandler<EventArgs<bool>>   ShowFovToggled;\n        public event EventHandler<EventArgs<bool>>   ShowPathArrowToggled;\n        public event EventHandler<EventArgs<bool>>   ShowRangeLineToggled;\n        public event EventHandler<EventArgs<bool>>   IsTransposedToggled;\n\n        public ToolStrip ToolStrip       => toolStrip;\n        public int       PathCutover     => int.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n        public bool      ShowPathArrow   => buttonPathArrow.Checked;\n        public bool      ShowFieldOfView => buttonFieldOfView.Checked;\n\n        public Tracing EnabledTraces { get; private set; } = Tracing.None;\n\n        public void LoadMapList(object[] mapNames) {\n            comboBoxMapSelection.Items.AddRange(mapNames);\n            comboBoxMapSelection.SelectedIndex = 0;\n        }\n\n        public void LoadLandmarkMenu(ILandmarkCollection landmarks) {\n            menuItemLandmarks.Items.Clear();\n            menuItemLandmarks.Items.Add(\"None\");\n            landmarks?.ForEach(landmark => menuItemLandmarks.Items.Add($\"{landmark.Coords}\") );\n\n            menuItemLandmarks.SelectedIndexChanged += new EventHandler(MenuItemLandmarks_SelectedIndexChanged);\n            menuItemLandmarks.SelectedIndex = 0; \n        }\n\n        [Conditional(\"TRACE\")]\n        public void LoadTraceMenu()\n        =>  Tracing.ForEachKey(item => LoadTraceMenuItem(item,MenuItemDebugTracing_Click), n => n!=\"None\");\n\n        [Conditional(\"TRACE\")]\n        void LoadTraceMenuItem(string item, EventHandler handler) {\n            var menuItem = new ToolStripMenuItem() {\n                Name         = \"menuItemDebugTracing\" + item.ToString(),\n                Size         = new HexSize(143, 22),\n                Text         = item.ToString(),\n                CheckOnClick = true\n            };\n            menuItem.Click += handler;\n            menuItemDebug.DropDownItems.Add(menuItem);\n        }\n\n        private void TxtPathCutover_TextChanged(object sender, EventArgs e) {\n            if(int.TryParse(txtPathCutover.Text, out var value)) {\n                txtPathCutover.Tag = value;\n            } else {\n                txtPathCutover.Text = txtPathCutover.Tag.ToString();\n                value = (int)txtPathCutover.Tag;\n            }\n\n            TextPathCutoverChanged?.Invoke(sender, new EventArgs<int>(value));\n        }\n\n        private void MenuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e)\n        =>  SelectedLandmarkChanged?.Invoke(sender, new EventArgs<int>(menuItemLandmarks.SelectedIndex));\n\n        private void MenuItemDebugTracing_Click(object sender, EventArgs e) {\n            var item = (ToolStripMenuItem)sender;\n            item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n            var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n            var flag = Tracing.Item(name);\n            if( item.Checked)   EnabledTraces |=  flag;\n            else                EnabledTraces &= ~flag;\n        }\n\n        private void MenuItemHelpContents_Click(object sender, EventArgs e) {\n    //      helpProvider1.SetShowHelp(this,true);\n        }\n\n        private void ComboBoxMapSelection_SelectionChanged(object sender, EventArgs e)\n        =>  MapChanged?.Invoke(sender, new EventArgs<string>(((ToolStripItem)sender).Text));\n        \n        private void ButtonFieldOfView_Click(object sender, EventArgs e)\n        => ShowFovToggled?.Invoke(sender, new EventArgs<bool>(buttonFieldOfView.Checked));   \n\n        private void ButtonPathArrow_Click(object sender, EventArgs e)\n        => ShowPathArrowToggled?.Invoke(sender, new EventArgs<bool>(buttonPathArrow.Checked));\n\n        private void ButtonRangeLine_Click(object sender, EventArgs e)\n        => ShowRangeLineToggled?.Invoke(sender, new EventArgs<bool>(buttonRangeLine.Checked));\n        \n        private void ButtonTransposeMap_Click(object sender, EventArgs e)\n        => IsTransposedToggled?.Invoke(sender, new EventArgs<bool>(buttonTransposeMap.Checked));\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/StatusBarToolStrip.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel.Example {\n    partial class StatusBarToolStrip {\n        /// <summary> \n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary> \n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Component Designer generated code\n\n        /// <summary> \n        /// Required method for Designer support - do not modify \n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent() {\n            this.toolStrip = new System.Windows.Forms.ToolStrip();\n            this.toolStripLabel = new System.Windows.Forms.ToolStripLabel();\n            this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n            this.SuspendLayout();\n            // \n            // toolStrip1\n            // \n            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;\n            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n                this.toolStripLabel,\n                this.statusLabel});\n            this.toolStrip.Location = new System.Drawing.Point(3, 0);\n            this.toolStrip.Name = \"toolStrip1\";\n            this.toolStrip.Size = new System.Drawing.Size(143, 25);\n            this.toolStrip.TabIndex = 0;\n            this.toolStrip.Text = \"toolStrip1\";\n            // \n            // toolStripLabel1\n            // \n            this.toolStripLabel.Name = \"toolStripLabel1\";\n            this.toolStripLabel.Size = new System.Drawing.Size(45, 22);\n            this.toolStripLabel.Text = \"Status: \";\n            // \n            // statusLabel\n            // \n            this.statusLabel.Name = \"statusLabel\";\n            this.statusLabel.Size = new System.Drawing.Size(86, 22);\n            this.statusLabel.Text = \"toolStripLabel2\";\n            this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n            // \n            // StatusBarToolStrip\n            // \n            this.Controls.Add(this.toolStrip);\n            this.Name = \"StatusBarToolStrip\";\n            this.Size = new System.Drawing.Size(609, 25);\n            this.ResumeLayout(false);\n            this.PerformLayout();\n        }\n\n        #endregion\n\n        private System.Windows.Forms.ToolStrip toolStrip;\n        private System.Windows.Forms.ToolStripLabel toolStripLabel;\n        private System.Windows.Forms.ToolStripLabel statusLabel;\n   }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/StatusBarToolStrip.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.Example {\n    public partial class StatusBarToolStrip : UserControl {\n        public StatusBarToolStrip() => InitializeComponent();\n\n        public string StatusLabelText {\n            get => statusLabel.Text;\n            set => statusLabel.Text = value;\n        }\n\n        public ToolStrip ToolStrip => toolStrip;\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Example/StatusBarToolStrip.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n</root>"
  },
  {
    "path": "HexgridPanel/GraphicsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public static partial class GraphicsExtensions {\n        /// <summary>TODO</summary>\n        public static void Contain(this Graphics graphics, Action<Graphics> drawingCommands) {\n            if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n            var container = graphics.BeginContainer();\n            drawingCommands?.Invoke(graphics);\n            graphics.EndContainer(container); \n        }\n\n        /// <summary>Paints, scaled and translated, the supplied <paramref name=\"action\"/> to the\n        /// specified <paramref name=\"graphics\"/>.</summary>\n        /// <param name=\"graphics\">Target <see cref=\"Graphics\"/> to be rendered to.</param>\n        /// <param name=\"point\"><see cref=\"Point\"/> at which to render <paramref name=\"action\"/>.</param>\n        /// <param name=\"scale\">Scale at which the source should be drawn.</param>\n        /// <param name=\"action\">The drawing action to be performed.</param>\n        public static void Paint(this Graphics graphics, Point point, float scale, Action<Graphics> action) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n            if (action   == null) throw new ArgumentNullException(\"action\");\n    \n            graphics.PageUnit = GraphicsUnit.Pixel;\n            graphics.TranslateTransform(point.X, point.Y);\n            graphics.ScaleTransform(scale,scale);\n\n            action(graphics);\n        }\n   }\n}\n"
  },
  {
    "path": "HexgridPanel/GraphicsMapPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexgridExampleCommon;\n\nnamespace PGNapoleonics.HexgridPanel {\n    //public class GraphicsMapPainter {\n    //    public GraphicsMapPainter() {\n\n    //    }\n\n    //    public void PaintMap<THex>(Graphics graphics, HexgridViewModel dataContext, MapPanel panel)\n    //    where THex:IHex {\n    //        if (panel.IsTransposed) { graphics.Transform = TransposeMatrix; }\n\n    //        var scroll = dataContext.Grid.GetScrollPosition(panel.AutoScrollPosition);\n    //        graphics.TranslateTransform(scroll.X + panel.Margin.Left,  scroll.Y + panel.Margin.Top);\n    //        graphics.ScaleTransform(panel.MapScale,panel.MapScale);\n    //        Tracing.PaintDetail.Trace($\"{panel.Name}.PaintBuffer - VisibleClipBounds: ({graphics.VisibleClipBounds})\");\n\n    //        using(var brush = new SolidBrush(panel.BackColor)) {\n    //            graphics.FillRectangle(brush, graphics.VisibleClipBounds);\n    //        }\n    //        graphics.Paint(Point.Empty, 1.0F, g => {\n    //            var model = dataContext.Model;\n    //            //model.PaintMap(g, true, c => from h in model[c] select h as IHex, model.Landmarks);\n    //            model.PaintMap(g, true, model.BoardHexes, model.Landmarks);\n    //        });\n    //    }\n\n    //    /// <summary>TODO</summary>\n    //    static protected Matrix TransposeMatrix => new Matrix(0F,1F, 1F,0F, 0F,0F);\n    //}\n\n    //public class GraphicsMapPainter<THex> : IMapPainter<THex> where THex:IHex {\n    //    //public void PaintHighlight<Graphics>(Graphics surface, MapDisplay<THex> map)\n    //    //=> map.PaintHighlight(surface, map.ShowRangeLine);\n\n    //    /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n    //    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    //    /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n    //    public void PaintHighlight<Graphics>(Graphics graphics,  IMapDisplay<THex> @this, bool showRangeLine)\n    //    {\n    //        graphics.Contain(g => {\n    //            g.Transform = @this.TranslateToHex(@this.StartHex);\n    //            g.DrawPath(Pens.Red, @this.HexgridPath);\n    //        });\n\n    //        if (@this.Path != null) {\n    //            graphics.Contain(g => { @this.PaintPath(g, @this.Path); });\n    //        }\n\n    //        if (showRangeLine) {\n    //            graphics.Contain(g => {\n    //                var target = @this.CentreOfHex(@this.HotspotHex);\n    //                graphics.DrawLine(Pens.Red, @this.CentreOfHex(@this.StartHex), target);\n    //                graphics.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n    //                graphics.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n    //            });\n    //        }\n    //    }\n\n    //    public void PaintMap<Graphics>(Graphics surface, IMapDisplay<THex> map)\n    //    => map.PaintMap(surface, map.ShowHexgrid, map.BoardHexes, map.Landmarks);\n\n    //    public void PaintShading<Graphics>(Graphics surface, IMapDisplay<THex> map)\n    //    => map.PaintShading(surface, map.Fov, ShadeBrushAlpha, ShadeBrushColor);\n    //}\n}\n"
  },
  {
    "path": "HexgridPanel/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary></summary>\n    public class HexEventArgs : MouseEventArgs {\n        /// <summary>TODO</summary>\n        public HexEventArgs(HexCoords coords) \n        : this(coords, Keys.None, MouseButtons.None,0,0,0,0) {}\n\n        /// <summary>TODO</summary>\n        public HexEventArgs(HexCoords coords, Keys modifierKeys) \n        : this(coords, modifierKeys, MouseButtons.None,0,0,0,0) {}\n\n        /// <summary>TODO</summary>\n        public HexEventArgs(HexCoords coords, Keys modifierKeys, \n        MouseButtons buttons, int clicks, int x, int y, int delta)\n        : base(buttons,clicks,x,y,delta) {\n            Coords       = coords;\n            ModifierKeys = modifierKeys;\n        }\n\n        /// <summary>TODO</summary>\n        public HexCoords  Coords   { get; }\n\n        /// <summary>TODO</summary>\n        public Keys   ModifierKeys { get; }\n\n        /// <summary>TODO</summary>\n        public bool       Alt      => ModifierKeys.HasFlag(Keys.Alt);\n        /// <summary>TODO</summary>\n        public bool       Control  => ModifierKeys.HasFlag(Keys.Control);\n        /// <summary>TODO</summary>\n        public bool       Shift    => ModifierKeys.HasFlag(Keys.Shift);\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridBufferedPanel.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class HexgridBufferedPanel {\n    /// <summary> Required designer variable.</summary>\n    private System.ComponentModel.IContainer components = null;\n\n    private bool _isDisposed = false;\n    /// <summary>  Clean up any resources being used. </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (components !=null) { components .Dispose();  components  = null; }\n        }\n        _isDisposed = true;\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridBufferedPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public partial class HexgridBufferedPanel : HexgridPanel {\n        /// <summary>TODO</summary>\n        public HexgridBufferedPanel() : base() => InitializeComponent();\n\n        /// <summary>Signals the object that initialization is complete.</summary>\n        public override void EndInit() { \n            base.EndInit();\n            SetStyle(ControlStyles.AllPaintingInWmPaint, true);\n            SetStyle(ControlStyles.UserPaint, true);\n            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n            SetStyle(ControlStyles.Opaque, true);\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridBufferedPanelForm.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n    partial class HexgridBufferedPanelForm {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent() {\n            this.Panel = new PGNapoleonics.HexgridPanel.HexgridBufferedPanel();\n            this.ToolStripContainer.ContentPanel.SuspendLayout();\n            this.ToolStripContainer.SuspendLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.Panel)).BeginInit();\n            this.SuspendLayout();\n            // \n            // ToolStripContainer\n            // \n            // \n            // ToolStripContainer.ContentPanel\n            // \n            this.ToolStripContainer.ContentPanel.Controls.Add(this.Panel);\n            // \n            // Panel\n            // \n            this.Panel.AutoScroll = true;\n            this.Panel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n            this.Panel.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.Panel.IsMapDirty = false;\n            this.Panel.IsTransposed = false;\n            this.Panel.IsUnitsDirty = false;\n            this.Panel.Location = new System.Drawing.Point(5, 5);\n            this.Panel.MapOrientation = PGNapoleonics.HexgridPanel.MapOrientation.ZeroDegrees;\n            this.Panel.Margin = new System.Windows.Forms.Padding(0);\n            this.Panel.Name = \"Panel\";\n            this.Panel.ScaleIndex = 0;\n            this.Panel.Size = new System.Drawing.Size(786, 436);\n            this.Panel.TabIndex = 1;\n            this.Panel.UnappliedScroll = new System.Drawing.Point(0, 0);\n\n            this.Panel.HotspotHexChange += this.PanelBoard_HotSpotHexChange;\n            this.Panel.MouseCtlClick += this.PanelBoard_GoalHexChange;\n            this.Panel.MouseLeftClick += this.PanelBoard_StartHexChange;\n            this.Panel.ScaleChange += this.HexgridPanel_ScaleChange;\n            this.Panel.MouseMove += this.HexgridPanel_MouseMove;\n            // \n            // HexgridBufferedPanelForm\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(800, 450);\n            this.Name = \"HexgridBufferedPanelForm\";\n            this.Text = \"HexgridBufferedPanelForm\";\n            this.ToolStripContainer.ContentPanel.ResumeLayout(false);\n            this.ToolStripContainer.ResumeLayout(false);\n            this.ToolStripContainer.PerformLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.Panel)).EndInit();\n            this.ResumeLayout(false);\n\n        }\n\n        private HexgridBufferedPanel Panel;\n\n        #endregion\n    }\n}"
  },
  {
    "path": "HexgridPanel/HexgridBufferedPanelForm.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexgridPanel {\n    public partial class HexgridBufferedPanelForm: TiltableForm {\n        public HexgridBufferedPanelForm() => InitializeComponent();\n\n        protected override HexgridPanel HexgridPanel => Panel;\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridBufferedPanelForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "HexgridPanel/HexgridPanel.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class HexgridPanel {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>Clean up any resources being used.</summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      // \n      // HexgridScrollable\n      // \n      this.AutoScroll = true;\n      this.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this.Dock = System.Windows.Forms.DockStyle.Fill;\n    //  this.IsTransposed = false;\n      this.Location = new System.Drawing.Point(5, 5);\n      this.Margin = new System.Windows.Forms.Padding(0);\n      this.Name = \"_hexgridPanel\";\n    //  this.ScaleIndex = 0;\n      this.Size = new System.Drawing.Size(756, 356);\n      this.TabIndex = 0;\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Storage;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    using WpfInput = System.Windows.Input;\n    using Model = IMapDisplayWinForms<IHex>;\n\n    /// <summary>Sub-class implementation of a <b>WinForms</b> Panel with integrated <see cref=\"TransposableHexgrid\"/> support.</summary>\n    [Docking(DockingBehavior.AutoDock)]\n    public partial class HexgridPanel : TiltAwareScrollableControl, ISupportInitialize {\n        /// <summary>Creates a new instance of HexgridScrollable.</summary>\n        public HexgridPanel() {\n            DataContext = new HexgridViewModel(this);\n\n            InitializeComponent();\n        }\n\n        /// <summary>Signals the object that initialization is starting.</summary>\n        public virtual void BeginInit() { ; }\n        /// <summary>Signals the object that initialization is complete.</summary>\n        public virtual void EndInit() { ; }\n\n        #region Events\n        /// <summary>Announces that the mouse is now over a new hex.</summary>\n        public event EventHandler<HexEventArgs> HotspotHexChange;\n        /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n        public event EventHandler<HexEventArgs> MouseAltClick;\n        /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n        public event EventHandler<HexEventArgs> MouseCtlClick;\n        /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n        public event EventHandler<HexEventArgs> MouseLeftClick;\n        /// <summary>Announces a mouse right-click. </summary>\n        public event EventHandler<HexEventArgs> MouseRightClick;\n        /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n        public event EventHandler<EventArgs>    ScaleChange;\n        #endregion\n\n        #region Properties\n        /// <summary>The map orientation in 90 degree increments, CCW.</summary>\n        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]\n        [EditorBrowsable(EditorBrowsableState.Always)]\n        [Browsable(true), Bindable(true), Category(\"Custom\")]\n        public MapOrientation        MapOrientation { get; set; }\n\n        /// <summary>TODO</summary>\n        public HexgridViewModel      DataContext    { get; }\n        /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n        public SizeF                 GridSizeF      => DataContext.Model.GridSize.Scale(MapScale);\n        /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n        public HexCoords             HotspotHex     => DataContext.HotspotHex;\n        /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n        public static bool           IsAltKeyDown   => ModifierKeys.HasFlag(Keys.Alt);\n        /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n        public static bool           IsCtlKeyDown   => ModifierKeys.HasFlag(Keys.Control);\n        /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n        public static bool           IsShiftKeyDown => ModifierKeys.HasFlag(Keys.Shift);\n        /// <summary>TODO</summary>\n        public         bool          IsMapDirty {\n            get => _isMapDirty;\n            set {\n                _isMapDirty = value;\n                if(_isMapDirty) { IsUnitsDirty = true; }\n            }\n        }\n        bool _isMapDirty = false;\n        /// <summary>TODO</summary>\n        public         bool          IsUnitsDirty {\n            get => _isUnitsDirty;\n            set {\n                _isUnitsDirty = value;\n                if(_isUnitsDirty) { Invalidate(); }\n            }\n        }\n        bool _isUnitsDirty = false;\n        /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n        [Browsable(true)] [Bindable(true)] [EditorBrowsable(EditorBrowsableState.Always)]\n        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]\n        [Category(\"Custom\")]\n        public         bool          IsTransposed      { get; set; }\n\n        /// <inheritdoc/>\n        public         Size          MapSizePixels     => DataContext.Model.MapSizePixels(); // + MapMargin.Scale(2);} }\n        /// <summary>Current scaling factor for map display.</summary>\n        [Browsable(false)]\n        public         float         MapScale          => DataContext.MapScale;\n        /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n        public HexCoords PanelCenterHex => GetHexCoords(Location + Size.Round(ClientSize.Scale(0.50F)));\n        /// <summary>TODO</summary>\n        public WpfInput.ICommand     RefreshCmd        => new RelayCommand(_refeshCmd);\n        void _refeshCmd(object obj ) { if (obj != null) { SetMapDirty(); }  Refresh(); }\n\n        /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n        [Browsable(false)]\n        public virtual int           ScaleIndex {\n            get => DataContext.ScaleIndex;\n            set {\n                var newValue = Math.Max(0, Math.Min(DataContext.Scales.Count-1, value));\n                var CenterHex           = PanelCenterHex;\n                DataContext.ScaleIndex = newValue;\n\n                SetScroll(CenterHex);\n                OnScaleChange(EventArgs.Empty);\n            }\n        }\n\n        /// <summary>Array of supported map scales  as IList {float}.</summary>\n        public IReadOnlyList<float>  Scales => DataContext.Scales;\n\n        /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n        public virtual CoordsRectangle VisibleRectangle\n        => GetClipInHexes(AutoScrollPosition.Scale(-1.0F / MapScale),\n                            ClientSize.Scale(1.0F / MapScale));\n        #endregion\n\n        #region Methods\n        /// <summary>TODO</summary>\n        public         void CenterOnHex(HexCoords coords) {\n            AutoScrollPosition = ScrollPositionToCenterOnHex(coords);\n            IsMapDirty = true;\n            Invalidate();\n        }\n\n        /// <summary>TODO</summary>\n        CoordsRectangle GetClipInHexes(PointF point,SizeF size) => DataContext.Model.GetClipInHexes(point,size);\n        /// <summary><c>HexCoords</c> for a selected hex.</summary>\n        /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n        /// <returns>Coordinates for a hex specified by a screen point.</returns>\n        /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n        public HexCoords GetHexCoords(Point point) => DataContext.Grid.GetHexCoords(point, new Size(AutoScrollPosition));\n\n        /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n        public virtual void SetMapDirty() => Invalidate(ClientRectangle);\n\n        /// <summary>TODO</summary>\n        public         void SetModel(IPanelModel model) {\n            SetScrollLimits(DataContext.Model);   \n            DataContext.Model = model;\n            SetMapDirty();\n        }\n\n        /// <summary>TODO</summary>\n        public         void SetPanelSize() {\n            if(DesignMode || !IsHandleCreated) return;\n            Tracing.Sizing.Trace(\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n            SetScroll(PanelCenterHex);\n        }\n\n        /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n        public virtual void SetScroll(HexCoords newCenterHex) {\n            if(DesignMode || !IsHandleCreated) return;\n            Tracing.Sizing.Trace(\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n            SetScrollLimits(DataContext.Model);\n\n            CenterOnHex(newCenterHex);\n        }\n\n        /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n        public virtual void SetScrollLimits(IPanelModel model) {\n            if (model == null  ||  !AutoScroll) return;\n            var smallChange              = Size.Ceiling(model.GridSize.Scale(MapScale));\n            HorizontalScroll.SmallChange = smallChange.Width;\n            VerticalScroll.SmallChange   = smallChange.Height;\n\n            var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n            HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n            VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n            var size                     = DataContext.Grid.GetSize(MapSizePixels,MapScale)\n                                         + Margin.Size;\n            if (AutoScrollMinSize != size) {\n                AutoScrollMinSize          = size;\n                HorizontalScroll.Maximum   = Math.Max(HorizontalScroll.Minimum, \n                                             Math.Min(HorizontalScroll.Maximum, \n                                                      Margin.Horizontal  + size.Width - ClientSize.Width));\n                VerticalScroll.Maximum     = Math.Max(VerticalScroll.Minimum, \n                                             Math.Min(VerticalScroll.Maximum, \n                                                      Margin.Vertical   + size.Height - ClientSize.Height));\n                Invalidate();\n            }\n        }\n        #endregion\n\n        #region Grid Coordinates\n        /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n        /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        public Point HexCenterPoint(HexCoords coordsNewULHex)\n        => DataContext.Grid.HexCenterPoint(coordsNewULHex);\n\n        /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n        /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        protected Point ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex)\n        => DataContext.Grid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n        #endregion\n\n        #region Painting\n        /// <inheritdoc/>\n        protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n        /// <inheritdoc/>\n        protected override void OnPaint(PaintEventArgs e) {\n            if(e==null) throw new ArgumentNullException(nameof(e));\n            if (DesignMode) { e.Graphics.FillRectangle(Brushes.Gray, ClientRectangle); return; }\n\n            if(IsHandleCreated) e.Graphics.Contain(PaintMe);\n            base.OnPaint(e);\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"graphics\"></param>\n        protected virtual void PaintMe(Graphics graphics) {\n            if (graphics==null) throw new ArgumentNullException(nameof(graphics));\n\n            if (IsTransposed) { graphics.Transform = TransposeMatrix; }\n\n            var scroll = DataContext.Grid.GetScrollPosition(AutoScrollPosition);\n            graphics.TranslateTransform(scroll.X + Margin.Left,  scroll.Y + Margin.Top);\n            graphics.ScaleTransform(MapScale,MapScale);\n            Tracing.PaintDetail.Trace($\"{Name}.PaintPanel: ({graphics.VisibleClipBounds})\");\n\n            graphics.Contain(RenderMap);\n            graphics.Contain(RenderUnits);\n            graphics.Contain(RenderShading);\n            graphics.Contain(RenderHighlight);\n        }\n        /// <inheritdoc/>\n        protected virtual void RenderHighlight(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n            DataContext.Model.PaintHighlight<IHex>(graphics);\n        }\n        /// <inheritdoc/>\n        protected virtual void RenderMap(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(nameof(graphics));\n            using(var brush = new SolidBrush(BackColor)) graphics.FillRectangle(brush, graphics.VisibleClipBounds);\n            var model = DataContext.Model;\n            model.PaintMap<IHex>(graphics, true);\n        }\n        /// <inheritdoc/>\n        protected virtual void RenderShading(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n            DataContext.Model.PaintShading<IHex>(graphics,DataContext.Model?.Fov);\n        }\n        /// <inheritdoc/>\n        protected virtual void RenderUnits(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n            DataContext.Model.PaintUnits<IHex>(graphics);\n        }\n\n        /// <summary>TODO</summary>\n        static protected Matrix TransposeMatrix => new Matrix(0F,1F,1F,0F,0F,0F);\n        #endregion\n\n        /// <summary>TODO</summary>\n        protected override void OnMarginChanged(EventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            base.OnMarginChanged(e);\n            DataContext.Margin = Margin;\n        }\n\n        #region Mouse event handlers\n        /// <inheritdoc/>\n        protected override void OnMouseClick(MouseEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n            Tracing.Mouse.Trace($\" - {Name}.OnMouseClick - Shift: {IsShiftKeyDown}; Ctl: {IsCtlKeyDown}; Alt: {IsAltKeyDown}\");\n\n            var coords    = GetHexCoords(e.Location);\n            var eventArgs = new HexEventArgs(coords, ModifierKeys,e.Button,e.Clicks,e.X,e.Y,e.Delta);\n\n                 if (e.Button == MouseButtons.Middle) base.OnMouseClick(eventArgs);\n            else if (e.Button == MouseButtons.Right)  this.OnTargetHexSelected(eventArgs);\n            else if (IsAltKeyDown  && !IsCtlKeyDown)  this.OnMouseAltClick(eventArgs);\n            else if (IsCtlKeyDown)                    this.OnTargetHexSelected(eventArgs);\n            else                                      this.OnStartHexSelected(eventArgs);\n        }\n        /// <inheritdoc/>\n        protected override void OnMouseMove(MouseEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n            OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n            base.OnMouseMove(e);\n        }\n\n        /// <summary>Raise the MouseAltClick event.</summary>\n        protected virtual void OnMouseAltClick(HexEventArgs e) => MouseAltClick?.Invoke(this,e);\n        /// <summary>Raise the MouseCtlClick event.</summary>\n        protected virtual void OnTargetHexSelected(HexEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n            DataContext.Model.GoalHex = e.Coords;\n            MouseCtlClick?.Invoke(this,e);\n            Refresh();\n        }\n        /// <summary>Raise the MouseLeftClick event.</summary>\n        protected virtual void OnStartHexSelected(HexEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n            DataContext.Model.StartHex = e.Coords;\n            MouseLeftClick?.Invoke(this,e);\n            Refresh();\n        }\n\n        /// <summary>Raise the HotspotHexChange event.</summary>\n        protected virtual void OnHotspotHexChange(HexEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n            DataContext.Model.HotspotHex = e.Coords;\n            HotspotHexChange?.Invoke(this,e);\n            Refresh();\n        }\n\n        /// <summary>Raise the ScaleChange event.</summary>\n        protected virtual void OnScaleChange(EventArgs e) {\n            SetMapDirty();\n            OnResize(e);\n            Invalidate();\n            ScaleChange?.Invoke(this, e);\n        }\n\n        /// <inheritdoc/>\n        protected override void OnResize(EventArgs e) {\n            SetScrollLimits(DataContext.Model);\n            base.OnResize(e);\n        }\n        #endregion\n\n        #region MouseWheel & Scroll event handlers\n        /// <inheritdoc/>\n        protected override void OnMouseWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            Tracing.ScrollEvents.Trace($\" - {Name}.OnMouseWheel: {e.ToString()}\");\n\n            if (ModifierKeys.HasFlag(Keys.Control)) { ScaleIndex += Math.Sign(e.Delta); }\n            else if (IsShiftKeyDown) {\n                base.OnMouseHWheel(e);\n            } else{\n                base.OnMouseWheel(e);\n            }\n            if(e is HandledMouseEventArgs he) { he.Handled = true; }\n        }\n\n        /// <summary>TODO</summary>\n        public void ScrollPanelVertical(ScrollEventType type, int sign)\n        =>  ScrollPanelCommon(type, sign, VerticalScroll);\n\n        /// <summary>TODO</summary>\n        public void ScrollPanelHorizontal(ScrollEventType type, int sign)\n        =>  ScrollPanelCommon(type, sign, HorizontalScroll);\n\n        /// <summary>TODO</summary>\n        private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n            if (sign == 0) return;\n            Point func(Point p,int step) => new Point(-p.X,-p.Y + step * sign);\n            AutoScrollPosition = func(AutoScrollPosition,\n                type.HasFlag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridPanel.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridPanel</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexgridPanel</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <HighEntropyVA>False</HighEntropyVA>\n    <DynamicBase>False</DynamicBase>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n    <CodeContractsAssemblyMode>1</CodeContractsAssemblyMode>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>\n    </DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n    <BaseAddress>258277376</BaseAddress>\n    <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>\n    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>\n    <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>\n    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>\n    <CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers>\n    <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>\n    <CodeContractsNonNullObligations>True</CodeContractsNonNullObligations>\n    <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>\n    <CodeContractsArithmeticObligations>True</CodeContractsArithmeticObligations>\n    <CodeContractsEnumObligations>True</CodeContractsEnumObligations>\n    <CodeContractsRedundantAssumptions>True</CodeContractsRedundantAssumptions>\n    <CodeContractsAssertsToContractsCheckBox>True</CodeContractsAssertsToContractsCheckBox>\n    <CodeContractsRedundantTests>True</CodeContractsRedundantTests>\n    <CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings>\n    <CodeContractsMissingPublicEnsuresAsWarnings>True</CodeContractsMissingPublicEnsuresAsWarnings>\n    <CodeContractsInferRequires>True</CodeContractsInferRequires>\n    <CodeContractsInferEnsures>True</CodeContractsInferEnsures>\n    <CodeContractsInferEnsuresAutoProperties>True</CodeContractsInferEnsuresAutoProperties>\n    <CodeContractsInferObjectInvariants>True</CodeContractsInferObjectInvariants>\n    <CodeContractsSuggestAssumptions>False</CodeContractsSuggestAssumptions>\n    <CodeContractsSuggestAssumptionsForCallees>True</CodeContractsSuggestAssumptionsForCallees>\n    <CodeContractsSuggestRequires>False</CodeContractsSuggestRequires>\n    <CodeContractsNecessaryEnsures>True</CodeContractsNecessaryEnsures>\n    <CodeContractsSuggestObjectInvariants>False</CodeContractsSuggestObjectInvariants>\n    <CodeContractsSuggestReadonly>True</CodeContractsSuggestReadonly>\n    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>\n    <CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>\n    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>\n    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>\n    <CodeContractsCustomRewriterAssembly />\n    <CodeContractsCustomRewriterClass />\n    <CodeContractsLibPaths />\n    <CodeContractsExtraRewriteOptions />\n    <CodeContractsExtraAnalysisOptions>-timeout 15</CodeContractsExtraAnalysisOptions>\n    <CodeContractsSQLServerOption>%28LocalDb%29\\MSSQLLocalDB</CodeContractsSQLServerOption>\n    <CodeContractsBaseLineFile />\n    <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>\n    <CodeContractsSkipAnalysisIfCannotConnectToCache>False</CodeContractsSkipAnalysisIfCannotConnectToCache>\n    <CodeContractsFailBuildOnWarnings>False</CodeContractsFailBuildOnWarnings>\n    <CodeContractsBeingOptimisticOnExternal>True</CodeContractsBeingOptimisticOnExternal>\n    <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>\n    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>\n    <CodeContractsAnalysisWarningLevel>1</CodeContractsAnalysisWarningLevel>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexgridPanel.xml</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <BaseAddress>258277376</BaseAddress>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>false</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <FileAlignment>512</FileAlignment>\n    <HighEntropyVA>False</HighEntropyVA>\n    <DynamicBase>False</DynamicBase>\n    <BaseAddress>258277376</BaseAddress>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Accessibility\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AbstractModelDisplayPainter.cs\" />\n    <Compile Include=\"BitmapExtensions.cs\" />\n    <Compile Include=\"Example\\HexgridBufferedPanelExample.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"Example\\HexgridBufferedPanelExample.Designer.cs\">\n      <DependentUpon>HexgridBufferedPanelExample.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Example\\MenuBarToolStrip.cs\">\n      <SubType>UserControl</SubType>\n    </Compile>\n    <Compile Include=\"Example\\MenuBarToolStrip.Designer.cs\">\n      <DependentUpon>MenuBarToolStrip.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"GraphicsExtensions.cs\" />\n    <Compile Include=\"GraphicsMapPainter.cs\" />\n    <Compile Include=\"HexEventArgs.cs\" />\n    <Compile Include=\"Example\\HexGridPanelExample.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"Example\\HexGridPanelExample.Designer.cs\">\n      <DependentUpon>HexGridPanelExample.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridBufferedPanelForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexgridBufferedPanelForm.Designer.cs\">\n      <DependentUpon>HexgridBufferedPanelForm.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"IMapDisplayPainter.cs\" />\n    <Compile Include=\"MapDisplayPainterExtensions.cs\" />\n    <Compile Include=\"MapOrientation.cs\" />\n    <Compile Include=\"TiltableForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"TiltableForm.Designer.cs\">\n      <DependentUpon>TiltableForm.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridPanelForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexgridPanelForm.Designer.cs\">\n      <DependentUpon>HexgridPanelForm.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"MapPanel.Designer.cs\">\n      <DependentUpon>MapPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapPanelCached.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"MapPanelCached.Designer.cs\">\n      <DependentUpon>MapPanelCached.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Example\\StatusBarToolStrip.cs\">\n      <SubType>UserControl</SubType>\n    </Compile>\n    <Compile Include=\"Example\\StatusBarToolStrip.Designer.cs\">\n      <DependentUpon>StatusBarToolStrip.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\BufferedGraphicsExtensions.cs\" />\n    <Compile Include=\"HexgridBufferedPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridBufferedPanel.Designer.cs\">\n      <DependentUpon>HexgridBufferedPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"MapDisplayPainter.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\ControlExtensions.cs\" />\n    <Compile Include=\"IScrollableControl.cs\" />\n    <Compile Include=\"WinForms\\Layer.cs\" />\n    <Compile Include=\"WinForms\\LayerCollection.cs\" />\n    <Compile Include=\"WinForms\\NativeMethodsTreeView.cs\" />\n    <Compile Include=\"WinForms\\ScrollableControlExtensions.cs\" />\n    <Compile Include=\"WinForms\\TiltAwareFlowLayoutPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\TiltAwarePanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridPanel.Designer.cs\">\n      <DependentUpon>HexgridPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridViewModel.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\LayeredScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\LayeredScrollable.Designer.cs\">\n      <DependentUpon>LayeredScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ViewModelBase.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.Designer.cs\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\GdiRasterOps.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\ThreadExceptionHandler.cs\" />\n    <Compile Include=\"WinForms\\TiltAwareScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\TiltAwareTreeView.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\TiltAwareTreeView.Designer.cs\">\n      <DependentUpon>TiltAwareTreeView.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Example\\HexgridBufferedPanelExample.resx\">\n      <DependentUpon>HexgridBufferedPanelExample.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Example\\HexGridPanelExample.resx\">\n      <DependentUpon>HexGridPanelExample.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"HexgridBufferedPanelForm.resx\">\n      <DependentUpon>HexgridBufferedPanelForm.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Example\\StatusBarToolStrip.resx\">\n      <DependentUpon>StatusBarToolStrip.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"TiltableForm.resx\">\n      <DependentUpon>TiltableForm.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.en-US.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"CustomDictionary.xsd\">\n      <SubType>Designer</SubType>\n    </None>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n      <SubType>Designer</SubType>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "HexgridPanel/HexgridPanelForm.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n    partial class HexgridPanelForm {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent() {\n            this.Panel = new PGNapoleonics.HexgridPanel.HexgridPanel();\n            this.ToolStripContainer.ContentPanel.SuspendLayout();\n            this.ToolStripContainer.SuspendLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.Panel)).BeginInit();\n            this.SuspendLayout();\n            // \n            // ToolStripContainer\n            // \n            // \n            // ToolStripContainer.ContentPanel\n            // \n            this.ToolStripContainer.ContentPanel.Controls.Add(this.Panel);\n            // \n            // Panel\n            // \n            this.Panel.AutoScroll = true;\n            this.Panel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n            this.Panel.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.Panel.IsMapDirty = false;\n            this.Panel.IsTransposed = false;\n            this.Panel.IsUnitsDirty = false;\n            this.Panel.Location = new System.Drawing.Point(5, 5);\n            this.Panel.MapOrientation = PGNapoleonics.HexgridPanel.MapOrientation.ZeroDegrees;\n            this.Panel.Margin = new System.Windows.Forms.Padding(0);\n            this.Panel.Name = \"Panel\";\n            this.Panel.ScaleIndex = 0;\n            this.Panel.Size = new System.Drawing.Size(786, 436);\n            this.Panel.TabIndex = 1;\n            this.Panel.UnappliedScroll = new System.Drawing.Point(0, 0);\n\n            this.Panel.HotspotHexChange += this.PanelBoard_HotSpotHexChange;\n            this.Panel.MouseCtlClick += this.PanelBoard_GoalHexChange;\n            this.Panel.MouseLeftClick += this.PanelBoard_StartHexChange;\n            this.Panel.ScaleChange += this.HexgridPanel_ScaleChange;\n            this.Panel.MouseMove += this.HexgridPanel_MouseMove;\n            // \n            // HexgridBufferedPanelForm\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(800, 450);\n            this.Name = \"HexgridPanelForm\";\n            this.Text = \"HexgridPanelForm\";\n            this.ToolStripContainer.ContentPanel.ResumeLayout(false);\n            this.ToolStripContainer.ResumeLayout(false);\n            this.ToolStripContainer.PerformLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.Panel)).EndInit();\n            this.ResumeLayout(false);\n\n        }\n\n        private HexgridPanel Panel;\n\n        #endregion\n    }\n}"
  },
  {
    "path": "HexgridPanel/HexgridPanelForm.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexgridPanel {\n    public partial class HexgridPanelForm: TiltableForm {\n        public HexgridPanelForm() => InitializeComponent();\n\n        protected override HexgridPanel HexgridPanel => Panel;\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexgridPanel.WinForms;\nusing PGNapoleonics.HexgridExampleCommon;\n\n#pragma warning disable 1587\n/// <summary>Implementations of a scrollable tiltable Winforms Panel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridPanel {\n    using Model     = IPanelModel;\n    using HexSize   = System.Drawing.Size;\n    using HexSizeF  = System.Drawing.SizeF;\n    using HexPointF = System.Drawing.PointF;\n\n    /// <summary>.</summary>\n    public class HexgridViewModel {\n        /// <summary>TODO</summary>\n        public HexgridViewModel(HexgridPanel panel) {\n            Panel      = panel;\n\n            Panel.HotspotHexChange  += HotspotHexChange;\n            Panel.MarginChanged     += MarginChanged;\n    //      Panel.MouseAltClick     += MouseAltClick;\n    //      Panel.MouseCtlClick     += GoalHexChange;\n    //      Panel.MouseRightClick   += MouseRightClick;\n    //      Panel.ScaleChange       += ScaleChange;\n\n            SetScales( new List<float>() { 0.250F, 0.297F, 0.354F, 0.420F,\n                                           0.500F, 0.594F, 0.707F, 0.841F,\n                                           1.000F, 1.189F, 1.414F, 1.684F,\n                                           2.000F }.AsReadOnly());\n            Grid  = GetHexgrid();\n        }\n\n        HexgridPanel Panel { get; set; }\n\n        ///// <summary>Return new AutoScrollPosition for applied muse-wheel scroll.</summary>\n        //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n        //  Func<int,Point> newAutoScroll)\n        //{\n        //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n        //  var steps = (delta+remainder) \n        //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n        //  remainder = (delta+remainder) \n        //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n        //  return newAutoScroll(scroll.SmallChange * steps);\n        //}\n        ///// <summary>TODO</summary>\n        //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n        //  return new ScrollEventArgs(\n        //    ScrollEventType.ThumbTrack,\n        //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n        //    isHorizontal ? -newScroll.X : -newScroll.Y,\n        //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n        //  );\n        //}\n\n        IHexgrid GetHexgrid()\n        => new Hexgrid(IsTransposed,Model.GridSize,MapScale,Margin.OffsetSize());\n\n        #region Properties\n        /// <summary>MapBoard hosting this panel.</summary>\n        public Model Model           {\n            get => _model;\n            set { if(_model is IDisposable model) model.Dispose(); _model = value; }\n        } Model _model = EmptyBoard.TheOne;\n\n        /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n        public HexCoords   HotspotHex      { get; set; } = HexCoords.EmptyUser;\n\n        /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n        protected static bool IsAltKeyDown   => HexgridPanel.IsAltKeyDown;\n        /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n        protected static bool IsCtlKeyDown   => HexgridPanel.IsCtlKeyDown;\n        /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n        protected static bool IsShiftKeyDown => HexgridPanel.IsShiftKeyDown;\n\n        /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n        public bool        IsTransposed {\n            get => _isTransposed;\n            set {\n                _isTransposed = value;\n                Grid = GetHexgrid();\n                if (Panel.IsHandleCreated) Panel.SetScrollLimits(Model);\n            }\n        }\n        bool _isTransposed;\n\n        /// <inheritdoc/>\n        public HexSize     MapSizePixels   => Model.MapSizePixels(); // + MapMargin.Scale(2);} }\n\n        /// <summary>Current scaling factor for map display.</summary>\n        public float       MapScale {\n            get => Model.MapScale;\n            private set => Model.MapScale = value;\n        }\n\n        /// <inheritdoc/>\n        public Padding     Margin {\n            get => _margin;\n            set { _margin = value; Grid.Margin = new HexSize(_margin.Left,_margin.Top); }\n        }\n        Padding _margin;\n\n        /// <summary>TODO</summary>\n        public    bool     IsMapDirty {\n            get => _isMapDirty;\n            set {\n                _isMapDirty = value;\n                if (_isMapDirty) { IsUnitsDirty = true; }\n            }\n        }\n        bool _isMapDirty;\n        /// <summary>TODO</summary>\n        public    bool     IsUnitsDirty {\n            get => _isUnitsDirty;\n            set {\n                _isUnitsDirty = value;\n                if (_isUnitsDirty) { Panel.Invalidate(); }\n            }\n        }\n        bool _isUnitsDirty;\n\n        /// <summary>Array of supported map scales  as IList {float}.</summary>\n        public IReadOnlyList<float> Scales { get; private set; }\n\n        /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n        public virtual int ScaleIndex {\n            get => _scaleIndex;\n            set {\n                var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n                if (_scaleIndex != newValue) {\n                    _scaleIndex = newValue;\n                    MapScale    = Scales[ScaleIndex];\n                    Grid        = new Hexgrid(IsTransposed,Model.GridSize,MapScale);\n                    ScaleChange?.Invoke(this,EventArgs.Empty);\n                }\n            }\n        }\n        int _scaleIndex;\n        #endregion\n\n        /// <summary>TODO</summary>\n        public void SetScales(IReadOnlyList<float> scales) {\n            Scales = scales;\n            ScaleIndex = Scales.Where((o,i) => Math.Abs(o-1.00F) < 0.01F).Select((o,i)=>i).FirstOrDefault();\n        }\n        #region Events\n        /// <summary>TODO</summary>\n        void MarginChanged(object sender,EventArgs e) => Margin = Panel.Margin;\n\n        /// <summary>Announces that the mouse is now over a new hex.</summary>\n        void HotspotHexChange(object sender, HexEventArgs e) {\n          //if (e==null) throw new ArgumentNullException(nameof(e));\n          if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n        }\n\n    //    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n    //    public event EventHandler<HexEventArgs> GoalHexChange;\n    //    /// <summary>Announces that the Path-Start hex has changed.</summary>\n    //    public event EventHandler<HexEventArgs> StartHexChange;\n    //    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    //    public event EventHandler<HexEventArgs> MouseAltClick;\n    //    /// <summary>Announces a mouse right-click. </summary>\n    //    public event EventHandler<HexEventArgs> MouseRightClick;\n        /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n        public event EventHandler<EventArgs>    ScaleChange;\n        #endregion\n\n        #region Grid Coordinates\n        /// <inheritdoc/>\n        public IHexgrid   Grid    { get; set; }\n        /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n        public HexSizeF GridSizeF => Model.GridSize.Scale(MapScale);\n\n        //CoordsRectangle  GetClipInHexes(PointF point, SizeF size) {\n        //  return Model.GetClipInHexes(point, size);\n        //}\n\n        /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n        /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n        /// <returns>Pixel coordinates in Client reference frame.</returns>\n        public HexPointF HexCenterPoint(HexCoords coordsNewULHex)\n        => Grid.HexCenterPoint(coordsNewULHex);\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/IMapDisplayPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n    public interface IMapDisplayPainter {\n        /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"showHexgrid\">.</param>\n        /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n        void PaintMap(Graphics graphics, bool showHexgrid);\n\n        /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"hexText\">.</param>\n        /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n        void PaintLabels(Graphics graphics, Func<HexCoords,string> hexText);\n\n        /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n        /// for each hex on <paramref name=\"graphics\"/>.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"paintAction\">The paint action to be performed for each hex as a <see cref=\"Action{HexCoords}\"/>.</param>\n        void PaintForEachHex(Graphics graphics, Action<HexCoords> paintAction);\n\n        /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        void PaintHighlight(Graphics graphics);\n\n        /// <summary>.</summary>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"isNotShaded\">The <see cref=\"IShadingMask\"/> object for the canvas being painted.</param>\n        void PaintShading(Graphics graphics, IShadingMask isNotShaded);\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        void PaintUnits(Graphics graphics);\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/IScrollableControl.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>The interface that must be supported for controls leveraging the <see cref=\"ScrollableControlExtensions\"/> methods.</summary>\n    internal interface IScrollableControl {\n        /// <summary>Returns or sets the current scrolling position for the control.</summary>\n        /// <remarks>\n        /// The getter must return the current scrolling position; and \n        /// the setter must scroll to the specified position when assigned.\n        /// </remarks>\n        Point AutoScrollPosition { get; set; }\n\n        /// <summary>The horizontal (X) and vertical (Y) scrolling increments for 'paging'.</summary>\n        Point ScrollLargeChange  { get; }\n\n        /// <summary>Reserved for internal use by <see cref=\"ScrollableControlExtensions\"/>.</summary>\n        /// <remarks>Gets or sets the current amount of unapplied scroll, as a <see cref=\"Point\"/> object.</remarks>\n        Point UnappliedScroll    { get; set; }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/MapDisplayPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>.</summary>\n    /// <typeparam name=\"THex\"></typeparam>\n    public class MapDisplayPainter<THex>: AbstractModelDisplayPainter<THex> where THex:IHex {\n        /// <summary></summary>\n        /// <param name=\"model\">The map to be painted, as a <see cref=\"IMapDisplayWinForms{THex}\"/>.</param>\n        public MapDisplayPainter(IPanelModel model) : base(model) { }\n\n        /// <summary>Returns a <see cref=\"Brush\"/> suitable for painting the specified <see cref=\"THex\"/>.</summary>\n        /// <param name=\"hex\">The <see cref=\"THex\"/> being queried.</param>\n        /// <remarks>\n        /// Returns clones to avoid inter-thread contention.\n        /// </remarks>\n        protected override Brush GetHexBrush(THex hex) {\n            switch(hex.TerrainType) {\n                default:  return UndefinedBrush;\n                case '.': return ClearBrush;\n                case '2': return PikeBrush;\n                case '3': return RoadBrush;\n                case 'F': return FordBrush;\n                case 'H': return HillBrush;\n                case 'M': return MountainBrush;\n                case 'R': return RiverBrush;\n                case 'W': return WoodsBrush;\n            }\n        }\n\n        private readonly Brush UndefinedBrush = (Brush)Brushes.SlateGray.Clone();\n        private readonly Brush ClearBrush     = (Brush)Brushes.White.Clone();\n        private readonly Brush PikeBrush      = (Brush)Brushes.DarkGray.Clone();\n        private readonly Brush RoadBrush      = (Brush)Brushes.SandyBrown.Clone();\n        private readonly Brush FordBrush      = (Brush)Brushes.Brown.Clone();\n        private readonly Brush HillBrush      = (Brush)Brushes.Khaki.Clone();\n        private readonly Brush MountainBrush  = (Brush)Brushes.DarkKhaki.Clone();\n        private readonly Brush RiverBrush     = (Brush)Brushes.DarkBlue.Clone();\n        private readonly Brush WoodsBrush     = (Brush)Brushes.Green.Clone();\n\n        /// <summary>Gets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        protected override Color ShadeColor { get; } = Color.Black;\n        /// <summary>Gets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n        protected override Brush TextBrush  { get; } = (Brush)Brushes.Black.Clone();\n \n        /// <summary>Gets the <see cref=\"Font\"/> to be used by <see cref=\"PaintLabels(Graphics, Func{HexCoords, string})\"/.></summary>\n        protected override Font  LabelFont  { get; } = SystemFonts.MenuFont;\n   }\n}\n"
  },
  {
    "path": "HexgridPanel/MapDisplayPainterExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Storage;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>Extension methods to paint an <see cref=\"IMapDisplayWinForms{T}\"/> from a <see cref=\"Graphics\"/>.</summary>\n    public static partial class MapDisplayPainterExtensions {\n        private static IMapDisplayPainter Painter(this IPanelModel @this)\n        => new MapDisplayPainter<IHex>(@this);\n\n        /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n        /// <param name=\"this\">The map to be painted, as a <see cref=\"MapDisplay{THex}\"/>.</param>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"showHexgrid\">.</param>\n        /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n        public static void PaintMap<THex>(this IPanelModel @this, Graphics graphics,\n                bool showHexgrid)\n        where THex:IHex\n        => @this.Painter().PaintMap(graphics,showHexgrid);\n\n        /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n        /// <param name=\"this\">The map to be painted, as a <see cref=\"MapDisplay{THex}\"/>.</param>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"hexText\">.</param>\n        /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n        public static void PaintLabels<THex>(this IPanelModel @this, Graphics graphics,\n                Func<HexCoords,string> hexText)\n        where THex:IHex\n        => @this.Painter().PaintLabels(graphics,hexText);\n\n        /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n        /// <param name=\"this\">The map to be painted, as a <see cref=\"MapDisplay{THex}\"/>.</param>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        public static void PaintHighlight<THex>(this IPanelModel @this, Graphics graphics)\n        where THex:IHex\n        => @this.Painter().PaintHighlight(graphics);\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"this\">The map to be painted, as a <see cref=\"MapDisplay{THex}\"/>.</param>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        /// <param name=\"isNotShaded\">The <see cref=\"IShadingMask\"/> object for the canvas being painted.</param>\n        public static void PaintShading<THex>(this IPanelModel @this, Graphics graphics, IShadingMask isNotShaded)\n        where THex: IHex\n        => @this.Painter().PaintShading(graphics,isNotShaded);\n\n        /// <summary>.</summary>\n        /// <typeparam name=\"THex\"></typeparam>\n        /// <param name=\"this\">The map to be painted, as a <see cref=\"MapDisplay{THex}\"/>.</param>\n        /// <param name=\"graphics\">The <see cref=\"Graphics\"/> object for the canvas being painted.</param>\n        public static void PaintUnits<THex>(this IPanelModel @this,Graphics graphics)\n        where THex : IHex\n        => @this.Painter().PaintUnits(graphics);\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/MapOrientation.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>Map orientation settings in 90 degree increments, CCW.</summary>\n    public enum MapOrientation {\n        /// <summary>Map orientation with no rotation.</summary>\n        ZeroDegrees, \n        /// <summary>Map orientation rotated 90 degrees CCW.</summary>\n        NinetyDegreesCCW, \n        /// <summary>Map orientation rotated 180 degrees CCW.</summary>\n        Reversed, \n        /// <summary>Map orientation rotated 270 degrees CCW.</summary>\n        NinetyDegreesCW\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/MapPanel.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class MapPanel {\n    /// <summary> Required designer variable.</summary>\n    private System.ComponentModel.IContainer components = null;\n\n    private bool _isDisposed = false;\n    /// <summary>  Clean up any resources being used. </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (components !=null) { components .Dispose();  components  = null; }\n          if(_mapBuffer  !=null) { _mapBuffer .Dispose();  _mapBuffer  = null; }\n          if(_backBuffer !=null) { _backBuffer.Dispose();  _backBuffer = null; }\n        }\n        _isDisposed = true;\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/MapPanel.cs",
    "content": "﻿#region Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n///////////////////////////////////////////////////////////////////////////////////////////\n// THis software may be used under the terms of attached file License.md (The MIT License).\n///////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public partial class MapPanel : HexgridPanel {\n        /// <summary>TODO</summary>\n        public MapPanel() => InitializeComponent();\n\n        /// <inheritdoc/>\n        public override int ScaleIndex {\n            set {\n                var CenterHex   = PanelCenterHex;\n                base.ScaleIndex = value;\n                SetScroll(CenterHex);\n            }\n        }\n\n        /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n        public override void SetMapDirty() { \n            _cacheStatus = _NEEDS_PAINTING;\n            base.SetMapDirty();\n        }\n\n        #region Mouse Events\n        /// <inheritdoc/>\n        protected override void OnMouseHWheel(MouseEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n\n            var oldPosition    = - AutoScrollPosition.X;\n            var newPosition    = NewPosition(HorizontalScroll, ClientSize.Width, oldPosition,  e.Delta);\n            AutoScrollPosition = new Point(newPosition, - AutoScrollPosition.Y);\n\n            OnScroll(new ScrollEventArgs(ScrollEventType.ThumbPosition, oldPosition, newPosition, \n                                         ScrollOrientation.HorizontalScroll));\n        }\n        /// <inheritdoc/>\n        protected override void OnMouseWheel(MouseEventArgs e) {\n            if (e==null) throw new ArgumentNullException(nameof(e));\n\n            var oldPosition    = - AutoScrollPosition.Y;\n            var newPosition    = NewPosition(VerticalScroll, ClientSize.Height, oldPosition, -e.Delta);\n            AutoScrollPosition = new Point(- AutoScrollPosition.X, newPosition);\n      \n            OnScroll(new ScrollEventArgs(ScrollEventType.ThumbPosition, oldPosition, newPosition, \n                                         ScrollOrientation.VerticalScroll));\n        }\n        /// <summary>TODO</summary>\n        /// <param name=\"scroll\"></param>\n        /// <param name=\"limit\"></param>\n        /// <param name=\"oldPosition\"></param>\n        /// <param name=\"delta\"></param>\n        /// <returns></returns>\n        private static int NewPosition(ScrollProperties scroll, int limit, int oldPosition, int delta)\n        => Math.Max(scroll.Minimum,\n           Math.Min(scroll.Maximum - limit + 1, oldPosition + delta));\n        #endregion\n\n        #region Other Events\n        /// <inheritdoc/>\n        protected override void OnResize(EventArgs e) {\n            if(Application.OpenForms.Count > 0 \n            && Application.OpenForms[0].WindowState != FormWindowState.Minimized) ResizeBuffer();\n            base.OnResize(e);\n        }\n        /// <inheritdoc/>\n        protected override void OnScaleChange(EventArgs e) {\n            ResizeBuffer();\n            base.OnScaleChange(e);\n        }\n        /// <inheritdoc/>\n        protected override void OnScroll(ScrollEventArgs se) {\n            if (se==null) throw new ArgumentNullException(\"se\");\n            var clip = (se.ScrollOrientation == ScrollOrientation.HorizontalScroll)\n                     ? HorizontalScrollBuffer(se.NewValue - se.OldValue)\n                     : VerticalScrollBuffer  (se.NewValue - se.OldValue);\n\n            if (clip.Size != Size.Empty) {\n                var status = Interlocked.CompareExchange(ref _cacheStatus, _IS_SCROLLING, _IS_READY);\n                if (status == _IS_READY) {\n                  try     { _backBuffer = Interlocked.Exchange(ref _mapBuffer, ScrollBuffer(clip)); }\n                  finally { Interlocked.CompareExchange(ref _cacheStatus, _IS_READY, _IS_SCROLLING); }\n                }\n            }\n            base.OnScroll(se);\n        }\n\n        /// <summary>Clipping rectangle requiring re-painting after a horizontal scroll.</summary>\n        /// <param name=\"delta\">The signed horizontal scroll amount</param>\n        protected virtual Rectangle HorizontalScrollBuffer(int delta) {\n            if (delta == 0)    return Rectangle.Empty;  // Combinig this with below impacts performance.\n\n            _backBuffer.Render(_mapBuffer, new Point(-delta,0));\n            return (delta < 0) ? new Rectangle(                     0,0, -delta,ClientSize.Height)\n                               : new Rectangle(ClientSize.Width-delta,0,  delta,ClientSize.Height);\n        }\n\n        /// <summary>Clipping rectangle requiring re-painting after a vertical scroll.</summary>\n        /// <param name=\"delta\">The signed vertical scroll amount</param>\n        protected virtual Rectangle VerticalScrollBuffer(int delta) {\n            if (delta == 0)    return Rectangle.Empty;  // Combinig this with below impacts performance.\n\n            _backBuffer.Render(_mapBuffer, new Point(0,-delta));\n            return (delta < 0) ? new Rectangle(0,                      0, ClientSize.Width,-delta)\n                               : new Rectangle(0,ClientSize.Height-delta, ClientSize.Width, delta);\n        }\n        #endregion\n\n        #region BufferedGraphics\n        /// <summary>Gets or sets backing buffer for the map underlay.</summary>\n        private Bitmap _mapBuffer  = null;\n        /// <summary>Gets or sets double-buffered buffer for the map underlay.</summary>\n        private Bitmap _backBuffer = null;\n\n        /// <summary>Service routine to paint the backing store bitmap for the map underlay, asynchronously.</summary>\n        protected virtual async Task<Bitmap> PaintBufferAsync(Rectangle clipBounds)\n        => await Task.Run(() => PaintBuffer(clipBounds));\n\n        /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n        protected virtual Bitmap PaintBuffer(Rectangle clipBounds) {\n            if (DataContext.Model==null) return null;\n\n            Bitmap bitmap = null, temp = null;\n            try {\n                temp = ClientSize.AllocateBitmap();\n                using(var graphics = Graphics.FromImage(temp)) {\n                    graphics.Clip = new Region(clipBounds);\n                    graphics.Contain(PaintBuffer);\n                }\n\n                bitmap = temp;\n                temp   = null;\n            } finally { if(temp != null) temp.Dispose(); }\n\n            return bitmap;\n        }\n\n        /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n        protected virtual Bitmap ScrollBuffer(Rectangle clipBounds) {\n            if (DataContext.Model==null) return null;\n\n            using(var graphics = Graphics.FromImage(_backBuffer)) {\n                graphics.Clip = new Region(clipBounds);\n                graphics.Contain(PaintBuffer);\n            }\n            this.UIThread(Invalidate);\n            return _backBuffer;\n        }\n        /// <summary>TODO</summary>\n        /// <param name=\"graphics\"></param>\n        private void PaintBuffer(Graphics graphics) {\n            if (IsTransposed) { graphics.Transform = TransposeMatrix; }\n\n            var scroll = DataContext.Grid.GetScrollPosition(AutoScrollPosition);\n            graphics.TranslateTransform(scroll.X + Margin.Left,  scroll.Y + Margin.Top);\n            graphics.ScaleTransform(MapScale,MapScale);\n            Tracing.PaintDetail.Trace($\"{Name}.PaintBuffer - VisibleClipBounds: ({graphics.VisibleClipBounds})\");\n\n            using(var brush = new SolidBrush(BackColor)) {\n                graphics.FillRectangle(brush, graphics.VisibleClipBounds);\n            }\n            graphics.Paint(Point.Empty, 1.0F, g => {\n                var model = DataContext.Model;\n                model.PaintMap<IHex>(g, true);\n                if (model.LandmarkToShow > 0) model.PaintLabels<IHex>(g, LandmarkText);\n            });\n        }\n\n        private string LandmarkText(HexCoords coords)\n        => DataContext.Model.Landmarks.DistanceFrom(coords,DataContext.Model.LandmarkToShow-1);\n\n        /// <summary>TODO</summary>\n        void ResizeBuffer() => _cacheStatus = _NEEDS_PAINTING;\n        #endregion\n\n        #region Painting\n        private const int _NEEDS_PAINTING = 0;\n        private const int _IS_PAINTING    = 1;\n        private const int _IS_SCROLLING   = 2;\n        private const int _IS_READY       = 3;\n        private       int _cacheStatus    = _NEEDS_PAINTING;\n\n        private int _count = 0;\n\n        /// <inheritdoc/>\n        protected override async void OnPaint(PaintEventArgs e) {\n            if(e==null) throw new ArgumentNullException(nameof(e));\n            if (DesignMode) { e.Graphics.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n            if (IsMapDirty) { OnResize(EventArgs.Empty); IsMapDirty = false; }\n\n            // TODO - Fix thread timing error work-around of catching and discarding InvalidOperationException.\n            if (_mapBuffer != null) try { base.OnPaint(e); } catch (InvalidOperationException) { _count++; }\n\n            var status = Interlocked.CompareExchange(ref _cacheStatus, _IS_PAINTING, _NEEDS_PAINTING);\n            if (status == _NEEDS_PAINTING) {\n                try {\n                    if (_backBuffer != null) { _backBuffer.Dispose(); }\n\n                    _backBuffer = Interlocked.Exchange(ref _mapBuffer, await PaintBufferAsync(ClientRectangle));\n\n                    if (_backBuffer != null) { _backBuffer.Dispose(); }   _backBuffer = ClientSize.AllocateBitmap();\n                } catch (InvalidOperationException) {\n                    if (_backBuffer == null) _backBuffer = ClientSize.AllocateBitmap();\n\n                    Interlocked.CompareExchange(ref _cacheStatus, _NEEDS_PAINTING, _IS_PAINTING);\n                    Thread.Sleep(250);\n                } finally { Interlocked.CompareExchange(ref _cacheStatus, _IS_READY, _IS_PAINTING); }\n                Refresh();\n            }\n            IsUnitsDirty = false;\n        }\n        /// <inheritdoc/>\n        protected override void PaintMe(Graphics graphics) {\n            if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n            graphics.Contain(RenderMapLocal);\n            base.PaintMe(graphics);\n        }\n\n        /// <summary>TODO</summary>\n        protected override void RenderMap(Graphics graphics) { }\n\n        private void RenderMapLocal(Graphics graphics) {\n            if (graphics == null) throw new ArgumentNullException(\"graphics\");\n\n            using(var brush = new SolidBrush(this.BackColor)) {\n                graphics.FillRectangle(brush,ClientRectangle);\n            }\n            graphics.Render(_mapBuffer, ClientRectangle.Location, 1.0F);\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/MapPanelCached.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class CachedMapPanel {\n    /// <summary>Required designer variable.</summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>True if already Disposed.</summary>\n    private bool _isDisposed = false;\n    /// <summary>Clean up any resources being used.</summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if ( ! _isDisposed) {\n        if (disposing) {\n          if (components    != null) components.Dispose();\n          if (BufferCache   != null) { BufferCache.Dispose();   BufferCache   = null; }\n          BufferBack.Dispose();    BufferBack    = null;\n          BufferMap.Dispose();     BufferMap     = null;\n          BufferShading.Dispose(); BufferShading = null;\n          BufferUnits.Dispose();   BufferUnits   = null;\n        }\n        _isDisposed = true;\n        base.Dispose(disposing);\n      }\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/MapPanelCached.cs",
    "content": "﻿#region License - Copyright (C) 2012-2019 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Drawing;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public sealed partial class CachedMapPanel : HexgridBufferedPanel {\n        /// <summary>TODO</summary>/>\n        public CachedMapPanel() => InitializeComponent();\n\n        #region EventHandlers\n        /// <inheritdoc/>\n        protected override void OnResize(EventArgs e) {\n            BufferMap = BufferUnits = BufferShading = BufferBack = null;\n            base.OnResize(e);\n        }\n        #endregion\n\n        #region Map Caching\n        /// <summary>The fraction of 100% at which the map is drawn (and stored) to <seealso cref=\"BufferCache\"/>.</summary>\n        [Browsable(false)]\n        public  float  CacheScale {\n            get => _cacheScale;\n            set { _cacheScale = value; BufferCache = null; }\n        }\n        float  _cacheScale = 1.00F;\n\n        private Bitmap BufferCache {\n            get => _bufferCache;\n            set { if (_bufferCache!=null) _bufferCache.Dispose(); _bufferCache = value; }\n        }\n        Bitmap _bufferCache = null;\n\n        private Bitmap BufferMap {\n            get => _bufferMap     ?? (_bufferMap   = AllocateBuffer(ClientSize,\"Map\"));\n            set { if (_bufferMap != null) _bufferMap.Dispose(); _bufferMap = value; }\n        }\n        Bitmap _bufferMap = null;\n\n        private Bitmap BufferShading {\n            get => _bufferShading ?? (_bufferShading = AllocateBuffer(ClientSize,\"Shading\"));\n            set { if (_bufferShading != null) _bufferShading.Dispose(); _bufferShading = value; }\n        }\n        Bitmap _bufferShading = null;\n\n        private Bitmap BufferUnits {\n            get => _bufferUnits   ?? (_bufferUnits = AllocateBuffer(ClientSize,\"Units\"));\n            set { if (_bufferUnits != null) _bufferUnits.Dispose(); _bufferUnits = value; }\n        }\n        Bitmap _bufferUnits = null;\n\n        private Bitmap BufferBack {\n            get => _bufferBack    ?? (_bufferBack  = AllocateBuffer(ClientSize,\"Back\"));\n            set { if (_bufferBack != null) _bufferBack.Dispose(); _bufferBack = value; }\n        }\n        Bitmap _bufferBack = null;\n\n        private static Bitmap AllocateBuffer(Size size, string tag) {\n          Bitmap temp = null, buffer = null;\n            try {\n                var width  = Math.Max(1,size.Width);\n                var height = Math.Max(1,size.Height);\n                temp       = new Bitmap(width, height) { Tag = tag };\n                buffer     = temp;\n                temp       = null;\n            } finally {\n                if (temp != null) temp.Dispose(); \n            }\n            return buffer;\n        }\n        [SuppressMessage(\"Microsoft.Performance\",\"CA1811:AvoidUncalledPrivateCode\")]\n        private async Task<Bitmap> PaintedCacheBufferAsync(string tag)\n        => await Task.Run(() => PaintedCacheBuffer(tag));\n\n        private Bitmap PaintedCacheBuffer(string tag) {\n            Bitmap temp   = null;\n            Bitmap bitmap = null;\n\n            try {\n                var size   = Size.Round(MapSizePixels.Scale(CacheScale));\n                var width  = Math.Max(1,size.Width);\n                var height = Math.Max(1,size.Height);\n\n                temp = new Bitmap(width, height) { Tag = tag };\n                temp.Paint(Point.Empty, CacheScale, g => {\n                    var model = DataContext.Model;\n                    model.PaintMap<IHex>(g, true);\n                });\n                bitmap = temp;\n                temp   = null;\n            } finally { if(temp != null) temp.Dispose(); }\n            return bitmap;\n        }\n        #endregion\n\n        #region Painting\n        private const int CACHE_IS_FREE      = 0;\n        private const int CACHE_IS_PAINTING  = 1;\n    //    private const int CACHE_IS_DISPOSING = 2;\n        private       int _isCacheBusy       = CACHE_IS_FREE;\n\n        /// <inheritdoc/>\n        protected override async void OnPaint(PaintEventArgs e) {\n            if(e==null) throw new ArgumentNullException(nameof(e));\n            if (DesignMode) { e.Graphics.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n            void PaintFov(Graphics graphics)\n            => DataContext.Model.PaintShading<IHex>(graphics,DataContext.Model?.Fov);\n\n            if (BufferCache == null) {\n                var isBusy = Interlocked.CompareExchange(ref _isCacheBusy, CACHE_IS_PAINTING, CACHE_IS_FREE);\n                if (isBusy == CACHE_IS_FREE) {\n                    try     { BufferCache  = await PaintedCacheBufferAsync(\"Cache\"); }\n                    finally { _isCacheBusy = CACHE_IS_FREE; }\n                    Refresh();\n                }\n            } else {\n                var mapScale = DataContext.Scales[ScaleIndex];\n                var location = AutoScrollPosition + Margin.OffsetSize();\n\n                BufferMap  .Render(BufferCache,location, mapScale / CacheScale);\n                BufferUnits.Render(BufferMap,  location, mapScale, DataContext.Model.PaintUnits<IHex>);\n                BufferBack .Render(BufferUnits,location, mapScale, PaintFov);\n                BufferBack .Render(null,       location, mapScale, DataContext.Model.PaintHighlight<IHex>);\n\n                e.Graphics.DrawImageUnscaled(BufferBack, Point.Empty);\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridPanel\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions\")]\n[assembly: AssemblyProduct(\"HexgridPanel\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"16392062-b876-4417-a826-7928e7883e80\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.*\")]\n[assembly: AssemblyFileVersion(\"6.4\")]\n"
  },
  {
    "path": "HexgridPanel/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridPanel.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridPanel.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to - Fatal Application Error.\n        /// </summary>\n        internal static string FatalApplicationError {\n            get {\n                return ResourceManager.GetString(\"FatalApplicationError\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Fatal Error in Last-Chance Exception Handler..\n        /// </summary>\n        internal static string FatalThreadingError {\n            get {\n                return ResourceManager.GetString(\"FatalThreadingError\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to \n        ///From: .\n        /// </summary>\n        internal static string From {\n            get {\n                return ResourceManager.GetString(\"From\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ThreadExceptionEventArgs is null \n        ///From: .\n        /// </summary>\n        internal static string NullThreadExceptionArgs {\n            get {\n                return ResourceManager.GetString(\"NullThreadExceptionArgs\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to .\n        /// </summary>\n        internal static string NulSender {\n            get {\n                return ResourceManager.GetString(\"NulSender\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to - Severe Application Error.\n        /// </summary>\n        internal static string SevereApplicationError {\n            get {\n                return ResourceManager.GetString(\"SevereApplicationError\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}.\n        /// </summary>\n        internal static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"FatalApplicationError\" xml:space=\"preserve\">\n    <value>- Fatal Application Error</value>\n  </data>\n  <data name=\"FatalThreadingError\" xml:space=\"preserve\">\n    <value>Fatal Error in Last-Chance Exception Handler.</value>\n  </data>\n  <data name=\"From\" xml:space=\"preserve\">\n    <value>\nFrom: </value>\n  </data>\n  <data name=\"NullThreadExceptionArgs\" xml:space=\"preserve\">\n    <value>ThreadExceptionEventArgs is null \nFrom: </value>\n  </data>\n  <data name=\"NulSender\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"SevereApplicationError\" xml:space=\"preserve\">\n    <value>- Severe Application Error</value>\n  </data>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridPanel/Reference Source/BufferedGraphics.cs",
    "content": "//------------------------------------------------------------------------------ \n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\nnamespace System.Drawing { \n    using System; \n    using System.ComponentModel;\n    using System.Collections; \n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text;\n    using System.Diagnostics; \n    using System.Runtime.InteropServices;\n    using System.Threading; \n    using System.Security; \n    using System.Security.Permissions;\n    using System.Diagnostics.CodeAnalysis; \n    using System.Runtime.Versioning;\n\n    /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics\"]/*' />\n    /// <devdoc> \n    ///         The BufferedGraphics class can be thought of as a \"Token\" or \"Reference\" to the\n    ///         buffer that a BufferedGraphicsContext creates. While a BufferedGraphics is \n    ///         outstanding, the memory associated with the buffer is locked. The general design \n    ///         is such that under normal conditions a single BufferedGraphics will be in use at\n    ///         one time for a given BufferedGraphicsContext. \n    /// </devdoc>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA2216:DisposableTypesShouldDeclareFinalizer\")]\n    public sealed class BufferedGraphics : IDisposable {\n \t \n        private Graphics                bufferedGraphicsSurface;\n        private Graphics                targetGraphics; \n        private BufferedGraphicsContext context; \n        private IntPtr                  targetDC;\n        private Point                   targetLoc; \n        private Size                    virtualSize;\n        private bool                    disposeContext;\n        private static int              rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.BufferedGraphics\"]/*' />\n        /// <devdoc> \n        ///         Internal constructor, this class is created by the BufferedGraphicsContext. \n        /// </devdoc>\n        internal BufferedGraphics(Graphics bufferedGraphicsSurface, BufferedGraphicsContext context, Graphics targetGraphics, \n                                  IntPtr targetDC, Point targetLoc, Size virtualSize) {\n            this.context = context;\n            this.bufferedGraphicsSurface = bufferedGraphicsSurface;\n            this.targetDC = targetDC; \n            this.targetGraphics = targetGraphics;\n            this.targetLoc = targetLoc; \n            this.virtualSize = virtualSize; \n        }\n \n        ~BufferedGraphics() {\n            Dispose(false);\n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Dispose\"]/*' />\n        /// <devdoc> \n        ///         Disposes the object and releases the lock on the memory. \n        /// </devdoc>\n        public void Dispose() { \n            Dispose(true);\n        }\n\n        private void Dispose(bool disposing) { \n            if (disposing) {\n                if (context != null) { \n                    context.ReleaseBuffer(this); \n\n                    if (DisposeContext) { \n                        context.Dispose();\n                        context = null;\n                    }\n                } \n                if (bufferedGraphicsSurface != null) {\n                    bufferedGraphicsSurface.Dispose(); \n                    bufferedGraphicsSurface = null; \n                }\n            } \n        }\n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.DisposeContext\"]/*' />\n        /// <devdoc> \n        ///         Internal property - determines if we need to dispose of the Context when this is disposed\n        /// </devdoc> \n        internal bool DisposeContext { \n            get {\n                return disposeContext; \n            }\n            set {\n                disposeContext = value;\n            } \n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Graphics\"]/*' /> \n        /// <devdoc>\n        ///         Allows access to the Graphics wrapper for the buffer. \n        /// </devdoc>\n        public Graphics Graphics {\n            get {\n                Debug.Assert(bufferedGraphicsSurface != null, \"The BufferedGraphicsSurface is null!\"); \n                return bufferedGraphicsSurface;\n            } \n        } \n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render\"]/*' /> \n        /// <devdoc>\n        ///         Renders the buffer to the original graphics used to allocate the buffer.\n        /// </devdoc>\n        public void Render() { \n            if (targetGraphics != null) {\n                Render(targetGraphics); \n            } \n            else {\n                RenderInternal(new HandleRef(Graphics, targetDC),  this); \n            }\n        }\n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render1\"]/*' /> \n        /// <devdoc>\n        ///         Renders the buffer to the specified target graphics. \n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n        public void Render(Graphics target) {\n            if (target != null) {\n                IntPtr targetDC = target.GetHdc();\n \n                try {\n                    RenderInternal(new HandleRef(target, targetDC), this); \n                } \n                finally {\n                    target.ReleaseHdcInternal(targetDC); \n                }\n            }\n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render2\"]/*' />\n        /// <devdoc> \n        ///         Renders the buffer to the specified target HDC. \n        /// </devdoc>\n        public void Render(IntPtr targetDC) { \n            IntSecurity.UnmanagedCode.Demand();\n\n            RenderInternal(new HandleRef(null, targetDC), this);\n        } \n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.RenderInternal\"]/*' /> \n        /// <devdoc> \n        ///         Internal method that renders the specified buffer into the target.\n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer) {\n            IntPtr sourceDC = buffer.Graphics.GetHdc(); \n\n            try { \n                SafeNativeMethods.BitBlt(refTargetDC, targetLoc.X, targetLoc.Y, virtualSize.Width, virtualSize.Height, \n                                         new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n            } \n            finally {\n                buffer.Graphics.ReleaseHdcInternal(sourceDC);\n            }\n        } \n\n    } \n} \n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n//------------------------------------------------------------------------------ \n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\nnamespace System.Drawing { \n    using System; \n    using System.ComponentModel;\n    using System.Collections; \n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text;\n    using System.Diagnostics; \n    using System.Runtime.InteropServices;\n    using System.Threading; \n    using System.Security; \n    using System.Security.Permissions;\n    using System.Diagnostics.CodeAnalysis; \n    using System.Runtime.Versioning;\n\n    /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics\"]/*' />\n    /// <devdoc> \n    ///         The BufferedGraphics class can be thought of as a \"Token\" or \"Reference\" to the\n    ///         buffer that a BufferedGraphicsContext creates. While a BufferedGraphics is \n    ///         outstanding, the memory associated with the buffer is locked. The general design \n    ///         is such that under normal conditions a single BufferedGraphics will be in use at\n    ///         one time for a given BufferedGraphicsContext. \n    /// </devdoc>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA2216:DisposableTypesShouldDeclareFinalizer\")]\n    public sealed class BufferedGraphics : IDisposable {\n \t \n        private Graphics                bufferedGraphicsSurface;\n        private Graphics                targetGraphics; \n        private BufferedGraphicsContext context; \n        private IntPtr                  targetDC;\n        private Point                   targetLoc; \n        private Size                    virtualSize;\n        private bool                    disposeContext;\n        private static int              rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.BufferedGraphics\"]/*' />\n        /// <devdoc> \n        ///         Internal constructor, this class is created by the BufferedGraphicsContext. \n        /// </devdoc>\n        internal BufferedGraphics(Graphics bufferedGraphicsSurface, BufferedGraphicsContext context, Graphics targetGraphics, \n                                  IntPtr targetDC, Point targetLoc, Size virtualSize) {\n            this.context = context;\n            this.bufferedGraphicsSurface = bufferedGraphicsSurface;\n            this.targetDC = targetDC; \n            this.targetGraphics = targetGraphics;\n            this.targetLoc = targetLoc; \n            this.virtualSize = virtualSize; \n        }\n \n        ~BufferedGraphics() {\n            Dispose(false);\n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Dispose\"]/*' />\n        /// <devdoc> \n        ///         Disposes the object and releases the lock on the memory. \n        /// </devdoc>\n        public void Dispose() { \n            Dispose(true);\n        }\n\n        private void Dispose(bool disposing) { \n            if (disposing) {\n                if (context != null) { \n                    context.ReleaseBuffer(this); \n\n                    if (DisposeContext) { \n                        context.Dispose();\n                        context = null;\n                    }\n                } \n                if (bufferedGraphicsSurface != null) {\n                    bufferedGraphicsSurface.Dispose(); \n                    bufferedGraphicsSurface = null; \n                }\n            } \n        }\n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.DisposeContext\"]/*' />\n        /// <devdoc> \n        ///         Internal property - determines if we need to dispose of the Context when this is disposed\n        /// </devdoc> \n        internal bool DisposeContext { \n            get {\n                return disposeContext; \n            }\n            set {\n                disposeContext = value;\n            } \n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Graphics\"]/*' /> \n        /// <devdoc>\n        ///         Allows access to the Graphics wrapper for the buffer. \n        /// </devdoc>\n        public Graphics Graphics {\n            get {\n                Debug.Assert(bufferedGraphicsSurface != null, \"The BufferedGraphicsSurface is null!\"); \n                return bufferedGraphicsSurface;\n            } \n        } \n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render\"]/*' /> \n        /// <devdoc>\n        ///         Renders the buffer to the original graphics used to allocate the buffer.\n        /// </devdoc>\n        public void Render() { \n            if (targetGraphics != null) {\n                Render(targetGraphics); \n            } \n            else {\n                RenderInternal(new HandleRef(Graphics, targetDC),  this); \n            }\n        }\n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render1\"]/*' /> \n        /// <devdoc>\n        ///         Renders the buffer to the specified target graphics. \n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n        public void Render(Graphics target) {\n            if (target != null) {\n                IntPtr targetDC = target.GetHdc();\n \n                try {\n                    RenderInternal(new HandleRef(target, targetDC), this); \n                } \n                finally {\n                    target.ReleaseHdcInternal(targetDC); \n                }\n            }\n        }\n \n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.Render2\"]/*' />\n        /// <devdoc> \n        ///         Renders the buffer to the specified target HDC. \n        /// </devdoc>\n        public void Render(IntPtr targetDC) { \n            IntSecurity.UnmanagedCode.Demand();\n\n            RenderInternal(new HandleRef(null, targetDC), this);\n        } \n\n        /// <include file='doc\\BufferedGraphics.uex' path='docs/doc[@for=\"BufferedGraphics.RenderInternal\"]/*' /> \n        /// <devdoc> \n        ///         Internal method that renders the specified buffer into the target.\n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer) {\n            IntPtr sourceDC = buffer.Graphics.GetHdc(); \n\n            try { \n                SafeNativeMethods.BitBlt(refTargetDC, targetLoc.X, targetLoc.Y, virtualSize.Width, virtualSize.Height, \n                                         new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n            } \n            finally {\n                buffer.Graphics.ReleaseHdcInternal(sourceDC);\n            }\n        } \n\n    } \n} \n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n"
  },
  {
    "path": "HexgridPanel/Reference Source/BufferedGraphicsContext.cs",
    "content": "//------------------------------------------------------------------------------ \n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\nnamespace System.Drawing { \n    using System; \n    using System.ComponentModel;\n    using System.Collections; \n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text;\n    using System.Diagnostics; \n    using System.Runtime.InteropServices;\n    using System.Threading; \n    using System.Security; \n    using System.Security.Permissions;\n    using System.Runtime.Versioning; \n\n    /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext\"]/*' />\n    /// <devdoc>\n    ///         The BufferedGraphicsContext class can be used to perform standard double buffer \n    ///         rendering techniques.\n    /// </devdoc> \n    public sealed class BufferedGraphicsContext : IDisposable { \n\n        private Size                    maximumBuffer; \n        private Size                    bufferSize;\n        private Size                    virtualSize;\n        private Point                   targetLoc;\n        private IntPtr                  compatDC; \n        private IntPtr                  dib;\n        private IntPtr                  oldBitmap; \n        private Graphics                compatGraphics; \n        private BufferedGraphics        buffer;\n        private int                     busy; \n        private bool                    invalidateWhenFree;\n\n        private const int               BUFFER_FREE = 0; //the graphics buffer is free to use\n        private const int               BUFFER_BUSY_PAINTING = 1; //graphics buffer is busy being created/painting \n        private const int               BUFFER_BUSY_DISPOSING = 2; //graphics buffer is busy disposing\n \n        static TraceSwitch              doubleBuffering; \n\n        #if DEBUG \n        string stackAtBusy;\n        #endif\n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.BufferedGraphicsContext\"]/*' /> \n        /// <devdoc>\n        ///         Basic constructor. \n        /// </devdoc> \n        public BufferedGraphicsContext() {\n            //by defualt, the size of our maxbuffer will be 3 x standard button size \n            maximumBuffer.Width = 75 * 3;\n            maximumBuffer.Height = 32 * 3;\n\n            bufferSize = Size.Empty; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Finalizer\"]/*' /> \n        /// <devdoc>\n        ///         Destructor. \n        /// </devdoc>\n        ~BufferedGraphicsContext() {\n            Dispose(false);\n        } \n\n        //Internal trace switch for debugging \n        // \n        internal static TraceSwitch DoubleBuffering {\n            get { \n                if (doubleBuffering == null) {\n                    doubleBuffering = new TraceSwitch(\"DoubleBuffering\", \"Output information about double buffering\");\n                }\n                return doubleBuffering; \n            }\n        } \n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.MaximumBuffer\"]/*' />\n        /// <devdoc> \n        ///         Allows you to set the maximum width and height of the buffer that will be retained in memory.\n        ///         You can allocate a buffer of any size, however any request for a buffer that would have a total\n        ///         memory footprint larger that the maximum size will be allocated temporarily and then discarded\n        ///         with the BufferedGraphics is released. \n        /// </devdoc>\n        public Size MaximumBuffer { \n            get { \n                return maximumBuffer;\n            } \n            [UIPermission(SecurityAction.Demand, Window=UIPermissionWindow.AllWindows)]\n            set {\n                if (value.Width <= 0 || value.Height <= 0) {\n                    throw new ArgumentException(SR.GetString(SR.InvalidArgument, \"MaximumBuffer\", value)); \n                }\n \n                //if we've been asked to decrease the size of the maximum buffer, \n                //then invalidate the older & larger buffer\n                // \n                if (value.Width * value.Height < maximumBuffer.Width * maximumBuffer.Height) {\n                    Invalidate();\n                }\n \n                maximumBuffer = value;\n            } \n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Allocate\"]/*' /> \n        /// <devdoc>\n        ///         Returns a BufferedGraphics that is matched for the specified target Graphics object.\n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)]\n        public BufferedGraphics Allocate(Graphics targetGraphics, Rectangle targetRectangle) { \n            if (ShouldUseTempManager(targetRectangle)) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Too big of buffer requested (\" + targetRectangle.Width + \" x \" + targetRectangle.Height + \") ... allocating temp buffer manager\");\n                return AllocBufferInTempManager(targetGraphics, IntPtr.Zero, targetRectangle); \n            }\n            return AllocBuffer(targetGraphics, IntPtr.Zero, targetRectangle);\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Allocate1\"]/*' />\n        /// <devdoc> \n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object. \n        /// </devdoc>\n        [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public BufferedGraphics Allocate(IntPtr targetDC, Rectangle targetRectangle) {\n            if (ShouldUseTempManager(targetRectangle)) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Too big of buffer requested (\" + targetRectangle.Width + \" x \" + targetRectangle.Height + \") ... allocating temp buffer manager\");\n                return AllocBufferInTempManager(null, targetDC, targetRectangle); \n            } \n            return AllocBuffer(null, targetDC, targetRectangle);\n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.AllocBuffer\"]/*' />\n        /// <devdoc>\n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)] \n        private BufferedGraphics AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) {\n \n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_PAINTING, BUFFER_FREE);\n\n            // In the case were we have contention on the buffer - i.e. two threads\n            // trying to use the buffer at the same time, we just create a temp \n            // buffermanager and have the buffer dispose of it when it is done.\n            // \n            if (oldBusy != BUFFER_FREE) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Attempt to have two buffers for a buffer manager... allocating temp buffer manager\");\n                return AllocBufferInTempManager(targetGraphics, targetDC, targetRectangle); \n            }\n\n            #if DEBUG\n            if (DoubleBuffering.TraceVerbose) { \n                stackAtBusy = new StackTrace().ToString();\n            } \n            #endif \n\n            Graphics surface; \n            this.targetLoc = new Point(targetRectangle.X, targetRectangle.Y);\n\n            try {\n                if (targetGraphics != null) { \n                    IntPtr destDc = targetGraphics.GetHdc();\n                    try { \n                        surface = CreateBuffer(destDc, -targetLoc.X, -targetLoc.Y, targetRectangle.Width, targetRectangle.Height); \n                    }\n                    finally { \n                        targetGraphics.ReleaseHdcInternal(destDc);\n                    }\n                }\n                else { \n                    surface = CreateBuffer(targetDC, -targetLoc.X, -targetLoc.Y, targetRectangle.Width, targetRectangle.Height);\n                } \n \n                this.buffer = new BufferedGraphics(surface, this, targetGraphics, targetDC, targetLoc, virtualSize);\n            } \n            catch {\n                this.busy = BUFFER_FREE; // free the buffer so it can be disposed.\n                throw;\n            } \n            return this.buffer;\n        } \n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.AllocBufferInTempManager\"]/*' />\n        /// <devdoc> \n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object.\n        /// </devdoc>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2000:DisposeObjectsBeforeLosingScope\")]\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)]\n        private BufferedGraphics AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) { \n            BufferedGraphicsContext tempContext = null; \n            BufferedGraphics tempBuffer = null;\n \n            try {\n                tempContext = new BufferedGraphicsContext();\n                if (tempContext != null) {\n                    tempBuffer = tempContext.AllocBuffer(targetGraphics, targetDC, targetRectangle); \n                    tempBuffer.DisposeContext = true;\n                } \n            } \n            finally {\n                if (tempContext != null && (tempBuffer == null || (tempBuffer != null && !tempBuffer.DisposeContext))) { \n                    tempContext.Dispose();\n                }\n            }\n \n            return tempBuffer;\n        } \n \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.bFillBitmapInfo\"]/*' /> \n        /// <devdoc>\n        // bFillBitmapInfo\n        //\n        // Fills in the fields of a BITMAPINFO so that we can create a bitmap \n        // that matches the format of the display.\n        // \n        // This is done by creating a compatible bitmap and calling GetDIBits \n        // to return the color masks.  This is done with two calls.  The first\n        // call passes in biBitCount = 0 to GetDIBits which will fill in the \n        // base BITMAPINFOHEADER data.  The second call to GetDIBits (passing\n        // in the BITMAPINFO filled in by the first call) will return the color\n        // table or bitmasks, as appropriate.\n        // \n        // Returns:\n        //   TRUE if successful, FALSE otherwise. \n        // \n        // History:\n        //  07-Jun-1995 -by- Gilman Wong [[....]] \n        // Wrote it.\n        //\n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C# \n        //\n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)] \n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private bool bFillBitmapInfo(IntPtr hdc, IntPtr hpal, ref NativeMethods.BITMAPINFO_FLAT pbmi) { \n            IntPtr hbm = IntPtr.Zero;\n            bool bRet = false;\n            try {\n \n                //\n                // Create a dummy bitmap from which we can query color format info \n                // about the device surface. \n                //\n                hbm = SafeNativeMethods.CreateCompatibleBitmap(new HandleRef(null, hdc), 1, 1); \n\n                if (hbm == IntPtr.Zero) {\n                    throw new OutOfMemoryException(SR.GetString(SR.GraphicsBufferQueryFail));\n                } \n\n                pbmi.bmiHeader_biSize = Marshal.SizeOf(typeof(NativeMethods.BITMAPINFOHEADER)); \n                pbmi.bmiColors = new byte[NativeMethods.BITMAPINFO_MAX_COLORSIZE*4]; \n\n                // \n                // Call first time to fill in BITMAPINFO header.\n                //\n                SafeNativeMethods.GetDIBits(new HandleRef(null, hdc),\n                                                    new HandleRef(null, hbm), \n                                                    0,\n                                                    0, \n                                                    IntPtr.Zero, \n                                                    ref pbmi,\n                                                    NativeMethods.DIB_RGB_COLORS); \n\n                if ( pbmi.bmiHeader_biBitCount <= 8 ) {\n                    bRet = bFillColorTable(hdc, hpal, ref pbmi);\n                } \n                else {\n                    if ( pbmi.bmiHeader_biCompression == NativeMethods.BI_BITFIELDS ) { \n \n                        //\n                        // Call a second time to get the color masks. \n                        // It's a GetDIBits Win32 \"feature\".\n                        //\n                        SafeNativeMethods.GetDIBits(new HandleRef(null, hdc),\n                                                new HandleRef(null, hbm), \n                                                0,\n                                                pbmi.bmiHeader_biHeight, \n                                                IntPtr.Zero, \n                                                ref pbmi,\n                                                NativeMethods.DIB_RGB_COLORS); \n                    }\n                    bRet = true;\n                }\n            } \n            finally {\n                if (hbm != IntPtr.Zero) { \n                    SafeNativeMethods.DeleteObject(new HandleRef(null, hbm)); \n                    hbm = IntPtr.Zero;\n                } \n            }\n            return bRet;\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.bFillColorTable\"]/*' />\n        /// <devdoc> \n        // bFillColorTable \n        //\n        // Initialize the color table of the BITMAPINFO pointed to by pbmi.  Colors \n        // are set to the current system palette.\n        //\n        // Note: call only valid for displays of 8bpp or less.\n        // \n        // Returns:\n        //   TRUE if successful, FALSE otherwise. \n        // \n        // History:\n        //  23-Jan-1996 -by- Gilman Wong [[....]] \n        // Wrote it.\n        //\n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C# \n        //\n        /// </devdoc> \n        private unsafe bool bFillColorTable(IntPtr hdc, IntPtr hpal, ref NativeMethods.BITMAPINFO_FLAT pbmi) { \n            bool bRet = false;\n            byte[] aj = new byte[sizeof(NativeMethods.PALETTEENTRY) * 256]; \n            int i, cColors;\n\n            fixed (byte* pcolors = pbmi.bmiColors) {\n                fixed (byte* ppal = aj) { \n                    NativeMethods.RGBQUAD* prgb = (NativeMethods.RGBQUAD*)pcolors;\n                    NativeMethods.PALETTEENTRY* lppe = (NativeMethods.PALETTEENTRY*)ppal; \n \n                    cColors = 1 << pbmi.bmiHeader_biBitCount;\n                    if ( cColors <= 256 ) { \n                        Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"8 bit or less...\");\n\n                        // NOTE : Didn't port \"MyGetPaletteEntries\" as it is only\n                        //      : for 4bpp displays, which we don't work on anyway. \n                        uint palRet;\n                        IntPtr palHalftone = IntPtr.Zero; \n                        if (hpal == IntPtr.Zero) { \n                            Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"using halftone palette...\");\n                            palHalftone = Graphics.GetHalftonePalette(); \n                            palRet = SafeNativeMethods.GetPaletteEntries(new HandleRef(null, palHalftone), 0, cColors, aj);\n                        }\n                        else {\n                            Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"using custom palette...\"); \n                            palRet = SafeNativeMethods.GetPaletteEntries(new HandleRef(null, hpal), 0, cColors, aj);\n                        } \n                        if ( palRet != 0 ) { \n                            for (i = 0; i < cColors; i++) {\n                                prgb[i].rgbRed      = lppe[i].peRed; \n                                prgb[i].rgbGreen    = lppe[i].peGreen;\n                                prgb[i].rgbBlue     = lppe[i].peBlue;\n                                prgb[i].rgbReserved = 0;\n                            } \n                            bRet = true;\n                        } \n                        else { \n                            Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"bFillColorTable: MyGetSystemPaletteEntries failed\\n\");\n                        } \n                    }\n                }\n            }\n            return bRet; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.CreateBuffer\"]/*' /> \n        /// <devdoc>\n        ///         Returns a Graphics object representing a buffer. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        private Graphics CreateBuffer(IntPtr src, int offsetX, int offsetY, int width, int height) \n        {\n            //create the compat DC \n            busy = BUFFER_BUSY_DISPOSING; \n            DisposeDC();\n            busy = BUFFER_BUSY_PAINTING; \n            compatDC = UnsafeNativeMethods.CreateCompatibleDC(new HandleRef(null, src));\n\n            //recreate the bitmap if necessary\n            if (width > bufferSize.Width || height > bufferSize.Height) \n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"allocating new bitmap: \" + width + \" x \" + height); \n                int optWidth = Math.Max(width, bufferSize.Width); \n                int optHeight = Math.Max(height, bufferSize.Height);\n \n                busy = BUFFER_BUSY_DISPOSING;\n                DisposeBitmap();\n                busy = BUFFER_BUSY_PAINTING;\n \n                Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"    new size         : \" + optWidth + \" x \" + optHeight);\n                IntPtr pvbits = IntPtr.Zero; \n                dib = CreateCompatibleDIB(src, IntPtr.Zero, optWidth, optHeight, ref pvbits); \n                bufferSize = new Size(optWidth, optHeight);\n            } \n\n            //select the bitmap\n            oldBitmap = SafeNativeMethods.SelectObject(new HandleRef(this, compatDC), new HandleRef(this, dib));\n \n            //create compat graphics\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"    Create compatGraphics\"); \n            compatGraphics = Graphics.FromHdcInternal(compatDC); \n            compatGraphics.TranslateTransform(-targetLoc.X, -targetLoc.Y);\n            virtualSize = new Size(width, height); \n\n            return compatGraphics;\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.CreateCompatibleDIB\"]/*' />\n        /// <devdoc> \n        // CreateCompatibleDIB \n        //\n        // Create a DIB section with an optimal format w.r.t. the specified hdc. \n        //\n        // If DIB <= 8bpp, then the DIB color table is initialized based on the\n        // specified palette.  If the palette handle is NULL, then the system\n        // palette is used. \n        //\n        // Note: The hdc must be a direct DC (not an info or memory DC). \n        // \n        // Note: On palettized displays, if the system palette changes the\n        //       UpdateDIBColorTable function should be called to maintain \n        //       the identity palette mapping between the DIB and the display.\n        //\n        // Returns:\n        //   Valid bitmap handle if successful, NULL if error. \n        //\n        // History: \n        //  23-Jan-1996 -by- Gilman Wong [[....]] \n        // Wrote it.\n        // \n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C#.\n        //\n        /// </devdoc> \n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Interoperability\", \"CA1404:CallGetLastErrorImmediatelyAfterPInvoke\")]\n        private IntPtr CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, int ulWidth, int ulHeight, ref IntPtr ppvBits) { \n            if (hdc == IntPtr.Zero) { \n                throw new ArgumentNullException(\"hdc\");\n            } \n\n            IntPtr hbmRet = IntPtr.Zero;\n            NativeMethods.BITMAPINFO_FLAT pbmi = new NativeMethods.BITMAPINFO_FLAT();\n \n            //\n            // Validate hdc. \n            // \n            int objType = UnsafeNativeMethods.GetObjectType(new HandleRef(null, hdc));\n \n            switch(objType) {\n                case NativeMethods.OBJ_DC:\n                case NativeMethods.OBJ_METADC:\n                case NativeMethods.OBJ_MEMDC: \n                case NativeMethods.OBJ_ENHMETADC:\n                    break; \n                default: \n                    throw new ArgumentException(SR.GetString(SR.DCTypeInvalid));\n            } \n\n            if (bFillBitmapInfo(hdc, hpal, ref pbmi)) {\n\n                // \n                // Change bitmap size to match specified dimensions.\n                // \n \n                pbmi.bmiHeader_biWidth = ulWidth;\n                pbmi.bmiHeader_biHeight = ulHeight; \n                if (pbmi.bmiHeader_biCompression == NativeMethods.BI_RGB) {\n                    pbmi.bmiHeader_biSizeImage = 0;\n                }\n                else { \n                    if ( pbmi.bmiHeader_biBitCount == 16 )\n                        pbmi.bmiHeader_biSizeImage = ulWidth * ulHeight * 2; \n                    else if ( pbmi.bmiHeader_biBitCount == 32 ) \n                        pbmi.bmiHeader_biSizeImage = ulWidth * ulHeight * 4;\n                    else \n                        pbmi.bmiHeader_biSizeImage = 0;\n                }\n                pbmi.bmiHeader_biClrUsed = 0;\n                pbmi.bmiHeader_biClrImportant = 0; \n\n                // \n                // Create the DIB section.  Let Win32 allocate the memory and return \n                // a pointer to the bitmap surface.\n                // \n\n                hbmRet = SafeNativeMethods.CreateDIBSection(new HandleRef(null, hdc), ref pbmi, NativeMethods.DIB_RGB_COLORS, ref ppvBits, IntPtr.Zero, 0);\n                Win32Exception ex = null;\n                if ( hbmRet == IntPtr.Zero ) { \n                    ex = new Win32Exception(Marshal.GetLastWin32Error());\n#if DEBUG \n                    DumpBitmapInfo(ref pbmi); \n#endif\n                } \n\n#if DEBUG\n                if (DoubleBuffering.TraceVerbose) {\n                    DumpBitmapInfo(ref pbmi); \n                }\n#endif \n                if(ex!=null) { \n                    throw ex;\n                } \n\n            }\n            return hbmRet;\n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Dispose\"]/*' /> \n        /// <devdoc> \n        ///     Disposes of native handles.\n        /// </devdoc> \n        public void Dispose() {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        } \n\n        /// <devdoc> \n        ///         Disposes the DC, but leaves the bitmap alone. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.None)] \n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private void DisposeDC()\n        {\n            if (oldBitmap != IntPtr.Zero && compatDC != IntPtr.Zero) \n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"restoring bitmap to DC\"); \n                SafeNativeMethods.SelectObject(new HandleRef(this, compatDC), new HandleRef(this, oldBitmap)); \n                oldBitmap = IntPtr.Zero;\n            } \n            if (compatDC != IntPtr.Zero)\n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"delete compat DC\");\n                UnsafeNativeMethods.DeleteDC(new HandleRef(this, compatDC)); \n                compatDC = IntPtr.Zero;\n            } \n        } \n\n        /// <devdoc> \n        ///         Disposes the bitmap, will ASSERT if bitmap is being used (checks oldbitmap).\n        ///         if ASSERTed, call DisposeDC() first.\n        /// </devdoc>\n        private void DisposeBitmap() \n        {\n            if (dib != IntPtr.Zero) \n            { \n                Debug.Assert(oldBitmap == IntPtr.Zero);\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"delete dib\"); \n\n                SafeNativeMethods.DeleteObject(new HandleRef(this, dib));\n                dib = IntPtr.Zero;\n            } \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Dispose1\"]/*' /> \n        /// <devdoc>\n        ///     Disposes of the Graphics buffer. \n        /// </devdoc>\n        private void Dispose(bool disposing) {\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"Dispose(\" + disposing + \") {\");\n            Debug.Indent(); \n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_DISPOSING, BUFFER_FREE);\n \n            if(disposing){ \n                if (oldBusy == BUFFER_BUSY_PAINTING) {\n                    #if DEBUG \n                        Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"Stack at busy buffer: \\n\" + stackAtBusy);\n                    #endif\n\n                    throw new InvalidOperationException(SR.GetString(SR.GraphicsBufferCurrentlyBusy)); \n                }\n \n                if (compatGraphics != null) { \n                    Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"Disposing compatGraphics\");\n                    compatGraphics.Dispose(); \n                    compatGraphics = null;\n                }\n            }\n            else{ \n                Debug.Fail(\"Never let a graphics buffer finalize!\");\n            } \n \n            DisposeDC();\n            DisposeBitmap(); \n\n            if (buffer != null) {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"Disposing buffer\");\n                buffer.Dispose(); \n                buffer = null;\n            } \n \n            bufferSize = Size.Empty;\n            virtualSize = Size.Empty; \n            Debug.Unindent();\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"}\");\n\n            this.busy = BUFFER_FREE; \n        }\n \n#if DEBUG \n        private void DumpBitmapInfo(ref NativeMethods.BITMAPINFO_FLAT pbmi) {\n            //Debug.WriteLine(\"biSize --> \" + pbmi.bmiHeader_biSize); \n            Debug.WriteLine(\"biWidth --> \" + pbmi.bmiHeader_biWidth);\n            Debug.WriteLine(\"biHeight --> \" + pbmi.bmiHeader_biHeight);\n            Debug.WriteLine(\"biPlanes --> \" + pbmi.bmiHeader_biPlanes);\n            Debug.WriteLine(\"biBitCount --> \" + pbmi.bmiHeader_biBitCount); \n            //Debug.WriteLine(\"biCompression --> \" + pbmi.bmiHeader_biCompression);\n            //Debug.WriteLine(\"biSizeImage --> \" + pbmi.bmiHeader_biSizeImage); \n            //Debug.WriteLine(\"biXPelsPerMeter --> \" + pbmi.bmiHeader_biXPelsPerMeter); \n            //Debug.WriteLine(\"biYPelsPerMeter --> \" + pbmi.bmiHeader_biYPelsPerMeter);\n            //Debug.WriteLine(\"biClrUsed --> \" + pbmi.bmiHeader_biClrUsed); \n            //Debug.WriteLine(\"biClrImportant --> \" + pbmi.bmiHeader_biClrImportant);\n            //Debug.Write(\"bmiColors --> \");\n            //for (int i=0; i<pbmi.bmiColors.Length; i++) {\n            //    Debug.Write(pbmi.bmiColors[i].ToString(\"X\")); \n            //}\n            Debug.WriteLine(\"\"); \n        } \n#endif\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Invalidate\"]/*' />\n        /// <devdoc>\n        ///         Invalidates the cached graphics buffer.\n        /// </devdoc> \n        public void Invalidate() {\n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_DISPOSING, BUFFER_FREE); \n \n            //if we're not busy with our buffer, lets\n            //clean it up now \n            //\n            if (oldBusy == BUFFER_FREE) {\n                Dispose();\n                this.busy = BUFFER_FREE; \n            }\n            else { \n                //this will indicate to free the buffer \n                //as soon as it becomes non-busy\n                // \n                this.invalidateWhenFree = true;\n            }\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.ReleaseBuffer\"]/*' />\n        /// <devdoc> \n        ///         Returns a Graphics object representing a buffer. \n        /// </devdoc>\n        internal void ReleaseBuffer(BufferedGraphics buffer) { \n            Debug.Assert(buffer == this.buffer, \"Tried to release a bogus buffer\");\n\n            this.buffer = null;\n            if (this.invalidateWhenFree) { \n                this.busy = BUFFER_BUSY_DISPOSING;\n                Dispose(); //clears everything (incl bitmap) \n            } \n            else {  //otherwise, just dispose the DC.  A new one will be created next time.\n                this.busy = BUFFER_BUSY_DISPOSING; \n                DisposeDC(); //only clears out the DC\n            }\n\n            this.busy = BUFFER_FREE; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.ShouldUseTempManager\"]/*' /> \n        /// <devdoc>\n        ///         This routine allows us to control the point were we start using throw away \n        ///         managers for painting. Since the buffer manager stays around (by default)\n        ///         for the life of the app, we don't want to consume too much memory\n        ///         in the buffer. However, re-allocating the buffer for small things (like\n        ///         buttons, labels, etc) will hit us on runtime performance. \n        /// </devdoc>\n        private bool ShouldUseTempManager(Rectangle targetBounds) { \n            return (targetBounds.Width * targetBounds.Height) > (MaximumBuffer.Width * MaximumBuffer.Height); \n        }\n \n    }\n}\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n//------------------------------------------------------------------------------ \n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\nnamespace System.Drawing { \n    using System; \n    using System.ComponentModel;\n    using System.Collections; \n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text;\n    using System.Diagnostics; \n    using System.Runtime.InteropServices;\n    using System.Threading; \n    using System.Security; \n    using System.Security.Permissions;\n    using System.Runtime.Versioning; \n\n    /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext\"]/*' />\n    /// <devdoc>\n    ///         The BufferedGraphicsContext class can be used to perform standard double buffer \n    ///         rendering techniques.\n    /// </devdoc> \n    public sealed class BufferedGraphicsContext : IDisposable { \n\n        private Size                    maximumBuffer; \n        private Size                    bufferSize;\n        private Size                    virtualSize;\n        private Point                   targetLoc;\n        private IntPtr                  compatDC; \n        private IntPtr                  dib;\n        private IntPtr                  oldBitmap; \n        private Graphics                compatGraphics; \n        private BufferedGraphics        buffer;\n        private int                     busy; \n        private bool                    invalidateWhenFree;\n\n        private const int               BUFFER_FREE = 0; //the graphics buffer is free to use\n        private const int               BUFFER_BUSY_PAINTING = 1; //graphics buffer is busy being created/painting \n        private const int               BUFFER_BUSY_DISPOSING = 2; //graphics buffer is busy disposing\n \n        static TraceSwitch              doubleBuffering; \n\n        #if DEBUG \n        string stackAtBusy;\n        #endif\n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.BufferedGraphicsContext\"]/*' /> \n        /// <devdoc>\n        ///         Basic constructor. \n        /// </devdoc> \n        public BufferedGraphicsContext() {\n            //by defualt, the size of our maxbuffer will be 3 x standard button size \n            maximumBuffer.Width = 75 * 3;\n            maximumBuffer.Height = 32 * 3;\n\n            bufferSize = Size.Empty; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Finalizer\"]/*' /> \n        /// <devdoc>\n        ///         Destructor. \n        /// </devdoc>\n        ~BufferedGraphicsContext() {\n            Dispose(false);\n        } \n\n        //Internal trace switch for debugging \n        // \n        internal static TraceSwitch DoubleBuffering {\n            get { \n                if (doubleBuffering == null) {\n                    doubleBuffering = new TraceSwitch(\"DoubleBuffering\", \"Output information about double buffering\");\n                }\n                return doubleBuffering; \n            }\n        } \n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.MaximumBuffer\"]/*' />\n        /// <devdoc> \n        ///         Allows you to set the maximum width and height of the buffer that will be retained in memory.\n        ///         You can allocate a buffer of any size, however any request for a buffer that would have a total\n        ///         memory footprint larger that the maximum size will be allocated temporarily and then discarded\n        ///         with the BufferedGraphics is released. \n        /// </devdoc>\n        public Size MaximumBuffer { \n            get { \n                return maximumBuffer;\n            } \n            [UIPermission(SecurityAction.Demand, Window=UIPermissionWindow.AllWindows)]\n            set {\n                if (value.Width <= 0 || value.Height <= 0) {\n                    throw new ArgumentException(SR.GetString(SR.InvalidArgument, \"MaximumBuffer\", value)); \n                }\n \n                //if we've been asked to decrease the size of the maximum buffer, \n                //then invalidate the older & larger buffer\n                // \n                if (value.Width * value.Height < maximumBuffer.Width * maximumBuffer.Height) {\n                    Invalidate();\n                }\n \n                maximumBuffer = value;\n            } \n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Allocate\"]/*' /> \n        /// <devdoc>\n        ///         Returns a BufferedGraphics that is matched for the specified target Graphics object.\n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)]\n        public BufferedGraphics Allocate(Graphics targetGraphics, Rectangle targetRectangle) { \n            if (ShouldUseTempManager(targetRectangle)) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Too big of buffer requested (\" + targetRectangle.Width + \" x \" + targetRectangle.Height + \") ... allocating temp buffer manager\");\n                return AllocBufferInTempManager(targetGraphics, IntPtr.Zero, targetRectangle); \n            }\n            return AllocBuffer(targetGraphics, IntPtr.Zero, targetRectangle);\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Allocate1\"]/*' />\n        /// <devdoc> \n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object. \n        /// </devdoc>\n        [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public BufferedGraphics Allocate(IntPtr targetDC, Rectangle targetRectangle) {\n            if (ShouldUseTempManager(targetRectangle)) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Too big of buffer requested (\" + targetRectangle.Width + \" x \" + targetRectangle.Height + \") ... allocating temp buffer manager\");\n                return AllocBufferInTempManager(null, targetDC, targetRectangle); \n            } \n            return AllocBuffer(null, targetDC, targetRectangle);\n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.AllocBuffer\"]/*' />\n        /// <devdoc>\n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)] \n        private BufferedGraphics AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) {\n \n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_PAINTING, BUFFER_FREE);\n\n            // In the case were we have contention on the buffer - i.e. two threads\n            // trying to use the buffer at the same time, we just create a temp \n            // buffermanager and have the buffer dispose of it when it is done.\n            // \n            if (oldBusy != BUFFER_FREE) { \n                Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"Attempt to have two buffers for a buffer manager... allocating temp buffer manager\");\n                return AllocBufferInTempManager(targetGraphics, targetDC, targetRectangle); \n            }\n\n            #if DEBUG\n            if (DoubleBuffering.TraceVerbose) { \n                stackAtBusy = new StackTrace().ToString();\n            } \n            #endif \n\n            Graphics surface; \n            this.targetLoc = new Point(targetRectangle.X, targetRectangle.Y);\n\n            try {\n                if (targetGraphics != null) { \n                    IntPtr destDc = targetGraphics.GetHdc();\n                    try { \n                        surface = CreateBuffer(destDc, -targetLoc.X, -targetLoc.Y, targetRectangle.Width, targetRectangle.Height); \n                    }\n                    finally { \n                        targetGraphics.ReleaseHdcInternal(destDc);\n                    }\n                }\n                else { \n                    surface = CreateBuffer(targetDC, -targetLoc.X, -targetLoc.Y, targetRectangle.Width, targetRectangle.Height);\n                } \n \n                this.buffer = new BufferedGraphics(surface, this, targetGraphics, targetDC, targetLoc, virtualSize);\n            } \n            catch {\n                this.busy = BUFFER_FREE; // free the buffer so it can be disposed.\n                throw;\n            } \n            return this.buffer;\n        } \n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.AllocBufferInTempManager\"]/*' />\n        /// <devdoc> \n        ///         Returns a BufferedGraphics that is matched for the specified target HDC object.\n        /// </devdoc>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2000:DisposeObjectsBeforeLosingScope\")]\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)]\n        private BufferedGraphics AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) { \n            BufferedGraphicsContext tempContext = null; \n            BufferedGraphics tempBuffer = null;\n \n            try {\n                tempContext = new BufferedGraphicsContext();\n                if (tempContext != null) {\n                    tempBuffer = tempContext.AllocBuffer(targetGraphics, targetDC, targetRectangle); \n                    tempBuffer.DisposeContext = true;\n                } \n            } \n            finally {\n                if (tempContext != null && (tempBuffer == null || (tempBuffer != null && !tempBuffer.DisposeContext))) { \n                    tempContext.Dispose();\n                }\n            }\n \n            return tempBuffer;\n        } \n \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.bFillBitmapInfo\"]/*' /> \n        /// <devdoc>\n        // bFillBitmapInfo\n        //\n        // Fills in the fields of a BITMAPINFO so that we can create a bitmap \n        // that matches the format of the display.\n        // \n        // This is done by creating a compatible bitmap and calling GetDIBits \n        // to return the color masks.  This is done with two calls.  The first\n        // call passes in biBitCount = 0 to GetDIBits which will fill in the \n        // base BITMAPINFOHEADER data.  The second call to GetDIBits (passing\n        // in the BITMAPINFO filled in by the first call) will return the color\n        // table or bitmasks, as appropriate.\n        // \n        // Returns:\n        //   TRUE if successful, FALSE otherwise. \n        // \n        // History:\n        //  07-Jun-1995 -by- Gilman Wong [[....]] \n        // Wrote it.\n        //\n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C# \n        //\n        /// </devdoc> \n        [ResourceExposure(ResourceScope.None)] \n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private bool bFillBitmapInfo(IntPtr hdc, IntPtr hpal, ref NativeMethods.BITMAPINFO_FLAT pbmi) { \n            IntPtr hbm = IntPtr.Zero;\n            bool bRet = false;\n            try {\n \n                //\n                // Create a dummy bitmap from which we can query color format info \n                // about the device surface. \n                //\n                hbm = SafeNativeMethods.CreateCompatibleBitmap(new HandleRef(null, hdc), 1, 1); \n\n                if (hbm == IntPtr.Zero) {\n                    throw new OutOfMemoryException(SR.GetString(SR.GraphicsBufferQueryFail));\n                } \n\n                pbmi.bmiHeader_biSize = Marshal.SizeOf(typeof(NativeMethods.BITMAPINFOHEADER)); \n                pbmi.bmiColors = new byte[NativeMethods.BITMAPINFO_MAX_COLORSIZE*4]; \n\n                // \n                // Call first time to fill in BITMAPINFO header.\n                //\n                SafeNativeMethods.GetDIBits(new HandleRef(null, hdc),\n                                                    new HandleRef(null, hbm), \n                                                    0,\n                                                    0, \n                                                    IntPtr.Zero, \n                                                    ref pbmi,\n                                                    NativeMethods.DIB_RGB_COLORS); \n\n                if ( pbmi.bmiHeader_biBitCount <= 8 ) {\n                    bRet = bFillColorTable(hdc, hpal, ref pbmi);\n                } \n                else {\n                    if ( pbmi.bmiHeader_biCompression == NativeMethods.BI_BITFIELDS ) { \n \n                        //\n                        // Call a second time to get the color masks. \n                        // It's a GetDIBits Win32 \"feature\".\n                        //\n                        SafeNativeMethods.GetDIBits(new HandleRef(null, hdc),\n                                                new HandleRef(null, hbm), \n                                                0,\n                                                pbmi.bmiHeader_biHeight, \n                                                IntPtr.Zero, \n                                                ref pbmi,\n                                                NativeMethods.DIB_RGB_COLORS); \n                    }\n                    bRet = true;\n                }\n            } \n            finally {\n                if (hbm != IntPtr.Zero) { \n                    SafeNativeMethods.DeleteObject(new HandleRef(null, hbm)); \n                    hbm = IntPtr.Zero;\n                } \n            }\n            return bRet;\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.bFillColorTable\"]/*' />\n        /// <devdoc> \n        // bFillColorTable \n        //\n        // Initialize the color table of the BITMAPINFO pointed to by pbmi.  Colors \n        // are set to the current system palette.\n        //\n        // Note: call only valid for displays of 8bpp or less.\n        // \n        // Returns:\n        //   TRUE if successful, FALSE otherwise. \n        // \n        // History:\n        //  23-Jan-1996 -by- Gilman Wong [[....]] \n        // Wrote it.\n        //\n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C# \n        //\n        /// </devdoc> \n        private unsafe bool bFillColorTable(IntPtr hdc, IntPtr hpal, ref NativeMethods.BITMAPINFO_FLAT pbmi) { \n            bool bRet = false;\n            byte[] aj = new byte[sizeof(NativeMethods.PALETTEENTRY) * 256]; \n            int i, cColors;\n\n            fixed (byte* pcolors = pbmi.bmiColors) {\n                fixed (byte* ppal = aj) { \n                    NativeMethods.RGBQUAD* prgb = (NativeMethods.RGBQUAD*)pcolors;\n                    NativeMethods.PALETTEENTRY* lppe = (NativeMethods.PALETTEENTRY*)ppal; \n \n                    cColors = 1 << pbmi.bmiHeader_biBitCount;\n                    if ( cColors <= 256 ) { \n                        Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"8 bit or less...\");\n\n                        // NOTE : Didn't port \"MyGetPaletteEntries\" as it is only\n                        //      : for 4bpp displays, which we don't work on anyway. \n                        uint palRet;\n                        IntPtr palHalftone = IntPtr.Zero; \n                        if (hpal == IntPtr.Zero) { \n                            Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"using halftone palette...\");\n                            palHalftone = Graphics.GetHalftonePalette(); \n                            palRet = SafeNativeMethods.GetPaletteEntries(new HandleRef(null, palHalftone), 0, cColors, aj);\n                        }\n                        else {\n                            Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"using custom palette...\"); \n                            palRet = SafeNativeMethods.GetPaletteEntries(new HandleRef(null, hpal), 0, cColors, aj);\n                        } \n                        if ( palRet != 0 ) { \n                            for (i = 0; i < cColors; i++) {\n                                prgb[i].rgbRed      = lppe[i].peRed; \n                                prgb[i].rgbGreen    = lppe[i].peGreen;\n                                prgb[i].rgbBlue     = lppe[i].peBlue;\n                                prgb[i].rgbReserved = 0;\n                            } \n                            bRet = true;\n                        } \n                        else { \n                            Debug.WriteLineIf(DoubleBuffering.TraceWarning, \"bFillColorTable: MyGetSystemPaletteEntries failed\\n\");\n                        } \n                    }\n                }\n            }\n            return bRet; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.CreateBuffer\"]/*' /> \n        /// <devdoc>\n        ///         Returns a Graphics object representing a buffer. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        private Graphics CreateBuffer(IntPtr src, int offsetX, int offsetY, int width, int height) \n        {\n            //create the compat DC \n            busy = BUFFER_BUSY_DISPOSING; \n            DisposeDC();\n            busy = BUFFER_BUSY_PAINTING; \n            compatDC = UnsafeNativeMethods.CreateCompatibleDC(new HandleRef(null, src));\n\n            //recreate the bitmap if necessary\n            if (width > bufferSize.Width || height > bufferSize.Height) \n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"allocating new bitmap: \" + width + \" x \" + height); \n                int optWidth = Math.Max(width, bufferSize.Width); \n                int optHeight = Math.Max(height, bufferSize.Height);\n \n                busy = BUFFER_BUSY_DISPOSING;\n                DisposeBitmap();\n                busy = BUFFER_BUSY_PAINTING;\n \n                Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"    new size         : \" + optWidth + \" x \" + optHeight);\n                IntPtr pvbits = IntPtr.Zero; \n                dib = CreateCompatibleDIB(src, IntPtr.Zero, optWidth, optHeight, ref pvbits); \n                bufferSize = new Size(optWidth, optHeight);\n            } \n\n            //select the bitmap\n            oldBitmap = SafeNativeMethods.SelectObject(new HandleRef(this, compatDC), new HandleRef(this, dib));\n \n            //create compat graphics\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"    Create compatGraphics\"); \n            compatGraphics = Graphics.FromHdcInternal(compatDC); \n            compatGraphics.TranslateTransform(-targetLoc.X, -targetLoc.Y);\n            virtualSize = new Size(width, height); \n\n            return compatGraphics;\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.CreateCompatibleDIB\"]/*' />\n        /// <devdoc> \n        // CreateCompatibleDIB \n        //\n        // Create a DIB section with an optimal format w.r.t. the specified hdc. \n        //\n        // If DIB <= 8bpp, then the DIB color table is initialized based on the\n        // specified palette.  If the palette handle is NULL, then the system\n        // palette is used. \n        //\n        // Note: The hdc must be a direct DC (not an info or memory DC). \n        // \n        // Note: On palettized displays, if the system palette changes the\n        //       UpdateDIBColorTable function should be called to maintain \n        //       the identity palette mapping between the DIB and the display.\n        //\n        // Returns:\n        //   Valid bitmap handle if successful, NULL if error. \n        //\n        // History: \n        //  23-Jan-1996 -by- Gilman Wong [[....]] \n        // Wrote it.\n        // \n        //  15-Nov-2000 -by- Chris Anderson [[....]]\n        // Ported it to C#.\n        //\n        /// </devdoc> \n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Interoperability\", \"CA1404:CallGetLastErrorImmediatelyAfterPInvoke\")]\n        private IntPtr CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, int ulWidth, int ulHeight, ref IntPtr ppvBits) { \n            if (hdc == IntPtr.Zero) { \n                throw new ArgumentNullException(\"hdc\");\n            } \n\n            IntPtr hbmRet = IntPtr.Zero;\n            NativeMethods.BITMAPINFO_FLAT pbmi = new NativeMethods.BITMAPINFO_FLAT();\n \n            //\n            // Validate hdc. \n            // \n            int objType = UnsafeNativeMethods.GetObjectType(new HandleRef(null, hdc));\n \n            switch(objType) {\n                case NativeMethods.OBJ_DC:\n                case NativeMethods.OBJ_METADC:\n                case NativeMethods.OBJ_MEMDC: \n                case NativeMethods.OBJ_ENHMETADC:\n                    break; \n                default: \n                    throw new ArgumentException(SR.GetString(SR.DCTypeInvalid));\n            } \n\n            if (bFillBitmapInfo(hdc, hpal, ref pbmi)) {\n\n                // \n                // Change bitmap size to match specified dimensions.\n                // \n \n                pbmi.bmiHeader_biWidth = ulWidth;\n                pbmi.bmiHeader_biHeight = ulHeight; \n                if (pbmi.bmiHeader_biCompression == NativeMethods.BI_RGB) {\n                    pbmi.bmiHeader_biSizeImage = 0;\n                }\n                else { \n                    if ( pbmi.bmiHeader_biBitCount == 16 )\n                        pbmi.bmiHeader_biSizeImage = ulWidth * ulHeight * 2; \n                    else if ( pbmi.bmiHeader_biBitCount == 32 ) \n                        pbmi.bmiHeader_biSizeImage = ulWidth * ulHeight * 4;\n                    else \n                        pbmi.bmiHeader_biSizeImage = 0;\n                }\n                pbmi.bmiHeader_biClrUsed = 0;\n                pbmi.bmiHeader_biClrImportant = 0; \n\n                // \n                // Create the DIB section.  Let Win32 allocate the memory and return \n                // a pointer to the bitmap surface.\n                // \n\n                hbmRet = SafeNativeMethods.CreateDIBSection(new HandleRef(null, hdc), ref pbmi, NativeMethods.DIB_RGB_COLORS, ref ppvBits, IntPtr.Zero, 0);\n                Win32Exception ex = null;\n                if ( hbmRet == IntPtr.Zero ) { \n                    ex = new Win32Exception(Marshal.GetLastWin32Error());\n#if DEBUG \n                    DumpBitmapInfo(ref pbmi); \n#endif\n                } \n\n#if DEBUG\n                if (DoubleBuffering.TraceVerbose) {\n                    DumpBitmapInfo(ref pbmi); \n                }\n#endif \n                if(ex!=null) { \n                    throw ex;\n                } \n\n            }\n            return hbmRet;\n        } \n\n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Dispose\"]/*' /> \n        /// <devdoc> \n        ///     Disposes of native handles.\n        /// </devdoc> \n        public void Dispose() {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        } \n\n        /// <devdoc> \n        ///         Disposes the DC, but leaves the bitmap alone. \n        /// </devdoc>\n        [ResourceExposure(ResourceScope.None)] \n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private void DisposeDC()\n        {\n            if (oldBitmap != IntPtr.Zero && compatDC != IntPtr.Zero) \n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"restoring bitmap to DC\"); \n                SafeNativeMethods.SelectObject(new HandleRef(this, compatDC), new HandleRef(this, oldBitmap)); \n                oldBitmap = IntPtr.Zero;\n            } \n            if (compatDC != IntPtr.Zero)\n            {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"delete compat DC\");\n                UnsafeNativeMethods.DeleteDC(new HandleRef(this, compatDC)); \n                compatDC = IntPtr.Zero;\n            } \n        } \n\n        /// <devdoc> \n        ///         Disposes the bitmap, will ASSERT if bitmap is being used (checks oldbitmap).\n        ///         if ASSERTed, call DisposeDC() first.\n        /// </devdoc>\n        private void DisposeBitmap() \n        {\n            if (dib != IntPtr.Zero) \n            { \n                Debug.Assert(oldBitmap == IntPtr.Zero);\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"delete dib\"); \n\n                SafeNativeMethods.DeleteObject(new HandleRef(this, dib));\n                dib = IntPtr.Zero;\n            } \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Dispose1\"]/*' /> \n        /// <devdoc>\n        ///     Disposes of the Graphics buffer. \n        /// </devdoc>\n        private void Dispose(bool disposing) {\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"Dispose(\" + disposing + \") {\");\n            Debug.Indent(); \n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_DISPOSING, BUFFER_FREE);\n \n            if(disposing){ \n                if (oldBusy == BUFFER_BUSY_PAINTING) {\n                    #if DEBUG \n                        Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"Stack at busy buffer: \\n\" + stackAtBusy);\n                    #endif\n\n                    throw new InvalidOperationException(SR.GetString(SR.GraphicsBufferCurrentlyBusy)); \n                }\n \n                if (compatGraphics != null) { \n                    Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"Disposing compatGraphics\");\n                    compatGraphics.Dispose(); \n                    compatGraphics = null;\n                }\n            }\n            else{ \n                Debug.Fail(\"Never let a graphics buffer finalize!\");\n            } \n \n            DisposeDC();\n            DisposeBitmap(); \n\n            if (buffer != null) {\n                Debug.WriteLineIf(DoubleBuffering.TraceVerbose, \"Disposing buffer\");\n                buffer.Dispose(); \n                buffer = null;\n            } \n \n            bufferSize = Size.Empty;\n            virtualSize = Size.Empty; \n            Debug.Unindent();\n            Debug.WriteLineIf(DoubleBuffering.TraceInfo, \"}\");\n\n            this.busy = BUFFER_FREE; \n        }\n \n#if DEBUG \n        private void DumpBitmapInfo(ref NativeMethods.BITMAPINFO_FLAT pbmi) {\n            //Debug.WriteLine(\"biSize --> \" + pbmi.bmiHeader_biSize); \n            Debug.WriteLine(\"biWidth --> \" + pbmi.bmiHeader_biWidth);\n            Debug.WriteLine(\"biHeight --> \" + pbmi.bmiHeader_biHeight);\n            Debug.WriteLine(\"biPlanes --> \" + pbmi.bmiHeader_biPlanes);\n            Debug.WriteLine(\"biBitCount --> \" + pbmi.bmiHeader_biBitCount); \n            //Debug.WriteLine(\"biCompression --> \" + pbmi.bmiHeader_biCompression);\n            //Debug.WriteLine(\"biSizeImage --> \" + pbmi.bmiHeader_biSizeImage); \n            //Debug.WriteLine(\"biXPelsPerMeter --> \" + pbmi.bmiHeader_biXPelsPerMeter); \n            //Debug.WriteLine(\"biYPelsPerMeter --> \" + pbmi.bmiHeader_biYPelsPerMeter);\n            //Debug.WriteLine(\"biClrUsed --> \" + pbmi.bmiHeader_biClrUsed); \n            //Debug.WriteLine(\"biClrImportant --> \" + pbmi.bmiHeader_biClrImportant);\n            //Debug.Write(\"bmiColors --> \");\n            //for (int i=0; i<pbmi.bmiColors.Length; i++) {\n            //    Debug.Write(pbmi.bmiColors[i].ToString(\"X\")); \n            //}\n            Debug.WriteLine(\"\"); \n        } \n#endif\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.Invalidate\"]/*' />\n        /// <devdoc>\n        ///         Invalidates the cached graphics buffer.\n        /// </devdoc> \n        public void Invalidate() {\n            int oldBusy = Interlocked.CompareExchange(ref busy, BUFFER_BUSY_DISPOSING, BUFFER_FREE); \n \n            //if we're not busy with our buffer, lets\n            //clean it up now \n            //\n            if (oldBusy == BUFFER_FREE) {\n                Dispose();\n                this.busy = BUFFER_FREE; \n            }\n            else { \n                //this will indicate to free the buffer \n                //as soon as it becomes non-busy\n                // \n                this.invalidateWhenFree = true;\n            }\n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.ReleaseBuffer\"]/*' />\n        /// <devdoc> \n        ///         Returns a Graphics object representing a buffer. \n        /// </devdoc>\n        internal void ReleaseBuffer(BufferedGraphics buffer) { \n            Debug.Assert(buffer == this.buffer, \"Tried to release a bogus buffer\");\n\n            this.buffer = null;\n            if (this.invalidateWhenFree) { \n                this.busy = BUFFER_BUSY_DISPOSING;\n                Dispose(); //clears everything (incl bitmap) \n            } \n            else {  //otherwise, just dispose the DC.  A new one will be created next time.\n                this.busy = BUFFER_BUSY_DISPOSING; \n                DisposeDC(); //only clears out the DC\n            }\n\n            this.busy = BUFFER_FREE; \n        }\n \n        /// <include file='doc\\BufferedGraphicsContext.uex' path='docs/doc[@for=\"BufferedGraphicsContext.ShouldUseTempManager\"]/*' /> \n        /// <devdoc>\n        ///         This routine allows us to control the point were we start using throw away \n        ///         managers for painting. Since the buffer manager stays around (by default)\n        ///         for the life of the app, we don't want to consume too much memory\n        ///         in the buffer. However, re-allocating the buffer for small things (like\n        ///         buttons, labels, etc) will hit us on runtime performance. \n        /// </devdoc>\n        private bool ShouldUseTempManager(Rectangle targetBounds) { \n            return (targetBounds.Width * targetBounds.Height) > (MaximumBuffer.Width * MaximumBuffer.Height); \n        }\n \n    }\n}\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n"
  },
  {
    "path": "HexgridPanel/Reference Source/BufferedGraphicsManager.cs",
    "content": " \n//------------------------------------------------------------------------------\n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright> \n//-----------------------------------------------------------------------------\n \nnamespace System.Drawing { \n    using System;\n    using System.ComponentModel; \n    using System.Collections;\n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text; \n    using System.Diagnostics;\n    using System.Runtime.InteropServices; \n    using System.Threading; \n    using System.Security;\n    using System.Security.Permissions; \n    using System.Runtime.ConstrainedExecution;\n\n    /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager\"]/*' />\n    /// <devdoc> \n    ///         The BufferedGraphicsManager is used for accessing a BufferedGraphicsContext.\n    /// </devdoc> \n    public sealed class BufferedGraphicsManager { \n        private static BufferedGraphicsContext bufferedGraphicsContext;\n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.BufferedGraphicsManager\"]/*' />\n        /// <devdoc>\n        ///         Private constructor.\n        /// </devdoc> \n        private BufferedGraphicsManager() {\n        } \n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.BufferedGraphicsManager\"]/*' />\n        /// <devdoc> \n        ///         Static constructor.  Here, we hook the exit & unload events so we can clean up our context buffer.\n        /// </devdoc>\n        static BufferedGraphicsManager() {\n            AppDomain.CurrentDomain.ProcessExit += new EventHandler(BufferedGraphicsManager.OnShutdown); \n            AppDomain.CurrentDomain.DomainUnload += new EventHandler(BufferedGraphicsManager.OnShutdown);\n            bufferedGraphicsContext = new BufferedGraphicsContext(); \n        } \n\n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.Current\"]/*' /> \n        /// <devdoc>\n        ///         Retrieves the context associated with the app domain.\n        /// </devdoc>\n        public static BufferedGraphicsContext Current { \n            get {\n                return bufferedGraphicsContext; \n            } \n        }\n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.OnProcessExit\"]/*' />\n        /// <devdoc>\n        ///         Called on process exit\n        /// </devdoc> \n        [PrePrepareMethod]\n        private static void OnShutdown(object sender, EventArgs e) { \n            BufferedGraphicsManager.Current.Invalidate(); \n        }\n    } \n}\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n// Copyright (c) Microsoft Corporation. All rights reserved.\n \n//------------------------------------------------------------------------------\n// <copyright file=\"BufferedGraphics.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright> \n//-----------------------------------------------------------------------------\n \nnamespace System.Drawing { \n    using System;\n    using System.ComponentModel; \n    using System.Collections;\n    using System.Drawing;\n    using System.Drawing.Drawing2D;\n    using System.Drawing.Text; \n    using System.Diagnostics;\n    using System.Runtime.InteropServices; \n    using System.Threading; \n    using System.Security;\n    using System.Security.Permissions; \n    using System.Runtime.ConstrainedExecution;\n\n    /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager\"]/*' />\n    /// <devdoc> \n    ///         The BufferedGraphicsManager is used for accessing a BufferedGraphicsContext.\n    /// </devdoc> \n    public sealed class BufferedGraphicsManager { \n        private static BufferedGraphicsContext bufferedGraphicsContext;\n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.BufferedGraphicsManager\"]/*' />\n        /// <devdoc>\n        ///         Private constructor.\n        /// </devdoc> \n        private BufferedGraphicsManager() {\n        } \n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.BufferedGraphicsManager\"]/*' />\n        /// <devdoc> \n        ///         Static constructor.  Here, we hook the exit & unload events so we can clean up our context buffer.\n        /// </devdoc>\n        static BufferedGraphicsManager() {\n            AppDomain.CurrentDomain.ProcessExit += new EventHandler(BufferedGraphicsManager.OnShutdown); \n            AppDomain.CurrentDomain.DomainUnload += new EventHandler(BufferedGraphicsManager.OnShutdown);\n            bufferedGraphicsContext = new BufferedGraphicsContext(); \n        } \n\n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.Current\"]/*' /> \n        /// <devdoc>\n        ///         Retrieves the context associated with the app domain.\n        /// </devdoc>\n        public static BufferedGraphicsContext Current { \n            get {\n                return bufferedGraphicsContext; \n            } \n        }\n \n        /// <include file='doc\\BufferedGraphicsManager.uex' path='docs/doc[@for=\"BufferedGraphicsManager.OnProcessExit\"]/*' />\n        /// <devdoc>\n        ///         Called on process exit\n        /// </devdoc> \n        [PrePrepareMethod]\n        private static void OnShutdown(object sender, EventArgs e) { \n            BufferedGraphicsManager.Current.Invalidate(); \n        }\n    } \n}\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n// Copyright (c) Microsoft Corporation. All rights reserved.\n"
  },
  {
    "path": "HexgridPanel/Reference Source/SafeNativeMethods.cs",
    "content": "//------------------------------------------------------------------------------ \n// <copyright file=\"System.Drawing.IntNativeMethods.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\n#if [....]_NAMESPACE \nnamespace System.Windows.Forms.Internal \n#elif DRAWING_NAMESPACE\nnamespace System.Drawing.Internal \n#else\nnamespace System.Experimental.Gdi\n#endif\n{ \n    using System;\n    using System.Internal; \n    using System.Text; \n    using System.Runtime.InteropServices;\n    using System.ComponentModel; \n    using System.Runtime.Versioning;\n\n    /// <devdoc>\n    ///   This is an extract of the System.Drawing IntNativeMethods in the CommonUI tree. \n    ///   This is done to be able to compile the GDI code in both assemblies System.Drawing\n    ///   and System.Windows.Forms. \n    /// </devdoc> \n    [System.Security.SuppressUnmanagedCodeSecurityAttribute()]\n#if [....]_PUBLIC_GRAPHICS_LIBRARY \n    public\n#else\n    internal\n#endif \n    static partial class IntSafeNativeMethods\n    { \n        public sealed class CommonHandles \n        {\n            static CommonHandles(){} \n\n            /// <devdoc>\n            ///     Handle type for enhanced metafiles.\n            /// </devdoc> \n            public static readonly int EMF = System.Internal.HandleCollector.RegisterType(\"EnhancedMetaFile\", 20, 500);\n \n            /// <devdoc> \n            ///     Handle type for GDI objects.\n            /// </devdoc> \n            public static readonly int GDI = System.Internal.HandleCollector.RegisterType(\"GDI\", 90, 50);\n\n            /// <devdoc>\n            ///     Handle type for HDC's that count against the Win98 limit of five DC's.  HDC's \n            ///     which are not scarce, such as HDC's for bitmaps, are counted as GDIHANDLE's.\n            /// </devdoc> \n            public static readonly int HDC = System.Internal.HandleCollector.RegisterType(\"HDC\", 100, 2); // wait for 2 dc's before collecting \n        }\n \n        // Brush.\n\n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"CreateSolidBrush\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)] \n        private static extern IntPtr IntCreateSolidBrush(int crColor);\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)] \n        public static IntPtr CreateSolidBrush(int crColor)\n        { \n            IntPtr hBrush = System.Internal.HandleCollector.Add(IntCreateSolidBrush(crColor), IntSafeNativeMethods.CommonHandles.GDI);\n            DbgUtil.AssertWin32(hBrush != IntPtr.Zero, \"IntCreateSolidBrush(color={0}) failed.\", crColor);\n            return hBrush;\n        } \n\n        // Pen. \n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"CreatePen\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)] \n        private static extern IntPtr IntCreatePen(int fnStyle, int nWidth, int crColor);\n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public static IntPtr CreatePen(int fnStyle, int nWidth, int crColor) \n        {\n            IntPtr hPen = System.Internal.HandleCollector.Add(IntCreatePen(fnStyle, nWidth, crColor), IntSafeNativeMethods.CommonHandles.GDI); \n            DbgUtil.AssertWin32(hPen != IntPtr.Zero, \"IntCreatePen(style={0}, width={1}, color=[{2}]) failed.\", fnStyle, nWidth, crColor); \n            return hPen;\n        } \n\n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"ExtCreatePen\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)]\n        private static extern IntPtr IntExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, [MarshalAs(UnmanagedType.LPArray)] int[] lpStyle); \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)] \n        public static IntPtr ExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, int[] lpStyle) \n        {\n            IntPtr hPen = System.Internal.HandleCollector.Add(IntExtCreatePen(fnStyle, dwWidth, lplb, dwStyleCount, lpStyle), IntSafeNativeMethods.CommonHandles.GDI); \n            DbgUtil.AssertWin32(hPen != IntPtr.Zero, \"IntExtCreatePen(style={0}, width={1}, brush={2}, styleCount={3}, styles={4}) failed.\", fnStyle, dwWidth, lplb, dwStyleCount, lpStyle);\n            return hPen;\n        }\n \n        // Region\n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, EntryPoint=\"CreateRectRgn\", CharSet=System.Runtime.InteropServices.CharSet.Auto)] \n        [ResourceExposure(ResourceScope.Process)]\n        public static extern IntPtr IntCreateRectRgn(int x1, int y1, int x2, int y2); \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public static IntPtr CreateRectRgn(int x1, int y1, int x2, int y2)\n        { \n            IntPtr hRgn = System.Internal.HandleCollector.Add(IntCreateRectRgn(x1, y1, x2, y2), IntSafeNativeMethods.CommonHandles.GDI);\n            DbgUtil.AssertWin32(hRgn != IntPtr.Zero, \"IntCreateRectRgn([x1={0}, y1={1}, x2={2}, y2={3}]) failed.\", x1, y1, x2, y2); \n            return hRgn; \n        }\n \n        // Misc.\n\n        [DllImport(ExternDll.Kernel32, SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.AppDomain)] \n        public static extern int GetUserDefaultLCID();\n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] \n        [ResourceExposure(ResourceScope.None)]\n        public static extern bool GdiFlush(); \n    }\n}\n\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n//------------------------------------------------------------------------------ \n// <copyright file=\"System.Drawing.IntNativeMethods.cs\" company=\"Microsoft\">\n//     Copyright (c) Microsoft Corporation.  All rights reserved.\n// </copyright>\n//----------------------------------------------------------------------------- \n\n#if [....]_NAMESPACE \nnamespace System.Windows.Forms.Internal \n#elif DRAWING_NAMESPACE\nnamespace System.Drawing.Internal \n#else\nnamespace System.Experimental.Gdi\n#endif\n{ \n    using System;\n    using System.Internal; \n    using System.Text; \n    using System.Runtime.InteropServices;\n    using System.ComponentModel; \n    using System.Runtime.Versioning;\n\n    /// <devdoc>\n    ///   This is an extract of the System.Drawing IntNativeMethods in the CommonUI tree. \n    ///   This is done to be able to compile the GDI code in both assemblies System.Drawing\n    ///   and System.Windows.Forms. \n    /// </devdoc> \n    [System.Security.SuppressUnmanagedCodeSecurityAttribute()]\n#if [....]_PUBLIC_GRAPHICS_LIBRARY \n    public\n#else\n    internal\n#endif \n    static partial class IntSafeNativeMethods\n    { \n        public sealed class CommonHandles \n        {\n            static CommonHandles(){} \n\n            /// <devdoc>\n            ///     Handle type for enhanced metafiles.\n            /// </devdoc> \n            public static readonly int EMF = System.Internal.HandleCollector.RegisterType(\"EnhancedMetaFile\", 20, 500);\n \n            /// <devdoc> \n            ///     Handle type for GDI objects.\n            /// </devdoc> \n            public static readonly int GDI = System.Internal.HandleCollector.RegisterType(\"GDI\", 90, 50);\n\n            /// <devdoc>\n            ///     Handle type for HDC's that count against the Win98 limit of five DC's.  HDC's \n            ///     which are not scarce, such as HDC's for bitmaps, are counted as GDIHANDLE's.\n            /// </devdoc> \n            public static readonly int HDC = System.Internal.HandleCollector.RegisterType(\"HDC\", 100, 2); // wait for 2 dc's before collecting \n        }\n \n        // Brush.\n\n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"CreateSolidBrush\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)] \n        private static extern IntPtr IntCreateSolidBrush(int crColor);\n        [ResourceExposure(ResourceScope.Process)] \n        [ResourceConsumption(ResourceScope.Process)] \n        public static IntPtr CreateSolidBrush(int crColor)\n        { \n            IntPtr hBrush = System.Internal.HandleCollector.Add(IntCreateSolidBrush(crColor), IntSafeNativeMethods.CommonHandles.GDI);\n            DbgUtil.AssertWin32(hBrush != IntPtr.Zero, \"IntCreateSolidBrush(color={0}) failed.\", crColor);\n            return hBrush;\n        } \n\n        // Pen. \n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"CreatePen\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)] \n        private static extern IntPtr IntCreatePen(int fnStyle, int nWidth, int crColor);\n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public static IntPtr CreatePen(int fnStyle, int nWidth, int crColor) \n        {\n            IntPtr hPen = System.Internal.HandleCollector.Add(IntCreatePen(fnStyle, nWidth, crColor), IntSafeNativeMethods.CommonHandles.GDI); \n            DbgUtil.AssertWin32(hPen != IntPtr.Zero, \"IntCreatePen(style={0}, width={1}, color=[{2}]) failed.\", fnStyle, nWidth, crColor); \n            return hPen;\n        } \n\n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, EntryPoint = \"ExtCreatePen\", CharSet = System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.Process)]\n        private static extern IntPtr IntExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, [MarshalAs(UnmanagedType.LPArray)] int[] lpStyle); \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)] \n        public static IntPtr ExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, int[] lpStyle) \n        {\n            IntPtr hPen = System.Internal.HandleCollector.Add(IntExtCreatePen(fnStyle, dwWidth, lplb, dwStyleCount, lpStyle), IntSafeNativeMethods.CommonHandles.GDI); \n            DbgUtil.AssertWin32(hPen != IntPtr.Zero, \"IntExtCreatePen(style={0}, width={1}, brush={2}, styleCount={3}, styles={4}) failed.\", fnStyle, dwWidth, lplb, dwStyleCount, lpStyle);\n            return hPen;\n        }\n \n        // Region\n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling=true, EntryPoint=\"CreateRectRgn\", CharSet=System.Runtime.InteropServices.CharSet.Auto)] \n        [ResourceExposure(ResourceScope.Process)]\n        public static extern IntPtr IntCreateRectRgn(int x1, int y1, int x2, int y2); \n        [ResourceExposure(ResourceScope.Process)]\n        [ResourceConsumption(ResourceScope.Process)]\n        public static IntPtr CreateRectRgn(int x1, int y1, int x2, int y2)\n        { \n            IntPtr hRgn = System.Internal.HandleCollector.Add(IntCreateRectRgn(x1, y1, x2, y2), IntSafeNativeMethods.CommonHandles.GDI);\n            DbgUtil.AssertWin32(hRgn != IntPtr.Zero, \"IntCreateRectRgn([x1={0}, y1={1}, x2={2}, y2={3}]) failed.\", x1, y1, x2, y2); \n            return hRgn; \n        }\n \n        // Misc.\n\n        [DllImport(ExternDll.Kernel32, SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]\n        [ResourceExposure(ResourceScope.AppDomain)] \n        public static extern int GetUserDefaultLCID();\n \n        [DllImport(ExternDll.Gdi32, SetLastError=true, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] \n        [ResourceExposure(ResourceScope.None)]\n        public static extern bool GdiFlush(); \n    }\n}\n\n\n// File provided for Reference Use Only by Microsoft Corporation (c) 2007.\n"
  },
  {
    "path": "HexgridPanel/TiltableForm.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n    partial class TiltableForm {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing) {\n            if (disposing && (components != null)) {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent() {\n            this.ToolStripContainer = new System.Windows.Forms.ToolStripContainer();\n            this.ToolStripContainer.SuspendLayout();\n            this.SuspendLayout();\n            // \n            // ToolStripContainer\n            // \n            // \n            // ToolStripContainer.ContentPanel\n            // \n            this.ToolStripContainer.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n            this.ToolStripContainer.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n            this.ToolStripContainer.ContentPanel.Size = new System.Drawing.Size(800, 425);\n            this.ToolStripContainer.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.ToolStripContainer.Location = new System.Drawing.Point(0, 0);\n            this.ToolStripContainer.Margin = new System.Windows.Forms.Padding(0);\n            this.ToolStripContainer.Name = \"ToolStripContainer\";\n            this.ToolStripContainer.Size = new System.Drawing.Size(800, 450);\n            this.ToolStripContainer.TabIndex = 0;\n            this.ToolStripContainer.Text = \"ToolStripContainer\";\n            // \n            // TiltableForm\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(800, 450);\n            this.Controls.Add(this.ToolStripContainer);\n            this.Name = \"TiltableForm\";\n            this.Text = \"TiltableForm\";\n            this.Load += new System.EventHandler(this.HexgridPanelForm_Load);\n            this.ToolStripContainer.ResumeLayout(false);\n            this.ToolStripContainer.PerformLayout();\n            this.ResumeLayout(false);\n\n        }\n\n        #endregion\n\n        protected System.Windows.Forms.ToolStripContainer ToolStripContainer;\n\n        protected virtual HexgridPanel HexgridPanel { get; } = null;\n    }\n}"
  },
  {
    "path": "HexgridPanel/TiltableForm.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\nusing System.Security.Permissions;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Storage;\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    using HexSize        = System.Drawing.Size;\n\n    public partial class TiltableForm: Form, IMessageFilter {\n        public TiltableForm() {\n            InitializeComponent();\n            Application.AddMessageFilter(this);\n        }\n\n        protected IPanelModel    MapBoard;\n        protected CustomCoords   CustomCoords;\n\n        #region Event handlers\n        protected virtual void HexgridPanel_ScaleChange(object sender,EventArgs e) => OnResizeEnd(e);\n\n        protected virtual void HexgridPanel_MouseMove(object sender, MouseEventArgs e) { }\n\n        protected virtual void HexgridPanelForm_Load(object sender, EventArgs e) {\n            if (HexgridPanel == null) return;\n            HexgridPanel.ScaleIndex = HexgridPanel.Scales\n                                                  .Select((f,i) => new {value=f, index=i})\n                                                  .Where(s => s.value==1.0F)\n                                                  .Select(s => s.index).FirstOrDefault(); \n            var padding = ToolStripContainer.ContentPanel.Padding;\n            Size = HexgridPanel.MapSizePixels  + new HexSize(21,93)\n                 + new HexSize(padding.Left+padding.Right, padding.Top+padding.Bottom);\n        }\n\n        protected void PanelBoard_GoalHexChange(object sender, HexEventArgs e)\n        =>  RefreshAfter(()=>{MapBoard.GoalHex = e.Coords;} );\n\n        protected void PanelBoard_StartHexChange(object sender, HexEventArgs e)\n        =>  RefreshAfter(()=>{MapBoard.StartHex = e.Coords;} );\n\n        protected void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e)\n        =>  RefreshAfter(()=>{MapBoard.HotspotHex = e.Coords;} );\n\n        protected void RefreshAfter(Action action) { action?.Invoke(); HexgridPanel.Refresh(); }\n        #endregion\n\n        #region IMessageFilter implementation\n        /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n        /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n        /// that with focus) with adjusted delta.\n        /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n        /// Dont forget to add this to constructor:\n        /// \t\t\tApplication.AddMessageFilter(this);\n        ///</remarks>\n        /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n        /// <returns>Success (true) or failure (false) to OS.</returns>\n        [PermissionSet(SecurityAction.Demand, Name = \"FullTrust\")]\n        public bool PreFilterMessage(ref Message m) {\n            if ((WM)m.Msg != WM.MouseHWheel && (WM)m.Msg != WM.MouseWheel) return false;\n\n            var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n            var ctl = FromChildHandle(hWnd);\n            if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n                switch ((WM)m.Msg) {\n                    case WM.MouseHWheel:\n                    case WM.MouseWheel:\n                        Tracing.ScrollEvents.Trace(true, $\" - {Name}.WM.{(WM)m.Msg}: \");\n                        return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n                    default: break;\n                }\n            }\n            return false;\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/TiltableForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "HexgridPanel/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n        /// <summary>TODO</summary>\n        protected ViewModelBase(string displayName) { DisplayName = displayName; }\n\n        /// <summary>TODO</summary>\n        public            string DisplayName                { get; private set; }\n        /// <summary>TODO</summary>\n        protected virtual bool   ThrowOnInvalidPropertyName { get { return true; } }\n\n        /// <summary>Raised when a property on this object has a new value.</summary>\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        /// <summary>Raises this object's PropertyChanged event.</summary>\n        /// <param name=\"propertyName\">The property that has a new value.</param>\n        protected virtual void OnPropertyChanged(string propertyName) {\n            VerifyPropertyName(propertyName);\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n        }\n\n        /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n        [Conditional(\"DEBUG\"), DebuggerStepThrough]\n        public void VerifyPropertyName(string propertyName) {\n            if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n                var msg = $\"Invalid property name: {propertyName}\";\n                if (ThrowOnInvalidPropertyName) throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n                Debug.Fail(msg);\n            }\n        }\n\n        #region IDisposable implementation with Finalizeer\n        /// <summary>Clean up any resources being used, and suppress finalization.</summary>\n        public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n        /// <summary>True if already Disposed.</summary>\n        private bool _isDisposed = false;\n        /// <summary>Clean up any resources being used.</summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected virtual void Dispose(bool disposing) {\n            if (!_isDisposed) {\n                if (disposing) {\n                }\n                _isDisposed = true;\n            }\n        }\n        /// <summary>Finalize this instance.</summary>\n        ~ViewModelBase() { Dispose(false); }\n        #endregion\n    }\n\n    /// <summary>TODO</summary>\n    public class CommandViewModel : ViewModelBase { \n        /// <summary>TODO</summary>\n        public CommandViewModel(string displayName, ICommand command) : base(displayName) {\n            Command = command ?? throw new ArgumentNullException(\"command\"); \n        } \n        /// <summary>TODO</summary>\n        public ICommand Command { get; private set; } \n    }\n\n    /// <summary>TODO</summary>\n    public class RelayCommand : ICommand { \n        /// <summary>TODO</summary>\n        public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n        /// <summary>TODO</summary>\n        public RelayCommand(Action<object> execute, Predicate<object> canExecute) {\n            _execute = execute ?? throw new ArgumentNullException(\"execute\"); \n            _canExecute = canExecute ?? throw new ArgumentNullException(\"canExecute\");\n        } \n  \n        /// <summary>TODO</summary>\n        [DebuggerStepThrough] \n        public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n        /// <summary>TODO</summary>\n        public event EventHandler CanExecuteChanged { \n            add    { CommandManager.RequerySuggested += value; } \n            remove { CommandManager.RequerySuggested -= value; } \n        }\n  \n        /// <summary>TODO</summary>\n        public void Execute(object parameter) { _execute(parameter); }\n\n        readonly Action<object>    _execute; \n        readonly Predicate<object> _canExecute; \n    }\n\n    ///// <summary>TODO</summary>\n    //public class RelayCommand<T> : ICommand { \n    //  /// <summary>TODO</summary>\n    //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n    //  /// <summary>TODO</summary>\n    //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n    //    if (execute == null) throw new ArgumentNullException(\"execute\");\n    //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n    //    _execute    = execute; \n    //    _canExecute = canExecute;\n    //  } \n  \n    //  /// <summary>TODO</summary>\n    //  [DebuggerStepThrough] \n    //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n    //  /// <summary>TODO</summary>\n    //  public event EventHandler CanExecuteChanged { \n    //    add    { CommandManager.RequerySuggested += value; } \n    //    remove { CommandManager.RequerySuggested -= value; } \n    //  }\n  \n    //  /// <summary>TODO</summary>\n    //  public void Execute(T parameter) { _execute(parameter); }\n\n    //  readonly Action<T>    _execute; \n    //  readonly Predicate<object> _canExecute; \n    //}\n\n    /// <summary>TODO</summary>\n    public abstract class WorkspaceViewModel : ViewModelBase {\n        /// <summary>TODO</summary>\n        protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n        /// <summary>TODO</summary>\n        protected WorkspaceViewModel(string displayName) : base (displayName) {\n            CloseCommand = new RelayCommand(param => this.OnRequestClose());\n        }\n\n        /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n        public virtual ICommand CloseCommand { get; }\n\n        /// <summary>Raised when this workspace should be removed from the UI.</summary>\n        public event EventHandler RequestClose;\n\n        void OnRequestClose()  { RequestClose?.Invoke(this,EventArgs.Empty); }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/BufferedGraphicsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n  /// <summary>TODO</summary>\n  public static partial class BufferedGraphicsExtensions {\n    /// <summary>Performs a SrcCopy BitBLt from <paramref name=\"source\"/> to <paramref name=\"target\"/> of the rectangle <paramref name=\"clientRectangle\"/>.</summary>\n    /// <param name=\"source\">BufferedGraphics source for the BitBlt.</param>\n    /// <param name=\"target\">Graphics target for the BitBlt.</param>\n    /// <param name=\"clientRectangle\">Rectangle in pixels in <paramref name=\"source\"/> to BitBlt.</param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public static void Render(this BufferedGraphics source,\n      Graphics     target,\n      Rectangle    clientRectangle\n    ) { source.Render(target, clientRectangle.Location, clientRectangle.Size, GdiRasterOps.SrcCopy); }\n\n    /// <summary>Performs a <paramref name=\"rasterOp\"/> BitBLt from <paramref name=\"source\"/> to <paramref name=\"target\"/> of the rectangle <paramref name=\"clientRectangle\"/>.</summary>\n    /// <param name=\"source\">BufferedGraphics source for the BitBlt.</param>\n    /// <param name=\"target\">Graphics target for the BitBlt.</param>\n    /// <param name=\"clientRectangle\">Rectangle in pixels in <paramref name=\"source\"/> to BitBlt.</param>\n    /// <param name=\"rasterOp\">The raster-operation to be performed during the BitBlt.</param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    internal static void Render(this BufferedGraphics source,\n      Graphics     target,\n      Rectangle    clientRectangle,\n      GdiRasterOps rasterOp\n    ) { source.Render(target, clientRectangle.Location, clientRectangle.Size, rasterOp); }\n\n    /// <summary>Performs a <paramref name=\"rasterOp\"/> BitBLt from <paramref name=\"source\"/> to <paramref name=\"target\"/> of the rectangle at <paramref name=\"scrollPosition\"/> with dimensions <paramref name=\"virtualSize\"/>.</summary>\n    /// <param name=\"source\">BufferedGraphics source for the BitBlt.</param>\n    /// <param name=\"target\">Graphics target for the BitBlt.</param>\n    /// <param name=\"scrollPosition\">Location in pixels in <paramref name=\"source\"/> of the rectangle to BitBlt.</param>\n    /// <param name=\"virtualSize\">Size in pixels of the rectangle to BitBlt.</param>\n    /// <param name=\"rasterOp\">The raster-operation to be performed during the BitBlt.</param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    internal static void Render(this BufferedGraphics source, \n      Graphics     target, \n      Point        scrollPosition, \n      Size         virtualSize,\n      GdiRasterOps rasterOp\n    ) {\n      if (target != null) {\n        var targetDC = target.GetHdc();\n\n        try {\n          source.RenderInternal(new HandleRef(target,targetDC), scrollPosition, virtualSize, rasterOp);\n        } finally {\n          target.ReleaseHdc(targetDC);\n        }\n      }\n    }\n\n    /// <summary>Private method that renders the specified buffer into the target.</summary>\n    /// <param name=\"source\">BufferedGraphics source for the BitBlt.</param>\n    /// <param name=\"targetDC\">HandleRef for the Graphics target of the BitBlt.</param>\n    /// <param name=\"scrollPosition\">Location in pixels in <paramref name=\"source\"/> of the rectangle to BitBlt.</param>\n    /// <param name=\"virtualSize\">Size in pixels of the rectangle to BitBlt.</param>\n    /// <param name=\"rasterOp\">The raster-operation to be performed during the BitBlt.</param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    private static void RenderInternal(this BufferedGraphics source, \n      HandleRef    targetDC, \n      Point        scrollPosition, \n      Size         virtualSize,\n      GdiRasterOps rasterOp\n    ) {\n      var sourceDC = source.Graphics.GetHdc();\n      try {\n        NativeMethods.BitBlt(\n            targetDC,\n            scrollPosition.X,  scrollPosition.Y, \n            virtualSize.Width, virtualSize.Height, \n            new HandleRef(source.Graphics, sourceDC),\n                            0,                 0, \n            (int)rasterOp);\n      } finally {\n        source.Graphics.ReleaseHdc(sourceDC);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ControlExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n    public static partial class ControlExtensions {\n        /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"action\"></param>\n        public static void UIThread(this Control @this, Action action) {\n            if (@this ==null) throw new ArgumentNullException(\"this\");\n            if (action==null) throw new ArgumentNullException(\"action\");\n\n            if (@this.InvokeRequired)   @this.BeginInvoke(action);\n            else                        action.Invoke();\n        }\n\n        /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"action\"></param>\n        /// <param name=\"args\"></param>\n        public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n            if (@this ==null) throw new ArgumentNullException(\"this\");\n            if (action==null) throw new ArgumentNullException(\"action\");\n\n            if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n            else                        action.Invoke(args);\n        }\n\n        /// <summary>.</summary>\n        /// <param name=\"this\"></param>\n        /// <param name=\"g\"></param>\n        /// <param name=\"inflation\"></param>\n        public static void DrawFocusRectangle(this Control @this, Graphics g, Point inflation)\n        => ControlPaint.DrawFocusRectangle(g, @this.ClientRectInflated(inflation));\n\n        private static Rectangle ClientRectInflated(this Control @this, Point p) {\n            var a = @this.ClientRectangle;    a.Inflate(p.X, p.Y);    return a;\n        }        \n\n        /// <inheritdoc/>\n        public static bool IsInputKey(this Keys keyData)\n        => keyData == Keys.Up   || keyData == Keys.Down\n        || keyData == Keys.Left || keyData == Keys.Right;\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>Clean up any resources being used.</summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "HexgridPanel/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "HexgridPanel/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "HexgridPanel/WinForms/GdiRasterOps.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n  internal enum GdiRasterOps {\n    SrcCopy                 = 0x00CC0020, /* dest = source                   */ \n    SrcPaint                = 0x00EE0086, /* dest = source OR dest           */\n    SrcAnd                  = 0x008800C6, /* dest = source AND dest          */\n    SrcInvert               = 0x00660046, /* dest = source XOR dest          */\n    SrcErase                = 0x00440328, /* dest = source AND (NOT dest )   */ \n    NotSrcCopy              = 0x00330008, /* dest = (NOT source)             */\n    NotSrcErase             = 0x001100A6, /* dest = (NOT src) AND (NOT dest) */ \n    MergeCopy               = 0x00C000CA, /* dest = (source AND pattern)     */ \n    MergePaint              = 0x00BB0226, /* dest = (NOT source) OR dest     */\n    PatCopy                 = 0x00F00021, /* dest = pattern                  */ \n    PatPaint                = 0x00FB0A09, /* dest = DPSnoo                   */\n    PatInvert               = 0x005A0049, /* dest = pattern XOR dest         */\n    DstInvert               = 0x00550009, /* dest = (NOT dest)               */\n    Blackness               = 0x00000042, /* dest = BLACK                    */ \n    Whiteness               = 0x00FF0062  /* dest = WHITE                    */\n//    public const int CaptureBlt              = 0x40000000; /* Include layered windows */ \n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/Layer.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    using PaintAction = Action<Graphics>;\n\n    /// <summary>TODO</summary>\n    public sealed class Layer {\n\n        /// <summary>TODO</summary>\n        internal Layer(BufferedGraphics buffer, PaintAction paintAction) {\n            Buffer      = buffer;\n            PaintAction = paintAction;\n\n            Background  = Color.Transparent;\n            IsOn        = true;\n            Resize(Buffer);\n        }\n\n        /// <summary>TODO</summary>\n        internal void Resize(BufferedGraphics buffer) {\n            const BindingFlags binding = BindingFlags.NonPublic | BindingFlags.Instance;\n\n            Buffer   = buffer;\n            var info = Buffer.GetType().GetField(\"virtualSize\",binding);\n            Size     = (Size)info.GetValue(Buffer);\n        }\n\n        /// <summary>TODO</summary>\n        public Color            Background      { get; private set; }\n        /// <summary>TODO</summary>\n        public BufferedGraphics Buffer          { \n            get => _buffer;\n            private set { if (_buffer != null) _buffer.Dispose(); _buffer = value; }\n        } BufferedGraphics _buffer;\n        /// <summary>TODO</summary>\n        public bool             IsOn            { get; set; }\n        /// <summary>TODO</summary>\n        public PaintAction      PaintAction     { get; }\n        /// <summary>TODO</summary>\n        public Size             Size            { get; private set; }\n\n        /// <summary>TODO</summary>\n        public void Refresh() { if (IsOn) Buffer.Graphics.Contain(Refresh); }\n\n        private void Refresh(Graphics graphics) {\n            graphics.Clear(Background);\n            PaintAction(graphics);\n        }\n\n        /// <summary>TODO</summary>\n        public async Task RefreshAsync() => await Task.Run(() => Refresh());\n\n        /// <summary>TODO</summary>\n        public async Task RenderAsync(Graphics target, Point scrollPosition) =>\n            await Task.Run(() => Render(target,scrollPosition));\n\n        /// <summary>TODO</summary>\n        /// <param name=\"target\"></param>\n        /// <param name=\"scrollPosition\"></param>\n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n        public void Render(Graphics target, Point scrollPosition) {\n            if (target != null) {\n                var targetDC = target.GetHdc();\n \n                try { RenderInternal(new HandleRef(target, targetDC), Buffer, scrollPosition); } \n                finally { target.ReleaseHdcInternal(targetDC);  }\n            }\n        }\n\n        /// <summary>TODO</summary>\n        [ResourceExposure(ResourceScope.None)]\n        [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n        private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition) {\n            const int  rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n\n            var sourceDC    = buffer.Graphics.GetHdc(); \n            var virtualSize = Size;\n            try { \n                NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                                  virtualSize.Width, virtualSize.Height, \n                                      new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n            } finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n        } \n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/LayerCollection.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexgridPanel {\n    using PaintAction = Action<Graphics>;\n\n    /// <summary>TODO</summary>\n    public class LayerCollection : ReadOnlyCollection<Layer> {\n        /// <summary>TODO</summary>\n        internal LayerCollection(Graphics g, Size size) : this(g, size, new List<PaintAction>()) {}\n\n        /// <summary>TODO</summary>\n        internal LayerCollection(Graphics g, Size size, IList<PaintAction> list) : base(new List<Layer>()) {\n            Context   = new BufferedGraphicsContext();\n            Graphics  = g;\n            Size      = size;\n\n            foreach (var action in list) AddLayer(action);\n        }\n\n        /// <summary>TODO</summary>\n        public void AddLayer(PaintAction paintAction) => Items.Add(NewLayer(paintAction));\n\n        /// <summary>TODO</summary>\n        public void Render(Graphics g, Point scrollPosition) {\n            for(var i=0; i < Count; i++) this[i].Render(g, scrollPosition); \n        }\n\n        /// <summary>TODO</summary>\n        public void Resize (Rectangle rectangle) {\n            Size = rectangle.Size;\n            Context.MaximumBuffer = Size;\n            foreach(var layer in this) { layer.Resize(Context.Allocate(Graphics, rectangle)); }\n        }\n\n        BufferedGraphicsContext Context   { get; set; }\n        Graphics                Graphics  { get; set; }\n        Size                    Size      { get; set; }\n\n        /// <summary>TODO</summary>\n        Layer            NewLayer(PaintAction paintAction) =>\n            new Layer(\n                Context.Allocate(Graphics, new Rectangle(Point.Empty,Size)), \n                paintAction\n            );\n\n        #region IDisposable implementation\n        /// <summary>Clean up any resources being used, and suppress finalization.</summary>\n        public void Dispose() => Dispose(true);\n        /// <summary>True if already Disposed.</summary>\n        private bool _isDisposed = false;\n        /// <summary>Clean up any resources being used.</summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected virtual void Dispose(bool disposing) {\n            if (!_isDisposed) {\n                if (disposing) {\n                    if (Context  != null) Context.Dispose();  Context  = null;\n                    if (Graphics != null) Graphics.Dispose(); Graphics = null;\n                }\n                _isDisposed = true;\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/LayeredScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class LayeredScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>Clean up any resources being used.</summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/LayeredScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>TODO</summary>\n    public partial class LayeredScrollable : ScrollableControl, ISupportInitialize { //, IMessageFilter {\n        /// <summary>TODO</summary>\n        public LayeredScrollable() => InitializeComponent();        \n\n        #region ISupportInitialize implementation\n        /// <summary>Signals the object that initialization is starting.</summary>\n        public virtual void BeginInit() { \n        }\n        /// <summary>Signals the object that initialization is complete.</summary>\n        public virtual void EndInit() { \n    \t//\t\tApplication.AddMessageFilter(this);\n\n            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n            SetStyle(ControlStyles.Opaque, true);\n\n            Layers = new LayerCollection(this.CreateGraphics(), DisplayRectangle.Size);\n        }\n        #endregion\n\n        /// <summary>TODO</summary>\n        public    LayerCollection   Layers    { get; private set; }\n\n        /// <inheritdoc/>\n        protected override void OnResize(EventArgs e) {\n            Layers.Resize(ClientRectangle);\n            base.OnResize(e);\n        }\n\n        //#region IMessageFilter implementation\n        ///// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n        ///// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n        ///// that with focus) with adjusted delta.\n        ///// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n        ///// Dont forget to add this to constructor:\n        ///// \t\t\tApplication.AddMessageFilter(this);\n        ///// </remarks>\n        ///// <param name=\"m\">The Windows Message to filter and/or process.</param>\n        ///// <returns>Success (true) or failure (false) to OS.</returns>\n        //[System.Security.Permissions.PermissionSetAttribute(\n        //  System.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n        //public bool PreFilterMessage(ref Message m) {\n        //  if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n        //  var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n        //  var ctl\t  = Control.FromHandle(hWnd);\n        //  if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        //    switch((WM)m.Msg) {\n        //      case WM.MOUSEHWHEEL:\n        //      case WM.MOUSEWHEEL:\n        //        DebugTracing.Trace(Tracing.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, ((WM)m.Msg)); \n        //        return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n        //      default: break;\n        //    }\n        //  }\n        //  return false;\n        //}\n        //#endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>Extern declarations from the Win32 API.</summary>\n    internal static class NativeMethods {\n        /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(vector=vs.85).aspx\"></a></remarks>\n\t\t/// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n        [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n            Justification=\"Research suggests the Code Analysis message is incorrect.\")]\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        [DllImport(\"user32.dll\")]\n        public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n        /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n        /// <param name=\"hWnd\">Window handle</param>\n        /// <param name=\"msg\">Windows message</param>\n        /// <param name=\"wParam\">WParam</param>\n        /// <param name=\"lParam\">LParam</param>\n        /// <returns></returns>\n        [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n        public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n\n        /// <summary>Performs A Bit-Block-Transfer (ie BitBlt) of the color data corresponding to a rectangle \n        /// of pixels from the specified source device context into a destination device context.</summary>\n        /// <param name=\"hDC\">A handle to the destination device context.</param>\n        /// <param name=\"x\">The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>\n        /// <param name=\"y\">The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>\n        /// <param name=\"nWidth\">The width, in logical units, of the source and destination rectangles.</param>\n        /// <param name=\"nHeight\">The height, in logical units, of the source and the destination rectangles.</param>\n        /// <param name=\"hSrcDC\">A handle to the source device context.</param>\n        /// <param name=\"xSrc\">The x-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>\n        /// <param name=\"ySrc\">The y-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>\n        /// <param name=\"dwRop\">The raster-operation code (<see cref=\"GdiRasterOps\"/>) specifying how to combine color data in the source with color data in the destination.</param>\n        [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n        [ResourceExposure(ResourceScope.None)]\n        [return: MarshalAs(UnmanagedType.Bool)]\n        public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n                                         HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n        /// <summary>Message Cracker for HiWord</summary>\n        /// <param name=\"ptr\">A Windows message IntPtr</param>\n        /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n        public static int HiWord(this IntPtr ptr)\n        => unchecked((short)unchecked((int)(((ulong)ptr & 0xFFFFFFFFFFFF0000UL) >> 16)));\n\n        /// <summary>Message Cracker for LoWord</summary>\n        /// <param name=\"ptr\">A Windows message IntPtr</param>\n        /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n        public static int LoWord(this IntPtr ptr)\n        =>  unchecked((short)(int)((ulong)ptr & 0xFFFFUL));\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/NativeMethodsTreeView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>Methods to get/set AUtoScrollPosition for a <see cref=\"TreeView\"/> control</summary>\n    /// <remarks>\n    ///  Courtesy of Stefan Koell for this solution:\n    ///    <a>https://stackoverflow.com/questions/332788/maintain-scroll-position-of-treeview]]</a>\n    /// </remarks>\n    internal static class NativeMethodsTreeView {\n        #region TreeView\n        public static Point GetAutoScrollPosition(this IntPtr HWnd)\n            => new Point(GetScrollPos(HWnd, SB_HORZ),  GetScrollPos(HWnd, SB_VERT) );\n\n        public static void SetAutoScrollPosition(this IntPtr HWnd, Point position) {\n            SetScrollPos(HWnd, SB_HORZ, position.X, true);\n            SetScrollPos(HWnd, SB_VERT, position.Y, true); \n        }\n\n        [DllImport(\"user32.dll\",  CharSet = CharSet.Unicode)]\n        private static extern int GetScrollPos(IntPtr hWnd, int nBar);\n\n        [DllImport(\"user32.dll\",  CharSet = CharSet.Unicode)]\n        private static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);\n\n        private const int SB_HORZ = 0x0;\n        private const int SB_VERT = 0x1;\n        #endregion\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ScrollBarCommand.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n  #pragma warning disable 1570,1591\n  /// <summary>TODO</summary>\n  internal enum ScrollBarCommand {\n      SB_LINEUP           = 0,  //!< TODO\n      SB_LINELEFT         = 0,  //!< TODO\n      SB_LINEDOWN         = 1,  //!< TODO\n      SB_LINERIGHT        = 1,  //!< TODO\n      SB_PAGEUP           = 2,  //!< TODO\n      SB_PAGELEFT         = 2,  //!< TODO\n      SB_PAGEDOWN         = 3,  //!< TODO\n      SB_PAGERIGHT        = 3,  //!< TODO\n      SB_THUMBPOSITION    = 4,  //!< TODO\n      SB_THUMBTRACK       = 5,  //!< TODO\n      SB_TOP              = 6,  //!< TODO\n      SB_LEFT             = 6,  //!< TODO\n      SB_BOTTOM           = 7,  //!< TODO\n      SB_RIGHT            = 7,  //!< TODO\n      SB_ENDSCROLL        = 8   //!< TODO\n  }\n  #pragma warning restore 1570,1591\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ScrollableControlExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>Extension methoda supporting  horizontal (ie tilt) scrolling on the <see cref=\"IScrollableControl\"/> interface.</summary>\n    internal static class ScrollableControlExtensions {\n        /// <summary>Service routine to execute a Panel scroll.</summary>\n        [Obsolete(\"Use ScrollPanelVertical or ScrollPanelHorizontal instead.\")]\n        public static void ScrollPanel(this IScrollableControl @this, ScrollEventType type,\n                    ScrollOrientation orientation, int sign)\n        =>  ScrollActions[ScrollActionIndex(type, orientation, sign)](@this);\n\n        /// <summary>Returns a new <see cref=\"MouseEventArgs\"/> from the supplies <see cref=\"Message\"/>.</summary>\n        /// <param name=\"this\"></param>\n        public static MouseEventArgs CreateMouseEventArgs(this Message @this) \n        => new MouseEventArgs(  \n              (MouseButtons)@this.WParam.LoWord(),\n                            0,\n                            @this.LParam.LoWord(),\n                            @this.LParam.HiWord(),\n                            @this.WParam.HiWord() );\n\n        /// <summary>TODO</summary>\n        /// <param name=\"this\">The <see cref=\"IScrollableControl\"/> to be scrolled.</param>\n        /// <param name=\"delta\"></param>\n        public static void RollHorizontal(this IScrollableControl @this, int delta) {\n            @this.UnappliedScroll += new Size(delta, 0);// += delta;\n            while (@this.UnappliedScroll.X >= MouseWheelStep) {\n                @this.HScrollByOffset( + MouseWheelStep);\n                @this.UnappliedScroll -= new Size(MouseWheelStep, 0);\n            }\n            while (@this.UnappliedScroll.X <= -MouseWheelStep) {\n                @this.HScrollByOffset( - MouseWheelStep);\n                @this.UnappliedScroll += new Size(MouseWheelStep, 0);\n            }\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"this\">The <see cref=\"IScrollableControl\"/> to be scrolled.</param>\n        /// <param name=\"delta\"></param>\n        public static void RollVertical(this IScrollableControl @this, int delta) {\n            @this.UnappliedScroll += new Size(0, delta);\n            while (@this.UnappliedScroll.Y >= MouseWheelStep) {\n                @this.VScrollByOffset( + MouseWheelStep);\n                @this.UnappliedScroll -= new Size(0, MouseWheelStep);\n            }\n            while (@this.UnappliedScroll.Y <= -MouseWheelStep) {\n                @this.VScrollByOffset( - MouseWheelStep);\n                @this.UnappliedScroll += new Size(0, MouseWheelStep);\n            }\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"this\">The <see cref=\"IScrollableControl\"/> to be scrolled.</param>\n        /// <param name=\"delta\">The amount to be scrolled.</param>\n        public static void HScrollByOffset(this IScrollableControl @this, int delta)\n        =>   @this.AutoScrollPosition = new Point (- @this.AutoScrollPosition.X + delta,\n                                                   - @this.AutoScrollPosition.Y);\n\n        /// <summary>TODO</summary>\n        /// <param name=\"this\">The <see cref=\"IScrollableControl\"/> to be scrolled.</param>\n        /// <param name=\"delta\">The amount to be scrolled.</param>\n        public static void VScrollByOffset(this IScrollableControl @this, int delta)\n        =>  @this.AutoScrollPosition = new Point (-@this.AutoScrollPosition.X,\n                                                  -@this.AutoScrollPosition.Y + delta);\n\n        /// <summary>TODO</summary>\n        public static void PageUp(this IScrollableControl @this)    \n            => @this.RollVertical(-1 *  @this.ScrollLargeChange.Y);\n        /// <summary>TODO</summary>\n        public static void PageDown(this IScrollableControl @this)  \n            => @this.RollVertical(+1 *  @this.ScrollLargeChange.Y);\n        /// <summary>TODO</summary>\n        public static void PageLeft(this IScrollableControl @this)\n            => @this.RollHorizontal(-1 *  @this.ScrollLargeChange.X);\n        /// <summary>TODO</summary>\n        public static void PageRight(this IScrollableControl @this)\n            => @this.RollHorizontal(+1 *  @this.ScrollLargeChange.X);\n        /// <summary>TODO</summary>\n        public static void LineUp(this IScrollableControl @this)    \n            => @this.RollVertical(-1 * MouseWheelStep);\n        /// <summary>TODO</summary>\n        public static void LineDown(this IScrollableControl @this)  \n            => @this.RollVertical(+1 * MouseWheelStep);\n        /// <summary>TODO</summary>\n        public static void LineLeft(this IScrollableControl @this)\n            => @this.RollHorizontal(-1 * MouseWheelStep);\n        /// <summary>TODO</summary>\n        public static void LineRight(this IScrollableControl @this)\n            => @this.RollHorizontal(+1 * MouseWheelStep);\n\n        /// <summary>TODO</summary>\n        public static int MouseWheelStep\n        => SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines;\n\n        private delegate void ScrollAction(IScrollableControl ctrl);\n\n        private static int ScrollActionIndex(ScrollEventType type, ScrollOrientation orientation, int sign)\n        => ( type.HasFlag(ScrollEventType.SmallDecrement)        ? 4 : 0 )\n        +  ( (orientation == ScrollOrientation.HorizontalScroll) ? 2 : 0 )\n        +  ( (sign == +1)                                        ? 1 : 0 );\n\n        private static readonly IReadOnlyList<ScrollAction> ScrollActions = new List<ScrollAction> {\n                PageUp,   PageDown,  PageLeft, PageRight,\n                LineUp,   LineDown,  LineLeft, LineRight\n            };\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Resources;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.Properties;\n\nnamespace  PGNapoleonics.HexgridPanel.WinForms {\n  /// <summary>A Last-chance Thread Exception handler.</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public class ThreadExceptionHandler {\n    static ResourceManager StringManager =\n            new ResourceManager(\"en-US\", Assembly.GetExecutingAssembly());\n    static CultureInfo Culture = CultureInfo.CurrentCulture;\n\n    static readonly string NewLine       = Environment.NewLine;\n    static readonly string NewLineX2     = Environment.NewLine + Environment.NewLine;\n           readonly string ErrorTitle    = Application.ProductName + Resources.SevereApplicationError;\n           readonly string FatalTitle    = Application.ProductName + Resources.FatalApplicationError;\n    //       readonly string NullEventArgs = Resources.NullThreadExceptionArgs;\n           readonly string FatalMessage  = Resources.FatalThreadingError;\n\n    /// <summary>Handles the thread exception.</summary> \n    [SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\")]\n    public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) {\n      try {\n        var senderType = sender==null ? StringManager.GetString(\"NullSender\",Culture) : sender.ToString();\n        var aggregateException = e.Exception as AggregateException;\n        if (aggregateException != null) {\n          foreach (var ex in aggregateException.InnerExceptions)\n            ShowException(ex, senderType);\n        }\n        else if( e.Exception is NotImplementedException\n        ||  e.Exception is NotSupportedException\n        ||  e.Exception is InvalidOperationException\n        ) {\n          ShowException(e.Exception, senderType);\n        } else {\n            if (ShowThreadExceptionDialog(e.Exception) == DialogResult.Abort) Application.Exit();\n        }\n        Application.ExitThread();\n      } catch(Exception ex) {\n\n        try {\n          MessageBox.Show(FatalMessage + Environment.NewLine + ex.StackTrace, \n            FatalTitle, \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Stop,\n            MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);\n        } finally { Application.Exit(); }\n      }\n    }\n\n    private void ShowException(Exception ex, string senderType) {\n      var stackTrace = ex.StackTrace.Replace(@\"c:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\",\".\");\n      MessageBox.Show(\n          ex.Message + Environment.NewLine +\n          StringManager.GetString(\"From\",Culture) + senderType + Environment.NewLine + \n          stackTrace,\n          ErrorTitle, \n          MessageBoxButtons.OK, \n          MessageBoxIcon.Stop,\n          MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private static DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var result = DialogResult.Abort;\n\n      var errorMessage = \n        \"Unhandled Exception:\" + NewLineX2 +\n        ex.Message             + NewLineX2 +\n        ex.GetType()           + NewLineX2 +\n        \"Stack Trace:\"         + NewLine +\n        ex.StackTrace;\n\n      using (var dialog = new ExceptionDialog(errorMessage)) {\n        dialog.ShowDialog();\n        result = dialog.DialogResult;\n      }\n\n      return result;\n    }\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TiltAwareFlowLayoutPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>A Tilt-Aware FlowLayoutPanel</summary>\n    /// ///<remarks>Courtesy of Hans Passant: \n    /// <a>http://stackoverflow.com/questions/3562235/panel-not-getting-focus</a>\n    /// </remarks>\n    public class TiltAwareFlowLayoutPanel : FlowLayoutPanel, IScrollableControl {\n        /// <summary>TODO</summary>\n        public TiltAwareFlowLayoutPanel() : base() {\n            SetStyle(ControlStyles.Selectable, true);\n            TabStop = true;\n        }\n\n        #region Implementation of \"scrolling without focus\"\n        /// <inheritdoc/>\n        protected override bool IsInputKey(Keys keyData)\n            => keyData.IsInputKey() || base.IsInputKey(keyData);\n        /// <inheritdoc/>\n        protected override void OnMouseDown(MouseEventArgs e) { Focus(); base.OnMouseDown(e); }\n        /// <inheritdoc/>\n        protected override void OnEnter(EventArgs e)          { Invalidate(); base.OnEnter(e); }\n        /// <inheritdoc/>\n        protected override void OnLeave(EventArgs e)          { Invalidate(); base.OnLeave(e); }\n        /// <inheritdoc/>\n        protected override void OnMouseEnter(EventArgs e)     { base.OnMouseEnter(e); Focus(); }\n        /// <inheritdoc/>\n        protected override void OnMouseLeave(EventArgs e)     { Parent.Focus(); base.OnMouseEnter(e); }\n        /// <inheritdoc/>\n        protected override void OnPaint(PaintEventArgs e) {\n            if (Focused  &&  ShowFocusCues) { this.DrawFocusRectangle(e.Graphics, new Point(-2,-2)); }\n            base.OnPaint(e);\n        }\n        #endregion\n\n        /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n        public event EventHandler<MouseEventArgs> MouseHWheel;\n\n        /// <inheritdoc/>\n        public Point UnappliedScroll { get; set; } = new Point();\n\n        /// <inheritdoc/>\n        public Point ScrollLargeChange => new Point (120, 120);\n\n        /// <summary>Raise a <see cref=\"MouseHWheel\"/> event.</summary>\n        /// <param name=\"e\">A <see cref=\"MouseEventArgs\"/> that contains the event data. </param>\n        protected virtual void OnMouseHWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            if (!AutoScroll) return;\n\n            this.RollHorizontal(e.Delta * MouseHWheelStep/120);\n            MouseHWheel?.Invoke(this, e);\n\n            if(e is HandledMouseEventArgs eh) eh.Handled = true;\n        }\n\n        /// <summary>TODO</summary>\n        /// <param name=\"e\"></param>\n        protected override void OnMouseWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            base.OnMouseWheel(new MouseEventArgs(e.Button,e.Clicks,e.X,e.Y,\n                                e.Delta*MouseVWheelStep/120));\n        }\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Naming\", \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"Vwheel\")]\n        public int MouseVWheelStep { set; get; }\n        /// <summary>TODO</summary>\n        public int MouseHWheelStep { set; get; }\n\n        /// <summary>TODO</summary>\n        public void ScrollByOneControl(bool forward) {\n            var rectangle   = ClientRectangle;  rectangle.Inflate(-4,-4);\n            var control     = GetChildAtPoint(rectangle.Location + (forward ? rectangle.Size : Size.Empty));\n            var nextControl = GetNextControl(control,forward);\n            ScrollControlIntoView(nextControl);\n        }\n\n        /// <summary>Extend Windows Message Loop to receive MouseHWheel messages.</summary>\n        protected override void WndProc(ref Message m) {\n            if (!IsDisposed && m.HWnd == this.Handle) {\n                switch ((WM)m.Msg) {\n                    case WM.MouseHWheel:  OnMouseHWheel(m.CreateMouseEventArgs());\n                                          m.Result = (IntPtr)0;\n                                          break;\n                    default:              break;\n                }\n            }\n            base.WndProc(ref m);\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TiltAwarePanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>A Tilt-Aware Focusable Panel</summary>\n    /// ///<remarks>Courtesy of Hans Passant: \n    /// <a>http://stackoverflow.com/questions/3562235/panel-not-getting-focus</a>\n    /// </remarks>\n    public class TiltAwarePanel : Panel, IScrollableControl {\n        /// <summary>TODO</summary>\n        public TiltAwarePanel() : base() {\n            SetStyle(ControlStyles.Selectable, true);\n            TabStop = true;\n        }\n\n        #region Implementation of \"scrolling without focus\"\n        /// <inheritdoc/>\n        protected override bool IsInputKey(Keys keyData)\n            => keyData.IsInputKey() || base.IsInputKey(keyData);\n\n        /// <inheritdoc/>\n        protected override void OnMouseDown(MouseEventArgs e) { Focus(); base.OnMouseDown(e); }\n        /// <inheritdoc/>\n        protected override void OnEnter(EventArgs e)          { Invalidate(); base.OnEnter(e); }\n        /// <inheritdoc/>\n        protected override void OnLeave(EventArgs e)          { Invalidate(); base.OnLeave(e); }\n        /// <inheritdoc/>\n        protected override void OnMouseEnter(EventArgs e)     { base.OnMouseEnter(e); Focus(); }\n        /// <inheritdoc/>\n        protected override void OnMouseLeave(EventArgs e)     { Parent.Focus(); base.OnMouseLeave(e); }\n        /// <inheritdoc/>\n        protected override void OnPaint(PaintEventArgs e) {\n            if (Focused  &&  ShowFocusCues) { this.DrawFocusRectangle(e.Graphics, new Point(-2,-2)); }\n            base.OnPaint(e);\n        }\n        #endregion\n\n        /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n        public virtual event EventHandler<MouseEventArgs> MouseHWheel;\n\n        /// <inheritdoc/>\n        public Point UnappliedScroll { get; set; } = new Point();\n\n        /// <inheritdoc/>\n        public Point ScrollLargeChange => new Point (120, 120);\n\n        /// <summary>Raise a <see cref=\"MouseHWheel\"/> event.</summary>\n        /// <param name=\"e\">A <see cref=\"MouseEventArgs\"/> that contains the event data. </param>\n        protected virtual void OnMouseHWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            if (!AutoScroll) return;\n\n            this.RollHorizontal(e.Delta);\n            MouseHWheel?.Invoke(this, e);\n\n            if(e is HandledMouseEventArgs eh) eh.Handled = true;\n        }\n\n        /// <summary>Extend Windows Message Loop to receive MouseHWheel messages.</summary>\n        protected override void WndProc(ref Message m) {\n            if (!IsDisposed && m.HWnd == Handle) {\n                switch ((WM)m.Msg) {\n                    case WM.MouseHWheel:  OnMouseHWheel(m.CreateMouseEventArgs());\n                                          m.Result = (IntPtr)0;\n                                          break;\n                    default:              break;\n                }\n            }\n            base.WndProc(ref m);\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TiltAwareScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n    /// <summary>A Tilt-Aware <see cref=\"ScrollableControl\"/></summary>\n    /// ///<remarks>Courtesy of Hans Passant: \n    /// <a>http://stackoverflow.com/questions/3562235/panel-not-getting-focus</a>\n    /// </remarks>\n    public class TiltAwareScrollableControl : ScrollableControl, IScrollableControl {\n        /// <summary>TODO</summary>\n        public TiltAwareScrollableControl() : base() {\n            SetStyle(ControlStyles.Selectable, true);\n            TabStop = true;\n        }\n\n        #region Implementation of \"scrolling without focus\"\n        /// <inheritdoc/>\n        protected override bool IsInputKey(Keys keyData) \n            => keyData.IsInputKey() || base.IsInputKey(keyData);\n        /// <inheritdoc/>\n        protected override void OnMouseDown(MouseEventArgs e) { Focus(); base.OnMouseDown(e); }\n        /// <inheritdoc/>\n        protected override void OnEnter(EventArgs e)          { Invalidate(); base.OnEnter(e); }\n        /// <inheritdoc/>\n        protected override void OnLeave(EventArgs e)          { Invalidate(); base.OnLeave(e); }\n        /// <inheritdoc/>\n        protected override void OnMouseEnter(EventArgs e)     { base.OnMouseEnter(e); Focus(); }\n        /// <inheritdoc/>\n        protected override void OnMouseLeave(EventArgs e)     { Parent.Focus(); base.OnMouseLeave(e); }\n        /// <inheritdoc/>\n        protected override void OnPaint(PaintEventArgs e) {\n            base.OnPaint(e);\n            if (Focused  &&  ShowFocusCues) { this.DrawFocusRectangle(e.Graphics, new Point(-2,-2)); }\n        }\n        #endregion\n\n        /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n        public virtual event EventHandler<MouseEventArgs> MouseHWheel;\n\n        /// <inheritdoc/>\n        public Point UnappliedScroll { get; set; } = new Point();\n\n        /// <inheritdoc/>\n        public Point ScrollLargeChange => new Point (HorizontalScroll.LargeChange, VerticalScroll.LargeChange);\n\n        /// <summary>Raise a <see cref=\"MouseHWheel\"/> event.</summary>\n        /// <param name=\"e\">A <see cref=\"MouseEventArgs\"/> that contains the event data. </param>\n        protected virtual void OnMouseHWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            if (!AutoScroll) return;\n\n            this.RollHorizontal(e.Delta);\n            MouseHWheel?.Invoke(this, e);\n\n            if(e is HandledMouseEventArgs eh) eh.Handled = true;\n        }\n\n        /// <summary>Extend Windows Message Loop to receive MouseHWheel messages.</summary>\n        protected override void WndProc(ref Message m) {\n            if (!IsDisposed  &&  m.HWnd == Handle) {\n                switch (m.Msg) {\n                    case (int)WM.MouseHWheel:  OnMouseHWheel(m.CreateMouseEventArgs());\n                                               m.Result = (IntPtr)0;\n                                               break;\n                    default:                   break;\n                }\n            }\n            base.WndProc(ref m);\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TiltAwareTreeView.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel.WinForms {\n  partial class TiltAwareTreeView {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>Clean up any resources being used.</summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify \n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TiltAwareTreeView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>TODO</summary>\n    public partial class TiltAwareTreeView : TreeView, IScrollableControl {\n        /// <summary>TODO</summary>\n        public TiltAwareTreeView() => InitializeComponent();\n\n        /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n        public virtual event EventHandler<MouseEventArgs>  MouseHWheel;\n\n        #region Implementation of \"scrolling without focus\"\n        /// <inheritdoc/>\n        protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); Focus(); }\n        /// <inheritdoc/>\n        protected override void OnMouseLeave(EventArgs e) { Parent.Focus(); base.OnMouseEnter(e); }\n        /// <inheritdoc/>\n        protected override void OnPaint(PaintEventArgs e) {\n            base.OnPaint(e);\n            if (Focused  &&  ShowFocusCues) { this.DrawFocusRectangle(e.Graphics, new Point(-2,-2)); }\n        }\n        #endregion\n\n        /// <summary>TODO</summary>\n        /// <param name=\"e\"></param>\n        protected virtual void OnMouseHWheel(MouseEventArgs e) {\n            if (e == null) throw new ArgumentNullException(nameof(e));\n            if (!Scrollable) return;\n\n            this.RollHorizontal(e.Delta);\n            MouseHWheel?.Invoke(this, e);\n\n            if (e is HandledMouseEventArgs eh) eh.Handled = true;\n        }\n\n        /// <summary>Gets or sets the current amount of unapplied scroll, as a <see cref=\"Point\"/> object.</summary>\n        public Point UnappliedScroll { get; set; } = new Point();\n\n        public Point ScrollLargeChange => new Point (120, 120);\n\n        public Point AutoScrollPosition {\n            get => Handle.GetAutoScrollPosition();\n            set => Handle.SetAutoScrollPosition(value);\n        }\n\n        /// <summary>Extend Windows Message Loop to receive MouseHWheel messages.</summary>\n        protected override void WndProc(ref Message m) {\n            if (!IsDisposed  &&  m.HWnd == Handle) {\n                switch ((WM)m.Msg) {\n                    case WM.MouseHWheel:  OnMouseHWheel(m.CreateMouseEventArgs());\n                                          m.Result = (IntPtr)0;\n                                          break;\n                    default:              break;\n                }\n            }\n            base.WndProc(ref m);\n        }\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowExtendedStyles.Transparent;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n        /// <summary> Invalidate entire parent control to redraw on our background.</summary>\n        /// <remarks>Invalidate the parent of the control, not the control itself, whenever \n        /// we need to update the graphics. This ensures that whatever is behind the control \n        /// gets painted before we need to do our own graphics output.\n        public virtual void Invalidate2() => Invalidate2(new Rectangle(Location,Size));\n        /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n        /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n        public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"e\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs e) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    /// <summary>TODO</summary>\n    public static partial class WinFormsExtensions {\n        /// <summary>Reflect to set Double-Buffering on Control.</summary>\n        /// <param name=\"control\">Control to operate on.</param>\n        /// <param name=\"setting\">New value for parameter.</param>\n        public static void MakeDoubleBuffered(this Control control, bool setting) {\n            if (control==null) throw new ArgumentNullException(\"control\");\n            control.GetType()\n                   .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n                   .SetValue(control, setting, null);\n        }\n\n        /// <summary>Use COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n        public static CreateParams SetCompositedStyle(this Control control, CreateParams parameters) {\n            if (control==null) throw new ArgumentNullException(\"control\");\n            if (parameters==null) throw new ArgumentNullException(\"parameters\");\n            parameters.ExStyle |= (int)WindowExtendedStyles.Composited;\n            return parameters;\n        }\n    }\n\n    /// <summary>TODO</summary>/>\n    public static partial class PaddingExtensions {\n        /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n        public static Point Offset(this Padding @this) => new Point(@this.Left,@this.Top);\n        /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n        public static Size OffsetSize(this Padding @this) => new Size(@this.Left,@this.Top);\n    }\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n  /// <summary>Windows Messages</summary>\n    /// <remarks>\n    /// Defined in winuser.h from Windows SDK v6.1\n    /// Documentation pulled from MSDN.\n    /// </remarks>\n  public enum WM : int //: uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    Null = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    Create = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    Destroy = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    Move = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    Size = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    Activate = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SetFocus = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KillFocus = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    Enable = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SetRedraw = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SetText = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GetText = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GetTextLength = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    Paint = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    Close = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QueryEndSession = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QueryOpen = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    EndSession = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    Quit = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    EraseBkgnd = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SysColorChange = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    ShowWindow = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WinInitChange = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SettingChange = WM.WinInitChange,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DevModeChange = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ActivateApp = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FontChange = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever neighbour is a change in the system time.\n    /// </summary>\n    TimeChange = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CancelMode = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SetCursor = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MouseActivate = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    ChildActivate = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QueueSync = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GetMinMaxInfo = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PaintIcon = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    IconEraseBkgnd = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NextDlgCtl = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SpoolerStatus = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DrawItem = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MeasureItem = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DeleteItem = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKeyToItem = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CharToItem = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SetFont = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GetFont = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SetHotkey = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GetHotkey = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QueryDragIcon = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    CompareItem = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GetObject = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    Compacting = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete(\"Deprecated - WM_COMMNOTIFY is Obsolete for Win32-Based Applications.\")]\n    CommNotify = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WindowPosChanging = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WindowPosChanged = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete(\"Deprecated - use POWERBROADCAST instead of POWER.\")]\n    Power = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    CopyData = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CancelJournal = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    Notify = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    InputLangChangeRequest = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    InputLangChange = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCard = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    Help = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    UserChanged = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NotifyFormat = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    ContextMenu = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    StyleChanging = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    StyleChanged = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DisplayChange = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GetIcon = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SetIcon = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCreate = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDestroy = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCalcSize = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHitTest = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPaint = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCActivate = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GetDlgCode = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SyncPaint = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMouseMove = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonDown = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonUp = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonDblClick = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonDown = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonUp = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonDblClick = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonDown = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonUp = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonDblClick = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonDown = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonUp = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonDblClick = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    InputDeviceChange = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    Input = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KeyFirst = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KeyDown = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KeyUp = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    Char = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DeadChar = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SysKeyDown = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SysKeyUp = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SysChar = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SysDeadChar = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UniChar = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KeyLast = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeStartComposition = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeEndComposition = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeComposition = 0x010F,\n    /// <summary>TODO</summary>\n    ImeKeyLast = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    InitDialog = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    Command = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SysCommand = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    Timer = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    Hscroll = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    Vscroll = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    InitMenu = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    InitMenuPopup = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MenuSelect = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MenuChar = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    EnterIdle = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MenuRbuttonUp = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MenuDrag = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MenuGetObject = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UninitMenuPopup = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MenuCommand = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    ChangeUiState = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UpdateUiState = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QueryUiState = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CtlColorMsgbox = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CtlColorEdit = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CtlColorListBox = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CtlColorButton = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CtlColorDlg = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CtlColorScrollBar = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CtlColorStatic = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MouseFirst = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MouseMove = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonDown = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonUp = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonDblClick = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonDown = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonUp = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonDblClick = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonDown = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonUp = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonDblClick = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MouseWheel = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n    /// </summary>\n    XbuttonDown = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XbuttonUp = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XbuttonDblClick = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MouseHWheel = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MouseLast = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    ParentNotify = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    EnterMenuLoop = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    ExitMenuLoop = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NextMenu = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    Sizing = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CaptureChanged = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    Moving = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    PowerBroadcast = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DeviceChange = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MdiCreate = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MdiDestroy = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MdiActivate = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MdiRestore = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MdiNext = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MdiMaximize = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MdiTitle = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MdiCascade = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MdiIconChange = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MdiGetActive = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MdiSetMenu = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    EnterSizeMove = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    ExitSizeMove = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DropFiles = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MdiRefreshMenu = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeSetContext = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeNotify = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    ImeControl = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeCompositionFull = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeSelect = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeChar = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeRequest = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeKeyDown = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeKeyUp = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MouseHover = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MouseLeave = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMouseHover = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMouseLeave = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WtsSessionChange = 0x02B1,\n    /// <summary>TODO</summary>\n    TabletFirst = 0x02c0,\n    /// <summary>TODO</summary>\n    TabletLast = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    Cut = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    Copy = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    Paste = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    Clear = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    Undo = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RenderFormat = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RenderAllFormats = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DestroyClipboard = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DrawClipboard = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PaintClipboard = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VscrollClipboard = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SizeClipboard = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    AskCBFormatName = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    ChangeCBChain = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HscrollClipboard = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QueryNewPalette = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PaletteChanging = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PaletteChanged = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    Hotkey = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    Print = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PrintClient = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    AppCommand = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    ThemeChanged = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    ClipboardUpdate = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCompositionChanged= 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1709:IdentifiersShouldBeCasedCorrectly\", MessageId = \"DWMNC\")]\n    DWMNCRenderingChanged = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMColorizationColorChanged = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWindowMaximizedChange = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n    GetTitleBarInfoEx = 0x033F,\n    /// <summary>TODO</summary>\n    HandheldFirst = 0x0358,\n    /// <summary>TODO</summary>\n    HandheldLast = 0x035F,\n    /// <summary>TODO</summary>\n    AfxFirst = 0x0360,\n    /// <summary>TODO</summary>\n    AfxLast = 0x037F,\n    /// <summary>TODO</summary>\n    PenWinFirst = 0x0380,\n    /// <summary>TODO</summary>\n    PenWinLast = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    App = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    User = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    CplLaunch = User+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    CplLaunched = User+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SysTimer = 0x118\n\t}\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexgridPanel.WinForms {\n    using Point = System.Drawing.Point;\n\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n [SuppressMessage(\"Microsoft.Design\", \"CA1028:EnumStorageShouldBeInt32\")]\n\t[Flags]public enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLbutton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRbutton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMbutton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXbutton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXbutton2\t= 0x40\n\t}\n\n    /// <summary>TODO</summary>\n    public static class WindowsMouseInput {\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        public static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n\t\tpublic static Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new Point(\n                     (short)(lParam.ToInt64() & 0x0000ffff),\n                     (short)(lParam.ToInt64() >> 16)\n                );\n\t\t}\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        public static short WheelDelta(IntPtr wParam) {\n\t\t\treturn (short)(wParam.ToInt64() >> 16);\n\t\t}\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        public static IntPtr LParam(Point point) {\n\t\t\tif (point.X<short.MinValue || point.X > Int16.MaxValue\n            ||  point.Y<short.MinValue || point.Y > Int16.MaxValue)\n\t\t\tthrow new ArgumentOutOfRangeException(\"point\",point,\n\t\t\t\t\t\"Must be a valid Point struct.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\n        /// <summary>TODO</summary>\n        [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        public static IntPtr WParam (short wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (short)mouseKeys;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "HexgridPanel/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2019 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace  PGNapoleonics.HexgridPanel.WinForms {\n  /// <summary>TODO</summary>\n  /// <a href=\"https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx\">MSDN - Extended Windows Styles</a>\n  [Flags]\n  public enum WindowExtendedStyles {\n    /// <summary>A default window </summary>\n    /// <remarks>\n    /// A window that has generic left-aligned properties; vertical scroll bar (if present) to the right\n    /// of the client area; and window text displayed using left-to-right reading-order properties.\n    /// </remarks>\n    None              = 0x00000000,\n    #if NONE\n    /// <summary>Creates a window that has generic left-aligned properties. This is the default.</summary>\n    Left              = None,\n    /// <summary>Vertical scroll bar (if present) is to the right of the client area. This is the default.</summary>\n    RightScrollBar    = None,\n    /// <summary>The window text is displayed using left-to-right reading-order properties. This is the default.</summary>\n    LtrReading        = None,\n    #endif\n    /// <summary>Creates a window that has a double border.</summary>\n    /// <remarks>\n    /// The window can, optionally, be created with a title bar by specifying the \n    /// WS_CAPTION style in the dwStyle parameter.\n    /// </remarks>\n    DlgModalFrame     = 0x00000001,\n    /// <summary>Specifies a child window that does not send WM_PARENTNOTIFY messages to its parent window.</summary>\n    /// <remarks>\n    /// a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n    /// </remarks>\n    NoParentNotify    = 0x00000004,\n    /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should be placed above all \n    /// non-topmost windows and should stay above them, even when the window is \n    /// deactivated. To add or remove this style, use the SetWindowPos function.\n    /// </remarks>\n    Topmost           = 0x00000008,\n    /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n    AcceptFiles       = 0x00000010,\n    /// <summary>Specifies that a window should be painted after all siblings.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should not be painted until \n    /// siblings beneath the window (that were created by the same thread) have been \n    /// painted. The window appears transparent because the bits of underlying sibling \n    /// windows have already been painted.\n    /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n    /// </remarks>\n    Transparent       = 0x00000020,\n    /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n    MdiChild          = 0x00000040,\n    /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n    /// <remarks>\n    /// A tool window has a title bar that is shorter than a normal title bar, and the \n    /// window title is drawn using a smaller font. A tool window does not appear in \n    /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n    /// tool window has a system menu, its icon is not displayed on the title bar. \n    /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n    /// </remarks>\n    ToolWindow        = 0x00000080,\n\n    /// <summary>Specifies that a window has a border with a raised edge.</summary>\n    WindowEdge        = 0x00000100,\n    /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n    ClientEdge        = 0x00000200,\n    /// <summary>Includes a question mark in the title bar of the window.</summary>\n    /// <remarks>\n    /// When the user clicks the question mark, the cursor changes to a question mark \n    /// with a pointer. If the user then clicks a child window, the child receives a \n    /// WM_HELP message. The child window should pass the message to the parent window \n    /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n    /// The Help application displays a pop-up window that typically contains help for\n    /// the child window.  \n    /// CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n    /// </remarks>\n    ContextHelp       = 0x00000400,\n\n    /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n    /// <remarks>\n    /// This depends on the window class. This style has an effect only if the \n    /// shell language is Hebrew, Arabic, or another language that supports \n    /// reading-order alignment; otherwise, the style is ignored.\n    /// \n    /// Using the RIGHT style for static or edit controls has the same \n    /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n    /// style with button controls has the same effect as using BS_RIGHT and \n    /// BS_RIGHTBUTTON styles.\n    /// </remarks>\n    Right             = 0x00001000,\n    /// <summary>The window text is displayed using right-to-left reading-order properties.</summary>\n    /// <remarks>\n    /// Applies only if the shell language is Hebrew, Arabic, or another language that supports reading-order \n    /// alignment; for other languages, the style is ignored.\n    /// </remarks>\n    RtlReading        = 0x00002000,\n    /// <summary>The vertical scroll bar (if present) is to the left of the client area.</summary>\n    /// <remarks>\n    /// Applies only if the shell language is Hebrew, Arabic, or another language that supports reading-order \n    /// alignment; for other languages, the style is ignored.\n    /// </remarks>\n    LeftScrollBar     = 0x00004000,\n\n    /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n    /// <remarks>\n    /// If this style is specified, the dialog manager recurses into children of this \n    /// window when performing navigation operations such as handling the TAB key, \n    /// an arrow key, or a keyboard mnemonic.\n    /// </remarks>\n    ControlParent     = 0x00010000,\n    /// <summary>Creates a window with a three-dimensional border style.</summary>\n    /// <remarks> intended to be used for items that do not accept user input.</remarks>\n    StaticEdge        = 0x00020000,\n    /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n    AppWindow         = 0x00040000,\n    /// <summary>Windows 2000/XP: Creates a layered window.</summary>\n    /// <remarks>\n    ///  Note that this cannot be used for child windows.\n    ///  Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    ///  </remarks>\n    Layered           = 0x00080000,\n\n    /// <summary>Windows 2000/XP: A window that does not pass its window layout to its child windows.</summary>\n    NoInheritLayout   = 0x00100000,\n    /// <summary>Creates a window whose horizontal origin is on the right edge.</summary>\n    /// <remarks>Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal o\n    /// rigin is on the right edge. Increasing horizontal values advance to the left.\n    /// </remarks>\n    LayoutRtl         = 0x00400000,\n\n    /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n    /// <remarks>\n    /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </remarks>\n    Composited        = 0x02000000,\n    /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n    /// <remarks>\n    /// Windows 2000/XP: A top-level window created with this style does not become the \n    /// foreground window when the user clicks it. \n    /// \n    /// The system does not bring this window to the foreground when the user minimizes \n    /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n    /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n    /// default. To force the window to appear on the taskbar, use the APPWINDOW \n    /// style.\n    /// </remarks>\n    NoActivate        = 0x08000000,\n\n    /// <summary>Combines the CLIENTEDGE and WINDOWEDGE styles.</summary>\n    OverlappedWindow  = WindowEdge | ClientEdge,\n    /// <summary>Combines the WINDOWEDGE, TOOLWINDOW, and TOPMOST styles.</summary>\n    PaletteWindow     = WindowEdge | ToolWindow | Topmost\n  }\n}\n"
  },
  {
    "path": "HexgridPanel/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2019 Pieter Geerkens (email: pgeerkens@users.noreply.github.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2012-2019 Pieter Geerkens\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Packages.dgml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<DirectedGraph GraphDirection=\"LeftToRight\" xmlns=\"http://schemas.microsoft.com/vs/2009/dgml\">\n  <Nodes />\n  <Links />\n  <Categories>\n    <Category Id=\"Project\" />\n    <Category Id=\"Package\" />\n  </Categories>\n  <Styles>\n    <Style TargetType=\"Node\" GroupLabel=\"Project\" ValueLabel=\"True\">\n      <Condition Expression=\"HasCategory('Project')\" />\n      <Setter Property=\"Background\" Value=\"Blue\" />\n    </Style>\n  </Styles>\n</DirectedGraph>"
  },
  {
    "path": "README.md",
    "content": "## HexGridUtilitiesForGames\n\n### Hex Grid Utilities for Board-Game Development in C#\n\n#### A tool-kit of utilities for building board- and strategy-games on a hexagonal grid, providing these features:\n\n- Lightning-fast **ALT Bidirectional Path-Finding** implementation;\n  - Default landmarks are the 4 corners and 4 side midpoints of the map\n  - To/from distances for all landmarks pre-computed on load using Dijkstra's agorithm\n- **Fast Shadowcasting** implementation provides 3D Field-of-View;\n  - optionally supports automatic visibility limiting due to Earth's curvature.\n- Board storage as either a flat or blocked (providing better localization) array;\n- Hexagonal grid with coordinates\n  - **Hex-picking** (identifying the hex selected by the user);\n  - All internal calculations performed with integer canonical (obtuse) coordinates;\n  - All external interfaces and board storage erformed with user (standard rectangular) coordinates;\n  - Built-in support for non-standard & transformed coordinate systems (such as for multi-map boards);\n  - Automatic internal conversion between coordinate systems hidden in a single type HexCoords;\n- WinForms Panel sub-class exposing all of the above plus:\n  - Mouse-wheel zoom and scroll; and\n  - Map transposition\n  \n#### Structure\n\n- **HexUtilitites:** The core library with all functionality not dependent on either WinForms or WPF. THis library is moderatey to extremely stable at the present time.\n\n- **HexgridPanel:** All core functionality depending on either WinForms or WPF. THis library is undergoing revision currently that may include breaking changes.\n\n- **HexgridExamplesCommon:** Common structures used by the example libraries below.\n\n- **HexgridExampleWinform:** An example MDI WInForm that opens two windows (forms) based around HexgridPanel (terrible performance) and HexgridBufferedPanel (moderately good performance). Planned:\n\n  - Example based around a 5-layer buffered & cached subclass of HexgridPanel (HexgridCachedPanel - from proprietary code) that offers excellent performance even on maps very much larger than the examples.\n  \n- **HexgridExampleWpf:** A WPF example that opens two windows (forms) based around HexgridPanel (terrible performance) and HexgridBufferedPanel (moderately good performance).  Once HexgridCachedPanel is complete an example based around it will also be added.\n\n- **HexgridExampleWinformw:** Work in progress.\n  \n### External Documentation\n\n[Doxygen](http://www.doxygen.nl/) is used to generate external documentation for the entire solution, including diagrams using [Graphviz](https://www.graphviz.org/) [DOT](https://www.graphviz.org/doc/info/lang.html), in the file docs.zip. I endeavour to update this on every *push* to GitHub - but it is not yet automated.\n  \n### References:\n\nMany thanks to:\n- Eric Lippert for providing the original [Shadowcasting](https://blogs.msdn.microsoft.com/ericlippert/tag/shadowcasting/) implementation, and inspiring me with his [rectangular A* path-finding](https://blogs.msdn.microsoft.com/ericlippert/tag/astar/) algorithm;\n- Wim Pijls & Henk Post for [Yet Another Bidirectional Algorithm for Shortest Paths](http://repub.eur.nl/res/pub/16100/ei2009-10.pdf);\n- Luis Henrique Oliveira Rios & Luiz Chaimowicz for [PNBA{\"*\"} - A Parallel Bidirectional Heuristic Search Algorithm](https://homepages.dcc.ufmg.br/~chaimo/public/ENIA11.pdf); \n- Andrew V. Goldberg & Renato F. Werneck for [Computing Point-to-Point Shortest Paths from External Memory](http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/GW05.pdf), (the explanation of ALT that finally stuck.)\n"
  },
  {
    "path": "codeplex/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n            <Word>Alt</Word>\n            <Word>App</Word>\n            <Word>Bkgnd</Word>\n            <Word>Cb</Word>\n            <Word>Calc</Word>\n            <Word>Char</Word>\n            <Word>coloured</Word>\n            <Word>Comm</Word>\n            <Word>Coords</Word>\n            <Word>Ctl</Word>\n            <Word>Dbl</Word>\n            <Word>Dlg</Word>\n            <Word>Eachable</Word>\n            <Word>Fov</Word>\n            <Word>Fwd</Word>\n            <Word>functor</Word>      <Word>functors</Word>\n            <Word>hexgrid</Word>\n            <Word>HexgridExampleWinForms</Word>\n            <Word>HexgridUtilities</Word>\n            <Word>hexside</Word>      <Word>hexsides</Word>\n            <Word>Hotspot</Word>\n            <Word>Hwheel</Word>\n            <Word>Ime</Word>\n            <Word>Init</Word>\n            <Word>Lang</Word>\n            <Word>lhs</Word>\n            <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n            <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n            <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n            <Word>Mdi</Word>\n            <Word>Msgbox</Word>\n            <Word>Napoleonics</Word>\n            <Word>NC</Word>\n            <Word>Neighbour</Word>    <Word>Neighbours</Word>\n            <Word>Pos</Word>\n            <Word>rhs</Word>\n            <Word>c</Word>\n            <Word>dx</Word>\n            <Word>dy</Word>\n            <Word>f</Word>\n            <Word>g</Word>\n            <Word>h</Word>\n            <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n            <Word>l</Word>\n            <Word>m</Word>\n            <Word>p</Word>\n            <Word>Pathfinding</Word>\n            <Word>s</Word>\n            <Word>Sync</Word>\n            <Word>Sys</Word>\n            <Word>TransparentPanel</Word>\n            <Word>Uni</Word>\n            <Word>Uninit</Word>\n            <Word>v</Word>\n            <Word>w</Word>\n            <Word>Wts</Word>\n            <Word>x</Word>      <Word>dx</Word>\n            <Word>y</Word>      <Word>dy</Word>\n            <Word>z</Word>      <Word>dz</Word>\n            <Word>wParam</Word>\n            <Word>lParam</Word>\n            <Word>param</Word>\n            <Word>param</Word>\n            <Word>Lbutton</Word>\n            <Word>Rbutton</Word>\n            <Word>Mbutton</Word>\n            <Word>Xbutton</Word>\n            <Word>Vscroll</Word>\n            <Word>Hscroll</Word>\n            <Word>Afx</Word>\n            <Word>DWM</Word>\n            <Word>Cpl</Word>\n            <Word>Rtl</Word>\n            <Word>Ltr</Word>\n         </Recognized>\n         <Deprecated>\n            <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n         <DiscreteExceptions>\n            <Term>LParam</Term>\n            <Term>lParam</Term>\n            <Term>TransparentPanel</Term>\n            <Term>WParam</Term>\n            <Term>wParam</Term>\n            <Term>LineUp</Term>\n         </DiscreteExceptions>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n            <Acronym>ASL</Acronym>\n            <Acronym>CB</Acronym>\n            <Acronym>DWM</Acronym>\n            <Acronym>Fov</Acronym>\n            <Acronym>NC</Acronym>\n            <Acronym>PG</Acronym>\n            <Acronym>TransparentPanel</Acronym>\n            <Acronym>x</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "codeplex/HexGridExample/HexGridExample.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2013 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PG_Napoleonics.HexGridExample {\n  partial class HexGridExampleForm {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexGridExampleForm));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.hexgridPanel = new PG_Napoleonics.Utilities.HexUtilities.HexgridPanel(this.components);\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this.hexgridPanel)).BeginInit();\n      this.toolStrip2.SuspendLayout();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this.hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(558, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(558, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(513, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.AutoSize = false;\n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(425, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // hexgridPanel\n      // \n      this.hexgridPanel.AutoScroll = true;\n      this.hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.hexgridPanel.Host = null;\n      this.hexgridPanel.IsTransposed = false;\n      this.hexgridPanel.Location = new System.Drawing.Point(0, 0);\n      this.hexgridPanel.Name = \"hexgridPanel\";\n      this.hexgridPanel.ScaleIndex = 1;\n      this.hexgridPanel.Scales = new float[] {\n        0.707F,\n        1F,\n        1.414F};\n      this.hexgridPanel.Size = new System.Drawing.Size(554, 366);\n      this.hexgridPanel.TabIndex = 0;\n      this.hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      this.hexgridPanel.MouseCtlClick += PanelBoard_GoalHexChange;\n      this.hexgridPanel.HotSpotHexChange += PanelBoard_HotSpotHexChange;\n      this.hexgridPanel.MouseLeftClick += PanelBoard_StartHexChange;\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.toolStripComboBox1,\n            this.buttonFieldOfView});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(233, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Size = new System.Drawing.Size(65, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Transpose Map\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // toolStripComboBox1\n      // \n      this.toolStripComboBox1.AutoSize = false;\n      this.toolStripComboBox1.CausesValidation = false;\n      this.toolStripComboBox1.Items.AddRange(new object[] {\n            \"MazeMap\",\n            \"TerrainMap\"});\n      this.toolStripComboBox1.Name = \"toolStripComboBox1\";\n      this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23);\n      this.toolStripComboBox1.Sorted = true;\n      this.toolStripComboBox1.Text = \"Map:\";\n      this.toolStripComboBox1.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBox1_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Size = new System.Drawing.Size(33, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // HexGridExampleForm\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(558, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"HexGridExampleForm\";\n      this.Text = \"Hex Grid Example\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this.hexgridPanel)).EndInit();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PG_Napoleonics.Utilities.HexUtilities.HexgridPanel hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox toolStripComboBox1;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n  }\n}"
  },
  {
    "path": "codeplex/HexGridExample/HexGridExample.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows.Forms;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\nusing PG_Napoleonics.Utilities.WinForms;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public sealed partial class HexGridExampleForm : Form, IMessageFilter {\n    public HexGridExampleForm() {\n      InitializeComponent();\n\n      hexgridPanel.Host = \n      MapBoard          = new TerrainMap();\n      MapBoard.ShowFov  = buttonFieldOfView.Checked\n                        = true;\n      toolStripComboBox1.SelectedIndex = 0;\n      var matrix        = new IntMatrix2D(2,0, 0,-2, 0,2*MapBoard.SizeHexes.Height-1, 2);\n      HexCoords.SetCustomMatrices(matrix,matrix);\n\n\t\t\tApplication.AddMessageFilter(this);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    MapDisplay MapBoard     { get; set; }\n\n    #region Event handlers\n    void HexGridExampleForm_Load(object sender, EventArgs e) {\n      hexgridPanel.ScaleIndex = 1; \n\n      Size = hexgridPanel.MapSizePixels + new Size(21,93);\n    }\n\n    bool isPanelResizeSuppressed = false;\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! isPanelResizeSuppressed) hexgridPanel.SetScroll();\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      isPanelResizeSuppressed = false;\n      hexgridPanel.SetScroll();\n    }\n\n    private void hexgridPanel_MouseClick() {\n      MapBoard.Path = PathFinder2.FindPath(\n        MapBoard.StartHex, \n        MapBoard.GoalHex, \n        MapBoard\n      );\n    }\n    void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = MapBoard.HotSpotHex;\n      statusLabel.Text = \"HotHex: \" + hotHex.ToString() \n                       + \"/\" + hotHex.Canon.Custom.ToString()\n                       + \"/\" + hotHex.Canon.ToString()\n                       + \"; Range = \" + MapBoard.StartHex.Range(hotHex)\n                       + \"; Path Length = \" + (MapBoard.Path==null ? 0 : MapBoard.Path.TotalCost);\n    }\n\n    void buttonTransposeMap_Click(object sender, EventArgs e) {\n      hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n    #endregion\n\n    private void toolStripComboBox1_Click(object sender, EventArgs e) {\n      var name = ((ToolStripItem)sender).Text;\n      switch (name) {\n        case \"MazeMap\":    hexgridPanel.Host = MapBoard = new MazeMap();    break;\n        case \"TerrainMap\": hexgridPanel.Host = MapBoard = new TerrainMap(); break;\n        default:  break;\n      }\n      MapBoard.ShowFov = buttonFieldOfView.Checked;\n      hexgridPanel.Refresh();\n    }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      MapBoard.ShowFov = buttonFieldOfView.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      MapBoard.GoalHex = e.Coords;\n      hexgridPanel_MouseClick();\n      Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      MapBoard.StartHex = e.Coords;\n      hexgridPanel_MouseClick();\n      Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      MapBoard.HotSpotHex = e.Coords;\n      Refresh();\n    }\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n\t\t/// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <see cref=\"http://www.flounder.com/virtual_screen_coordinates.htm\"/>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n\t\t/// <param name=\"m\">The Windows Message to filter and/or process.</param>\n\t\t/// <returns>Success (true) or failure (false) to OS.</returns>\n\t\t[System.Security.Permissions.PermissionSetAttribute(\n\t\t\tSystem.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n\t\tbool IMessageFilter.PreFilterMessage(ref Message m) {\n\t\t\tvar hWnd  = WindowFromPoint( WindowsMouseInput.GetPointLParam(m.LParam) );\n\t\t\tvar ctl\t  = Control.FromHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch((WM)m.Msg) {\n          default:  break;\n          case WM.MOUSEWHEEL:\n            #if DEBUG\n              DebugTracing.Trace(TraceFlag.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, ((WM)m.Msg)); \n            #endif\n            if (ctl is HexgridPanel  ||  ctl is HexGridExampleForm) {\n              return (SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n            }\n            break;\n        }\n      }\n      return false;\n\t\t}\n    #region Extern declarations\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><see cref=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"/></remarks>\n\t\t/// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n\t\t[DllImport(\"user32.dll\")]\n\t\tprivate static extern IntPtr WindowFromPoint(Point pt);\n\t\t/// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n\t\t/// <param name=\"hWnd\">Window handle</param>\n\t\t/// <param name=\"msg\">Windows message</param>\n\t\t/// <param name=\"wp\">WParam</param>\n\t\t/// <param name=\"lp\">LParam</param>\n\t\t/// <returns></returns>\n\t\t[DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n\t\tprivate static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);\n    #endregion\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/HexGridExample.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{E7F69A37-7E26-45BD-80D7-FA811CCE853B}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PG_Napoleonics.HexGridExample</RootNamespace>\n    <AssemblyName>HexGridExample</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexGridExample\\bin\\x86\\Debug32\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexGridExample\\bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>PG_Napoleonics.HexGridExample.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>\n    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'\">\n    <OutputPath>..\\bin\\HexGridExample\\bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <CodeAnalysisFailOnMissingRules>true</CodeAnalysisFailOnMissingRules>\n    <DocumentationFile>\n    </DocumentationFile>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x64'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample\\bin\\x64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x64'\">\n    <OutputPath>..\\bin\\HexGridExample\\bin\\x64\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <CodeAnalysisFailOnMissingRules>true</CodeAnalysisFailOnMissingRules>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"IMapBoard.cs\" />\n    <Compile Include=\"MapGridHex.cs\" />\n    <Compile Include=\"TerrainGridHex.cs\" />\n    <Compile Include=\"TerrainMap.cs\" />\n    <Compile Include=\"HexGridExample.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexGridExample.Designer.cs\">\n      <DependentUpon>HexGridExample.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapBoard.cs\" />\n    <Compile Include=\"MapDisplay.cs\" />\n    <Compile Include=\"MazeMap.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"HexGridExample.resx\">\n      <DependentUpon>HexGridExample.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Utilities\\Utilities.csproj\">\n      <Project>{F8F3C076-404D-4B41-83CA-9E233393B139}</Project>\n      <Name>Utilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.0,Profile=Client\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexGridExample/HexGridExample.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI\n        ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9\n        HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN\n        rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K\n        TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx\n        oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8\n        7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI\n        xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX\n        LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd\n        KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI\n        ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9\n        HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN\n        rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K\n        TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx\n        oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8\n        7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI\n        xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX\n        LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd\n        KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC\n</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample/IMapBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public interface IMapBoard : IBoard<IMapGridHex>{\n    ICoordsUser         GoalHex        { get; set; }\n    ICoordsUser         HotSpotHex     { get; set; }\n    IPath<ICoordsCanon> Path           { get; set; }\n    bool                ShowFov        { get; set; }\n    ICoordsUser         StartHex       { get; set; }\n\n    string HexText(ICoordsUser coords);\n    int    Range(ICoordsCanon goal, ICoordsCanon current);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/MapBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public abstract class MapBoard :  IBoard<IGridHex> {\n    public static int FoVRange = 40;\n\n    public bool                ShowFov      { get; set; }\n    public ICoordsUser         StartHex     { get; set; }\n    public ICoordsUser         GoalHex      { get; set; }\n    public ICoordsUser         HotSpotHex   { \n      get { return _hotSpotHex; }\n      set { _hotSpotHex = value; FOV = null; }\n    } ICoordsUser _hotSpotHex;\n    public IPath2 Path         { get; set; }\n    public Size   SizeHexes    { get {return new Size(Board[0].Length,Board.Length);} }\n\n    IGridHex IBoard<IGridHex>.this[ICoordsCanon coords] { get { return this[coords]; } }\n    IGridHex IBoard<IGridHex>.this[ICoordsUser coords]  { get { return this[coords]; } }\n    public abstract IMapGridHex this[ICoordsCanon coords] { get; }\n    public abstract IMapGridHex this[ICoordsUser coords]  { get; }\n\n    public string        HexText(ICoordsUser coords)   { return HexText(coords.X, coords.Y); }\n    public bool          IsOnBoard(ICoordsUser coords) {\n      return 0<=coords.X && coords.X < SizeHexes.Width\n          && 0<=coords.Y && coords.Y < SizeHexes.Height;\n    }\n    public virtual bool  IsPassable(ICoordsUser coords) { return IsOnBoard(coords); }\n    public abstract int  StepCost(ICoordsCanon coords, Hexside hexSide);\n    public abstract int Heuristic(int range);\n\n    protected abstract string[] Board  { get; }\n    protected IFieldOfView      FOV    {\n      get { return _fov ?? \n                (_fov = FieldOfView.GetFieldOfView(this, HotSpotHex, FoVRange)); }\n      private set { _fov = value; }\n    } IFieldOfView _fov;\n    string HexText(int x, int y)       { return string.Format(\"{0,2}-{1,2}\", x, y); }\n  } \n}\n"
  },
  {
    "path": "codeplex/HexGridExample/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public interface IMapGridHex : IGridHex {\n    int              StepCost       { get; }\n    char             Value          { get; }\n  }\n\n  public abstract class MapDisplay : MapBoard, IMapDisplay, IBoard<IMapGridHex>, INavigableBoard {\n    public MapDisplay() : base() {\n      GridSize = new Size(27,30);\n      StartHex = GoalHex = HotSpotHex = HexCoords.EmptyUser;\n\n      HexgridPath = new GraphicsPath();\n      HexgridPath.AddLines(new Point[] {\n        new Point(GridSize.Width*1/3,                0), \n        new Point(GridSize.Width*3/3,                0),\n        new Point(GridSize.Width*4/3,GridSize.Height/2),\n        new Point(GridSize.Width*3/3,GridSize.Height  ),\n        new Point(GridSize.Width*1/3,GridSize.Height  ),\n        new Point(                 0,GridSize.Height/2),\n        new Point(GridSize.Width*1/3,                0)\n      } );\n      MapSizeMatrix = new IntMatrix2D(GridSize.Width,                0, \n                                                   0,  GridSize.Height, \n                                      GridSize.Width/3,GridSize.Height/2);\n\n    }\n\n    public Size            GridSize      { get; private set; }\n    public Size            MapMargin     { get; set; }\n    public Size            MapSizePixels { get {return SizeHexes * MapSizeMatrix;} }\n    public string          Name          { get { return \"MapDisplay\"; }}\n    protected GraphicsPath HexgridPath   { get; set; }\n    protected IntMatrix2D  MapSizeMatrix { get; set; }\n\n    public UserCoordsRectangle GetClipCells(PointF point, SizeF size) {\n      return GetClipHexes( new RectangleF(point,size), SizeHexes );\n    }\n    public UserCoordsRectangle GetClipCells(RectangleF visibleClipBounds) {\n      return GetClipHexes(visibleClipBounds, SizeHexes);\n    }\n    public virtual  void PaintHighlight(Graphics g) { \n      var state = g.Save();\n      g.TranslateTransform(\n        MapMargin.Width  + StartHex.X * GridSize.Width,\n        MapMargin.Height + StartHex.Y * GridSize.Height + (StartHex.X+1)%2 * GridSize.Height/2\n      );\n      g.DrawPath(Pens.Red, HexgridPath);\n\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        var path = Path;\n        while (path != null) {\n          g.Restore(state); state = g.Save();\n          var step = path.LastStep;\n\n          g.TranslateTransform(\n            MapMargin.Width  + step.X * GridSize.Width,\n            MapMargin.Height + step.Y * GridSize.Height + (step.X+1)%2 * GridSize.Height/2\n          );\n          g.FillPath(brush, HexgridPath);\n          path = path.PreviousSteps;\n        }\n      }\n\n      g.Restore(state); state = g.Save();\n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      using(var shadeBrush = new SolidBrush(Color.FromArgb(78,Color.Black))) {\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            var coords = HexCoords.NewUserCoords(x,y);\n            if (ShowFov && FOV!=null && ! FOV[coords]) { g.FillPath(shadeBrush, HexgridPath);  }\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n    public abstract void PaintMap(Graphics g);\n    public abstract void PaintUnits(Graphics g);\n\n    UserCoordsRectangle GetClipHexes(RectangleF visibleClipBounds, Size boardSizeHexes) {\n      var left    = Math.Max((int)visibleClipBounds.Left  /GridSize.Width  - 1, 0);\n      var top     = Math.Max((int)visibleClipBounds.Top   /GridSize.Height - 1, 0);\n      var right   = Math.Min((int)visibleClipBounds.Right /GridSize.Width  + 1, boardSizeHexes.Width);\n      var bottom  = Math.Min((int)visibleClipBounds.Bottom/GridSize.Height + 1, boardSizeHexes.Height); \n      return new UserCoordsRectangle (left, top, right-left, bottom-top);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/MapGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public abstract class MapGridHex : IMapGridHex {\n    internal static MapDisplay MyBoard { get; set; }\n\n    public MapGridHex(char value, ICoordsUser coords) { Value = value; Coords = coords; }\n\n    IBoard<IGridHex>   IGridHex.Board          { get { return MyBoard; } }\n    public IBoard<IMapGridHex>  Board          { get { return MyBoard; } }\n\n    public virtual  ICoordsUser Coords         { get; private set; }\n    public virtual  char        Value          { get; private set; }\n\n    public abstract int         Elevation      { get; }\n    public virtual  int         ElevationASL   { get { return Elevation * 10;   } }\n    public virtual  int         HeightObserver { get { return ElevationASL + 1; } }\n    public virtual  int         HeightTarget   { get { return ElevationASL + 1; } }\n    public abstract int         HeightTerrain  { get; }\n    public abstract int         StepCost       { get; }\n\n    public IEnumerable<NeighbourHex> GetNeighbours() {\n      var @this = this;\n      return NeighbourHex.GetNeighbours(@this).Where(n=>@this.Board.IsOnBoard(n.Hex.Coords));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/MazeMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public sealed class MazeMap : MapDisplay {\n    public MazeMap() : base() { MazeGridHex.MyBoard = this; }\n\n    public override bool  IsPassable(ICoordsUser coords) { \n      return IsOnBoard(coords)  &&  this[coords].Elevation == 0; \n    }\n\n    public override int    Heuristic(int range) { return range; }\n    public override int    StepCost(ICoordsCanon coords, Hexside hexSide) {\n      return ( IsOnBoard(coords.User) && this[coords.StepOut(hexSide)].Value=='.' ? 1 : -1 );\n    }\n\n    #region Painting\n    public override void PaintMap(Graphics g) { \n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var state     = g.Save();\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      using(var fillBrush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n      using(var font   = new Font(\"ArialNarrow\", 8))\n      using(var format = new StringFormat()) {\n        format.Alignment = format.LineAlignment = StringAlignment.Center;\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            var coords = HexCoords.NewUserCoords(x,y);\n            if (this[coords].Value!='.') {\n              g.FillPath(fillBrush, HexgridPath);\n            }\n            g.DrawPath(Pens.Black, HexgridPath);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n    public override void PaintUnits(Graphics g) { ; }\n    #endregion\n\n    #region Board definition\n    protected override string[]   Board { get { return _board; } }\n    string[] _board = new string[] {\n      \".............|.........|.......|.........|.............\",\n      \".............|.........|.......|.........|.............\",\n      \"....xxxxxxxxx|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \"xxxxxxxxx....|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|...................\",\n      \".....xxxxxxxx|....|........|.......|.......xxxxxxxx....\",\n      \"..................|........|.......|.......|......|....\",\n      \"xxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxx......|......|....\",\n      \"................|........|...|.............|...|..|....\",\n      \"xxxxxxxxxxxx....|...|....|...|.............|...|...|...\",\n      \"................|...|....|...|.............|...|...|...\",\n      \"..xxxxxxxxxxxxxxx...|....|...|.............|...|...|...\",\n      \"....................|....|.................|...|...|...\",\n      \"xxxxxxxxxxxxxxxxx..xx....|.................|...|.......\",\n      \".........................|...xxxxxxxxxxxxxxx...|xxxxxxx\",\n      \"xxxxxx...................|...|.................|.......\",\n      \".........xxxxxxxxxxxxxxxxx...|.................|.......\",\n      \".............................|...xxxxxxxxxxxxxx|.......\",\n      \"xxxxxxxxxx......xxxxxxxxxxxxx|...|.....................\",\n      \".............................|...|.....................\",\n      \".............................|...|...xxxxxxxxxxxxx.....\",\n      \"....xxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.................\",\n      \".............................|...|...|..........xxxxxxx\",\n      \"xxxxxxxxxxxxxxxxxxxxxxxxx....|...|...|.....|....|......\",\n      \".............................|...|...|.....|....|......\",\n      \"...xxxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.....|....|......\",\n      \".............................|.......|.....|...........\",\n      \".............................|.......|.....|...........\"\n    };\n    #endregion\n\n    public override IMapGridHex this[ICoordsCanon coords] { get {return this[coords.User];} }\n    public override IMapGridHex this[ICoordsUser  coords] { get {\n      return new MazeGridHex(Board[coords.Y][coords.X], coords);\n    } }\n\n    public sealed class MazeGridHex : MapGridHex {\n      public MazeGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n\n      public override int  Elevation      { get { return Value == '.' ? 0 : 1; } }\n      public override int  HeightTerrain  { get { return ElevationASL + (Value == '.' ? 0 : 10); } }\n      public override int  StepCost       { get { return 1; } }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  static class Program {\n    /// <summary>The main entry point for the application.</summary>\n    [STAThread]\n    static void Main()      {\n      Application.EnableVisualStyles();\n      Application.SetCompatibleTextRenderingDefault(false);\n      Application.ThreadException += \n        new ThreadExceptionEventHandler(\n          (new ThreadExceptionHandler()).Application_ThreadException);\n\n      Application.Run(new HexGridExampleForm());\n    }\n\n    public static void InquireOnThisException(Exception ex) {\n      string message = ex.Message + (ex.InnerException == null \n                     ? \"\" \n                     : Environment.NewLine + ex.InnerException.Message);\n      MessageBox.Show(message,\"Open Map-File Error\",MessageBoxButtons.OK);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexGridExample\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexGridExample\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"9515a211-22ba-4634-b1a6-7b56caff51b5\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"4.1.*\")]\n[assembly: AssemblyFileVersion(\"4.1.*\")]\n"
  },
  {
    "path": "codeplex/HexGridExample/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18034\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PG_Napoleonics.HexGridExample.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PG_Napoleonics.HexGridExample.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18034\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PG_Napoleonics.HexGridExample.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"10.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "codeplex/HexGridExample/TerrainGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n    public abstract class TerrainGridHex : MapGridHex {\n\n      public TerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n\n      public override int Elevation      { get { return  0; }  }\n      public override int HeightTerrain  { get { return  ElevationASL; } }\n      public override int StepCost       { get { return  4; } }\n    }\n    public sealed class ClearTerrainGridHex : TerrainGridHex {\n      public ClearTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n    }\n    public sealed class FordTerrainGridHex : TerrainGridHex {\n      public FordTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int StepCost       { get { return  5; } }\n    }\n    public sealed class RiverTerrainGridHex : TerrainGridHex {\n      public RiverTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int StepCost       { get { return -1; } }\n    }\n    public sealed class RoadTerrainGridHex : TerrainGridHex {\n      public RoadTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int StepCost       { get { return  2; } }\n    }\n    public sealed class TrailTerrainGridHex : TerrainGridHex {\n      public TrailTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int StepCost       { get { return  3; } }\n    }\n    public sealed class HillTerrainGridHex : TerrainGridHex {\n      public HillTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int Elevation      { get { return  1; } }\n      public override int StepCost       { get { return  5; } }\n   }\n    public sealed class MountainTerrainGridHex : TerrainGridHex {\n      public MountainTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int Elevation      { get { return  2; } }\n      public override int StepCost       { get { return  6; } }\n    }\n    public sealed class WoodsTerrainGridHex : TerrainGridHex {\n      public WoodsTerrainGridHex(char value, ICoordsUser coords) : base(value, coords) { }\n      public override int HeightTerrain  { get { return ElevationASL + 7; } }\n      public override int StepCost       { get { return  8; } }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample/TerrainMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.HexGridExample {\n  public sealed class TerrainMap : MapDisplay {\n    public TerrainMap() : base() { TerrainGridHex.MyBoard = this; }\n\n    public override int    Heuristic(int range) { return 2 * range; }\n    public override int    StepCost(ICoordsCanon coords, Hexside hexSide) {\n      return this[coords].StepCost;\n    }\n\n    #region Painting\n    public override void PaintMap(Graphics g) { \n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var state     = g.Save();\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      using(var pikeBrush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n      using(var roadBrush = new SolidBrush(Color.FromArgb(78,Color.SaddleBrown)))\n      using(var font   = new Font(\"ArialNarrow\", 8))\n      using(var format = new StringFormat()) {\n        format.Alignment = format.LineAlignment = StringAlignment.Center;\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            var coords = HexCoords.NewUserCoords(x,y);\n            switch (this[coords].Value) {\n              case 'F': g.FillPath(Brushes.Brown,     HexgridPath); break;  // Ford\n              case 'R': g.FillPath(Brushes.DarkBlue,  HexgridPath); break;  // River\n              case 'W': g.FillPath(Brushes.Green,     HexgridPath); break;  // Woods\n              case 'H': g.FillPath(Brushes.Khaki,     HexgridPath); break;  // Hill\n              case 'M': g.FillPath(Brushes.DarkKhaki, HexgridPath); break;  // Mountain\n              case '2': g.FillPath(pikeBrush, HexgridPath); break;\n              case '3': g.FillPath(roadBrush, HexgridPath); break;\n              default:  break;\n            }\n            g.DrawPath(Pens.Black, HexgridPath);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n    public override void PaintUnits(Graphics g) { ; }\n    #endregion\n\n    #region Board definition\n    protected override string[]   Board { get { return _board; } }\n    string[] _board = new string[] {\n      \"...................3.......22...........R..............\",\n      \"...................3.........222222.....R..............\",\n      \"...................3..............2.....R..............\",\n      \"...................33..............22222F.2.2..........\",\n      \"............RR......3...................R2.2.2222......\",\n      \"...........RRRR.....3.....HHHH..........R........22....\",\n      \"..........RRRRRRR...3....HHMMHH.........R..........22..\",\n      \"..........RRRRRRR....3....HHHH..........R............22\",\n      \"...........RRRR......3..................R..............\",\n      \"............RR.......3..........RRRRRRRR...............\",\n      \".....................3.........R............WW.........\",\n      \".....................3.........R...........WWWWW.......\",\n      \".....................3.........R............WWW........\",\n      \".....................3.........R.......................\",\n      \".....................3.........RRRRRRRR................\",\n      \"..........WWWWWWW....3.................R...............\",\n      \"........WWWWWWWWW....33................R...............\",\n      \".......WWWWWWWWW.....3.33..............R...............\",\n      \"..........WWWWWWW....3...32222222222222F22222..........\",\n      \"...........WWWWWWW...3...2.............R.....222222....\",\n      \"............WWWWW....32222.............R...........22..\",\n      \"....................22....HHHH........RR.............22\",\n      \"................2222.....HHMMHH.....RR.......WW........\",\n      \"............2222..........HHMHH...RR.......WWWWW.......\",\n      \"........2222...............HHH..RR.........WWWW........\",\n      \"......22......................RR............WW.........\",\n      \"..2222......................RR.........................\",\n      \"22..................RRRRRRRR...........................\",\n      \"..................RR...................................\",\n      \".................RRR...................................\"\n    };\n    #endregion\n\n    public override IMapGridHex this[ICoordsCanon coords] { get {return this[coords.User];} }\n    public override IMapGridHex this[ICoordsUser  coords] { get {\n      return GetGridHex(Board[coords.Y][coords.X], coords);\n    } }\n\n    public static TerrainGridHex GetGridHex(char value, ICoordsUser coords) {\n      switch(value) {\n      default:  return new ClearTerrainGridHex(value, coords);\n      case '2': return new RoadTerrainGridHex(value, coords);\n      case '3': return new TrailTerrainGridHex(value, coords);\n      case 'R': return new RiverTerrainGridHex(value, coords);\n      case 'W': return new WoodsTerrainGridHex(value, coords);\n      case 'F': return new FordTerrainGridHex(value, coords);\n      case 'H': return new HillTerrainGridHex(value, coords);\n      case 'M': return new MountainTerrainGridHex(value, coords);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.30501.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexUtilities\", \"HexUtilities\\HexUtilities.csproj\", \"{013628E1-60E2-40A6-91D4-8B446F397A0A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridPanel\", \"HexgridPanel\\HexgridPanel.csproj\", \"{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleWpf\", \"HexgridExampleWpf\\HexgridExampleWpf.csproj\", \"{6CEB2C15-1E1A-446C-92C6-77BC49833742}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridExampleCommon\", \"HexGridExampleCommon\\HexgridExampleCommon.csproj\", \"{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridScrollableExample\", \"HexgridScrollableExample\\HexgridScrollableExample.csproj\", \"{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridScrollViewer\", \"HexgridScrollViewer\\HexgridScrollViewer.csproj\", \"{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HexgridPanelExample\", \"HexGridPanelExample\\HexgridPanelExample.csproj\", \"{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}\"\nEndProject\nGlobal\n\tGlobalSection(TeamFoundationVersionControl) = preSolution\n\t\tSccNumberOfProjects = 8\n\t\tSccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}\n\t\tSccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs37\n\t\tSccLocalPath0 = .\n\t\tSccProjectUniqueName1 = HexUtilities\\\\HexUtilities.csproj\n\t\tSccProjectName1 = HexUtilities\n\t\tSccLocalPath1 = HexUtilities\n\t\tSccProjectUniqueName2 = HexgridPanel\\\\HexgridPanel.csproj\n\t\tSccProjectName2 = HexgridPanel\n\t\tSccLocalPath2 = HexgridPanel\n\t\tSccProjectUniqueName3 = HexgridExampleWpf\\\\HexgridExampleWpf.csproj\n\t\tSccProjectName3 = HexgridExampleWpf\n\t\tSccLocalPath3 = HexgridExampleWpf\n\t\tSccProjectUniqueName4 = HexGridExampleCommon\\\\HexgridExampleCommon.csproj\n\t\tSccProjectName4 = HexGridExampleCommon\n\t\tSccLocalPath4 = HexGridExampleCommon\n\t\tSccProjectUniqueName5 = HexgridScrollableExample\\\\HexgridScrollableExample.csproj\n\t\tSccProjectName5 = HexgridScrollableExample\n\t\tSccLocalPath5 = HexgridScrollableExample\n\t\tSccProjectUniqueName6 = HexgridScrollViewer\\\\HexgridScrollViewer.csproj\n\t\tSccProjectName6 = HexgridScrollViewer\n\t\tSccLocalPath6 = HexgridScrollViewer\n\t\tSccProjectUniqueName7 = HexGridPanelExample\\\\HexgridPanelExample.csproj\n\t\tSccProjectName7 = HexGridPanelExample\n\t\tSccLocalPath7 = HexGridPanelExample\n\tEndGlobalSection\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tChecked|Any CPU = Checked|Any CPU\n\t\tChecked|x86 = Checked|x86\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|x86.ActiveCfg = Checked|x86\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Checked|x86.Build.0 = Checked|x86\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Debug|x86.Build.0 = Debug|x86\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|x86.ActiveCfg = Release|x86\n\t\t{013628E1-60E2-40A6-91D4-8B446F397A0A}.Release|x86.Build.0 = Release|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|x86.ActiveCfg = Checked|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Checked|x86.Build.0 = Checked|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Debug|x86.Build.0 = Debug|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|x86.ActiveCfg = Release|x86\n\t\t{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}.Release|x86.Build.0 = Release|x86\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Checked|x86.ActiveCfg = Checked|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6CEB2C15-1E1A-446C-92C6-77BC49833742}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|x86.ActiveCfg = Checked|x86\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Checked|x86.Build.0 = Checked|x86\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Debug|x86.Build.0 = Debug|x86\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|x86.ActiveCfg = Release|x86\n\t\t{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}.Release|x86.Build.0 = Release|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|x86.ActiveCfg = Checked|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Checked|x86.Build.0 = Checked|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Debug|x86.Build.0 = Debug|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|x86.ActiveCfg = Release|x86\n\t\t{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}.Release|x86.Build.0 = Release|x86\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Checked|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Checked|Any CPU.Build.0 = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Checked|x86.ActiveCfg = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Checked|Any CPU.ActiveCfg = Checked|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Checked|Any CPU.Build.0 = Checked|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Checked|x86.ActiveCfg = Checked|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}.Release|x86.ActiveCfg = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "codeplex/HexGridExample2/HexGridExampleWinForms.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2013 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace HexgridExampleWinForms {\n  partial class HexgridExampleWinForms {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridExampleWinForms));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n      this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n      this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n      this._hexgridPanel = new PGNapoleonics.HexgridPanel.HexgridScrollable(this.components);\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      this.toolStrip2.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).BeginInit();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this._hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Margin = new System.Windows.Forms.Padding(0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(143, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(86, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.buttonRangeLine,\n            this.buttonFieldOfView,\n            this.buttonPathArrow,\n            this.comboBoxMapSelection,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug,\n            this.toolStripSeparator3,\n            this.menuItemHelp});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(745, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.AutoSize = false;\n      this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // buttonRangeLine\n      // \n      this.buttonRangeLine.AutoSize = false;\n      this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonRangeLine.CheckOnClick = true;\n      this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n      this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonRangeLine.Name = \"buttonRangeLine\";\n      this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n      this.buttonRangeLine.Text = \"Range Line\";\n      this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n      this.buttonRangeLine.CheckedChanged += new System.EventHandler(this.buttonRangeLine_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.AutoSize = false;\n      this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // buttonPathArrow\n      // \n      this.buttonPathArrow.AutoSize = false;\n      this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonPathArrow.Checked = true;\n      this.buttonPathArrow.CheckOnClick = true;\n      this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n      this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonPathArrow.Name = \"buttonPathArrow\";\n      this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n      this.buttonPathArrow.Text = \"Path Arrow\";\n      this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n      this.buttonPathArrow.CheckedChanged += new System.EventHandler(this.buttonPathArrow_Click);\n      // \n      // comboBoxMapSelection\n      // \n      this.comboBoxMapSelection.AutoSize = false;\n      this.comboBoxMapSelection.CausesValidation = false;\n      this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n      this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n      this.comboBoxMapSelection.Text = \"Map:\";\n      this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n      this.comboBoxMapSelection.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapSelection_SelectionChanged);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n      this.lblLandmark.Text = \"Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.AutoSize = false;\n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n      this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemHelp\n      // \n      this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n      this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n      this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemHelp.Name = \"menuItemHelp\";\n      this.menuItemHelp.ShowDropDownArrow = false;\n      this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n      this.menuItemHelp.Text = \"&Help\";\n      this.menuItemHelp.Visible = false;\n      // \n      // menuItemHelpContents\n      // \n      this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n      this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n      this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpContents.Text = \"&Contents\";\n      this.menuItemHelpContents.Click += new System.EventHandler(this.menuItemHelpContents_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n      // \n      // menuItemHelpAbout\n      // \n      this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n      this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n      // \n      // _hexgridPanel\n      // \n      this._hexgridPanel.AutoScroll = true;\n      this._hexgridPanel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this._hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this._hexgridPanel.IsMapDirty = false;\n      this._hexgridPanel.IsTransposed = false;\n      this._hexgridPanel.IsUnitsDirty = false;\n      this._hexgridPanel.Location = new System.Drawing.Point(5, 5);\n      this._hexgridPanel.Margin = new System.Windows.Forms.Padding(0);\n      this._hexgridPanel.Name = \"_hexgridPanel\";\n      this._hexgridPanel.ScaleIndex = 0;\n      this._hexgridPanel.Size = new System.Drawing.Size(756, 356);\n      this._hexgridPanel.TabIndex = 0;\n      this._hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this._hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this._hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this._hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // HexgridExampleWinForms\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"HexgridExampleWinForms\";\n      this.Text = \"HexgridExampleWinForms\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).EndInit();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexgridPanel.HexgridScrollable _hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripButton buttonPathArrow;\n    private System.Windows.Forms.ToolStripButton buttonRangeLine;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n  }\n}"
  },
  {
    "path": "codeplex/HexGridExample2/HexGridExampleWinForms.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing HexgridExampleCommon;\n\nnamespace HexgridExampleWinForms {\n  using MapGridDisplay = PGNapoleonics.HexgridPanel.MapDisplay<MapGridHex>;\n\n  internal sealed partial class HexgridExampleWinForms : Form, IMessageFilter {\n    private bool            _isPanelResizeSuppressed = false;\n    private MapGridDisplay _mapBoard;\n\n    public HexgridExampleWinForms() {\n      InitializeComponent();\n      Application.AddMessageFilter(this);\n\n      ComponentResourceManager resources = new ComponentResourceManager(typeof(HexgridExampleWinForms));\n      this._hexgridPanel.SetScales ( (IList<float>)(resources.GetObject(\"_hexgridPanel.Scales\")) );\n\n      this._hexgridPanel.ScaleChange += new EventHandler<EventArgs>((o,e) => OnResizeEnd(e));\n\n      LoadTraceMenu();\n\n      comboBoxMapSelection.Items.AddRange(\n         Map.MapList.Select(item => item.MapName).ToArray()\n      );\n      comboBoxMapSelection.SelectedIndex = 0;\n\n//      helpProvider1.SetShowHelp(this,true);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    partial void LoadTraceMenu();\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [System.Diagnostics.Conditional(\"TRACE\")]\n    partial void LoadTraceMenu() {\n      foreach(var item in Enum.GetValues(typeof(TraceFlags))) {\n        var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n        menuItemDebug.DropDownItems.Add(menuItem);\n        menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n        menuItem.Size         = new System.Drawing.Size(143, 22);\n        menuItem.Text         = item.ToString();\n        menuItem.CheckOnClick = true;\n        menuItem.Click       += new System.EventHandler(this.menuItemDebugTracing_Click);\n      }\n    }\n\n    private void LoadLandmarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      foreach(var landmark in _mapBoard.Landmarks) {\n        menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords));\n      }\n      menuItemLandmarks.SelectedIndexChanged += new EventHandler(menuItemLandmarks_SelectedIndexChanged);\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    #region Event handlers\n    private void HexGridExampleForm_Load(object sender, EventArgs e) {\n      _hexgridPanel.SetScales (new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly());\n      _hexgridPanel.ScaleIndex = _hexgridPanel.Scales\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      var padding = this.toolStripContainer1.ContentPanel.Padding;\n      Size = _hexgridPanel.MapSizePixels  + new Size(21,93)\n           + new Size(padding.Left+padding.Right, padding.Top+padding.Bottom);\n    }\n\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      _isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! _isPanelResizeSuppressed) _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      _isPanelResizeSuppressed = false;\n      _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n\n    private void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = _mapBoard.HotspotHex;\n      statusLabel.Text = string.Format(CultureInfo.InvariantCulture,\n        // \"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\",\n        PGNapoleonics.HexGridExample2.Properties.Resources.StatusLabelText,\n        hotHex, hotHex, hotHex,\n        _mapBoard.StartHex - hotHex, (_mapBoard.Path==null ? 0 : _mapBoard.Path.TotalCost));\n    }\n\n    private void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      _mapBoard.FovRadius   =\n      _mapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    private void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex;\n      _hexgridPanel.SetMapDirty();\n      Update();\n    }\n\n    private void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (TraceFlags)Enum.Parse(typeof(TraceFlags),name);\n      if( item.Checked)   DebugTracing.EnabledFlags |=  flag;\n      else                DebugTracing.EnabledFlags &= ~flag;\n    }\n\n    private void menuItemHelpContents_Click(object sender, EventArgs e) {\n//      helpProvider1.SetShowHelp(this,true);\n    }\n\n    private void comboBoxMapSelection_SelectionChanged(object sender, EventArgs e) {\n      SetMapBoard(ParseMapName(((ToolStripItem)sender).Text));\n    }\n    private static MapGridDisplay ParseMapName(string mapName) {\n     return Map.MapList.First(item => item.MapName == mapName).MapBoard;\n   }\n\n    private void SetMapBoard(MapGridDisplay mapBoard) {\n      _hexgridPanel.SetModel( _mapBoard = mapBoard);\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      _mapBoard.ShowFov       = buttonFieldOfView.Checked;\n      _mapBoard.FovRadius     =\n      _mapBoard.RangeCutoff   = Int32.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n      LoadLandmarkMenu();\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*_mapBoard.MapSizeHexes.Height-1, 2));\n   \n      _hexgridPanel.Focus();\n   }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      _mapBoard.ShowFov = buttonFieldOfView.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonPathArrow_Click(object sender, EventArgs e) {\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonRangeLine_Click(object sender, EventArgs e) {\n      _mapBoard.ShowRangeLine = buttonRangeLine.Checked;\n      _hexgridPanel.SetMapDirty();\n      _mapBoard.StartHex = _mapBoard.StartHex; // Indirect, but it works.\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonTransposeMap_Click(object sender, EventArgs e) {\n      _hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      _mapBoard.GoalHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      _mapBoard.StartHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      _mapBoard.HotspotHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    #endregion\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n    /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    /// <returns>Success (true) or failure (false) to OS.</returns>\n    [System.Security.Permissions.PermissionSetAttribute(\n      System.Security.Permissions.SecurityAction.Demand, Name = \"FullTrust\")]\n    public bool PreFilterMessage(ref Message m) {\n      if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n\n      var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n      var ctl = Control.FromChildHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch ((WM)m.Msg) {\n          case WM.MOUSEHWHEEL:\n          case WM.MOUSEWHEEL:\n            DebugTracing.Trace(TraceFlags.ScrollEvents, true, \" - {0}.WM.{1}: \", Name, ((WM)m.Msg));\n            return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n          default: break;\n        }\n      }\n      return false;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2/HexGridExampleWinForms.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <data name=\"_hexgridPanel.Scales\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n    <value>\n        AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u\n        ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u\n        PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB\n        AAAAQlN5c3RlbS5Db2xsZWN0aW9ucy5PYmplY3RNb2RlbC5SZWFkT25seUNvbGxlY3Rpb25gMVtbU3lz\n        dGVtLlNpbmdsZQEAAAAEbGlzdAQwU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0\n        ZW0uU2luZ2xlAgAAAAIAAAAJAwAAAAUDAAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3Rg\n        MVtbU3lzdGVtLlNpbmdsZQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACwgIAgAAAAkEAAAAAQAA\n        AAEAAAAPBAAAAAQAAAALAACAPwAAAAAAAAAAAAAAAAs=\n</value>\n  </data>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample2/HexgridExampleWinForms.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexGridExample2</RootNamespace>\n    <AssemblyName>HexGridExample2</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <TargetFrameworkProfile>\n    </TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <NoWarn>1607</NoWarn>\n    <Prefer32Bit>true</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'\">\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Release\\</OutputPath>\n    <DefineConstants>CODE_ANALYSIS</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <DocumentationFile>..\\bin\\HexGridExample2\\bin\\Release\\HexGridExample2.XML</DocumentationFile>\n    <CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>HexgridExampleWinForms.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>\n    <DocumentationFile>..\\bin\\HexGridExample2\\bin\\Release\\HexGridExample2.XML</DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1607,1587</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexGridExampleWinForms.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexGridExampleWinForms.Designer.cs\">\n      <DependentUpon>HexGridExampleWinForms.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"HexGridExampleWinForms.resx\">\n      <DependentUpon>HexGridExampleWinForms.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.config\" />\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.4.5\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 4.5</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexGridExample2/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \n      \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification=\"Research suggests the Code Analysis message is incorrect.\")] \n     [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n       \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.WinForms;\n\n#pragma warning disable 1587\n/// <summary>Example usage of <see cref=\"HexUtilities\"/> with <see cref=\"HexUtilities.HexgridPanel\"/> \n/// in a simple <see cref=\"WinForms\"/> application.</summary>\n#pragma warning restore 1587\nnamespace HexgridExampleWinForms {\n  static class Program {\n    /// <summary>The main entry point for the application.</summary>\n    [STAThread]\n    static void Main()      {\n      Application.EnableVisualStyles();\n      Application.SetCompatibleTextRenderingDefault(false);\n      Application.ThreadException += \n        new ThreadExceptionEventHandler(\n          (new ThreadExceptionHandler()).ApplicationThreadException);\n\n      Application.Run(new HexgridExampleWinForms());\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.InteropServices;\n\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinForms\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinForms\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"e0be8677-676e-4d95-bf9d-c39273565a46\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.*\")]\n[assembly: AssemblyFileVersion(\"6.4\")]\n"
  },
  {
    "path": "codeplex/HexGridExample2/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18052\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexGridExample2.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexGridExample2.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to &quot;Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}&quot;.\n        /// </summary>\n        internal static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>\"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\"</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample2/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18047\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HexgridExampleWinForms {\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "codeplex/HexGridExample2/app.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\"/></startup></configuration>\n"
  },
  {
    "path": "codeplex/HexGridExample2/index.xhtml",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.4\"/>\n<title>Hexgrid Utilities: Main Page</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(initResizable);\n  $(window).load(resizeHeight);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">Hexgrid Utilities\n   &#160;<span id=\"projectnumber\">V 6.3</span>\n   </div>\n   <div id=\"projectbrief\">Hexgrid utilities for Board Game Implementations</div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.4 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li class=\"current\"><a href=\"index.xhtml\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"namespaces.xhtml\"><span>Packages</span></a></li>\n      <li><a href=\"annotated.xhtml\"><span>Classes</span></a></li>\n      <li><a href=\"files.xhtml\"><span>Files</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n  <div id=\"nav-tree\">\n    <div id=\"nav-tree-contents\">\n      <div id=\"nav-sync\" class=\"sync\"></div>\n    </div>\n  </div>\n  <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n       class=\"ui-resizable-handle\">\n  </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('index.xhtml','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Classes</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Namespaces</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Files</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(8)\"><span class=\"SelectionMark\">&#160;</span>Properties</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(9)\"><span class=\"SelectionMark\">&#160;</span>Events</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">Hexgrid Utilities Documentation</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n</div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n  <ul>\n    <li class=\"footer\">Generated on Sun Jul 28 2013 22:52:44 for Hexgrid Utilities by\n    <a href=\"http://www.doxygen.org/index.html\">\n    <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.4 </li>\n  </ul>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/HexGridExample.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2013 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexGridExample2 {\n  partial class HexgridExampleForm {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridExampleForm));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.hexgridPanel = new PGNapoleonics.HexUtilities.HexgridPanel(this.components);\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this.hexgridPanel)).BeginInit();\n      this.toolStrip2.SuspendLayout();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this.hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(582, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.AutoSize = false;\n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(525, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // hexgridPanel\n      // \n      this.hexgridPanel.AutoScroll = true;\n      this.hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.hexgridPanel.Host = null;\n      this.hexgridPanel.IsTransposed = false;\n      this.hexgridPanel.Location = new System.Drawing.Point(0, 0);\n      this.hexgridPanel.Name = \"hexgridPanel\";\n      this.hexgridPanel.ScaleIndex = 0;\n      this.hexgridPanel.Size = new System.Drawing.Size(766, 366);\n      this.hexgridPanel.TabIndex = 0;\n      this.hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexUtilities.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this.hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexUtilities.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this.hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexUtilities.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this.hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.toolStripComboBox1,\n            this.buttonFieldOfView,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(700, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Size = new System.Drawing.Size(65, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // toolStripComboBox1\n      // \n      this.toolStripComboBox1.AutoSize = false;\n      this.toolStripComboBox1.CausesValidation = false;\n      this.toolStripComboBox1.Items.AddRange(new object[] {\n            \"MazeMap\",\n            \"TerrainMap\"});\n      this.toolStripComboBox1.Name = \"toolStripComboBox1\";\n      this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23);\n      this.toolStripComboBox1.Sorted = true;\n      this.toolStripComboBox1.Text = \"Map:\";\n      this.toolStripComboBox1.ToolTipText = \"Selects map to display.\";\n      this.toolStripComboBox1.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBox1_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Size = new System.Drawing.Size(33, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(145, 22);\n      this.lblLandmark.Text = \"Distances from Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark for which to display distances.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(100, 25);\n      this.menuItemLandmarks.ToolTipText = \"Landmark for which distances are to be shown\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // HexgridExampleForm\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"HexgridExampleForm\";\n      this.Text = \"HexGridExample2\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this.hexgridPanel)).EndInit();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexUtilities.HexgridPanel hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox toolStripComboBox1;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n  }\n}"
  },
  {
    "path": "codeplex/HexGridExample2-branch/HexGridExample.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows.Forms;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal sealed partial class HexgridExampleForm : Form, IMessageFilter {\n    public HexgridExampleForm() {\n      InitializeComponent();\n\t\t\tApplication.AddMessageFilter(this);\n\n      LoadTraceMenu();\n\n      toolStripComboBox1.SelectedIndex = 0;\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*MapBoard.MapSizeHexes.Height-1, 2));\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    void LoadTraceMenu() {\n      #if TRACE\n        foreach(var item in Enum.GetValues(typeof(TraceFlags))) {\n          var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n          menuItemDebug.DropDownItems.Add(menuItem);\n          menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n          menuItem.Size         = new System.Drawing.Size(143, 22);\n          menuItem.Text         = item.ToString();\n          menuItem.CheckOnClick = true;\n          menuItem.Click       += new System.EventHandler(this.menuItemDebugTracing_Click);\n        }\n      #endif\n    }\n\n    void LoadLandMarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      foreach(var landmark in _mapBoard.Landmarks) {\n        menuItemLandmarks.Items.Add(string.Format(\"{0}\", landmark.Coords));\n      }\n      menuItemLandmarks.SelectedIndexChanged += menuItemLandmarks_SelectedIndexChanged;\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    MapDisplay          MapBoard { \n      get {return _mapBoard;}\n      set {_mapBoard = value; _mapBoard.RangeCutoff = (int)txtPathCutover.Tag; LoadLandMarkMenu();}\n    } MapDisplay _mapBoard;\n\n    #region Event handlers\n    void HexGridExampleForm_Load(object sender, EventArgs e) {\n      hexgridPanel.SetScaleList(new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly());\n      hexgridPanel.ScaleIndex = hexgridPanel.Scales\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      Size = hexgridPanel.MapSizePixels + new Size(21,93);\n    }\n\n    bool isPanelResizeSuppressed = false;\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! isPanelResizeSuppressed) hexgridPanel.SetScroll();\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      isPanelResizeSuppressed = false;\n      hexgridPanel.SetScroll();\n    }\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA2204:Literals should be spelled correctly\", MessageId = \"HotspotHex\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1303:Do not pass literals as localized parameters\", \n      MessageId = \"System.Windows.Forms.ToolStripItem.set_Text(System.String)\")]\n    void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = MapBoard.HotspotHex;\n      statusLabel.Text = \"HotspotHex: \" + hotHex.ToString() \n                       + \"/ Custom=\" + hotHex.UserToCustom().ToString()\n                       + \"/ Canon=\" + hotHex.Canon.ToString()\n                       + \"; Range = \" + MapBoard.StartHex.Range(hotHex)\n                       + \"; Path Length = \" + (MapBoard.Path==null ? 0 : MapBoard.Path.TotalCost);\n    }\n\n    void buttonTransposeMap_Click(object sender, EventArgs e) {\n      hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    private void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      MapBoard.FovRadius   =\n      MapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    private void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex - 1;\n      Update();\n    }\n\n    private void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (TraceFlags)Enum.Parse(typeof(TraceFlags),name);\n      if( item.Checked)\n        DebugTracing.EnabledFags |=  flag;\n      else\n        DebugTracing.EnabledFags &= ~flag;\n    }\n    #endregion\n\n    private void toolStripComboBox1_Click(object sender, EventArgs e) {\n      var name = ((ToolStripItem)sender).Text;\n      switch (name) {\n        case \"MazeMap\":    hexgridPanel.Host = MapBoard = new MazeMap();    break;\n        case \"TerrainMap\": hexgridPanel.Host = MapBoard = new TerrainMap(); break;\n        default:  break;\n      }\n      MapBoard.ShowFov     = buttonFieldOfView.Checked;\n      MapBoard.FovRadius   =\n      MapBoard.RangeCutoff = (int)txtPathCutover.Tag;\n      hexgridPanel.Refresh();\n    }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      MapBoard.ShowFov = buttonFieldOfView.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      MapBoard.GoalHex = e.Coords;\n      Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      MapBoard.StartHex = e.Coords;\n      Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      MapBoard.HotspotHex = e.Coords;\n      Refresh();\n    }\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n\t\t/// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <see cref=\"http://www.flounder.com/virtual_screen_coordinates.htm\"/>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n\t\t/// <param name=\"m\">The Windows Message to filter and/or process.</param>\n\t\t/// <returns>Success (true) or failure (false) to OS.</returns>\n\t\t[System.Security.Permissions.PermissionSetAttribute(\n\t\t\tSystem.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n\t\tbool IMessageFilter.PreFilterMessage(ref Message m) {\n\t\t\tvar hWnd  = NativeMethods.WindowFromPoint( WindowsMouseInput.GetPointLParam(m.LParam) );\n\t\t\tvar ctl\t  = Control.FromHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch((WM)m.Msg) {\n          default:  break;\n          case WM.MOUSEWHEEL:\n            #if DEBUG\n              DebugTracing.Trace(TraceFlags.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, \n                ((WM)m.Msg)); \n            #endif\n            if (ctl is HexUtilities.HexgridPanel  ||  ctl is HexgridExampleForm) {\n              return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n            }\n            break;\n        }\n      }\n      return false;\n\t\t}\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/HexGridExample.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample2-branch/HexGridExample2.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>HexGridExample2</RootNamespace>\n    <AssemblyName>HexGridExample2</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <TargetFrameworkProfile>\n    </TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;PathFwd</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1607</NoWarn>\n    <RunCodeAnalysis>true</RunCodeAnalysis>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE;PathFwd</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1607</NoWarn>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <RunCodeAnalysis>true</RunCodeAnalysis>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'\">\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>PGNapoleonics.HexGridExample2.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x64'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\x64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <NoWarn>1607</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x64'\">\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\x64\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexGridExample.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexGridExample.Designer.cs\">\n      <DependentUpon>HexGridExample.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapDisplay.cs\" />\n    <Compile Include=\"MapGridHex.cs\" />\n    <Compile Include=\"MazeGridHex.cs\" />\n    <Compile Include=\"MazeMap.cs\" />\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"TerrainGridHex.cs\" />\n    <Compile Include=\"TerrainMap.cs\" />\n    <EmbeddedResource Include=\"HexGridExample.resx\">\n      <DependentUpon>HexGridExample.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.config\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.0\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexGridExample2-branch/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.PathFinding;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal abstract class MapDisplay : HexBoard<MapGridHex>, IMapDisplay, IBoard<IHex>, INavigableBoard {\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n    protected MapDisplay(Size sizeHexes, Func<IBoard<MapGridHex>, HexCoords, MapGridHex> initializeHex) \n      : base(sizeHexes, new Size(27,30), (map) => \n          new BoardStorage<MapGridHex>.FlatBoardStorage(sizeHexes, coords => initializeHex(map,coords))\n    ) {\n      StartHex   = GoalHex = HotspotHex = HexCoords.EmptyUser;\n    }\n\n    public virtual  IFov      Fov            {\n      get { return _fov ?? (_fov = this.GetFov(HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    public virtual  HexCoords GoalHex        { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    public virtual  HexCoords HotspotHex     { \n      get { return _hotSpotHex; }\n      set { _hotSpotHex = value; Fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    public          IDirectedPath Path       { \n      get { return _path ?? ( IsPassable(StartHex) && IsPassable(GoalHex) \n                          ? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])) : null); } \n    } IDirectedPath _path;\n    public virtual  HexCoords StartHex       { \n      get { return _startHex; } // ?? (_startHex = HexCoords.EmptyUser); } \n      set { if (IsOnboard(value)) _startHex = value; _path = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n\n    public          int       LandmarkToShow { get; set; }\n    public          Size      MapMargin      { get; set; }\n    public          string    Name           { get {return \"MapDisplay\";} }\n    public          bool      ShowFov        { get; set; }\n\n    IHex IFovBoard<IHex>.this[HexCoords coords] { get { return BoardHexes[coords]; } }\n\n    public CoordsRectangle GetClipCells(PointF point, SizeF size) {\n      return GetClipHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n    public CoordsRectangle GetClipCells(RectangleF visibleClipBounds) {\n      return GetClipHexes(visibleClipBounds, MapSizeHexes);\n    }\n    public virtual  void PaintHighlight(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var state = g.Save();\n      g.TranslateTransform(\n        MapMargin.Width  + StartHex.User.X * GridSize.Width,\n        MapMargin.Height + StartHex.User.Y * GridSize.Height + (StartHex.User.X+1)%2 * GridSize.Height/2\n      );\n      g.DrawPath(Pens.Red, HexgridPath);\n\n#if PathFwd\n      g.Restore(state); state = g.Save();\n      PaintPath(g,Path);\n#else\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        var path = Path;\n        while (path != null) {\n          g.Restore(state); state = g.Save();\n\n          var coords = path.StepCoords;\n          g.TranslateTransform(\n            MapMargin.Width  + coords.User.X * GridSize.Width,\n            MapMargin.Height + coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n          );\n          g.FillPath(brush, HexgridPath);\n\n          path = path.PathSoFar;\n        }\n      }\n#endif\n\n      g.Restore(state); state = g.Save();\n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      var textOffset = new Point(GridSize.Width/2 - 6, GridSize.Height/2 - 6);\n      var font       = SystemFonts.MenuFont;\n      using(var shadeBrush = new SolidBrush(Color.FromArgb(78,Color.Black))) {\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            var coords = HexCoords.NewUserCoords(x,y);\n            if (ShowFov && Fov!=null && ! Fov[coords]) { g.FillPath(shadeBrush, HexgridPath);  }\n\n            g.DrawString(HexText(x,y,LandmarkToShow), font, Brushes.Black, textOffset);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n\n#if PathFwd\n    void PaintPath(Graphics g, IDirectedPath Path) {\n      var state = g.Save();\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        var path = Path;\n        while (path != null) {\n          g.Restore(state); state = g.Save();\n          var coords = path.PathStep.Hex.Coords;\n          g.TranslateTransform(\n            MapMargin.Width  + coords.User.X * GridSize.Width,\n            MapMargin.Height + coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n          );\n          g.FillPath(brush, HexgridPath);\n\n          PaintPathArrow(g, path);\n          path = path.PathSoFar;\n        }\n      }\n    }\n\n    void PaintPathArrow(Graphics g, IDirectedPath path) {\n      g.TranslateTransform(GridSize.Width * 2/3, GridSize.Height/2);\n      var unit = GridSize.Height/8.0F;\n      if (path.PathSoFar == null) {\n        g.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n        g.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n      } else {\n        g.RotateTransform(60 * (int)path.PathStep.HexsideEntry);\n        g.DrawLine(Pens.Black, 0,unit*4,       0,-unit);\n        g.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n        g.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n      }\n    }\n#endif\n\n    public abstract void PaintMap(Graphics g);\n    public abstract void PaintUnits(Graphics g);\n\n    CoordsRectangle  GetClipHexes(RectangleF visibleClipBounds, Size boardSizeHexes) {\n      var left    = Math.Max((int)visibleClipBounds.Left  /GridSize.Width  - 1, 0);\n      var top     = Math.Max((int)visibleClipBounds.Top   /GridSize.Height - 1, 0);\n      var right   = Math.Min((int)visibleClipBounds.Right /GridSize.Width  + 1, boardSizeHexes.Width);\n      var bottom  = Math.Min((int)visibleClipBounds.Bottom/GridSize.Height + 1, boardSizeHexes.Height); \n      return new CoordsRectangle (left, top, right-left, bottom-top);\n    }\n    \n    public string HexText(HexCoords coords, int landmarkToShow) { \n      var value = (0 <= landmarkToShow && landmarkToShow < Landmarks.Count)\n        ? Landmarks[landmarkToShow].HexDistance(coords) : -1;\n      return value==-1 ? \"\" : string.Format(\"{0,3}\", value);\n    }\n    public string HexText(int x, int y, int landmarkToShow)     { \n      return HexText(HexCoords.NewUserCoords(x,y),landmarkToShow); \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/MapGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal interface IMapGridHex : IHex {\n    int              Elevation      { get; }\n    void Paint(Graphics g);\n  }\n\n  internal abstract class MapGridHex : Hex, IMapGridHex {\n    protected MapGridHex(IBoard<IHex> board, HexCoords coords) : base(board, coords) { \n    }\n\n    public virtual  int              Elevation      { get; protected set; }\n    public abstract void Paint(Graphics g);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/MazeGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal abstract class MazeGridHex : MapGridHex {\n    protected MazeGridHex(IBoard<MapGridHex> board, HexCoords coords, Size gridSize) \n      : base(board, coords) {\n      GridSize  = gridSize;\n\n      HexgridPath = new GraphicsPath();\n      HexgridPath.AddLines(new Point[] {\n        new Point(GridSize.Width*1/3,                0), \n        new Point(GridSize.Width*3/3,                0),\n        new Point(GridSize.Width*4/3,GridSize.Height/2),\n        new Point(GridSize.Width*3/3,GridSize.Height  ),\n        new Point(GridSize.Width*1/3,GridSize.Height  ),\n        new Point(                 0,GridSize.Height/2),\n        new Point(GridSize.Width*1/3,                0)\n      } );\n    }\n\n    public override int    ElevationASL  { get { return Elevation * 10; } }\n    public override void   Paint(Graphics g) {;}\n\n    protected Size         GridSize      { get; private set; }\n    protected GraphicsPath HexgridPath   { get; set; }\n  }\n\n  internal sealed class PathMazeGridHex : MazeGridHex {\n    public PathMazeGridHex(IBoard<MapGridHex> board, HexCoords coords, Size gridSize) \n      : base(board, coords, gridSize) {}\n    public override int  Elevation      { get { return 0; } }\n    public override int  HeightTerrain  { get { return ElevationASL + 0; } }\n    public override int  StepCost(Hexside direction) { return  1; }\n  }\n\n  internal sealed class WallMazeGridHex : MazeGridHex {\n    public WallMazeGridHex(IBoard<MapGridHex> board, HexCoords coords, Size gridSize) \n      : base(board, coords, gridSize) {}\n    public override int  Elevation      { get { return 1; } }\n    public override int  HeightTerrain  { get { return ElevationASL + 10; } }\n    public override int  StepCost(Hexside direction) { return -1; }\n\n    public override void Paint(Graphics g) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n        g.FillPath(brush, HexgridPath);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/MazeMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal sealed class MazeMap : MapDisplay {\n    public MazeMap() : base(_sizeHexes, (map,coords) => InitializeHex(map,coords)) {}\n\n    /// <inheritdoc/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2233:OperationsShouldNotOverflow\", MessageId = \"10*elevationLevel\")]\n    public override int   ElevationASL(int elevationLevel) { return 10 * elevationLevel; }\n    /// <inheritdoc/>\n    public override int   Heuristic(int range) { return range; }\n    /// <inheritdoc/>\n    public override bool  IsPassable(HexCoords coords) { \n      return IsOnboard(coords)  &&  this[coords].Elevation == 0; \n    }\n\n    #region Painting\n    public override void PaintMap(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      using(var font   = new Font(\"ArialNarrow\", 8))\n      using(var format = new StringFormat()) {\n        format.Alignment = format.LineAlignment = StringAlignment.Center;\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            this[HexCoords.NewUserCoords(x,y)].Paint(g);\n            g.DrawPath(Pens.Black, HexgridPath);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n    public override void PaintUnits(Graphics g) { ; }\n    #endregion\n\n    #region static Board definition\n    static List<string> _board = new List<string>() {\n      \".............|.........|.......|.........|.............\",\n      \".............|.........|.......|.........|.............\",\n      \"....xxxxxxxxx|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \"xxxxxxxxx....|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|...................\",\n      \".....xxxxxxxx|....|........|.......|.......xxxxxxxx....\",\n      \"..................|........|.......|.......|......|....\",\n      \"xxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxx......|......|....\",\n      \"................|........|...|.............|...|..|....\",\n      \"xxxxxxxxxxxx....|...|....|...|.............|...|...|...\",\n      \"................|...|....|...|.............|...|...|...\",\n      \"..xxxxxxxxxxxxxxx...|....|...|.............|...|...|...\",\n      \"....................|....|.................|...|...|...\",\n      \"xxxxxxxxxxxxxxxxx..xx....|.................|...|.......\",\n      \".........................|...xxxxxxxxxxxxxxx...|xxxxxxx\",\n      \"xxxxxx...................|...|.................|.......\",\n      \".........xxxxxxxxxxxxxxxxx...|.................|.......\",\n      \".............................|...xxxxxxxxxxxxxx|.......\",\n      \"xxxxxxxxxx......xxxxxxxxxxxxx|...|.....................\",\n      \".............................|...|.....................\",\n      \".............................|...|...xxxxxxxxxxxxx.....\",\n      \"....xxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.................\",\n      \".............................|...|...|..........xxxxxxx\",\n      \"xxxxxxxxxxxxxxxxxxxxxxxxx....|...|...|.....|....|......\",\n      \".............................|...|...|.....|....|......\",\n      \"...xxxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.....|....|......\",\n      \".............................|.......|.....|...........\",\n      \".............................|.......|.....|...........\"\n    };\n    static Size _sizeHexes = new Size(_board[0].Length, _board.Count);\n    #endregion\n\n    private static MapGridHex InitializeHex(IBoard<MapGridHex> board, HexCoords coords) {\n      switch (_board[coords.User.Y][coords.User.X]) {\n        case '.': return new PathMazeGridHex(board, coords, board.GridSize);\n        default:  return new WallMazeGridHex(board, coords, board.GridSize);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><see cref=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"/></remarks>\n\t\t/// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\"), DllImport(\"user32.dll\")]\n\t\tinternal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n\t\t/// <param name=\"hWnd\">Window handle</param>\n\t\t/// <param name=\"msg\">Windows message</param>\n\t\t/// <param name=\"wp\">WParam</param>\n\t\t/// <param name=\"lp\">LParam</param>\n\t\t/// <returns></returns>\n\t\t[DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n\t\tinternal static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  static class Program {\n    /// <summary>The main entry point for the application.</summary>\n    [STAThread]\n    static void Main()      {\n      Application.EnableVisualStyles();\n      Application.SetCompatibleTextRenderingDefault(false);\n      Application.ThreadException += \n        new ThreadExceptionEventHandler(\n          (new ThreadExceptionHandler()).ApplicationThreadException);\n\n      Application.Run(new HexgridExampleForm());\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexGridExample2\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexGridExample2\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"e0be8677-676e-4d95-bf9d-c39273565a46\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.0\")]\n[assembly: AssemblyFileVersion(\"6.0\")]\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18047\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HexGridExample2.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"HexGridExample2.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18047\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HexGridExample2.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"10.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/TerrainGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal abstract class TerrainGridHex : MapGridHex {\n\n    protected TerrainGridHex(IBoard<IHex> map, HexCoords coords, Size gridSize) \n      : base(map, coords) { \n      GridSize  = gridSize;\n\n      HexgridPath = new GraphicsPath();\n      HexgridPath.AddLines(new Point[] {\n        new Point(GridSize.Width*1/3,                0), \n        new Point(GridSize.Width*3/3,                0),\n        new Point(GridSize.Width*4/3,GridSize.Height/2),\n        new Point(GridSize.Width*3/3,GridSize.Height  ),\n        new Point(GridSize.Width*1/3,GridSize.Height  ),\n        new Point(                 0,GridSize.Height/2),\n        new Point(GridSize.Width*1/3,                0)\n      } );\n    }\n\n    protected Size         GridSize      { get; private set; }\n    protected GraphicsPath HexgridPath   { get; set; }\n\n    public override void Paint(Graphics g) {;}\n    public override int  Elevation     { get { return  0; }  }\n    public override int  ElevationASL  { get { return Board.ElevationASL(Elevation); } }\n    public override int  HeightTerrain { get { return ElevationASL; } }\n    public override int  StepCost(Hexside direction) { return  4; }\n  }\n  internal sealed class ClearTerrainGridHex    : TerrainGridHex {\n    public ClearTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override void Paint(Graphics g) { ; }\n  }\n  internal sealed class FordTerrainGridHex     : TerrainGridHex {\n    public FordTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int StepCost(Hexside direction) { return  5; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      g.FillPath(Brushes.Brown, HexgridPath); \n    }\n  }\n  internal sealed class RiverTerrainGridHex    : TerrainGridHex {\n    public RiverTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int StepCost(Hexside direction) { return -1; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      g.FillPath(Brushes.DarkBlue, HexgridPath); \n    }\n  }\n  internal sealed class PikeTerrainGridHex     : TerrainGridHex {\n    public PikeTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int StepCost(Hexside direction) { return  2; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n        g.FillPath(brush, HexgridPath); \n    }\n  }\n  internal sealed class RoadTerrainGridHex     : TerrainGridHex {\n    public RoadTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int StepCost(Hexside direction) { return  3; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.SaddleBrown)))\n        g.FillPath(brush, HexgridPath); \n    }\n  }\n  internal sealed class HillTerrainGridHex     : TerrainGridHex {\n    public HillTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int Elevation      { get { return  1; } }\n    public override int StepCost(Hexside direction) { return  5; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      g.FillPath(Brushes.Khaki, HexgridPath); \n    }\n  }\n  internal sealed class MountainTerrainGridHex : TerrainGridHex {\n    public MountainTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int Elevation      { get { return  2; } }\n    public override int StepCost(Hexside direction) { return  6; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      g.FillPath(Brushes.DarkKhaki, HexgridPath); \n    }\n  }\n  internal sealed class WoodsTerrainGridHex    : TerrainGridHex {\n    public WoodsTerrainGridHex(IBoard<MapGridHex> map, HexCoords coords, Size gridSize) : base(map, coords, gridSize) { }\n    public override int HeightTerrain  { get { return ElevationASL + 7; } }\n    public override int StepCost(Hexside direction) { return  8; }\n    public override void Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      g.FillPath(Brushes.Green, HexgridPath); \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/TerrainMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal sealed class TerrainMap : MapDisplay {\n    public TerrainMap() : base(_sizeHexes, (map,coords) => InitializeHex(map,coords)) {}\n\n    /// <inheritdoc/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2233:OperationsShouldNotOverflow\", MessageId = \"10*elevationLevel\")]\n    public override int   ElevationASL(int elevationLevel) { return 10 * elevationLevel; }\n\n    /// <inheritdoc/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2233:OperationsShouldNotOverflow\", MessageId = \"2*range\")]\n    public override int   Heuristic(int range) { return 2 * range; }\n\n    #region Painting\n    public override void PaintMap(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      using(var font   = new Font(\"ArialNarrow\", 8))\n      using(var format = new StringFormat()) {\n        format.Alignment = format.LineAlignment = StringAlignment.Center;\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            this[HexCoords.NewUserCoords(x,y)].Paint(g);\n            g.DrawPath(Pens.Black, HexgridPath);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n    public override void PaintUnits(Graphics g) { ; }\n    #endregion\n\n    #region static Board definition\n    static List<string> _board = new List<string>() {\n      \"...................3.......22...........R..............\",\n      \"...................3.........222222.....R..............\",\n      \"...................3..............2.....R..............\",\n      \"...................33..............22222F.2.2..........\",\n      \"............RR......3...................R2.2.2222......\",\n      \"...........RRRR.....3.....HHHH..........R........22....\",\n      \"..........RRRRRRR...3....HHMMHH.........R..........22..\",\n      \"..........RRRRRRR....3....HHHH..........R............22\",\n      \"...........RRRR......3..................R..............\",\n      \"............RR.......3..........RRRRRRRR...............\",\n      \".....................3.........R............WW.........\",\n      \".....................3.........R...........WWWWW.......\",\n      \".....................3.........R............WWW........\",\n      \".....................3.........R.......................\",\n      \".....................3.........RRRRRRRR................\",\n      \"..........WWWWWWW....3.................R...............\",\n      \"........WWWWWWWWW....33................R...............\",\n      \".......WWWWWWWWW.....3.33..............R...............\",\n      \"..........WWWWWWW....3...32222222222222F22222..........\",\n      \"...........WWWWWWW...3...2.............R.....222222....\",\n      \"............WWWWW....32222.............R...........22..\",\n      \"....................22....HHHH........RR.............22\",\n      \"................2222.....HHMMHH.....RR.......WW........\",\n      \"............2222..........HHMHH...RR.......WWWWW.......\",\n      \"........2222...............HHH..RR.........WWWW........\",\n      \"......22......................RR............WW.........\",\n      \"..2222......................RR.........................\",\n      \"22..................RRRRRRRR...........................\",\n      \"..................RR...................................\",\n      \".................RRR...................................\"\n    };\n    static Size _sizeHexes = new Size(_board[0].Length, _board.Count);\n    #endregion\n\n    private static MapGridHex InitializeHex(IBoard<MapGridHex> board, HexCoords coords) {\n      char value = _board[coords.User.Y][coords.User.X];\n      switch(value) {\n        default:   \n        case '.':  return new ClearTerrainGridHex   (board, coords, board.GridSize);\n        case '2':  return new PikeTerrainGridHex    (board, coords, board.GridSize);\n        case '3':  return new RoadTerrainGridHex    (board, coords, board.GridSize);\n        case 'F':  return new FordTerrainGridHex    (board, coords, board.GridSize);\n        case 'H':  return new HillTerrainGridHex    (board, coords, board.GridSize);\n        case 'M':  return new MountainTerrainGridHex(board, coords, board.GridSize);\n        case 'R':  return new RiverTerrainGridHex   (board, coords, board.GridSize);\n        case 'W':  return new WoodsTerrainGridHex   (board, coords, board.GridSize);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExample2-branch/app.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.0\"/></startup></configuration>\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/AStarBugMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n    /// <summary>TODO</summary>\n  public sealed class AStarBugMap : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n     public AStarBugMap() : base(_sizeHexes, new Size(26,30), InitializeHex) { }\n\n    /// <inheritdoc/>\n   [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\", MessageId = \"2*range\")]\n    public override int   Heuristic(int range) { return 2 * range; }\n\n    /// <inheritdoc/>\n    public override void PaintUnits(Graphics graphics) { ; }\n\n    #region static Board definition\n    static IList<string> _board     = MapDefinitions.AStarBugMapDefinition;\n    static Size          _sizeHexes = new Size(_board[0].Length, _board.Count);\n    #endregion\n\n    private new static MapGridHex InitializeHex(GraphicsPath hexgridPath, HexCoords coords) {\n      char value = _board[coords.User.Y][coords.User.X];\n      switch(value) {\n        default:   \n        case '.':  return new ClearTerrainGridHex   (hexgridPath, coords);\n        case '2':  return new PikeTerrainGridHex    (hexgridPath, coords);\n        case '3':  return new RoadTerrainGridHex    (hexgridPath, coords);\n        case 'F':  return new FordTerrainGridHex    (hexgridPath, coords);\n        case 'H':  return new HillTerrainGridHex    (hexgridPath, coords);\n        case 'M':  return new MountainTerrainGridHex(hexgridPath, coords);\n        case 'R':  return new RiverTerrainGridHex   (hexgridPath, coords);\n        case 'W':  return new WoodsTerrainGridHex   (hexgridPath, coords);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n           <Word>Alt</Word>\n           <Word>coloured</Word>\n           <Word>Coords</Word>\n           <Word>Ctl</Word>\n           <Word>Eachable</Word>\n           <Word>Fov</Word>\n           <Word>Fwd</Word>\n           <Word>functor</Word>      <Word>functors</Word>\n           <Word>hexgrid</Word>\n           <Word>HexgridUtilities</Word>\n           <Word>hexside</Word>      <Word>hexsides</Word>\n           <Word>Hotspot</Word>\n           <Word>lhs</Word>\n           <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n           <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n           <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n           <Word>Napoleonics</Word>\n           <Word>Neighbour</Word>    <Word>Neighbours</Word>\n           <Word>rhs</Word>\n           <Word>c</Word>\n           <Word>f</Word>\n           <Word>g</Word>\n           <Word>h</Word>\n           <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n           <Word>m</Word>\n           <Word>p</Word>\n           <Word>Pathfinding</Word>\n           <Word>s</Word>\n           <Word>v</Word>\n           <Word>w</Word>\n           <Word>x</Word>      <Word>dx</Word>\n           <Word>y</Word>      <Word>dy</Word>\n           <Word>z</Word>      <Word>dz</Word>\n           <Word>wParam</Word>\n           <Word>lParam</Word>\n           <Word>params</Word>\n         </Recognized>\n         <Deprecated>\n           <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n           <Acronym>ASL</Acronym>\n           <Acronym>Fov</Acronym>\n           <Acronym>PG</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "codeplex/HexGridExampleCommon/DocMainPage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n#pragma warning disable 1587\n/// @mainpage HexgridUtilities V 6.4\n/// \n/// @section Introduction \n/// \n/// <b>PGNapoleonics.HexgridUtilities</b> is a library of utilities and controls for buillding strategy simulation games on hexagonal-grid \n/// mapboards.\n/// \n/// @subsection Detailed_Description Detailed Description\n///\n/// - <b>PGNapoleonics</b> is the top level namespace for software develoepd by <b>PGSoftware Solutions Inc.</b>,\n/// and comprises these subsidiary namespaces:\n///   + <b>HexgridExample2</b> is a sample <b>WinForms</b> application demonstrating some straight-forward usage of the library.\n///   + <b>HexgridPanel</b> is the <b>System.Windows.Forms</b> specific extensions to support hex-grid panels in <b>Winforms</b> applications.\n///   + <b>HexUtilities</b> is the display-technology independent utilities underpinnign the provision of hex-grid utilities.\n///   + <b>WinForms</b> is a collection of extensions to the <b>System.Windows.Forms</b> technologies used by the remainder of the library.\n/// \n/// @subsection Getting_Started Getting Started\n///\n/// To get started, explore how the two sample maps in HexgridExample2 override\n/// the base class MapDisplay<THex>, and how the sample form overrides the base control HexgridPanel. \n/// \n/// The Collaboration diagram for MapDisplay<THex> provides a good overview of the library structure.\n/// \n/// @subsection Authorship \n/// \n/// Brought to you by <b>PG Software Solutions Inc.</b>, a quality software provider.\n/// \n/// Our software are more than <b>Pretty Good Solutions</b>; ... they're <b>Pretty Great Solutions!</b>\n/// \n/// @subsection The_MIT_License The MIT License:\n/// \n/// @copyright &copy; 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n/// \n/// > Permission is hereby granted, free of charge, to any person obtaining a copy of this  \n/// > software and associated documentation files (the \"Software\"), to deal in the Software  \n/// > without restriction, including without limitation the rights to use, copy, modify,  \n/// > merge, publish, distribute, sublicense, and/or sell copies of the Software, and to  \n/// > permit persons to whom the Software is furnished to do so, subject to the following  \n/// > conditions:\n/// >\n/// >     The above copyright notice and this permission notice shall be \n/// >     included in all copies or substantial portions of the Software.\n/// >\n/// >     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n/// >     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n/// >     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n/// >     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n/// >     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n/// >     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n/// >     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n/// >     OTHER DEALINGS IN THE SOFTWARE.\n//////////////////////////////////////////////////////////////////////////////////////////\n#pragma warning restore 1587\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/HexgridExampleCommon.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{4E4EC92B-2BF5-4342-A069-3A6BB76B7FCA}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleCommon</RootNamespace>\n    <AssemblyName>HexgridExampleCommon</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\HexgridExampleCommon.xml</DocumentationFile>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DocMainPage.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"MapDefs.cs\" />\n    <Compile Include=\"MapList.cs\" />\n    <Compile Include=\"MazeGridHex.cs\" />\n    <Compile Include=\"MazeMap.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"TerrainGridHex.cs\" />\n    <Compile Include=\"AStarBugMap.cs\" />\n    <Compile Include=\"TerrainMap.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"HexgridUtilities.Doxyfile\" />\n    <None Include=\"HexgridUtilities.HtmlHelp.Doxyfile\" />\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexGridExampleCommon/HexgridUtilities.Doxyfile",
    "content": "# Doxyfile 1.8.4\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file \n# that follow. The default is UTF-8 which is also the encoding used for all \n# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n# iconv built into libc) for the transcoding. See \n# http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or sequence of words) that should \n# identify the project. Note that if you do not use Doxywizard you need \n# to put quotes around the project name if it contains spaces.\n\nPROJECT_NAME           = \"Hexgrid Utilities\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         = \"V 6.4\"\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description \n# for a project that appears at the top of each page and should give viewer \n# a quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Hexgrid Utilities for Board Game Implementations\"\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is \n# included in the documentation. The maximum height of the logo should not \n# exceed 55 pixels and the maximum width should not exceed 200 pixels. \n# Doxygen will copy the logo to the output directory.\n\nPROJECT_LOGO           = \n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\Documentation\\XHTML\"\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, \n# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English \n# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, \n# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, \n# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip. Note that you specify absolute paths here, but also \n# relative paths, which will be relative from the directory where doxygen is \n# started.\n\nSTRIP_FROM_PATH        = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful if your file system \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like regular Qt-style comments \n# (thus requiring an explicit @brief command for a brief description.)\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n# interpret the first line (until the first dot) of a Qt-style \n# comment as the brief description. If set to NO, the comments \n# will behave just like regular Qt-style comments (thus requiring \n# an explicit \\brief command for a brief description.)\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# This tag can be used to specify a number of word-keyword mappings (TCL only). \n# A mapping has the form \"name=value\". For example adding \n# \"class=itcl::class\" will allow you to use the command class in the \n# itcl::class meaning.\n\nTCL_SUBST              = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for \n# Java. For instance, namespaces will be presented as packages, qualified \n# scopes will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran \n# sources only. Doxygen will then generate output that is more tailored for \n# Fortran.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL \n# sources. Doxygen will then generate output that is tailored for \n# VHDL.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it \n# parses. With this tag you can assign which parser to use for a given \n# extension. Doxygen has a built-in mapping, but you can override or extend it \n# using this tag. The format is ext=language, where ext is a file extension, \n# and language is one of the parsers supported by doxygen: IDL, Java, \n# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, \n# C++. For instance to make doxygen treat .inc files as Fortran files (default \n# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note \n# that for custom extensions you also need to set FILE_PATTERNS otherwise the \n# files are not read by doxygen.\n\nEXTENSION_MAPPING      = \n\n# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all \n# comments according to the Markdown format, which allows for more readable \n# documentation. See http://daringfireball.net/projects/markdown/ for details. \n# The output of markdown processing is further processed by doxygen, so you \n# can mix doxygen, HTML, and XML commands with Markdown formatting. \n# Disable only in case of backward compatibilities issues.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented \n# classes, or namespaces to their corresponding documentation. Such a link can \n# be prevented in individual cases by by putting a % sign in front of the word \n# or globally by setting AUTOLINK_SUPPORT to NO.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n# to include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also makes the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to \n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. \n# Doxygen will parse them like normal C++ but will assume all classes use public \n# instead of private inheritance when no explicit protection keyword is present.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate \n# getter and setter methods for a property. Setting this option to YES (the \n# default) will make doxygen replace the get and set methods by a property in \n# the documentation. This will only work if the methods are indeed getting or \n# setting a simple type. If this is not the case, or you want to show the \n# methods anyway, you should set this option to NO.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and \n# unions are shown inside the group in which they are included (e.g. using \n# @ingroup) instead of on a separate page (for HTML and Man pages) or \n# section (for LaTeX and RTF).\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and \n# unions with only public data fields or simple typedef fields will be shown \n# inline in the documentation of the scope in which they are defined (i.e. file, \n# namespace, or group documentation), provided this scope is documented. If set \n# to NO (the default), structs, classes, and unions are shown on a separate \n# page (for HTML and Man pages) or section (for LaTeX and RTF).\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n# is documented as struct, union, or enum with the name of the typedef. So \n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n# with name TypeT. When disabled the typedef will appear as a member of a file, \n# namespace, or class. And the struct will be named TypeS. This can typically \n# be useful for C code in case the coding convention dictates that all compound \n# types are typedef'ed and only the typedef is referenced, never the tag name.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This \n# cache is used to resolve symbols given their name and scope. Since this can \n# be an expensive process and often the same symbol appear multiple times in \n# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too \n# small doxygen will become slower. If the cache is too large, memory is wasted. \n# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid \n# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 \n# symbols.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal \n# scope will be included in the documentation.\n\nEXTRACT_PACKAGE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be \n# extracted and appear in the documentation as a namespace called \n# 'anonymous_namespace{file}', where file will be replaced with the base \n# name of the file that contains the anonymous namespace. By default \n# anonymous namespaces are hidden.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = YES\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen \n# will list include files with double quotes in the documentation \n# rather than with sharp brackets.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = YES\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen \n# will sort the (brief and detailed) documentation of class members so that \n# constructors and destructors are listed first. If set to NO (the default) \n# the constructors will appear in the respective orders defined by \n# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. \n# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO \n# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.\n\nSORT_MEMBERS_CTORS_1ST = YES\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the \n# hierarchy of group names into alphabetical order. If set to NO (the default) \n# the group names will appear in their defined order.\n\nSORT_GROUP_NAMES       = YES\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. \n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = YES\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to \n# do proper type resolution of all parameters of a function it will reject a \n# match between the prototype and the implementation of a member function even \n# if there is only one candidate or it is obvious which candidate to choose \n# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen \n# will still accept a match between prototype and implementation in such cases.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if section-label ... \\endif \n# and \\cond section-label ... \\endcond blocks.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or macro consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and macros in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. \n# This will remove the Files entry from the Quick Index and from the \n# Folder Tree View (if specified). The default is YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n# Namespaces page.  This will remove the Namespaces entry from the Quick Index \n# and from the Folder Tree View (if specified). The default is YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from \n# the version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed \n# by doxygen. The layout file controls the global structure of the generated \n# output files in an output format independent way. To create the layout file \n# that represents doxygen's defaults, run doxygen with the -l option. \n# You can optionally specify a file name after the option, if omitted \n# DoxygenLayout.xml will be used as the name of the layout file.\n\nLAYOUT_FILE            = \n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files \n# containing the references data. This must be a list of .bib files. The \n# .bib extension is automatically appended if omitted. Using this command \n# requires the bibtex tool to be installed. See also \n# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style \n# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this \n# feature you need bibtex and perl available in the search path. Do not use \n# file names with spaces, bibtex cannot handle them.\n\nCITE_BIB_FILES         = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = NO\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# The WARN_NO_PARAMDOC option can be enabled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# This tag can be used to specify the character encoding of the source files \n# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is \n# also the default input encoding. Doxygen uses libiconv (or the iconv built \n# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for \n# the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh \n# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py \n# *.f90 *.f *.for *.vhd *.vhdl\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag. \n# Note that relative paths are relative to the directory from which doxygen is \n# run.\n\nEXCLUDE                = \"./C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/obj\" \\\n                         \"../HexgridPanel/Reference Source\"\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or \n# directories that are symbolic links (a Unix file system feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = */obj/* \\\n                         *.Designer.cs\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the \n# output. The symbol name can be a fully qualified name, a word, or if the \n# wildcard * is used, a substring. Examples: ANamespace, AClass, \n# AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = WindowStylesEx \\\n                         WM\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be ignored. \n# Note that the filter must not add or remove lines; it is applied before the \n# code is scanned, but not when the output code is generated. If lines are added \n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty or if \n# non of the patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file \n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) \n# and it is also possible to disable source filtering for a specific pattern \n# using *.ext= (so without naming a filter). This option only has effect when \n# FILTER_SOURCE_FILES is enabled.\n\nFILTER_SOURCE_PATTERNS = \n\n# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that \n# is part of the input, its contents will be placed on the main page \n# (index.html). This can be useful if you have a project on for instance GitHub \n# and want reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C, C++ and Fortran comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) \n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from \n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will \n# link to the source code.  Otherwise they will link to the documentation.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser \n# for more acurate parsing at the cost of reduced performance. This can be \n# particularly helpful with template rich C++ code for which doxygen's built-in \n# parser lacks the necessairy type information.\n\nCLANG_ASSISTED_PARSING = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command \n# line options that you would normally use when invoking the compiler. Note that \n# the include paths will already be set by doxygen for the files and directories \n# specified at INPUT and INCLUDE_PATH.\n\nCLANG_OPTIONS          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = YES\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 2\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .xhtml\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header. Note that when using a custom header you are responsible  \n# for the proper inclusion of any scripts and style sheets that doxygen \n# needs, which is dependent on the configuration options used. \n# It is advised to generate a default header using \"doxygen -w html \n# header.html footer.html stylesheet.css YourConfigFile\" and then modify \n# that header. Note that the header is subject to change so you typically \n# have to redo this when upgrading to a newer version of doxygen or when \n# changing the value of configuration settings such as GENERATE_TREEVIEW!\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If left blank doxygen will \n# generate a default style sheet. Note that it is recommended to use \n# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this \n# tag will in the future become obsolete.\n\nHTML_STYLESHEET        = \n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional \n# user-defined cascading style sheet that is included after the standard \n# style sheets created by doxygen. Using this option one can overrule \n# certain style aspects. This is preferred over using HTML_STYLESHEET \n# since it does not replace the standard style sheet and is therefor more \n# robust against future updates. Doxygen will copy the style sheet file to \n# the output directory.\n\nHTML_EXTRA_STYLESHEET  = \n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or \n# other source files which should be copied to the HTML output directory. Note \n# that these files will be copied to the base HTML output directory. Use the \n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these \n# files. In the HTML_STYLESHEET file, use the file name only. Also note that \n# the files will be copied as-is; there are no commands or markers available.\n\nHTML_EXTRA_FILES       = \n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. \n# Doxygen will adjust the colors in the style sheet and background images \n# according to this color. Hue is specified as an angle on a colorwheel, \n# see http://en.wikipedia.org/wiki/Hue for more information. \n# For instance the value 0 represents red, 60 is yellow, 120 is green, \n# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. \n# The allowed range is 0 to 359.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of \n# the colors in the HTML output. For a value of 0 the output will use \n# grayscales only. A value of 255 will produce the most vivid colors.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to \n# the luminance component of the colors in the HTML output. Values below \n# 100 gradually make the output lighter, whereas values above 100 make \n# the output darker. The value divided by 100 is the actual gamma applied, \n# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, \n# and 100 does not change the gamma.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML \n# page will contain the date and time when the page was generated. Setting \n# this to NO can help when comparing the output of multiple runs.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n# documentation will contain sections that can be hidden and shown after the \n# page has loaded.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of \n# entries shown in the various tree structured indices initially; the user \n# can expand and collapse entries dynamically later on. Doxygen will expand \n# the tree to such a level that at most the specified number of entries are \n# visible (unless a fully collapsed tree already exceeds this amount). \n# So setting the number of entries 1 will produce a full collapsed tree by \n# default. 0 is a special value representing an infinite number of entries \n# and will result in a full expanded tree by default.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files \n# will be generated that can be used as input for Apple's Xcode 3 \n# integrated development environment, introduced with OSX 10.5 (Leopard). \n# To create a documentation set, doxygen will generate a Makefile in the \n# HTML output directory. Running make will produce the docset in that \n# directory and running \"make install\" will install the docset in \n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find \n# it at startup. \n# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html \n# for more information.\n\nGENERATE_DOCSET        = NO\n\n# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the \n# feed. A documentation feed provides an umbrella under which multiple \n# documentation sets from a single provider (such as a company or product suite) \n# can be grouped.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that \n# should uniquely identify the documentation set bundle. This should be a \n# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen \n# will append .docset to the name.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely \n# identify the documentation publisher. This should be a reverse domain-name \n# style string, e.g. com.mycompany.MyDocSet.documentation.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING \n# is used to encode HtmlHelp index (hhk), content (hhc) and project file \n# content.\n\nCHM_INDEX_ENCODING     = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and \n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated \n# that can be used as input for Qt's qhelpgenerator to generate a \n# Qt Compressed Help (.qch) of the generated HTML documentation.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can \n# be used to specify the file name of the resulting .qch file. \n# The path specified is relative to the HTML output folder.\n\nQCH_FILE               = \n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#namespace\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#virtual-folders\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to \n# add. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#custom-filters\n\nQHP_CUST_FILTER_NAME   = \n\n# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the \n# custom filter to add. For more information please see \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#custom-filters\"> \n# Qt Help Project / Custom Filters</a>.\n\nQHP_CUST_FILTER_ATTRS  = \n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this \n# project's \n# filter section matches. \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#filter-attributes\"> \n# Qt Help Project / Filter Attributes</a>.\n\nQHP_SECT_FILTER_ATTRS  = \n\n# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n# be used to specify the location of Qt's qhelpgenerator. \n# If non-empty doxygen will try to run qhelpgenerator on the generated \n# .qhp file.\n\nQHG_LOCATION           = \n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  \n# will be generated, which together with the HTML files, form an Eclipse help \n# plugin. To install this plugin and make it available under the help contents \n# menu in Eclipse, the contents of the directory containing the HTML and XML \n# files needs to be copied into the plugins directory of eclipse. The name of \n# the directory within the plugins directory should be the same as \n# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before \n# the help appears.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the eclipse help plugin. When installing the plugin \n# the directory name containing the HTML and XML files should also have \n# this name.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) \n# at top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it. Since the tabs have the same information as the \n# navigation tree you can set this option to NO if you already set \n# GENERATE_TREEVIEW to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index \n# structure should be generated to display hierarchical information. \n# If the tag value is set to YES, a side panel will be generated \n# containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). \n# Windows users are probably better off using the HTML help feature. \n# Since the tree basically has the same information as the tab index you \n# could consider to set DISABLE_INDEX to NO when enabling this option.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values \n# (range [0,1..20]) that doxygen will group on one line in the generated HTML \n# documentation. Note that a value of 0 will completely suppress the enum \n# values from appearing in the overview section.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open \n# links to external symbols imported via tag files in a separate window.\n\nEXT_LINKS_IN_WINDOW    = YES\n\n# Use this tag to change the font size of Latex formulas included \n# as images in the HTML documentation. The default is 10. Note that \n# when you change the font size after a successful doxygen run you need \n# to manually remove any form_*.png images from the HTML output directory \n# to force them to be regenerated.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images \n# generated for formulas are transparent PNGs. Transparent PNGs are \n# not supported properly for IE 6.0, but are supported on all modern browsers. \n# Note that when changing this option you need to delete any form_*.png files \n# in the HTML output before the changes have effect.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax \n# (see http://www.mathjax.org) which uses client side Javascript for the \n# rendering instead of using prerendered bitmaps. Use this if you do not \n# have LaTeX installed or if you want to formulas look prettier in the HTML \n# output. When enabled you may also need to install MathJax separately and \n# configure the path to it using the MATHJAX_RELPATH option.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for \n# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and \n# SVG. The default value is HTML-CSS, which is slower, but has the best \n# compatibility.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the \n# HTML output directory using the MATHJAX_RELPATH option. The destination \n# directory should contain the MathJax.js script. For instance, if the mathjax \n# directory is located at the same level as the HTML output directory, then \n# MATHJAX_RELPATH should be ../mathjax. The default value points to \n# the MathJax Content Delivery Network so you can quickly see the result without \n# installing MathJax.  However, it is strongly recommended to install a local \n# copy of MathJax from http://www.mathjax.org before deployment.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension \n# names that should be enabled during MathJax rendering.\n\nMATHJAX_EXTENSIONS     = \n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript \n# pieces of code that will be used on startup of the MathJax code.\n\nMATHJAX_CODEFILE       = \n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box \n# for the HTML output. The underlying search engine uses javascript \n# and DHTML and should work on any modern browser. Note that when using \n# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets \n# (GENERATE_DOCSET) there is already a search function so this one should \n# typically be disabled. For large projects the javascript based search engine \n# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be \n# implemented using a web server instead of a web client using Javascript. \n# There are two flavours of web server based search depending on the \n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for \n# searching and an index file used by the script. When EXTERNAL_SEARCH is \n# enabled the indexing and searching needs to be provided by external tools. \n# See the manual for details.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP \n# script for searching. Instead the search results are written to an XML file \n# which needs to be processed by an external indexer. Doxygen will invoke an \n# external search engine pointed to by the SEARCHENGINE_URL option to obtain \n# the search results. Doxygen ships with an example indexer (doxyindexer) and \n# search engine (doxysearch.cgi) which are based on the open source search \n# engine library Xapian. See the manual for configuration details.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server \n# which will returned the search results when EXTERNAL_SEARCH is enabled. \n# Doxygen ships with an example search engine (doxysearch) which is based on \n# the open source search engine library Xapian. See the manual for configuration \n# details.\n\nSEARCHENGINE_URL       = \n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed \n# search data is written to a file for indexing by an external tool. With the \n# SEARCHDATA_FILE tag the name of this file can be specified.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the \n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is \n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple \n# projects and redirect the results back to the right project.\n\nEXTERNAL_SEARCH_ID     = \n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen \n# projects other than the one defined by this configuration file, but that are \n# all added to the same external search index. Each project needs to have a \n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id \n# of to a relative location where the documentation can be found. \n# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...\n\nEXTRA_SEARCH_MAPPINGS  = \n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name. \n# Note that when enabling USE_PDFLATEX this option is only used for \n# generating bitmaps for formulas in the HTML output, but not in the \n# Makefile that is written to the output directory.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, letter, legal and \n# executive. If left blank a4 will be used.\n\nPAPER_TYPE             = letter\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for \n# the generated latex document. The footer should contain everything after \n# the last chapter. If it is left blank doxygen will generate a \n# standard footer. Notice: only use this tag if you know what you are doing!\n\nLATEX_FOOTER           = \n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images \n# or other source files which should be copied to the LaTeX output directory. \n# Note that the files will be copied as-is; there are no commands or markers \n# available.\n\nLATEX_EXTRA_FILES      = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n# If LATEX_SOURCE_CODE is set to YES then doxygen will include \n# source code with syntax highlighting in the LaTeX output. \n# Note that which sources are shown also depends on other settings \n# such as SOURCE_BROWSER.\n\nLATEX_SOURCE_CODE      = YES\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the \n# bibliography, e.g. plainnat, or ieeetr. The default style is \"plain\". See \n# http://en.wikipedia.org/wiki/BibTeX for more info.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load style sheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files \n# that can be used to generate PDF.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in \n# front of it. If left blank docbook will be used as the default path.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# pointed to by INCLUDE_PATH will be searched when a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = \n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition that \n# overrules the definition found in the source code.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all references to function-like macros \n# that are alone on a line, have an all uppercase name, and do not end with a \n# semicolon, because these will confuse the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. For each \n# tag file the location of the external documentation should be added. The \n# format of a tag file without this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths \n# or URLs. Note that each tag file must have a unique name (where the name does \n# NOT include the path). If a tag file is not located in the directory in which \n# doxygen is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed \n# in the related pages index. If set to NO, only the current project's \n# pages will be listed.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option also works with HAVE_DOT disabled, but it is recommended to \n# install and use dot, since it yields more powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see \n# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the \n# documentation. The MSCGEN_PATH tag allows you to specify the directory where \n# the mscgen tool resides. If left empty the tool is assumed to be found in the \n# default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = NO\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is \n# allowed to run in parallel. When set to 0 (the default) doxygen will \n# base this on the number of processors available in the system. You can set it \n# explicitly to a value larger than 0 to get control over the balance \n# between CPU load and processing speed.\n\nDOT_NUM_THREADS        = 0\n\n# By default doxygen will use the Helvetica font for all dot files that \n# doxygen generates. When you want a differently looking font you can specify \n# the font name using DOT_FONTNAME. You need to make sure dot is able to find \n# the font, which can be done by putting it in a standard location or by setting \n# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the \n# directory containing the font.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. \n# The default size is 10pt.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the Helvetica font. \n# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to \n# set the path where dot can find it.\n\nDOT_FONTPATH           = \n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = YES\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside \n# the class node. If there are many fields or methods and many nodes the \n# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS \n# threshold limits the number of items for each type to make the size more \n# manageable. Set this to 0 for no limit. Note that the threshold may be \n# exceeded by 50% before the limit is enforced.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH and HAVE_DOT options are set to YES then \n# doxygen will generate a call dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable call graphs \n# for selected functions only using the \\callgraph command.\n\nCALL_GRAPH             = YES\n\n# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then \n# doxygen will generate a caller dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable caller \n# graphs for selected functions only using the \\callergraph command.\n\nCALLER_GRAPH           = YES\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will generate a graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include \n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are svg, png, jpg, or gif. \n# If left blank png will be used. If you choose svg you need to set \n# HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible in IE 9+ (other browsers do not have this requirement).\n\nDOT_IMAGE_FORMAT       = svg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to \n# enable generation of interactive SVG images that allow zooming and panning. \n# Note that this requires a modern browser other than Internet Explorer. \n# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you \n# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible. Older versions of IE do not have SVG support.\n\nINTERACTIVE_SVG        = YES\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\3rd Party\\GraphViz-2.30.1\\release\\bin\"\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that \n# contain msc files that are included in the documentation (see the \n# \\mscfile command).\n\nMSCFILE_DIRS           = \n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen if the \n# number of direct children of the root node in a graph is already larger than \n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n# graphs generated by dot. A depth value of 3 means that only nodes reachable \n# from the root by following a path via at most 3 edges will be shown. Nodes \n# that lay further from the root node will be omitted. Note that setting this \n# option to 1 or 2 may greatly reduce the computation time needed for large \n# code bases. Also note that the size of a graph can be further restricted by \n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, because dot on Windows does not \n# seem to support this out of the box. Warning: Depending on the platform used, \n# enabling this option may lead to badly anti-aliased labels on the edges of \n# a graph (i.e. they become hard to read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = YES\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/HexgridUtilities.HtmlHelp.Doxyfile",
    "content": "# Doxyfile 1.8.4\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file \n# that follow. The default is UTF-8 which is also the encoding used for all \n# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n# iconv built into libc) for the transcoding. See \n# http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or sequence of words) that should \n# identify the project. Note that if you do not use Doxywizard you need \n# to put quotes around the project name if it contains spaces.\n\nPROJECT_NAME           = \"Hexgrid Utilities\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         = \"V 6.4\"\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description \n# for a project that appears at the top of each page and should give viewer \n# a quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Hexgrid Utilities for Board Game Implementations\"\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is \n# included in the documentation. The maximum height of the logo should not \n# exceed 55 pixels and the maximum width should not exceed 200 pixels. \n# Doxygen will copy the logo to the output directory.\n\nPROJECT_LOGO           = \n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\Documentation\\HtmlHelp\"\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, \n# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English \n# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, \n# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, \n# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = YES\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip. Note that you specify absolute paths here, but also \n# relative paths, which will be relative from the directory where doxygen is \n# started.\n\nSTRIP_FROM_PATH        = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful if your file system \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like regular Qt-style comments \n# (thus requiring an explicit @brief command for a brief description.)\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n# interpret the first line (until the first dot) of a Qt-style \n# comment as the brief description. If set to NO, the comments \n# will behave just like regular Qt-style comments (thus requiring \n# an explicit \\brief command for a brief description.)\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# This tag can be used to specify a number of word-keyword mappings (TCL only). \n# A mapping has the form \"name=value\". For example adding \n# \"class=itcl::class\" will allow you to use the command class in the \n# itcl::class meaning.\n\nTCL_SUBST              = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for \n# Java. For instance, namespaces will be presented as packages, qualified \n# scopes will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = YES\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran \n# sources only. Doxygen will then generate output that is more tailored for \n# Fortran.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL \n# sources. Doxygen will then generate output that is tailored for \n# VHDL.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it \n# parses. With this tag you can assign which parser to use for a given \n# extension. Doxygen has a built-in mapping, but you can override or extend it \n# using this tag. The format is ext=language, where ext is a file extension, \n# and language is one of the parsers supported by doxygen: IDL, Java, \n# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, \n# C++. For instance to make doxygen treat .inc files as Fortran files (default \n# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note \n# that for custom extensions you also need to set FILE_PATTERNS otherwise the \n# files are not read by doxygen.\n\nEXTENSION_MAPPING      = \n\n# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all \n# comments according to the Markdown format, which allows for more readable \n# documentation. See http://daringfireball.net/projects/markdown/ for details. \n# The output of markdown processing is further processed by doxygen, so you \n# can mix doxygen, HTML, and XML commands with Markdown formatting. \n# Disable only in case of backward compatibilities issues.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented \n# classes, or namespaces to their corresponding documentation. Such a link can \n# be prevented in individual cases by by putting a % sign in front of the word \n# or globally by setting AUTOLINK_SUPPORT to NO.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n# to include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also makes the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to \n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. \n# Doxygen will parse them like normal C++ but will assume all classes use public \n# instead of private inheritance when no explicit protection keyword is present.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate \n# getter and setter methods for a property. Setting this option to YES (the \n# default) will make doxygen replace the get and set methods by a property in \n# the documentation. This will only work if the methods are indeed getting or \n# setting a simple type. If this is not the case, or you want to show the \n# methods anyway, you should set this option to NO.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and \n# unions are shown inside the group in which they are included (e.g. using \n# @ingroup) instead of on a separate page (for HTML and Man pages) or \n# section (for LaTeX and RTF).\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and \n# unions with only public data fields or simple typedef fields will be shown \n# inline in the documentation of the scope in which they are defined (i.e. file, \n# namespace, or group documentation), provided this scope is documented. If set \n# to NO (the default), structs, classes, and unions are shown on a separate \n# page (for HTML and Man pages) or section (for LaTeX and RTF).\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n# is documented as struct, union, or enum with the name of the typedef. So \n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n# with name TypeT. When disabled the typedef will appear as a member of a file, \n# namespace, or class. And the struct will be named TypeS. This can typically \n# be useful for C code in case the coding convention dictates that all compound \n# types are typedef'ed and only the typedef is referenced, never the tag name.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This \n# cache is used to resolve symbols given their name and scope. Since this can \n# be an expensive process and often the same symbol appear multiple times in \n# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too \n# small doxygen will become slower. If the cache is too large, memory is wasted. \n# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid \n# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 \n# symbols.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal \n# scope will be included in the documentation.\n\nEXTRACT_PACKAGE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be \n# extracted and appear in the documentation as a namespace called \n# 'anonymous_namespace{file}', where file will be replaced with the base \n# name of the file that contains the anonymous namespace. By default \n# anonymous namespaces are hidden.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = YES\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen \n# will list include files with double quotes in the documentation \n# rather than with sharp brackets.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = YES\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen \n# will sort the (brief and detailed) documentation of class members so that \n# constructors and destructors are listed first. If set to NO (the default) \n# the constructors will appear in the respective orders defined by \n# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. \n# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO \n# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.\n\nSORT_MEMBERS_CTORS_1ST = YES\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the \n# hierarchy of group names into alphabetical order. If set to NO (the default) \n# the group names will appear in their defined order.\n\nSORT_GROUP_NAMES       = YES\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. \n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = YES\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to \n# do proper type resolution of all parameters of a function it will reject a \n# match between the prototype and the implementation of a member function even \n# if there is only one candidate or it is obvious which candidate to choose \n# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen \n# will still accept a match between prototype and implementation in such cases.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if section-label ... \\endif \n# and \\cond section-label ... \\endcond blocks.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or macro consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and macros in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. \n# This will remove the Files entry from the Quick Index and from the \n# Folder Tree View (if specified). The default is YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n# Namespaces page.  This will remove the Namespaces entry from the Quick Index \n# and from the Folder Tree View (if specified). The default is YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from \n# the version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed \n# by doxygen. The layout file controls the global structure of the generated \n# output files in an output format independent way. To create the layout file \n# that represents doxygen's defaults, run doxygen with the -l option. \n# You can optionally specify a file name after the option, if omitted \n# DoxygenLayout.xml will be used as the name of the layout file.\n\nLAYOUT_FILE            = \n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files \n# containing the references data. This must be a list of .bib files. The \n# .bib extension is automatically appended if omitted. Using this command \n# requires the bibtex tool to be installed. See also \n# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style \n# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this \n# feature you need bibtex and perl available in the search path. Do not use \n# file names with spaces, bibtex cannot handle them.\n\nCITE_BIB_FILES         = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = NO\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# The WARN_NO_PARAMDOC option can be enabled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  = \"C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/HexGridExampleTemp\"\n\n# This tag can be used to specify the character encoding of the source files \n# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is \n# also the default input encoding. Doxygen uses libiconv (or the iconv built \n# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for \n# the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh \n# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py \n# *.f90 *.f *.for *.vhd *.vhdl\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag. \n# Note that relative paths are relative to the directory from which doxygen is \n# run.\n\nEXCLUDE                = \"./C:/Users/Pieter_2/Documents/Visual Studio 2012/Projects/obj\" \\\n                         \"../HexgridPanel/Reference Source\"\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or \n# directories that are symbolic links (a Unix file system feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = */obj/* \\\n                         *.Designer.cs\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the \n# output. The symbol name can be a fully qualified name, a word, or if the \n# wildcard * is used, a substring. Examples: ANamespace, AClass, \n# AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = WindowStylesEx \\\n                         WM\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be ignored. \n# Note that the filter must not add or remove lines; it is applied before the \n# code is scanned, but not when the output code is generated. If lines are added \n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty or if \n# non of the patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file \n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) \n# and it is also possible to disable source filtering for a specific pattern \n# using *.ext= (so without naming a filter). This option only has effect when \n# FILTER_SOURCE_FILES is enabled.\n\nFILTER_SOURCE_PATTERNS = \n\n# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that \n# is part of the input, its contents will be placed on the main page \n# (index.html). This can be useful if you have a project on for instance GitHub \n# and want reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C, C++ and Fortran comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) \n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from \n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will \n# link to the source code.  Otherwise they will link to the documentation.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser \n# for more acurate parsing at the cost of reduced performance. This can be \n# particularly helpful with template rich C++ code for which doxygen's built-in \n# parser lacks the necessairy type information.\n\nCLANG_ASSISTED_PARSING = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command \n# line options that you would normally use when invoking the compiler. Note that \n# the include paths will already be set by doxygen for the files and directories \n# specified at INPUT and INCLUDE_PATH.\n\nCLANG_OPTIONS          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = YES\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 2\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header. Note that when using a custom header you are responsible  \n# for the proper inclusion of any scripts and style sheets that doxygen \n# needs, which is dependent on the configuration options used. \n# It is advised to generate a default header using \"doxygen -w html \n# header.html footer.html stylesheet.css YourConfigFile\" and then modify \n# that header. Note that the header is subject to change so you typically \n# have to redo this when upgrading to a newer version of doxygen or when \n# changing the value of configuration settings such as GENERATE_TREEVIEW!\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If left blank doxygen will \n# generate a default style sheet. Note that it is recommended to use \n# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this \n# tag will in the future become obsolete.\n\nHTML_STYLESHEET        = \n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional \n# user-defined cascading style sheet that is included after the standard \n# style sheets created by doxygen. Using this option one can overrule \n# certain style aspects. This is preferred over using HTML_STYLESHEET \n# since it does not replace the standard style sheet and is therefor more \n# robust against future updates. Doxygen will copy the style sheet file to \n# the output directory.\n\nHTML_EXTRA_STYLESHEET  = \n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or \n# other source files which should be copied to the HTML output directory. Note \n# that these files will be copied to the base HTML output directory. Use the \n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these \n# files. In the HTML_STYLESHEET file, use the file name only. Also note that \n# the files will be copied as-is; there are no commands or markers available.\n\nHTML_EXTRA_FILES       = \n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. \n# Doxygen will adjust the colors in the style sheet and background images \n# according to this color. Hue is specified as an angle on a colorwheel, \n# see http://en.wikipedia.org/wiki/Hue for more information. \n# For instance the value 0 represents red, 60 is yellow, 120 is green, \n# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. \n# The allowed range is 0 to 359.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of \n# the colors in the HTML output. For a value of 0 the output will use \n# grayscales only. A value of 255 will produce the most vivid colors.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to \n# the luminance component of the colors in the HTML output. Values below \n# 100 gradually make the output lighter, whereas values above 100 make \n# the output darker. The value divided by 100 is the actual gamma applied, \n# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, \n# and 100 does not change the gamma.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML \n# page will contain the date and time when the page was generated. Setting \n# this to NO can help when comparing the output of multiple runs.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n# documentation will contain sections that can be hidden and shown after the \n# page has loaded.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of \n# entries shown in the various tree structured indices initially; the user \n# can expand and collapse entries dynamically later on. Doxygen will expand \n# the tree to such a level that at most the specified number of entries are \n# visible (unless a fully collapsed tree already exceeds this amount). \n# So setting the number of entries 1 will produce a full collapsed tree by \n# default. 0 is a special value representing an infinite number of entries \n# and will result in a full expanded tree by default.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files \n# will be generated that can be used as input for Apple's Xcode 3 \n# integrated development environment, introduced with OSX 10.5 (Leopard). \n# To create a documentation set, doxygen will generate a Makefile in the \n# HTML output directory. Running make will produce the docset in that \n# directory and running \"make install\" will install the docset in \n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find \n# it at startup. \n# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html \n# for more information.\n\nGENERATE_DOCSET        = NO\n\n# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the \n# feed. A documentation feed provides an umbrella under which multiple \n# documentation sets from a single provider (such as a company or product suite) \n# can be grouped.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that \n# should uniquely identify the documentation set bundle. This should be a \n# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen \n# will append .docset to the name.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely \n# identify the documentation publisher. This should be a reverse domain-name \n# style string, e.g. com.mycompany.MyDocSet.documentation.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = YES\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\Projects\\HexGridExampleTemp\\HexgridExample2\\HexgridUtilities.chm\"\n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \"C:/Program Files (x86)/HTML Help Workshop/hhc.exe\"\n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING \n# is used to encode HtmlHelp index (hhk), content (hhc) and project file \n# content.\n\nCHM_INDEX_ENCODING     = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = YES\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and \n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated \n# that can be used as input for Qt's qhelpgenerator to generate a \n# Qt Compressed Help (.qch) of the generated HTML documentation.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can \n# be used to specify the file name of the resulting .qch file. \n# The path specified is relative to the HTML output folder.\n\nQCH_FILE               = \n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#namespace\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n# Qt Help Project output. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#virtual-folders\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to \n# add. For more information please see \n# http://doc.trolltech.com/qthelpproject.html#custom-filters\n\nQHP_CUST_FILTER_NAME   = \n\n# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the \n# custom filter to add. For more information please see \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#custom-filters\"> \n# Qt Help Project / Custom Filters</a>.\n\nQHP_CUST_FILTER_ATTRS  = \n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this \n# project's \n# filter section matches. \n# <a href=\"http://doc.trolltech.com/qthelpproject.html#filter-attributes\"> \n# Qt Help Project / Filter Attributes</a>.\n\nQHP_SECT_FILTER_ATTRS  = \n\n# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n# be used to specify the location of Qt's qhelpgenerator. \n# If non-empty doxygen will try to run qhelpgenerator on the generated \n# .qhp file.\n\nQHG_LOCATION           = \n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  \n# will be generated, which together with the HTML files, form an Eclipse help \n# plugin. To install this plugin and make it available under the help contents \n# menu in Eclipse, the contents of the directory containing the HTML and XML \n# files needs to be copied into the plugins directory of eclipse. The name of \n# the directory within the plugins directory should be the same as \n# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before \n# the help appears.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the eclipse help plugin. When installing the plugin \n# the directory name containing the HTML and XML files should also have \n# this name.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) \n# at top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it. Since the tabs have the same information as the \n# navigation tree you can set this option to NO if you already set \n# GENERATE_TREEVIEW to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index \n# structure should be generated to display hierarchical information. \n# If the tag value is set to YES, a side panel will be generated \n# containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). \n# Windows users are probably better off using the HTML help feature. \n# Since the tree basically has the same information as the tab index you \n# could consider to set DISABLE_INDEX to NO when enabling this option.\n\nGENERATE_TREEVIEW      = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values \n# (range [0,1..20]) that doxygen will group on one line in the generated HTML \n# documentation. Note that a value of 0 will completely suppress the enum \n# values from appearing in the overview section.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open \n# links to external symbols imported via tag files in a separate window.\n\nEXT_LINKS_IN_WINDOW    = YES\n\n# Use this tag to change the font size of Latex formulas included \n# as images in the HTML documentation. The default is 10. Note that \n# when you change the font size after a successful doxygen run you need \n# to manually remove any form_*.png images from the HTML output directory \n# to force them to be regenerated.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images \n# generated for formulas are transparent PNGs. Transparent PNGs are \n# not supported properly for IE 6.0, but are supported on all modern browsers. \n# Note that when changing this option you need to delete any form_*.png files \n# in the HTML output before the changes have effect.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax \n# (see http://www.mathjax.org) which uses client side Javascript for the \n# rendering instead of using prerendered bitmaps. Use this if you do not \n# have LaTeX installed or if you want to formulas look prettier in the HTML \n# output. When enabled you may also need to install MathJax separately and \n# configure the path to it using the MATHJAX_RELPATH option.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for \n# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and \n# SVG. The default value is HTML-CSS, which is slower, but has the best \n# compatibility.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the \n# HTML output directory using the MATHJAX_RELPATH option. The destination \n# directory should contain the MathJax.js script. For instance, if the mathjax \n# directory is located at the same level as the HTML output directory, then \n# MATHJAX_RELPATH should be ../mathjax. The default value points to \n# the MathJax Content Delivery Network so you can quickly see the result without \n# installing MathJax.  However, it is strongly recommended to install a local \n# copy of MathJax from http://www.mathjax.org before deployment.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension \n# names that should be enabled during MathJax rendering.\n\nMATHJAX_EXTENSIONS     = \n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript \n# pieces of code that will be used on startup of the MathJax code.\n\nMATHJAX_CODEFILE       = \n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box \n# for the HTML output. The underlying search engine uses javascript \n# and DHTML and should work on any modern browser. Note that when using \n# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets \n# (GENERATE_DOCSET) there is already a search function so this one should \n# typically be disabled. For large projects the javascript based search engine \n# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.\n\nSEARCHENGINE           = NO\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be \n# implemented using a web server instead of a web client using Javascript. \n# There are two flavours of web server based search depending on the \n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for \n# searching and an index file used by the script. When EXTERNAL_SEARCH is \n# enabled the indexing and searching needs to be provided by external tools. \n# See the manual for details.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP \n# script for searching. Instead the search results are written to an XML file \n# which needs to be processed by an external indexer. Doxygen will invoke an \n# external search engine pointed to by the SEARCHENGINE_URL option to obtain \n# the search results. Doxygen ships with an example indexer (doxyindexer) and \n# search engine (doxysearch.cgi) which are based on the open source search \n# engine library Xapian. See the manual for configuration details.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server \n# which will returned the search results when EXTERNAL_SEARCH is enabled. \n# Doxygen ships with an example search engine (doxysearch) which is based on \n# the open source search engine library Xapian. See the manual for configuration \n# details.\n\nSEARCHENGINE_URL       = \n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed \n# search data is written to a file for indexing by an external tool. With the \n# SEARCHDATA_FILE tag the name of this file can be specified.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the \n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is \n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple \n# projects and redirect the results back to the right project.\n\nEXTERNAL_SEARCH_ID     = \n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen \n# projects other than the one defined by this configuration file, but that are \n# all added to the same external search index. Each project needs to have a \n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id \n# of to a relative location where the documentation can be found. \n# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...\n\nEXTRA_SEARCH_MAPPINGS  = \n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name. \n# Note that when enabling USE_PDFLATEX this option is only used for \n# generating bitmaps for formulas in the HTML output, but not in the \n# Makefile that is written to the output directory.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, letter, legal and \n# executive. If left blank a4 will be used.\n\nPAPER_TYPE             = letter\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for \n# the generated latex document. The footer should contain everything after \n# the last chapter. If it is left blank doxygen will generate a \n# standard footer. Notice: only use this tag if you know what you are doing!\n\nLATEX_FOOTER           = \n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images \n# or other source files which should be copied to the LaTeX output directory. \n# Note that the files will be copied as-is; there are no commands or markers \n# available.\n\nLATEX_EXTRA_FILES      = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n# If LATEX_SOURCE_CODE is set to YES then doxygen will include \n# source code with syntax highlighting in the LaTeX output. \n# Note that which sources are shown also depends on other settings \n# such as SOURCE_BROWSER.\n\nLATEX_SOURCE_CODE      = YES\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the \n# bibliography, e.g. plainnat, or ieeetr. The default style is \"plain\". See \n# http://en.wikipedia.org/wiki/BibTeX for more info.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load style sheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files \n# that can be used to generate PDF.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in \n# front of it. If left blank docbook will be used as the default path.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# pointed to by INCLUDE_PATH will be searched when a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = \n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition that \n# overrules the definition found in the source code.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all references to function-like macros \n# that are alone on a line, have an all uppercase name, and do not end with a \n# semicolon, because these will confuse the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. For each \n# tag file the location of the external documentation should be added. The \n# format of a tag file without this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths \n# or URLs. Note that each tag file must have a unique name (where the name does \n# NOT include the path). If a tag file is not located in the directory in which \n# doxygen is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed \n# in the related pages index. If set to NO, only the current project's \n# pages will be listed.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option also works with HAVE_DOT disabled, but it is recommended to \n# install and use dot, since it yields more powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see \n# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the \n# documentation. The MSCGEN_PATH tag allows you to specify the directory where \n# the mscgen tool resides. If left empty the tool is assumed to be found in the \n# default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = NO\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is \n# allowed to run in parallel. When set to 0 (the default) doxygen will \n# base this on the number of processors available in the system. You can set it \n# explicitly to a value larger than 0 to get control over the balance \n# between CPU load and processing speed.\n\nDOT_NUM_THREADS        = 0\n\n# By default doxygen will use the Helvetica font for all dot files that \n# doxygen generates. When you want a differently looking font you can specify \n# the font name using DOT_FONTNAME. You need to make sure dot is able to find \n# the font, which can be done by putting it in a standard location or by setting \n# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the \n# directory containing the font.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. \n# The default size is 10pt.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the Helvetica font. \n# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to \n# set the path where dot can find it.\n\nDOT_FONTPATH           = \n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = YES\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside \n# the class node. If there are many fields or methods and many nodes the \n# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS \n# threshold limits the number of items for each type to make the size more \n# manageable. Set this to 0 for no limit. Note that the threshold may be \n# exceeded by 50% before the limit is enforced.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH and HAVE_DOT options are set to YES then \n# doxygen will generate a call dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable call graphs \n# for selected functions only using the \\callgraph command.\n\nCALL_GRAPH             = YES\n\n# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then \n# doxygen will generate a caller dependency graph for every global function \n# or class method. Note that enabling this option will significantly increase \n# the time of a run. So in most cases it will be better to enable caller \n# graphs for selected functions only using the \\callergraph command.\n\nCALLER_GRAPH           = YES\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will generate a graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include \n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are svg, png, jpg, or gif. \n# If left blank png will be used. If you choose svg you need to set \n# HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible in IE 9+ (other browsers do not have this requirement).\n\nDOT_IMAGE_FORMAT       = jpg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to \n# enable generation of interactive SVG images that allow zooming and panning. \n# Note that this requires a modern browser other than Internet Explorer. \n# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you \n# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files \n# visible. Older versions of IE do not have SVG support.\n\nINTERACTIVE_SVG        = YES\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \"C:\\Users\\Pieter_2\\Documents\\Visual Studio 2012\\3rd Party\\GraphViz-2.30.1\\release\\bin\"\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that \n# contain msc files that are included in the documentation (see the \n# \\mscfile command).\n\nMSCFILE_DIRS           = \n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen if the \n# number of direct children of the root node in a graph is already larger than \n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n# graphs generated by dot. A depth value of 3 means that only nodes reachable \n# from the root by following a path via at most 3 edges will be shown. Nodes \n# that lay further from the root node will be omitted. Note that setting this \n# option to 1 or 2 may greatly reduce the computation time needed for large \n# code bases. Also note that the size of a graph can be further restricted by \n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, because dot on Windows does not \n# seem to support this out of the box. Warning: Depending on the platform used, \n# enabling this option may lead to badly anti-aliased labels on the edges of \n# a graph (i.e. they become hard to read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = YES\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/MapDefs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  /// <summary>TODO</summary>\n  public static class MapDefinitions {\n\n    #region Map Definitions\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Security\", \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\")]\n    public static readonly IList<string> TerrainMapDefinition = new List<string>() {\n      \"...................3.......22...........R..............\",\n      \"...................3.........222222.....R..............\",\n      \"...................3..............2.....R..............\",\n      \"...................33..............22222F.2.2..........\",\n      \"..........WWRR......3...................R2.2.2222......\",\n      \".........WWRRRR.....3.....HHHH..........R........22....\",\n      \".........WRRRRRRR...3....HHMMHH.........R..........22..\",\n      \"..........RRRRRRR....3....HHHH..........R............22\",\n      \"...........RRRR......3..................R..............\",\n      \"............RR.......3..........RRRRRRRR...............\",\n      \".....................3.........R............WW.........\",\n      \".....................3.........R...........WWWWW.......\",\n      \".....................3.........R............WWW........\",\n      \".....................3.........R.......................\",\n      \".....................3.........RRRRRRRR................\",\n      \"..........WWWWWWW....3.................R...............\",\n      \"........WWWWWWWWW....33................R...............\",\n      \".......WWWWWWWWW.....3.33..............R...............\",\n      \"..........WWWWWWW....3...32222222222222F22222..........\",\n      \"...........WWWWWWW...3...2.............R.....222222....\",\n      \"............WWWWW....32222.............R...........22..\",\n      \"....................22....HHHH........RR.............22\",\n      \"................2222.....HHMMHH.....RR.......WW........\",\n      \"............2222..........HHMHH...RR.......WWWWW.......\",\n      \"........2222...............HHH..RR.........WWWW........\",\n      \"......22......................RR............WW.........\",\n      \"..2222......................RR.........................\",\n      \"22..................RRRRRRRR...........................\",\n      \"..................RR...................................\",\n      \".................RRR...................................\"\n    }.AsReadOnly();\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Security\", \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\")]\n    public static readonly IList<string> MazeMapDefinition = new List<string>() {\n      \".............|.........|.......|.........|.............\",\n      \".............|.........|.......|.........|.............\",\n      \"....xxxxxxxxx|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \"xxxxxxxxx....|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|.....|.............\",\n      \".............|....|....|...|...|...|...................\",\n      \".....xxxxxxxx|....|........|.......|.......xxxxxxxx....\",\n      \"..................|........|.......|.......|......|....\",\n      \"xxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxx......|......|....\",\n      \"................|........|...|.............|...|..|....\",\n      \"xxxxxxxxxxxx....|...|....|...|.............|...|...|...\",\n      \"................|...|....|...|.............|...|...|...\",\n      \"..xxxxxxxxxxxxxxx...|....|...|.............|...|...|...\",\n      \"....................|....|.................|...|...|...\",\n      \"xxxxxxxxxxxxxxxxx..xx....|.................|...|.......\",\n      \".........................|...xxxxxxxxxxxxxxx...|xxxxxxx\",\n      \"xxxxxx...................|...|.................|.......\",\n      \".........xxxxxxxxxxxxxxxxx...|.................|.......\",\n      \".............................|...xxxxxxxxxxxxxx|.......\",\n      \"xxxxxxxxxx......xxxxxxxxxxxxx|...|.....................\",\n      \".............................|...|.....................\",\n      \".............................|...|...xxxxxxxxxxxxx.....\",\n      \"....xxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.................\",\n      \".............................|...|...|..........xxxxxxx\",\n      \"xxxxxxxxxxxxxxxxxxxxxxxxx....|...|...|.....|....|......\",\n      \".............................|...|...|.....|....|......\",\n      \"...xxxxxxxxxxxxxxxxxxxxxxxxxx|...|...|.....|....|......\",\n      \".............................|.......|.....|...........\",\n      \".............................|.......|.....|...........\"\n    }.AsReadOnly();\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Security\", \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\")]\n    public static readonly IList<string> AStarBugMapDefinition = new List<string>() {\n      \".2333333333R..........2\",\n      \".2........R33333333.22.\",\n      \".2.......R........22...\",\n      \".2......RR......22...RR\",\n      \"R2RRRRRR.......2.......\",\n      \".2.....R.......2....RR.\",\n      \".2.....R.......2.....RR.\",\n      \".2.....R.......2......R.\"\n    }.AsReadOnly();\n    #endregion\n\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/MapList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridExampleCommon;\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using MapGridHex      = Hex<System.Drawing.Graphics,System.Drawing.Drawing2D.GraphicsPath>;\n\n  /// <summary>TODO</summary>\n  public delegate MapDisplay<MapGridHex> MapExtractor();\n\n  /// <summary>TODO</summary>\n  public struct Map {\n    /// <summary>TODO</summary>\n    public string MapName { get; private set; }\n    /// <summary>TODO</summary>\n    public MapDisplay<MapGridHex> MapBoard { get { return _mapExtractor(); } } MapExtractor _mapExtractor;\n\n    /// <summary>TODO</summary>\n    public Map(string mapName, MapExtractor mapExtractor)\n      : this() {\n      MapName = mapName;\n      _mapExtractor = mapExtractor;\n    }\n\n    private static IList<Map> _mapList = \n        new ReadOnlyCollection<Map>(new Map[] {\n            new Map(\"Terrain Map\",   () => new TerrainMap()),\n            new Map(\"Maze Map\",      () => new MazeMap()),\n            new Map(\"AStar Bug Map\", () => new AStarBugMap())\n          } );\n\n    /// <summary>TODO</summary>\n    public static IList<Map> MapList { get { return _mapList; } }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) {\n      var other = obj as Map?;\n      return other.HasValue && this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return MapName.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(Map other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator !=(Map lhs, Map rhs) { return !(lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator ==(Map lhs, Map rhs) { return (lhs.MapName == rhs.MapName); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/MazeGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>Abstract class for <c>MapGridHex</c> as used in the MazeGrid example.</summary>\n  internal abstract class MazeGridHex : MapGridHex {\n    /// <summary>Initializes a new instance of a <see cref=\"MazeGridHex\"/>.</summary>\n    /// <param name=\"hexgridPath\"></param>\n    /// <param name=\"coords\">Board location of this hex.</param>\n    /// <param name=\"elevation\">Elevation of this hex.</param>\n    protected MazeGridHex(GraphicsPath hexgridPath, HexCoords coords, int elevation)\n      : base(coords, elevation) {\n      HexgridPath = hexgridPath;\n    }\n\n    ///  <inheritdoc/>\n    public          GraphicsPath  HexgridPath   { get; private set; }\n  }\n\n  /// <summary>A <c>MazeGridHex</c> representing a passable hex in the maze.</summary>\n  internal sealed class PathMazeGridHex : MazeGridHex {\n    /// <summary>Create a new instance of a passable <c>MazeGridHex</c>.</summary>\n    /// <param name=\"hexgridPath\">Reference to the mapboard on which this hex sits.</param>\n    /// <param name=\"coords\">Location of the new hex.</param>\n    public PathMazeGridHex(GraphicsPath hexgridPath, HexCoords coords) \n      : base(hexgridPath, coords,0) {\n    }\n\n    /// <inheritdoc/>\n    public override int  HeightTerrain  { get { return 0; } }\n    /// <inheritdoc/>\n    public override int  StepCost(Hexside direction) { return  1; }\n    ///  <inheritdoc/>\n    public override void Paint(Graphics graphics) { ; }\n  }\n\n  /// <summary>A <c>MazeGridHex</c> representing an impassable hex, or wall, in the maze.</summary>\n  internal sealed class WallMazeGridHex : MazeGridHex {\n    /// <summary>Create a new instance of an impassable <c>MazeGridHex</c>.</summary>\n    /// <param name=\"hexgridPath\">Reference to the mapboard on which this hex sits.</param>\n    /// <param name=\"coords\">Location of the new hex.</param>\n    public WallMazeGridHex(GraphicsPath hexgridPath, HexCoords coords) \n      : base(hexgridPath, coords,1) {\n    }\n\n    /// <inheritdoc/>\n    public override int  HeightTerrain  { get { return 10; } }\n    /// <inheritdoc/>\n    public override int  StepCost(Hexside direction) { return -1; }\n    ///  <inheritdoc/>\n    public override void Paint(Graphics graphics) {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n        graphics.FillPath(brush, HexgridPath);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/MazeMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using MapGridHex   = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>Example of <see cref=\"HexUtilities\"/> usage with <see cref=\"HexgridPanel\"/> to implement\n  /// a maze map.</summary>\n  public sealed class MazeMap : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public MazeMap() : base(_sizeHexes, new Size(26,30), InitializeHex) {}\n\n    /// <inheritdoc/>\n    public override int   Heuristic(int range) { return range; }\n\n    /// <inheritdoc/>\n    public override bool  IsPassable(HexCoords coords) { \n      return base.IsPassable(coords)  &&  this[coords].ElevationLevel == 0; \n    }\n\n    /// <inheritdoc/>\n    public override void PaintUnits(Graphics graphics) { ; }\n\n    #region static Board definition\n    static IList<string> _board     = MapDefinitions.MazeMapDefinition;\n    static Size          _sizeHexes = new Size(_board[0].Length, _board.Count);\n    #endregion\n\n    private new static MapGridHex InitializeHex(GraphicsPath hexgridPath, HexCoords coords) {\n      switch (_board[coords.User.Y][coords.User.X]) {\n        case '.': return new PathMazeGridHex(hexgridPath, coords);\n        default:  return new WallMazeGridHex(hexgridPath, coords);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/MyMapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\nnamespace HexgridExampleCommon {\n  /// <summary>TODO</summary>\n  public class MyMapDisplay : MapDisplay<MapGridHex> {\n    #region Constructors\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MyMapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<MapGridHex>, HexCoords, MapGridHex> initializeHex) \n    : base(sizeHexes, gridSize, initializeHex) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MyMapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<MapGridHex>, HexCoords, MapGridHex> initializeHex, \n                       ReadOnlyCollection<HexCoords> landmarkCoords) \n    : base(sizeHexes, gridSize, initializeHex, landmarkCoords) {}\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Resources;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleCommon\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleCommon\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"2cdda541-1494-415c-b276-04a65e32c141\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\n\n[assembly:CLSCompliant(true)]\n\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleCommon.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    public class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleCommon.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}.\n        /// </summary>\n        public static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexGridExampleCommon/TerrainGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using MapGridHex  = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>Abstract class for <c>MapGridHex</c> as used in the TerrainGridHex example.</summary>\n  internal abstract class TerrainGridHex : MapGridHex {\n\n    /// <summary>Initializes a new instance of a <see cref=\"TerrainGridHex\"/>.</summary>\n    /// <param name=\"hexgridPath\"></param>\n    /// <param name=\"coords\">Board location of this hex.</param>\n    /// <param name=\"elevationLevel\">Elevation of this hex.</param>\n    protected TerrainGridHex(GraphicsPath hexgridPath, HexCoords coords, int elevationLevel) \n    : base(coords,elevationLevel) {\n      HexgridPath = hexgridPath;\n    }\n\n    ///  <inheritdoc/>\n    public             GraphicsPath HexgridPath   { get; private set; }\n    /// <summary>TODO</summary>\n    protected virtual  Brush        HexBrush      { get {return Brushes.Transparent;} }\n    ///  <inheritdoc/>\n    public    override int          HeightTerrain { get {return 0;} }\n    ///  <inheritdoc/>\n    public    override void         Paint(Graphics graphics) { \n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      graphics.FillPath(HexBrush, HexgridPath);\n    }\n    ///  <inheritdoc/>\n    public    override int          StepCost(Hexside direction) { return  4; }\n  }\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing clear terrain.</summary>\n  internal sealed class ClearTerrainGridHex    : TerrainGridHex {\n    /// <summary>Creates a new instance of a clear <see cref=\"TerrainGridHex\"/>.</summary>\n    public ClearTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    public    override void Paint(Graphics g) { ; }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing a river ford.</summary>\n  internal sealed class FordTerrainGridHex     : TerrainGridHex {\n    /// <summary>Creates a new instance of a ford <see cref=\"TerrainGridHex\"/>.</summary>\n    public FordTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    protected override Brush HexBrush { get { return Brushes.Brown; } }\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  5; }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing a river (impassable terrain).</summary>\n  internal sealed class RiverTerrainGridHex    : TerrainGridHex {\n    /// <summary>Creates a new instance of a river <see cref=\"TerrainGridHex\"/>.</summary>\n    public RiverTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    protected override Brush HexBrush { get { return Brushes.DarkBlue; } }\n\n    /// <summary>This hex type is always impassable.</summary>\n    public    override int   StepCost(Hexside direction) { return -1; }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing a pike (ie a major road).</summary>\n  internal sealed class PikeTerrainGridHex     : TerrainGridHex {\n    public PikeTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  2; }\n    /// <inheritdoc/>\n    public    override void  Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.DarkGray)))\n        g.FillPath(brush, HexgridPath); \n    }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing a (secondary) road..</summary>\n  internal sealed class RoadTerrainGridHex     : TerrainGridHex {\n    public RoadTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  3; }\n    /// <inheritdoc/>\n    public    override void  Paint(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(Color.FromArgb(78,Color.SaddleBrown)))\n        g.FillPath(brush, HexgridPath); \n    }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing elevated terrain.</summary>\n  internal sealed class HillTerrainGridHex     : TerrainGridHex {\n    public HillTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,1) { }\n\n    /// <inheritdoc/>\n    protected override Brush HexBrush  { get { return Brushes.Khaki; } }\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  5; }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing double elevated terrain.</summary>\n  internal sealed class MountainTerrainGridHex : TerrainGridHex {\n    public MountainTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,2) {}\n\n    /// <inheritdoc/>\n    protected override Brush HexBrush  { get { return Brushes.DarkKhaki; } }\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  6; }\n  }\n\n  /// <summary>A <see cref=\"TerrainGridHex\"/> representing forested terrain.</summary>\n  internal sealed class WoodsTerrainGridHex    : TerrainGridHex {\n    public WoodsTerrainGridHex(GraphicsPath hexgridPath, HexCoords coords) : base(hexgridPath,coords,0) { }\n\n    /// <inheritdoc/>\n    public    override int   HeightTerrain { get { return 7; } }\n    /// <inheritdoc/>\n    protected override Brush HexBrush      { get { return Brushes.Green; } }\n    /// <inheritdoc/>\n    public    override int   StepCost(Hexside direction) { return  8; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexGridExampleCommon/TerrainMap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing.Drawing2D;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\n\n#pragma warning disable 1587\n/// <summary>TODO</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridExampleCommon {\n  using HexSize  = System.Drawing.Size;\n  using Graphics = System.Drawing.Graphics;\n\n  using MapGridHex      = Hex<System.Drawing.Graphics,GraphicsPath>;\n\n  /// <summary>Example of <see cref=\"HexUtilities\"/> usage with <see cref=\"HexgridPanel\"/> to implement\n  /// a terrain map.</summary>\n  public sealed class TerrainMap : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public TerrainMap() : base(_sizeHexes, new HexSize(26,30), InitializeHex) {}\n\n    /// <inheritdoc/>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\",\n      MessageId = \"2*range\", Justification=\"No map is big enough to overflow,\")]\n    public override int   Heuristic(int range) { return 2 * range; }\n\n    /// <inheritdoc/>\n    public override void PaintUnits(Graphics graphics) { ; }\n\n    #region static Board definition\n    static IList<string> _board     = MapDefinitions.TerrainMapDefinition;\n    static HexSize       _sizeHexes = new HexSize(_board[0].Length, _board.Count);\n    #endregion\n\n    private new static MapGridHex InitializeHex(GraphicsPath hexgridPath, HexCoords coords) {\n      char value = _board[coords.User.Y][coords.User.X];\n      switch(value) {\n        default:   \n        case '.':  return new ClearTerrainGridHex   (hexgridPath, coords);\n        case '2':  return new PikeTerrainGridHex    (hexgridPath, coords);\n        case '3':  return new RoadTerrainGridHex    (hexgridPath, coords);\n        case 'F':  return new FordTerrainGridHex    (hexgridPath, coords);\n        case 'H':  return new HillTerrainGridHex    (hexgridPath, coords);\n        case 'M':  return new MountainTerrainGridHex(hexgridPath, coords);\n        case 'R':  return new RiverTerrainGridHex   (hexgridPath, coords);\n        case 'W':  return new WoodsTerrainGridHex   (hexgridPath, coords);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/DebugTracing.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>enumerationof known debugging trace flags.</summary>\n  [Flags]public enum Traces  {\n    /// <summary>TODO</summary>\n    None            = 0x00000,\n    /// <summary>TODO</summary>\n    Caching         = 0x00001,\n    /// <summary>TODO</summary>\n    FieldOfView     = 0x00002,\n    /// <summary>TODO</summary>\n    Mouse           = 0x00004,\n    /// <summary>TODO</summary>\n    MouseMove       = 0x00008,\n    /// <summary>TODO</summary>\n    MainForm        = 0x00010,\n    /// <summary>TODO</summary>\n    Initialization  = 0x00020,\n    /// <summary>TODO</summary>\n    Docking         = 0x00040,\n    /// <summary>TODO</summary>\n    MenuEvents      = 0x00080,\n    /// <summary>TODO</summary>\n    KeyEvents       = 0x00100,\n    /// <summary>TODO</summary>\n    Sizing          = 0x00200,\n    /// <summary>TODO</summary>\n    ScrollEvents    = 0x00400,\n    /// <summary>TODO</summary>\n    ToolTipEvents   = 0x00800,\n    /// <summary>TODO</summary>\n    Paint           = 0x01000,\n    /// <summary>TODO</summary>\n    PaintMap        = 0x02000,\n    /// <summary>TODO</summary>\n    PaintDetail     = 0x04000,\n    /// <summary>TODO</summary>\n    FindPathEnqueue = 0x08000,\n    /// <summary>TODO</summary>\n    FindPathDequeue = 0x10000,\n    /// <summary>TODO</summary>\n    FindPathDetail  = 0x20000,\n    /// <summary>TODO</summary>\n    FindPathShortcut= 0x40000\n  }\n\n  internal static partial class NativeMethods {\n    [StructLayout(LayoutKind.Sequential)]\n    internal sealed class SystemTime {\n      public ushort year;\n      public ushort month;\n      public ushort weekday;\n      public ushort day;\n      public ushort hour;\n      public ushort minute;\n      public ushort second;\n      public ushort millisecond;\n\n      public override string ToString() {\n        return string.Format(CultureInfo.InvariantCulture,\"{0,2}:{1,2}:{2,2}.{3,3}\", \n          this.hour, this.minute, this.second, this.millisecond);\n      }\n    }\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"Kernel32.dll\")]\n    internal static extern void GetSystemTime([In,Out] SystemTime st);\n  }\n\n  /// <summary>TODO</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public static partial class DebugTracing {\n    /// <summary>TODO</summary>\n    public static Traces EnabledTraces { get; set; }\n\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, string format, params object[] args) {\n      Trace(traces, false, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, bool newLine, string format, params object[] args) {\n      Trace(traces, newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n#if ! TRACE\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n#endif\n    public static void Trace(Traces traces, bool newLine, string description) {\n      TraceDetail(traces, newLine, description);\n    }\n\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string format, params object[] args) {\n      LogTime(traces, false, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, bool newLine, string format, params object[] args) {\n      LogTime(traces, newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string description) {\n      LogTime(traces, false, description);\n    }\n    /// <summary>TODO</summary>\n#if ! TRACE\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n#endif\n    public static void LogTime(Traces traces, bool newLine, string description) {\n      LogTimeDetail(traces, newLine, description);\n    }\n\n    static partial void TraceDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void TraceDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        System.Diagnostics.Trace.WriteLine(description);\n      }\n    }\n\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        var st = new NativeMethods.SystemTime();\n        NativeMethods.GetSystemTime(st);\n\n        System.Diagnostics.Trace.Write(\"{0} - \", st.ToString());\n        Trace(traces, false, description);\n      }\n    }\n  }\n\n    /// <summary>TODO</summary>\n  public static partial class Extensions {\n    #if TRACE\n      public static void Trace(this Traces @this, string format, params object[] args) {\n        DebugTracing.Trace(@this,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.Trace(@this,newLine,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string description) {\n        DebugTracing.Trace(@this,newLine,description);\n      }\n\n      public static void LogTime(this Traces @this, string format, params object[] args) {\n        DebugTracing.LogTime(@this,format,args);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.LogTime(@this,newLine,format,args);\n      }\n      public static void LogTime(this Traces @this, string description) {\n        DebugTracing.LogTime(@this,description);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string description) {\n        DebugTracing.LogTime(@this,newLine,description);\n      }\n    #else\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void Trace(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string description) {}\n\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void LogTime(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      public static void LogTime(this Traces @this, string description) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      public static void LogTime(this Traces @this, bool newLine, string description) {}\n    #endif\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/EnumExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.Reflection;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Type-safe extension methods for parsing Enums.</summary>\n    public static partial class EnumExtensions{\n      #region Enum Parsing utilities\n      /// <summary>Typesafe wrapper for <c>Enum.GetValues(typeof(TEnum).</c></summary>\n      public static IList<TEnum> EnumGetValues<TEnum>() {\n        return new List<TEnum>((TEnum[])(Enum.GetValues(typeof(TEnum)))).AsReadOnly();\n      }\n\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Design\", \"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n      [Obsolete(\"Less useful or convenient than originally thought - just use Enum.GetNames({TEnum}).\")]\n      public static IList<string> EnumGetNames<TEnum>() where TEnum : struct {\n        return new List<string>((string[])(Enum.GetNames(typeof(TEnum)))).AsReadOnly();\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value) where TEnum : struct {\n        return ParseEnum<TEnum>(value,true,false);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value, bool checkConstants, bool ignoreCase) where TEnum : struct {\n        TEnum enumValue;\n        if (!TryParseEnum<TEnum>(value, ignoreCase, out enumValue) && checkConstants) \n              throw new ArgumentOutOfRangeException(\"value\",value,\"Enum type: \" + typeof(TEnum).Name);\n\n        return enumValue;\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static bool TryParseEnum<TEnum>(string value, out TEnum enumValue) where TEnum : struct {\n        return Enum.TryParse<TEnum>(value, out enumValue)  \n           &&  Enum.IsDefined(typeof(TEnum),enumValue);\n      }\n      /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static bool TryParseEnum<TEnum>(string value, bool ignoreCase, out TEnum enumValue) where TEnum : struct {\n        return Enum.TryParse<TEnum>(value, ignoreCase, out enumValue)  \n           &&  Enum.IsDefined(typeof(TEnum),enumValue);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ToObject()</c>.</summary>\n      /// <typeparam name=\"TEnum\"></typeparam>\n      public static TEnum EnumParse<TEnum>(char c, string lookup) {\n        if (lookup==null) throw new ArgumentNullException(\"lookup\");\n        var index = lookup.IndexOf(c);\n        if (index == -1) throw new ArgumentOutOfRangeException(\"c\",c,\"Enum Type: \" + typeof(TEnum).Name);\n\n        return (TEnum) Enum.ToObject(typeof(TEnum), index);\n      }\n      #endregion\n    }\n}\n#region Deprecated code\nnamespace PGNapoleonics.HexUtilities.Common {\nusing System.IO;\n  public static partial class EnumExtensions{\n    #region InvalidDataException Throwers\n    /// <summary>Deprecated</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(MemberInfo type, object data) {\n      if (type == null) \n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"Unknown: Invalid: '{0}'\", data));\n      else\n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"{1}: Invalid: '{0}'\", data, type.Name));\n    }\n    ///  <summary>Deprecated:</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(string parseType, int lineNo, \n      object section, string error, Exception ex, object data) {\n      throw new InvalidDataException(\n          string.Format(CultureInfo.InvariantCulture,\n            \"{0}: {3}\\n  for section {2} on line # {1}:\\n   {4}\",  \n              parseType, lineNo, section, error, data), ex);\n    }\n    #endregion\n  }\n}\n#endregion"
  },
  {
    "path": "codeplex/HexInterfaces/Common/Extensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class EventHandlerExtensions {\n    /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler<T> @this, object sender, T e) \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this PropertyChangedEventHandler @this, object sender, T e)  \n      where T : PropertyChangedEventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler @this, object sender, T e)  \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/FastList.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Joe Duffy's Simple (Fast) List enumerator.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common {\n\n  #region Default implementations\n  /// <inheritdoc/>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  public sealed class FastList<TItem> : AbstractFastList<TItem> {\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    public FastList(TItem[] array) : base(array) { }\n  }\n\n  /// <inheritdoc/>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  public sealed class FastListDisposable<TItem> : AbstractFastList<TItem>, IDisposable \n    where TItem : IDisposable {\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    public FastListDisposable(TItem[] array) : base(array)  { }\n\n    #region IDisposable implementation with Finalizer\n    private bool _isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    private void Dispose(bool disposing) {\n      if (! _isDisposed  &&  disposing) {\n        ForEach ( item => item.Dispose() );\n        _array = null;\n      }\n      _isDisposed = true;\n    }\n    #endregion\n  }\n  #endregion\n\n\n  /// <summary>Adapted implementation of Joe Duffy's Simple (Fast) List enumerator.</summary>\n  /// <remarks>\n  /// <a href=\"http://www.bluebytesoftware.com/blog/2008/09/21/TheCostOfEnumeratingInNET.aspx\">\n  /// The Cost of Enumeration in DotNet</a>\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The Type of the Item to be stored and iterated over.</typeparam>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  private abstract class AbstractFastList<TItem> : IFastList<TItem> {\n    ///// <summary>Returns a new instance from <paramref name=\"array\"/>.</summary>\n    //[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n    //[SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\")]\n    //public static IFastList<TItem> NewDisposableFastList(TItem[] array) {\n    //  AbstractFastList<TItem>.FastListDisposable tempFastList = null;\n    //  AbstractFastList<TItem>.FastListDisposable fastList     = null;\n    //  try {\n    //    tempFastList = new FastListDisposable(array);\n    //    fastList     = tempFastList;\n    //    tempFastList = null;\n    //  } finally { if (tempFastList != null) tempFastList.Dispose(); }\n\n    //  return fastList;\n    //}\n\n    /// <summary>TODO</summary>\n    internal TItem[] _array;\n\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    protected AbstractFastList(TItem[] array) { _array = array; }\n\n    /// <inheritdoc/>>\n    public IEnumerator<TItem>                     GetEnumerator(){\n      return new ClassicEnumerable<TItem>(_array);\n    }\n    IEnumerator                       IEnumerable.GetEnumerator() {return this.GetEnumerator();}\n    IFastEnumerator<TItem> IFastEnumerable<TItem>.GetEnumerator(){\n      return new FastEnumerable<TItem>(_array);\n    }\n\n    /// <summary>IForEachable{TItem} implementation.</summary>\n    public void  ForEach(Action<TItem> action) {\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    action(a[i]);\n    }\n\n    /// <summary>IForEachable2{TItem} implementation</summary>\n    public void  ForEach(FastIteratorFunctor<TItem> functor) {\n      if (functor==null) throw new ArgumentNullException(\"functor\");\n\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    functor.Invoke(a[i]);\n    }\n\n    /// <inheritdoc/>\n    public int   Count               { get {return _array.Length;} }\n    /// <inheritdoc/>\n    public TItem this[int index]     { get { return _array[index]; } }\n    /// <inheritdoc/>\n    public int   IndexOf(TItem item) { return Array.IndexOf(_array, item); }\n  }\n\n  /// <summary>Optimized ForEach.</summary>\n  /// <remarks>\n  /// The idea behind IFastEnumerable{TItem} (and specifically IFastEnumerator{TItem}) is to return\n  /// the current element during the call to MoveNext itself.  This cuts the number of\n  /// interface method calls necessary to enumerate a list in half.  The impact to performance\n  /// isn’t huge, but it was enough to cut our overhead from about 3X to 2.3X.  Every little\n  /// bit counts.\n  /// </remarks>\n  /// <typeparam name=\"TItem\"></typeparam>\n  public interface IFastEnumerable<TItem> {\n    /// <summary>Returns the items of a list in order.</summary>\n    IFastEnumerator<TItem> GetEnumerator();\n  }\n\n  /// <summary>Returns the items of a list in order.</summary>\n  public interface IFastEnumerator<T>{\n    /// <summary>Return the next item in the enumeration.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1045:DoNotPassTypesByReference\", MessageId = \"0#\")]\n    bool MoveNext(ref T item);\n  }\n\n  /// <summary>Delegated ForEach - <c>action</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// The IForEachable{T} interface is a push model: the caller provides a delegate and the \n  /// ForEach method is responsible for invoking it once per element in the collection.\n  /// ForEach doesn’t return until this is done.  In addition to having far fewer method\n  /// calls to enumerate a collection, neighbour isn’t a single interface method call.\n  /// Delegate dispatch is also much faster than interface method dispatch.  The result is\n  /// nearly twice as fast as the classic IEnumerator{T} pattern (when /o+ isn’t defined).  \n  /// Now we’re really getting somewhere!\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable<TItem>{\n    /// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n    void ForEach(Action<TItem> action);\n  }\n\n  /// <summary>Functored ForEach - <c>functor</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// Clients will pass an instance of the Functor{T} class with the Invoke method\n  /// overridden.  The implementation of ForEach then looks quite a bit like \n  /// IForEachable{T}’s, just with virtual method calls in place of delegate calls:\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable2<TItem> {\n    /// <summary>Perform the action specified by <paramref name=\"functor\"/> for every item in the enumeration.</summary>\n    void ForEach(FastIteratorFunctor<TItem> functor);\n  }\n\n  /// <summary>TODO</summary>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n  public interface IFastList<TItem> : IEnumerable<TItem>,\n    IFastEnumerable<TItem>, IForEachable<TItem>, IForEachable2<TItem> {\n    /// <summary>Gets the item at location <paramref name=\"index\"/>.</summary>\n    TItem this[int index] { get; }\n\n    /// <summary>Returns the current size of the list.</summary>\n    int Count { get; }\n\n    /// <summary>Returns the index of the specified item in the internal array storage.</summary>\n    /// <param name=\"item\"></param>\n    int IndexOf(TItem item);\n  }\n\n  /// <summary>Abstract base class for a <c>FastList</c> functor.</summary>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public abstract class FastIteratorFunctor<TItem>{\n    /// <summary>Perform the action associated with this functor on <paramref name=\"item\"/>.</summary>\n    public abstract void Invoke(TItem item);\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>standard</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class ClassicEnumerable<TItem> : IEnumerator<TItem> {\n    internal ClassicEnumerable(TItem[] a) { _a = a; }\n\n    private TItem[] _a;\n    private int     _index = -1;  ///< Index of the currently-enumerated element.\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool   MoveNext() { return ++_index < _a.Length; }\n\n    /// <summary>Return the current item in the enumeration</summary>\n    public TItem       Current  { get { return _a[_index]; } }\n    object IEnumerator.Current  { get { return Current; } }\n\n    /// <summary>Reset the enumerator to the start of the enumeration.</summary>\n    public void Reset() { _index = -1; }\n\n    #region IDisposable implementation with Finalizer\n    private bool _isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    private void Dispose(bool disposing) {\n      if (! _isDisposed  &&  disposing  &&  typeof(TItem).GetInterfaces().Contains(typeof(IDisposable))) {\n        foreach(var i in _a) ((IDisposable)i).Dispose();\n      }\n      _isDisposed = true;\n    }\n    #endregion\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>fast</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class FastEnumerable<TItem> : IFastEnumerator<TItem> {\n    /// <summary>Construct a new instance from array <c>a</c>.</summary>\n    /// <param name=\"a\">The array of type <c>TItem</c> to make enumerable.</param>\n    internal FastEnumerable(TItem[] a) { _array = a; } \n\n    private TItem[] _array;\n    private int     _index = -1;\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool MoveNext(ref TItem item) {\n      var a = _array;\n      int i;\n      if ((i = ++_index) >= a.Length)     return false;\n      item = a[i];\n      return true;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public static class ArrayExtensions {\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this T[] @this) {\n      return new FastList<T>(@this);\n    }\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this IList<T> @this) {\n      return new FastList<T>(@this.ToArray());\n    }\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this IEnumerable<T> @this) {\n      return new FastList<T>(@this.ToArray());\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/ImmutableStack.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Eric Lippert's implementation for use in A*.</summary>\n  /// <remarks>An implementation of immutable stack for use in A* as a 'Path to here'..</remarks>\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx\">Path Finding Using A* Part THree</a>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ImmutableStackCollection<T> : IEnumerable<T> {\n\n    /// <summary>Gets the top item on the stack.</summary>\n    public T                 TopItem      { get; private set; }\n    /// <summary>Gets the remainder of the stack.</summary>\n    public ImmutableStackCollection<T> Remainder    { get; private set; }\n    /// <summary>Returns a new ImmutableStack by adding <paramref name=\"item\"/> to this stack.</summary>\n    public ImmutableStackCollection<T> Push(T item) { return new ImmutableStackCollection<T>(item, this); }\n\n    /// <summary>Construct a new empty instance.</summary>\n    public ImmutableStackCollection(T start) : this(start, null) {}\n    /// <summary>Construct a new instance by Push-ing <paramref name=\"item\"/> onto <paramref name=\"remainder\"/>.</summary>\n    private ImmutableStackCollection(T item, ImmutableStackCollection<T> remainder) {\n      TopItem   = item;\n      Remainder = remainder;\n    }\n\n    /// <summary>Returns the stackitems in order from top to bottom.</summary>\n    public IEnumerator<T> GetEnumerator() {\n      for (ImmutableStackCollection<T> p = this; p != null; p = p.Remainder)  yield return p.TopItem;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/IntMatrix2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Row-major order representation of an immutable integer @this.</summary>\n  /// <remarks> Represents Points as row vectors and planes as column vectors.\n  /// This representation is standard for computer graphics, though opposite \n  /// to standard mathematical (and physics) representation, and treats \n  /// row vectors as contravariant and column vectors as covariant.</remarks>\n  [DebuggerDisplay(\"(({M11},{M12}), ({M21},{M22}), ({M31},{M32}), {M33}))\")]\n  public struct IntMatrix2D : IEquatable<IntMatrix2D>, IFormattable {\n    static IntMatrix2D TransposeMatrix = new IntMatrix2D(0,1, 1,0);\n    /// <summary>TODO</summary>\n    public static IntMatrix2D Transpose(IntMatrix2D matrix) {\n      return matrix * TransposeMatrix;\n    }\n\n    #region Properties\n    /// <summary>Get the i-scale component.</summary>\n    public int M11 { get; private set; }\n    /// <summary>Get the X-shear component</summary>\n    public int M12 { get; private set; }\n    /// <summary>Get the j-shear component</summary>\n    public int M21 { get; private set; }\n    /// <summary>Get the Y-scale component</summary>\n    public int M22 { get; private set; }\n    /// <summary>Get the i-translation component</summary>\n    public int M31 { get; private set; }\n    /// <summary>Get the j-translationcomponent</summary>\n    public int M32 { get; private set; }\n    /// <summary>Ge the normalization component</summary>\n    public int M33 { get; private set; }\n    /// <summary>Get the identity @this.</summary>\n    public static readonly IntMatrix2D Identity = new IntMatrix2D(1,0,0,1,0,0, 1);\n\n    /// <summary>Returns the matrix elements as an array of <c>int</c>.</summary>\n    /// <param name=\"i\"></param>\n    /// <returns></returns>\n    public int this[int i] { get {  return (new int[] {M11,M12,M21,M22,M31,M32})[i];} }\n    #endregion\n\n    #region Constructors\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector vector.</summary>\n    /// <param name=\"vector\">the translation vector</param>\n    public IntMatrix2D(IntVector2D vector)  : this(1,0, 0,1, vector.X,vector.Y, 1) {}\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation (dx,dy).</summary>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int dx, int dy)  : this(1,0, 0,1, dx,dy,1) {}\n    /// <summary> Initialies a new <code>IntMatrix2D</code> with a rotation.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1025:ReplaceRepetitiveArgumentsWithParamsArray\")]\n    public IntMatrix2D(int m11, int m12, int m21, int m22) : this(m11,m12, m21,m22, 0,0, 1) {}\n    /// <summary>Copy Constructor for a new <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m\">Source IntegerMatrix</param>\n    public IntMatrix2D(IntMatrix2D m) : this(m.M11,m.M21, m.M12,m.M22, m.M31,m.M32, m.M33) { }\n    /// <summary>Initializes a new fully-specificed <code>IntMatrix2D</code> .</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy) : this(m11,m12,m21,m22,dx,dy,1) {}\n    /// <summary>Initializes a new fully-specificed non-normed <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    /// <param name=\"norm\">Normalization component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy, int norm) : this() {\n//      if (norm <= 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter norm must be > 0.\");\n      if (norm <= 0) norm = 1;\n      M11 = m11;  M12 = m12;\n      M21 = m21;  M22 = m22;\n      M31 = dx;   M32 = dy;   M33 = norm;\n    }\n    #endregion\n\n    #region operators\n    /// <summary>(Contravariant) Vector transformation by a matrix.</summary>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <returns>New IntVector2D resulting from application of vector <c>v</c> to matrix <c>m</c>.</returns>\n    public static IntVector2D operator * (IntVector2D v, IntMatrix2D m) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M21 + m.M31,   v.X * m.M12 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>(Covariant) Vector transformation by a matrix.</summary>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <returns>New IntVector2D resulting from application of matrix<c>m</c> to vector <c>v</c>.</returns>\n    [Obsolete(\"The standard in PGNapoleonics is to use Contravariant (ie column) vectors.\")]\n    public static IntVector2D operator * (IntMatrix2D m, IntVector2D v) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M12 + m.M31,   v.X * m.M21 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>Matrix multiplication.</summary>\n    /// <param name=\"m1\">Prepended transformation.</param>\n    /// <param name=\"m2\">Appended transformation.</param>\n    /// <returns></returns>\n    public static IntMatrix2D operator * (IntMatrix2D m1, IntMatrix2D m2) {\n      return new IntMatrix2D (\n        m1.M11*m2.M11 + m1.M12*m2.M21,           m1.M11*m2.M12 + m1.M12*m2.M22,\n        m1.M21*m2.M11 + m1.M22*m2.M21,           m1.M21*m2.M12 + m1.M22*m2.M22,\n        m1.M31*m2.M11 + m1.M32*m2.M21 + m2.M31,  m1.M31*m2.M12 + m1.M32*m2.M22 + m2.M32,  m1.M33 * m2.M33\n      );\n    }\n    /// <summary>Returns the result of applying the (row) vector <c>vector</c> to the @this <c>m</c>.</summary>\n    public static IntVector2D Multiply(IntVector2D v, IntMatrix2D m) { return v * m; }\n    /// <summary>Returns the <c>IntMatrix2D</c> representing the transformation <c>m1</c> composed with <c>m2</c>.</summary>\n    public static IntMatrix2D Multiply(IntMatrix2D m1, IntMatrix2D m2) { return m1 * m2; }\n    #endregion\n\n    /// <summary>Vector Rotation (only).</summary>\n    /// <param name=\"v\">IntVector2D to be rotated.</param>\n    /// <returns>New IntVector2D resulting from rotaion (only) of vector vector by this @this \n    /// (ignoring any translation components of this @this).</returns>\n    public IntVector2D Rotate(IntVector2D v) {\n      return new IntVector2D (v.X * M11 + v.Y * M12, v.X * M21 + v.Y * M22, v.W * M33).Normalize();\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      return (obj is IntMatrix2D) && this.Equals((IntMatrix2D)obj); \n    }\n    /// <inheritdoc/>\n    public bool          Equals(IntMatrix2D other)              { return this == other; }\n    /// <inheritdoc/>\n    public static bool operator != (IntMatrix2D lhs, IntMatrix2D rhs) { return ! (lhs == rhs); }\n    /// <inheritdoc/>\n    public static bool operator == (IntMatrix2D lhs, IntMatrix2D rhs) {\n      return lhs.M11== rhs.M11 && lhs.M12 == rhs.M12\n          && lhs.M21== rhs.M21 && lhs.M22 == rhs.M22\n          && lhs.M31== rhs.M31 && lhs.M32 == rhs.M32 && lhs.M33 == rhs.M33;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return M11 ^ M12 ^ M21 ^ M22 ^ M31 ^ M32 ^ M33; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return ToString(\"G\", CultureInfo.InvariantCulture);\n    }\n    /// <summary>Returns a string representation of the @this.</summary>\n    /// <param name=\"format\"></param>\n    /// <param name=\"formatProvider\"></param>\n    /// <returns></returns>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      return string.Format(CultureInfo.CurrentCulture,\"(({0},{1}), ({2},{3}), ({4},{5}), {6})\",  \n        M11.ToString(format,formatProvider), M12.ToString(format,formatProvider),\n        M21.ToString(format,formatProvider), M22.ToString(format,formatProvider),\n        M31.ToString(format,formatProvider), M32.ToString(format,formatProvider), M33.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/IntVector2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Globalization;\n\n#pragma warning disable 1587\n/// <summary>Shared technoloiges across the library, and useful gadgets.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Representation of an immutable integer 2D vector.</summary>\n  [DebuggerDisplay(\"({X},{Y},{W})\")]\n  public struct IntVector2D : IEquatable<IntVector2D>, IFormattable {\n    /// <summary>Returns the origin vector.</summary>\n    public static readonly IntVector2D Empty = new IntVector2D(Point.Empty);\n\n    #region Properties\n    /// <summary>Get the i-component.</summary>\n    public int X { get {return _x;} } readonly int _x;\n    /// <summary>Get the j-component.</summary>\n    public int Y { get {return _y;} } readonly int _y;\n    /// <summary>Get the w-component (ie scale factor).</summary>\n    public int W { get {return _w;} } readonly int _w;\n    #endregion\n\n    #region Constructors\n    /// <summary>Construct a new instance from <paramref name=\"point\"/>.</summary>\n    public IntVector2D(Point point)              : this(point.X, point.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"size\"/>.</summary>\n    public IntVector2D(Size size)                : this(size.Width, size.Height, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"intVector2D\"/>.</summary>\n    public IntVector2D(IntVector2D intVector2D)  : this(intVector2D.X, intVector2D.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"x\"/> and <paramref name=\"y\"/>.</summary>\n    public IntVector2D(int x, int y)             : this(x, y, 1) {}\n    /// <summary>Construct a new instance from i, j, and w.</summary>\n    internal IntVector2D(int x, int y, int norm) : this() {\n      if (norm == 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter 'norm' cannot be 0.\");\n//      if (norm == 0) norm = 1;\n      _x = x;\n      _y = y;\n      _w = norm;\n    }\n    #endregion\n\n    /// <summary>Returns a new instance with coordinates normalized using integer arithmetic.</summary>\n    public IntVector2D Normalize() {\n      switch (W) {\n        case 0:   throw new InvalidOperationException(\"IntVector2D is uninitialized.\");\n        case 1:   return this;\n        case 2:   return new IntVector2D(X >> 1, Y >> 1);\n        case 4:   return new IntVector2D(X >> 2, Y >> 2);\n        case 8:   return new IntVector2D(X >> 3, Y >> 3);\n\n        default:  return new IntVector2D(Math.Sign(X)*Math.Sign(W)*Math.Abs(X)/Math.Abs(W),\n                                         Math.Sign(Y)*Math.Sign(W)*Math.Abs(Y)/Math.Abs(W));\n      }\n    }\n\n    #region Scalar operators\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (IntVector2D v, int s) {\n      return new IntVector2D(v.X*s, v.Y*s);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, int i) {\n      return new IntVector2D(v.X/i, v.Y/i);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, float s) {\n      return new IntVector2D((int)Math.Floor(v.X/(float)s), (int)Math.Floor(v.Y/(float)s));\n    }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (IntVector2D v, int s) { return v * s; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, int i)   { return v / i; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, float s) { return v / s; }\n    #endregion\n\n    #region Vector operators\n    /// <summary>Scalar (Inner, or Dot) Product of two <code>IntVector2D</code> as an Int32.</summary>\n    public static int operator * (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.X + v1.Y*v2.Y;\n    }\n    /// <summary>Z component of the 'Vector'- or Cross-Product of two <code>IntVector2D</code>s</summary>\n    /// <returns>A pseudo-scalar (it reverses sign on exchange of its arguments).</returns>\n    public static int operator ^ (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.Y - v1.Y*v2.X;\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D operator + (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X+v2.X, v1.Y+v2.Y);\n    }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D operator - (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X-v2.X, v1.Y-v2.Y);\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D Add  (IntVector2D v1, IntVector2D v2) { return v1 + v2; }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D Subtract (IntVector2D v1, IntVector2D v2) { return v1 - v2; }\n\n    /// <summary>Returns the vector corss-product of v1 and v2.</summary>\n    public static int CrossProduct (IntVector2D v1, IntVector2D v2) { return v1 ^ v2; }\n    /// <summary>Returns the inner- / scalar / dot-product of v1 and v2.</summary>\n    public static int InnerProduct (IntVector2D v1, IntVector2D v2) { return v1 * v2; }\n    /// <summary>Obsolete - use InnerProduct operaotr instead.</summary>\n    [Obsolete(\"Deprecated (as really confusing) - use InnerProduct instead.\")]\n    public static int Xor (IntVector2D v1, IntVector2D v2) { return InnerProduct(v1, v2); }\n\n    #endregion\n\n    #region Casts\n    /// <summary>Returns a new instance initialized from point.</summary>\n    public static implicit operator IntVector2D (Point point) { return new IntVector2D(point);  }\n    /// <summary>Returns a new instance initialized from size.</summary>\n    public static implicit operator IntVector2D (Size size)   { return new IntVector2D(size);  }\n    /// <summary>Returns a new Point instance initialized from vector.</summary>\n    public static implicit operator Point (IntVector2D vector) { return new Point(vector.X, vector.Y); }\n    /// <summary>Returns a new Size instance initialized from vector.</summary>\n    public static implicit operator Size (IntVector2D vector)  { return new Size(vector.X, vector.Y);  }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as IntVector2D?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return X << 16  ^  Y  ^  W; }\n\n    /// <inheritdoc/>\n    public bool Equals(IntVector2D other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (IntVector2D lhs, IntVector2D rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (IntVector2D lhs, IntVector2D rhs) {\n      return (lhs.X == rhs.X)  &&  (lhs.Y == rhs.Y)  &&  (lhs.W == rhs.W);\n    }\n    #endregion\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"G\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'V' or 'vector': Vector formatting - Vector output like (nn,mm);\n    /// - 'G' or 'g': General formatting - same as 'V' or 'vector';  \n    /// - 'I' or 'i': 2-Dimensional  vector formatting as 11I + 22J;\n    /// - 'W' or 'w': 3-Dimensional  vector formatting as 11I + 22J = 33K;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// For the 2-D and 3-D vector formatting (ie 'I', 'i', 'W', or 'w'), the case of the \n    /// unit vectors follows that of the supplied formatting command character.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0 || Char.IsDigit(format[0])) format = \"G\";\n      var formatChar = format[0];\n      format = \"D\" + format.Substring(1);\n      string layout;\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'G':\n        case 'g': \n        case 'V':\n        case 'v':   layout = \"({0}, {1})\"; break;\n        case 'I':   layout = \"{0}I + {1}J\"; break;\n        case 'i':   layout = \"{0}i + {1}j\"; break;\n        case 'W':   layout = \"{0}I + {1}J + {2}K\"; break;\n        case 'w':   layout = \"{0}i + {1}j + {2}k\"; break;\n      }\n      return string.Format(CultureInfo.CurrentCulture,layout, X.ToString(format,formatProvider),\n                                                              Y.ToString(format,formatProvider),\n                                                              W.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/PointExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class PointExtensions {\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int valueX, int valueY) {\n      return new Point(@this.X * valueX, @this.Y * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float valueX, float valueY) {\n      return new PointF(@this.X,@this.Y).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float valueX, float valueY) {\n      return new PointF(@this.X * valueX, @this.Y * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/SizeExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class SizeExtensions {\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int valueX, int valueY) {\n      return new Size(@this.Width * valueX, @this.Height * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float valueX, float valueY) {\n      return new SizeF(@this).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float valueX, float valueY) {\n      return new SizeF(@this.Width * valueX, @this.Height * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "codeplex/HexInterfaces/Common/UserCoordsRectangle.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Stores a rectangular board region as a a location and extent of <see cref=\"HexCoords\"/>.</summary>\n  [DebuggerDisplay(\"({Location}):({Size})\")]\n  public struct CoordsRectangle : IEquatable<CoordsRectangle> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public CoordsRectangle(HexCoords location, HexCoords size)  : this(new Rectangle(location.User, size.User)) {}\n    /// <summary>TODO</summary>\n    public CoordsRectangle(int x, int y, int width, int height) : this(new Rectangle(x,y,width,height)) {}\n    /// <summary>TODO</summary>\n    private CoordsRectangle(Rectangle rectangle) : this() { Rectangle = rectangle; }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public int       Bottom     { get { return Rectangle.Bottom; } }\n    /// <summary>TODO</summary>\n    public int       Height     { get { return Rectangle.Height; } }\n    /// <summary>TODO</summary>\n    public bool      IsEmpty    { get { return Rectangle.IsEmpty; } }\n    /// <summary>TODO</summary>\n    public int       Left       { get { return Rectangle.Left; } }\n    /// <summary>TODO</summary>\n    public HexCoords Location   { get { return HexCoords.NewUserCoords(Rectangle.Location); } }\n    /// <summary>TODO</summary>\n    public int       Right      { get { return Rectangle.Right; } }\n    /// <summary>TODO</summary>\n    public HexCoords Size       { get { return HexCoords.NewUserCoords(Rectangle.Size); } }\n    /// <summary>TODO</summary>\n    public int       Top        { get { return Rectangle.Top; } }\n    /// <summary>TODO</summary>\n    public int       Width      { get { return Rectangle.Width; } }\n    /// <summary>TODO</summary>\n    public int       X          { get { return Rectangle.X; } }\n    /// <summary>TODO</summary>\n    public int       Y          { get { return Rectangle.Y; } }\n\n    /// <summary>TODO</summary>\n    public Rectangle Rectangle  { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords UpperLeft  { get { return HexCoords.NewUserCoords(Left,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords UpperRight { get { return HexCoords.NewUserCoords(Right,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerLeft  { get { return HexCoords.NewUserCoords(Left,Bottom); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerRight { get { return HexCoords.NewUserCoords(Right,Bottom); } }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return string.Format(CultureInfo.CurrentCulture,\"({0},{1}):({2},{3})\",X,Y,Width,Height);\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as CoordsRectangle?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Rectangle.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(CoordsRectangle other) { return this == other; }\n\n    /// <summary>Tests value inequality of two CoordsRectangle instances.</summary>\n    public static bool operator != (CoordsRectangle lhs, CoordsRectangle rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value equality of two CoordsRectangle instances.</summary>\n    public static bool operator == (CoordsRectangle lhs, CoordsRectangle rhs) { \n      return lhs.Rectangle == rhs.Rectangle; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/CustomCoordsFactory.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n  public static class CustomCoords {\n\n    /// <summary>Return the coordinate vector of this hex in the Custom frame.</summary>\n    public static IntVector2D UserToCustom(this HexCoords @this) {\n      return @this.User * MatrixUserToCustom;\n    }\n    /// <summary>Return the coordinate vector of this hex in the User frame.</summary>\n    public static HexCoords CustomToUser(this IntVector2D @this) {\n      return HexCoords.NewUserCoords(@this * MatrixUserToCustom);\n    }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D matrix) { SetMatrices(matrix,matrix); }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D userToCustom, IntMatrix2D customToUser) {\n      MatrixUserToCustom = userToCustom;\n      MatrixCustomToUser = customToUser;\n    }\n\n    /// <summary>Gets the conversion @this from Custom to Rectangular (User) coordinates.</summary>\n    public static IntMatrix2D MatrixCustomToUser { get; private set; }\n\n    /// <summary>Gets the conversion @this from Rectangular (User) to Custom coordinates.</summary>\n    public static IntMatrix2D MatrixUserToCustom { get; private set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n            <Word>Alt</Word>\n            <Word>App</Word>\n            <Word>Bkgnd</Word>\n            <Word>Cb</Word>\n            <Word>Calc</Word>\n            <Word>Char</Word>\n            <Word>coloured</Word>\n            <Word>Comm</Word>\n            <Word>Coords</Word>\n            <Word>Ctl</Word>\n            <Word>Dbl</Word>\n            <Word>Dlg</Word>\n            <Word>Eachable</Word>\n            <Word>Fov</Word>\n            <Word>Fwd</Word>\n            <Word>functor</Word>      <Word>functors</Word>\n            <Word>hexgrid</Word>\n            <Word>HexgridExampleWinForms</Word>\n            <Word>HexgridUtilities</Word>\n            <Word>hexside</Word>      <Word>hexsides</Word>\n            <Word>Hotspot</Word>\n            <Word>Hwheel</Word>\n            <Word>Ime</Word>\n            <Word>Init</Word>\n            <Word>Lang</Word>\n            <Word>lhs</Word>\n            <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n            <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n            <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n            <Word>Mdi</Word>\n            <Word>Msgbox</Word>\n            <Word>Napoleonics</Word>\n            <Word>NC</Word>\n            <Word>Neighbour</Word>    <Word>Neighbours</Word>\n            <Word>Pos</Word>\n            <Word>rhs</Word>\n            <Word>c</Word>\n            <Word>dx</Word>\n            <Word>dy</Word>\n            <Word>f</Word>\n            <Word>g</Word>\n            <Word>h</Word>\n            <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n            <Word>l</Word>\n            <Word>m</Word>\n            <Word>p</Word>\n            <Word>Pathfinding</Word>\n            <Word>s</Word>\n            <Word>Sync</Word>\n            <Word>Sys</Word>\n            <Word>TransparentPanel</Word>\n            <Word>Uni</Word>\n            <Word>Uninit</Word>\n            <Word>v</Word>\n            <Word>w</Word>\n            <Word>Wts</Word>\n            <Word>x</Word>      <Word>dx</Word>\n            <Word>y</Word>      <Word>dy</Word>\n            <Word>z</Word>      <Word>dz</Word>\n            <Word>wParam</Word>\n            <Word>lParam</Word>\n            <Word>param</Word>\n            <Word>param</Word>\n            <Word>Lbutton</Word>\n            <Word>Rbutton</Word>\n            <Word>Mbutton</Word>\n            <Word>Xbutton</Word>\n            <Word>Vscroll</Word>\n            <Word>Hscroll</Word>\n            <Word>Afx</Word>\n            <Word>DWM</Word>\n            <Word>Cpl</Word>\n            <Word>Rtl</Word>\n            <Word>Ltr</Word>\n         </Recognized>\n         <Deprecated>\n            <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n         <DiscreteExceptions>\n            <Term>LParam</Term>\n            <Term>lParam</Term>\n            <Term>TransparentPanel</Term>\n            <Term>WParam</Term>\n            <Term>wParam</Term>\n            <Term>LineUp</Term>\n         </DiscreteExceptions>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n            <Acronym>ASL</Acronym>\n            <Acronym>CB</Acronym>\n            <Acronym>DWM</Acronym>\n            <Acronym>Fov</Acronym>\n            <Acronym>NC</Acronym>\n            <Acronym>PG</Acronym>\n            <Acronym>TransparentPanel</Acronym>\n            <Acronym>x</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "codeplex/HexInterfaces/HexCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint = System.Drawing.Point;\n  using HexSize  = System.Drawing.Size;\n\n  /// <summary>Coordinate structure for hexagonal grids that abstracts the distinction \n  /// between rectangular (User) and canonical (Canon) bases (basis vectors, or reference \n  /// frame).</summary>\n  /// <remarks>\n  /// An obtuse reference frmae, with basis vectors at 120 degrees, eases most grid \n  /// calculations and movement operations; a rectangular reference frmae is easier for \n  /// most user interactions, and optimal for board storage. This structure hides the\n  /// distinction betwene them, and automatically converting from one to the other on \n  /// demand (and caching the result).\n  /// </remarks>\n  [DebuggerDisplay(\"User: {User}\")]\n  public struct HexCoords : IEquatable<HexCoords>, IFormattable  {\n    #region Public static members\n    /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (int x, int y) { return NewCanonCoords(new IntVector2D(x,y)); }\n    /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the ectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (int x, int y) { return NewUserCoords(new IntVector2D(x,y)); }\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (IntVector2D vector){ return new HexCoords(vector, vector * MatrixCanonToUser); }\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Rectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (IntVector2D vector){ return new HexCoords(vector * MatrixUserToCanon, vector); }\n\n    /// <summary>Origin of the Canon(ical) coordinate frame.</summary>\n    public static HexCoords EmptyCanon { get { return _EmptyCanon; } }\n    /// <summary>Origin of the Rectangular (User) coordinate frame.</summary>\n    public static HexCoords EmptyUser  { get { return _EmptyUser; } }\n\n    /// <summary>Returns the drawing origin (upper-left) for the hex with specified user components.</summary>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\", MessageId = \"i+1\",\n    Justification=\"No board remotely near large enough to cause overflow here.\")]\n    public static HexPoint HexOrigin(HexSize gridSize, int i, int j) {\n     return new HexPoint(\n       i * gridSize.Width,\n       j * gridSize.Height + (i+1)%2 * (gridSize.Height)/2);\n    }\n    #endregion\n\n    #region Private static methods\n    static readonly IntMatrix2D MatrixUserToCanon = new IntMatrix2D(2, 1,  0,2,  0,0,  2);\n    static readonly IntMatrix2D MatrixCanonToUser = new IntMatrix2D(2,-1,  0,2,  0,1,  2);\n\n    static readonly HexCoords _EmptyCanon  = HexCoords.NewCanonCoords(0,0);\n    static readonly HexCoords _EmptyUser   = HexCoords.NewUserCoords(0,0);\n\n    static readonly IntVector2D vectorN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D vectorNE = new IntVector2D( 1, 0);\n    static readonly IntVector2D vectorSE = new IntVector2D( 1, 1);\n    static readonly IntVector2D vectorS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D vectorSW = new IntVector2D(-1, 0);\n    static readonly IntVector2D vectorNW = new IntVector2D(-1,-1);\n    static readonly IntVector2D[] HexsideVectorsCanon = new IntVector2D[] {\n      vectorN,  vectorNE, vectorSE, vectorS,  vectorSW, vectorNW\n    };\n\n    static readonly IntVector2D userEvenN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D userEvenNE = new IntVector2D( 1, 0);\n    static readonly IntVector2D userEvenSE = new IntVector2D( 1, 1);\n    static readonly IntVector2D userEvenS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D userEvenSW = new IntVector2D(-1,+1);\n    static readonly IntVector2D userEvenNW = new IntVector2D(-1, 0);\n    static readonly IntVector2D[] HexsideVectorsUserEven = new IntVector2D[] {\n      userEvenN,  userEvenNE, userEvenSE, userEvenS,  userEvenSW, userEvenNW\n    };\n\n    static readonly IntVector2D userOddN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D userOddNE = new IntVector2D( 1,-1);\n    static readonly IntVector2D userOddSE = new IntVector2D( 1, 0);\n    static readonly IntVector2D userOddS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D userOddSW = new IntVector2D(-1, 0);\n    static readonly IntVector2D userOddNW = new IntVector2D(-1,-1);\n    static readonly IntVector2D[] HexsideVectorsUserOdd = new IntVector2D[] {\n      userOddN,  userOddNE, userOddSE, userOddS,  userOddSW, userOddNW\n    };\n    #endregion\n\n    #region Constructors\n    private HexCoords(IntVector2D canon, IntVector2D user) :this() {\n      _canon = canon;\n      _user  = user;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Returns an <c>IntVector2D</c> representing the Canonical (obtuse) coordinates of this hex.</summary>\n    public  IntVector2D Canon { get {return _canon;} } readonly IntVector2D _canon;\n\n    /// <summary>Returns an <c>IntVector2D</c> representing the User (rectangular) coordinates of this hex.</summary>\n    public  IntVector2D User  { get {return _user;} } readonly IntVector2D _user;\n\n    /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from the origin.</summary>\n    public  int         RangeFromOrigin { get { return EmptyCanon.Range(this);} }\n    #endregion\n\n    #region Methods\n    /// <summary>Returns an <c>HexCoords</c> for the hex in direction <c>hexside</c> from this one.</summary>\n    public HexCoords GetNeighbour(Hexside hexside) {\n      if ((User.X % 2) == 0) \n        return new HexCoords(Canon + HexsideVectorsCanon[(int)hexside]\n                            ,User  + HexsideVectorsUserEven[(int)hexside]);\n      else \n        return new HexCoords(Canon + HexsideVectorsCanon[(int)hexside]\n                            ,User  + HexsideVectorsUserOdd[(int)hexside]);\n    }\n\n    /// <summary>Returns all neighbouring hexes as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours() { \n      for (var hexside=0; hexside<HexsideVectorsCanon.Length; hexside++)\n        yield return new NeighbourCoords(NewCanonCoords(Canon + HexsideVectorsCanon[hexside]),\n                                        (Hexside)hexside); \n    }\n\n    /// <summary>Returns set of hexes at direction(s) specified by <c>hexsides</c>, as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours(Hexsides hexsides) { \n      return GetNeighbours().Where(n=>hexsides.HasFlag(n.Hexside));\n    }\n\n    /// <summary>Returns the drawing origin (upper-left) for the specified hex.</summary>\n    public HexPoint HexOrigin(HexSize gridSize) { \n      return HexCoords.HexOrigin(gridSize, User.X, User.Y); \n    }\n\n    /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from this one.</summary>\n    public int       Range(HexCoords coords) { \n      var deltaX = coords.Canon.X - Canon.X;\n      var deltaY = coords.Canon.Y - Canon.Y;\n      return ( Math.Abs(deltaX) + Math.Abs(deltaY) + Math.Abs(deltaX-deltaY) ) / 2;\n    }\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"g\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'C' or 'c': Canonical formatting - Int2Vector output of the Canonical coordinates for this hex;\n    /// - 'G' or 'g': General formatting - same as 'R';  \n    /// - 'R' or 'r': Range formatting - Scalar output of the Range of this hex from canonical (0,0);\n    /// - 'U' or 'u': Custom formatting - Int2Vector output of the Custom coordinates for this hex;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// The lower-case format comands prefix a descriptive string on the output (ie one of \"Canon: \",\n    /// \"User: \", \"Custom: \", or \"Range: \" respectivelly), while the upper-case commands do not.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0) format = \"G\";\n      var formatChar = format[0];\n      format = format.Substring(1);\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'C':   return this.Canon.ToString(format, formatProvider);\n        case 'G':   return this.User.ToString(format, formatProvider);\n        case 'U':   return this.UserToCustom().ToString(format, formatProvider);\n        case 'R':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n\n        case 'c':   return \"Canon: \"  + this.Canon.ToString(format, formatProvider);\n        case 'g':   return \"User: \"   + this.User.ToString(format, formatProvider);\n        case 'u':   return \"Custom: \" + this.UserToCustom().ToString(format, formatProvider);\n        case 'r':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return \"Range: \"  + this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n      }\n    }\n    #endregion\n\n    #region Operators\n    /// <summary>Vector sum; <see cref=\"Add\"/>.</summary>\n    public static HexCoords operator + (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon + rhs.Canon);\n    }\n    /// <summary>Vector difference; <see cref=\"Subtract\"/>.</summary>\n    public static HexCoords operator - (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon - rhs.Canon);\n    }\n    /// <summary>(Canonical) vector sum of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Add(HexCoords lhs, HexCoords rhs) { return lhs + rhs; }\n    /// <summary>(Canonical) vector difference of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Subtract(HexCoords lhs, HexCoords rhs) { return lhs - rhs; }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static implicit operator IntVector2D(HexCoords @this) { return @this.Canon; }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as HexCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return User.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(HexCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (HexCoords lhs, HexCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (HexCoords lhs, HexCoords rhs) { return lhs.User == rhs.User; }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/HexInterfaces.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{FB103F54-74CA-4646-824D-248D33237100}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexInterfaces</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexInterfaces</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45, HotPriorityQueue</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexInterfaces.XML</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <DocumentationFile>\n    </DocumentationFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Common\\DebugTracing.cs\" />\n    <Compile Include=\"Common\\EnumExtensions.cs\" />\n    <Compile Include=\"Common\\Extensions.cs\" />\n    <Compile Include=\"Common\\FastList.cs\" />\n    <Compile Include=\"Common\\ImmutableStack.cs\" />\n    <Compile Include=\"Common\\IntMatrix2D.cs\" />\n    <Compile Include=\"Common\\IntVector2D.cs\" />\n    <Compile Include=\"Common\\PointExtensions.cs\" />\n    <Compile Include=\"Common\\SizeExtensions.cs\" />\n    <Compile Include=\"Common\\UserCoordsRectangle.cs\" />\n    <Compile Include=\"CustomCoordsFactory.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexCoords.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Hexside.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Hexsides.cs\" />\n    <Compile Include=\"IBoardStorage.cs\" />\n    <Compile Include=\"IHexBoard.cs\" />\n    <Compile Include=\"IHexgrid.cs\" />\n    <Compile Include=\"IFieldOfView.cs\" />\n    <Compile Include=\"IHex.cs\" />\n    <Compile Include=\"IMapDisplay.cs\" />\n    <Compile Include=\"NeighbourCoords.cs\" />\n    <Compile Include=\"NeighbourHex.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"HexInterfaces.pfx.snk\" />\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Pathfinding\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexInterfaces/Hexside.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Enumeration of the six hexagonal directions.</summary>\n  public enum Hexside {\n    /// <summary>The hexside on the top of the hex.</summary>\n    North,    \n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast,    \n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast,    \n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South,    \n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest,   \n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest\n  }\n\n  /// <summary>Common <i>extension methods</i> for <c>Hexside</c> and <c>HexSideFlags</c>.</summary>\n  public static partial class HexsideExtensions {\n    /// <summary><c>Static List {Hexside}</c> for enumerations.</summary>\n    public static IFastList<Hexside> HexsideList { get {  return _hexsideList; } }\n    static IFastList<Hexside> _hexsideList  = EnumExtensions.EnumGetValues<Hexside>().ToFastList();\n\n    internal static readonly IFastList<Hexsides> HexsideBits\n      = HexsideList.Select(h=>EnumExtensions.ParseEnum<Hexsides>(h.ToString())).ToFastList();\n\n    /// <summary>Static List {HexSideFlags} for enumerations.</summary>\n    public static IFastList<Hexsides> HexsideCollection { get { return HexsideBits; } }\n\n    /// <summary>The <c>Hexside</c> corresponding to this <c>Hexside</c> bit, or -1 if it doesn't exist.</summary>\n    public static Hexside IndexOf(this Hexsides @this) {\n      return (Hexside)HexsideBits.IndexOf(@this);\n    }\n\n    /// <summary>The <c>Hexsides</c> bit corresponding to this <c>HexSide</c>.</summary>\n    public static Hexsides Direction(this Hexside @this) { return HexsideBits[(int)@this]; }\n\n    /// <summary>Returns the reversed, or opposite, <see cref=\"Hexside\"/> to the supplied value.</summary>\n    /// <param name=\"this\">The Hexside for which a reversal is desired.</param>\n    public static Hexside Reversed(this Hexside @this) {\n      return (@this <= Hexside.Southeast) ? (@this + 3) : (@this - 3);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Hexsides.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Flags for combinations of the six hexagonal directions.</summary>\n  [Flags]public enum Hexsides {\n    /// <summary>The selection of no hexsides.</summary>\n    None      = 0x00,\n    /// <summary>The hexside on the top of the hex.</summary>\n    North     = 1 << Hexside.North,\n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast = 1 << Hexside.Northeast,\n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast = 1 << Hexside.Southeast,\n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South     = 1 << Hexside.South,\n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest = 1 << Hexside.Southwest,\n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest = 1 << Hexside.Northwest\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class HexsidesExtensions {\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool AreAllClear(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//,\"Value must not be 0.\");\n      return (@this & testBits) == 0;\n    }\n    /// <summary>Tests (without boxing) if all flags are set.</summary>\n    public static bool AreAllSet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) == testBits;\n    }\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool IsAnySet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) != 0;\n    }\n    /// <summary>Clears the bits clearBits in this.</summary>\n    public static Hexsides ClearBits(this Hexsides @this, Hexsides bits) {\n      return @this & ~bits;\n    }\n    /// <summary>Sets the bits setBits in this.</summary>\n    public static Hexsides SetBits(this Hexsides @this, Hexsides bits) {\n      return @this | bits;\n    }\n    /// <summary>TODO</summary>\n    public static Hexsides ValidBitsMask(this Hexsides @this) {\n      const Hexsides HexsidesMask = Hexsides.North | Hexsides.Northeast | Hexsides.Southeast\n                                  | Hexsides.South | Hexsides.Southwest | Hexsides.Northwest;\n      return @this &= HexsidesMask;\n    }\n    /// <summary>Performs action for all bits set in this.</summary>\n    public static void ForEach(this Hexsides @this, Action<Hexsides> action) {\n      if (action == null) throw new ArgumentNullException(\"action\");\n      for (UInt32 bit = 1; bit != 0; bit <<= 1) {\n        var flag = (Hexsides) bit;\n        if (@this.IsAnySet(flag)) action(flag);\n      }\n    }\n\n    private static readonly int[] LookupTable = \n      Enumerable.Range(0,256).Select(CountBits).ToArray();\n\n    private static int CountBits(int value) {\n      int count = 0;\n      for (int i=0; i < 8; i++) { count += (value >> i) & 1; }\n      return count;\n    }\n\n    /// <summary>Returns the count of of set bit-flags in the argument.</summary>\n    /// <param name=\"this\"></param>\n    public static int BitCount(this Hexsides @this) { return LookupTable[(int)@this]; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IBoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public interface IBoardStorage<out T> : IDisposable {\n    /// <summary>Returns the <c>THex</c> instance at the specified coordinates.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    T this[HexCoords coords] { get; }\n\n    /// <summary>Perform <paramref name=\"action\"/> for all neighbours of <paramref name=\"coords\"/>.</summary>\n    void ForAllNeighbours(HexCoords coords, Action<T,Hexside> action);\n\n    /// <summary>Perform the specified <c>action</c> serially on all hexes.</summary>\n    void ForEach(Action<T> action);\n\n    /// <summary>Returns whether the hex with <see cref=\"HexCoords\"/> <c>coords</c> is \n    /// within the extent of the board.</summary>\n    bool IsOnboard(HexCoords coords);\n\n    /// <summary>TODO</summary>\n    /// <param name=\"coords\"></param>\n    /// <param name=\"hexside\"></param>\n    /// <returns></returns>\n    T Neighbour(HexCoords coords, Hexside hexside);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IFieldOfView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>Enumeration of line-of-sight modes</summary>\n  public enum FovTargetMode {\n    /// <summary>Target height and observer height both set to the same constant value \n    /// (ShadowCasting.DefaultHeight) above ground eleevation</summary>\n    EqualHeights,\n    /// <summary>Use actual observer height and ground level as target height.</summary>\n    TargetHeightEqualZero,\n    /// <summary>Use actual observer and target height.</summary>\n    TargetHeightEqualActual\n  }\n\n  /// <summary>Interface required to make use of ShadowCasting Field-of-View calculation.</summary>\n  public interface IFovBoard<out THex> where THex : IHex {\n    /// <summary>Distance in hexes out to which Field-of-View is to be calculated.</summary>\n    int  FovRadius               { get; set; }\n\n    /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n    Size MapSizeHexes            { get; }\n\n    /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    THex this[HexCoords  coords] { get; }\n\n    /// <summary>TODO</summary>\n    int  ElevationGroundASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationHexsideASL(HexCoords coords, Hexside hexside);\n    /// <summary>TODO</summary>\n    int  ElevationObserverASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationTargetASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationTerrainASL(HexCoords coords);\n\n    /// <summary>Returns whether the hex at location <c>coords</c>is \"on board\".</summary>\n    bool IsOnboard(HexCoords coords);\n\n    /// <summary>Returns whether the hex at location <c>coords</c> is passable.</summary>\n    /// <param name=\"coords\"></param>\n    bool IsPassable(HexCoords coords);\n  }\n\n  /// <summary>Structure returned by the Field-of-View factory.</summary>\n  public interface IFov {\n    /// <summary>True if the hex at location <c>coords</c>c> is visible in this field-of-view.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    bool this[HexCoords coords] { get; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>External interface exposed by individual hexes.</summary>\n  public interface IHex {\n    /// <summary>The <c>HexCoords</c> coordinates for this hex on <c>Board</c>.</summary>\n    HexCoords       Coords         { get; }\n\n    /// <summary>Elevation of this hex in \"steps\" above the minimum elevation of the board.</summary>\n    int             ElevationLevel { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of observer's eyes for FOV calculations.</summary>\n    int             HeightObserver { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of target above ground level to be spotted.</summary>\n    int             HeightTarget   { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of any blocking terrian in this hex.</summary>\n    int             HeightTerrain  { get; }\n\n    /// <summary>Cost to extend the path with the hex located across the <c>Hexside</c> at <c>direction</c>.</summary>\n    int  StepCost(Hexside hexsideExit);\n\n    /// <summary>Height ASL in <i>game units</i> of any blocking terrain in this hex and the specified Hexside.</summary>\n    int  HeightHexside(Hexside hexside);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IHexBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>External interface exposed by the the implementation of <see cref=\"IHexBoard{THex}\"/>.</summary>\n  public interface IHexBoard<out THex> : IBoardStorage<THex>, INavigableBoard<THex>, IFovBoard<THex> where THex : class, IHex {\n    /// <summary>Gets the extent in pixels o fhte grid on which hexes are to be laid out. </summary>\n    HexSize  GridSize    { get; }\n\n    /// <summary>Range beyond which Fast PathFinding is used instead of Stable PathFinding.</summary>\n    int      RangeCutoff { get; }\n\n    /// <summary>Returns whether the specified hex coordinates as a valid hex on this board.</summary>\n    new bool IsOnboard(HexCoords coords);\n\n    /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    new THex this[HexCoords coords] {get; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IHexgrid.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint  = System.Drawing.Point;\n  using HexPointF = System.Drawing.PointF;\n  using HexPoints = IList<System.Drawing.Point>;\n  using HexSize   = System.Drawing.Size;\n  using HexSizeF  = System.Drawing.SizeF;\n\n  /// <summary>TODO</summary>\n  public interface IHexgrid {\n    /// <summary>TODO</summary>\n    HexPoint  GetScrollPosition(HexPoint scrollPosition);\n    /// <summary>TODO</summary>\n    HexSize   GetSize(HexSize mapSizePixels, float mapScale);\n\n    /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n    HexCoords GetHexCoords(HexPoint point, HexSize autoScroll);\n\n    /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n    HexCoords GetHexCoords(HexPointF point, HexSizeF autoScroll);\n\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <param name=\"visibleRectangle\"></param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    HexPoint  ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex, CoordsRectangle visibleRectangle);\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    HexPoint  HexCenterPoint(HexCoords coordsNewULHex);\n\n    /// <summary>TODO</summary>\n    HexSize   GridSize      { get; }\n    /// <summary>TODO</summary>\n    HexSizeF  GridSizeF     { get; }\n    /// <summary>TODO</summary>\n    HexPoints HexCorners    { get; }\n    /// <summary>TODO</summary>\n    bool      IsTransposed  { get; }\n    /// <summary>Offset of grid origin, from control's client-area origin.</summary>\n    HexSize   Margin        { get; set; }\n    /// <summary>TODO</summary>\n    float     Scale         { get; }\n}\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/IMapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>(Technology-independent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplay {\n    /// <summary>TODO</summary>\n     int      FovRadius       { get; set; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the goal hex for path-fnding.</summary>\n    HexCoords GoalHex         { get; set; }\n    /// <summary>Gets the extens in pixels of the grid upon whch hexes are to be laid out.</summary>\n    /// <remarks>>Width is 3/4 of the point-to-point width of each hex, and Height is the full height.\n    /// Hexes should be defined assumed flat-topped and pointy-sided, and the entire board transposed \n    /// if necessary.</remarks>\n    HexSize   GridSize        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the hex currently under the mouse.</summary>\n    HexCoords HotspotHex      { get; set; }\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    bool      IsTransposed    { get; set; }\n    /// <summary>Gets or sets the index (-1 for none) of the path-finding <see cref=\"ILandmark\"/> to show.</summary>\n     int      LandmarkToShow  { get; set; }\n    /// <summary>Current scaling factor for map display.</summary>\n    float     MapScale        { get; set; } \n    /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n    HexSize   MapSizePixels   { get; }\n    /// <summary>Gets the display name for this HexgridPanel host.</summary>\n    string    Name            { get; }\n    /// <summary>Gets the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    IDirectedPathCollection Path        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the start hex for path-finding.</summary>\n    HexCoords StartHex        { get; set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/NeighbourCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"{Coords} at {Hexside}\")]\n  public struct NeighbourCoords : IEquatable<NeighbourCoords> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourCoords(HexCoords coords, Hexside hexside) : this() {\n      Coords = coords; Hexside = hexside;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public Hexside   Hexside   { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords Coords    { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\"Neighbour: {0} at {1}\", Coords.User,Hexside);\n    }\n\n    /// <summary>TODO</summary>\n    public static Func<NeighbourCoords,T> Bind<T>(Func<HexCoords,T> f) {\n      return n => f(n.Coords);\n    }\n\n    #region Value Equality - on Coords field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as NeighbourCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int  GetHashCode() { return Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourCoords lhs, NeighbourCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourCoords lhs, NeighbourCoords rhs) { \n      return lhs.Coords == rhs.Coords; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/NeighbourHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"NeighbourHex: {Hex.Coords} enters from {HexsideEntry}\")]\n  public struct NeighbourHex : IEquatable<NeighbourHex> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex) : this(hex, Hexside.North) {}\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex, Hexside hexsideExit) : this() {\n      Hex          = hex;\n      HexsideExit  = hexsideExit;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>The Hex</summary>\n    public IHex    Hex          { get; private set; }\n\n    /// <summary>The hexside of the neighbour through which the agent exits from the neighbour.</summary>\n    public Hexside HexsideEntry { get {return HexsideExit.Reversed();} }\n\n    /// <summary>The hexside of this hex through which the agent enters from the neighbour.</summary>\n    public Hexside HexsideExit  { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\n        \"NeighbourHex: {0} enters from {1}\", Hex.Coords, HexsideEntry);\n    }\n\n    #region Value Equality - on Hex field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj)                  {\n      var other = obj as NeighbourHex?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Hex.Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourHex other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourHex lhs, NeighbourHex rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourHex lhs, NeighbourHex rhs) {\n      return lhs.Hex.Coords == rhs.Hex.Coords;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Pathfinding/IDirectedNavigableBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Interface required to make use of A* Path Finding utility.</summary>\n  public interface INavigableBoard {\n    /// <summary>The cost of entering the hex at location <c>coords</c> heading <c>hexside</c>.</summary>\n    int   StepCost(HexCoords coords, Hexside hexsideExit);\n\n    /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n    /// <remarks>Returning the supplied range multiplied by the cheapest movement \n    /// cost for a single hex is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic \n    /// in order for the algorithm to perform properly and reliably return an optimum path.</remarks>\n    int   Heuristic(int range);\n\n    /// <summary>Returns whether the hex at location <c>coords</c>is \"on board\".</summary>\n    bool  IsOnboard(HexCoords coords);\n\n    /// <summary>Cost to move by exiting <paramref name=\"hex\"/> through <paramref name=\"hexsideExit\"/>.</summary>\n    int  GetDirectedCostToExit(IHex hex, Hexside hexsideExit);\n\n    /// <summary>Returns the collecction of defined landmarks on this board.</summary>\n    ILandmarkCollection Landmarks { get; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Pathfinding/IDirectedPathCollection.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Structure returned by the A* Path Finding utility.</summary>\n  public interface IDirectedPathCollection : IEnumerable<IDirectedPathCollection>, IEnumerable { \n    /// <summary>The <see cref=\"Hexside\"/> through which an agent must move in taking the first step of this path.</summary>\n    Hexside                 HexsideExit     { get; }\n    /// <summary>The coordinates of the first step on this path.</summary>\n    HexCoords               StepCoords      { get; }\n    /// <summary>The total movement cost for this path.</summary>\n    int                     TotalCost       { get; }\n    /// <summary>The total number of movement steps for this path.</summary>\n    int                     TotalSteps      { get; }\n    /// <summary>The first step on this path.</summary>\n    NeighbourHex            PathStep        { get; }\n    /// <summary>The remaining steps of this path, as an <see cref=\"IDirectedPathCollection\"/> instance.</summary>\n    IDirectedPathCollection PathSoFar       { get; }\n\n    /// <summary>Returns a new instance composed by extending this DirectedPath by one hex.</summary>\n    /// <param name=\"neighbour\"></param>\n    /// <param name=\"stepCost\"></param>\n    /// <returns></returns>\n    IDirectedPathCollection AddStep(NeighbourHex neighbour, int stepCost);\n    /// <summary>Returns a new instance composed by extending this DirectedPath by one hex.</summary>\n    /// <param name=\"there\"></param>\n    /// <param name=\"hexsideEntry\"></param>\n    /// <param name=\"cost\"></param>\n    /// <returns></returns>\n    IDirectedPathCollection AddStep(IHex there, Hexside hexsideEntry, int cost);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Pathfinding/ILandmark.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>TODO</summary>\n  public interface ILandmark : IDisposable {\n    /// <summary>Board coordinates for the landmark location.</summary>\n    HexCoords Coords { get; }\n\n    /// <summary>Returns the shortest-path directed-distance from the specified hex to the landmark.</summary>\n    int       DistanceFrom(HexCoords coords);\n    /// <summary>Returns the shortest-path directed-distance to the specified hex from the landmark.</summary>\n    int       DistanceTo  (HexCoords coords);\n\n    /// <summary>TODO</summary>\n    void FillLandmark();\n}\n\n  /// <summary>An <see cref=\"IList\"/> of defined <see cref=\"ILandmark\"/> locations.</summary>\n  public interface ILandmarkCollection : IFastList<ILandmark>, IDisposable {\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Pathfinding/IPathfinder.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n\n  /// <summary>TODO</summary>\n  public interface IPathfinder {\n    /// <summary>The <see cref=\"INavigableBoard\"/> on which the shortest-path has been requested.</summary>\n    INavigableBoard Board     { get; }\n    /// <summary>The <see cref=\"ISet{HexCoords}\"/> of all hexes expanded in finding the shortest-path.</summary>\n    ISet<HexCoords> ClosedSet { get; }\n    /// <summary>The target hex for this shortest-path search.</summary>\n    IHex            Source    { get; }\n    /// <summary>The source hex for this shortest-path search.</summary>\n    IHex            Target    { get; }\n  }\n\n  /// <summary></summary>\n  public abstract class Pathfinder : IPathfinder {\n    /// <summary>TODO</summary>\n    /// <param name=\"board\">Board on which this shortest-path search is taking place.</param>\n    /// <param name=\"source\">Source hex for this shortest-path search.</param>\n    /// <param name=\"target\">Target hex for this shortest-path search.</param>\n    /// <param name=\"closedSet\">Injected implementation of <see cref=\"ISet{HexCoords}\"/>.</param>\n    protected internal Pathfinder(INavigableBoard board, IHex source, IHex target, ISet<HexCoords> closedSet) {\n      if (board          ==null) throw new ArgumentNullException(\"board\"); \n      if (board.Landmarks==null) throw new ArgumentNullException(\"board\",\"Member Landmarks must not be null\");\n      if (closedSet      ==null) throw new ArgumentNullException(\"closedSet\"); \n      if (source         ==null) throw new ArgumentNullException(\"source\"); \n      if (target         ==null) throw new ArgumentNullException(\"target\"); \n\n      Board     = board;\n      ClosedSet = closedSet;\n      Source    = source;\n      Target    = target;\n    }\n\n    /// <inheritdoc/>\n    public          INavigableBoard Board     { get; private set; }\n    /// <inheritdoc/>\n    public          ISet<HexCoords> ClosedSet { get; private set; }\n    /// <inheritdoc/>\n    public          IHex            Source    { get; private set; }\n    /// <inheritdoc/>\n    public          IHex            Target    { get; private set; }\n\n    #region Conditional tracing routines\n    /// <summary>If the conditional constant TRACE is defined: writes the search start- and goal-coords to the trace log.</summary>\n    /// <param name=\"start\"></param>\n    /// <param name=\"goal\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathDetailInit(HexCoords start, HexCoords goal) {\n      Traces.FindPathDetail.Trace(true, \"Fwd: Find path from {0} to {1}:\", start, goal);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the search-direction initialization details to the trace log.</summary>\n    /// <param name=\"searchDirection\"></param>\n    /// <param name=\"vectorGoal\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathDetailDirection(string searchDirection, IntVector2D vectorGoal) {\n      Traces.FindPathDetail.Trace(\"   {0} Search uses: vectorGoal = {1}\", searchDirection, vectorGoal);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the search-direction initialization details to the trace log.</summary>\n    /// <param name=\"searchDirection\"></param>\n    /// <param name=\"vectorGoal\"></param>\n    /// <param name=\"landmarkCoords\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathDetailDirection(string searchDirection, IntVector2D vectorGoal, HexCoords landmarkCoords) {\n      Traces.FindPathDetail.Trace(\"   {0} Search uses: vectorGoal = {1}; and landmark at {2}\", \n                                    searchDirection, vectorGoal, landmarkCoords);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the dequeue details to the trace log.</summary>\n    /// <param name=\"searchDirection\"></param>\n    /// <param name=\"coords\"></param>\n    /// <param name=\"cost\"></param>\n    /// <param name=\"exit\"></param>\n    /// <param name=\"priority\"></param>\n    /// <param name=\"preference\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathDequeue(string searchDirection,HexCoords coords, int cost, Hexside exit, int priority, int preference) {\n      Traces.FindPathDequeue.Trace(\n            \"{0} Dequeue Path at {1} w/ cost={2,4} at {3,-9}; estimate={4,4}:{5,4}.\", \n            searchDirection, coords, cost, exit, priority, preference);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the enqueue details to the trace log.</summary>\n    /// <param name=\"coords\"></param>\n    /// <param name=\"priority\"></param>\n    /// <param name=\"preference\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathEnqueue(HexCoords coords,int priority, int preference) {\n      Traces.FindPathEnqueue.Trace(\n          \"   Enqueue {0}: estimate={1,4}:{2,4}\",coords, priority, preference);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the current direction pairing to the trace log.</summary>\n    /// <param name=\"coordsFwd\"></param>\n    /// <param name=\"coordsRev\"></param>\n    /// <param name=\"bestSoFar\"></param>\n    [Conditional(\"TRACE\")]\n    public static void TraceFindPathDetailBestSoFar(HexCoords coordsFwd, HexCoords coordsRev, int bestSoFar) {\n      Traces.FindPathDetail.Trace(\"   SetBestSoFar: pathFwd at {0}; pathRev at {1}; Cost = {2}\",\n          coordsFwd,coordsRev, bestSoFar);\n    }\n    /// <summary>If the conditional constant TRACE is defined: writes the dequeue details to the trace log.</summary>\n    /// <param name=\"count\"></param>\n    [Conditional(\"TRACE\")]\n    protected static void TraceFindPathDone(int count) {\n      Traces.FindPathDequeue.Trace(\"Closed: {0,7}\", count);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexInterfaces/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexInterfaces\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexInterfaces\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"dfb21827-7efc-461a-98f7-ca837eaff8b7\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "codeplex/HexUtilities/BlockedBoardStorage32x32.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n    using HexSize     = System.Drawing.Size;\n\n    /// <summary>A <c>BoardStorage</c> implementation optimized for large maps by blocking \n    /// 32 i 32 arrays of hexes for improved memory caching.</summary>\n    /// <remarks>This <c>BoardStorage</c> implementation stores the board cells in blocks\n    /// that are 32 i 32 cells to provide better localization for the Path-Finding and\n    /// Field-of-View algorithms.</remarks>\n    public sealed class BlockedBoardStorage32x32<T> : BoardStorage<T> {\n      const int _grouping = 32;\n      const int _buffer   = _grouping - 1;\n\n      /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n      /// initialized using <paramref name=\"initializer\"/>.</summary>\n      public BlockedBoardStorage32x32(HexSize sizeHexes, Func<HexCoords,T> initializer) \n        : base (sizeHexes) {\n        backingStore  = new List<List<List<T>>>((MapSizeHexes.Height+_buffer) / _grouping);\n        for(var y = 0;  y < backingStore.Capacity;  y++) {\n          backingStore.Add(new List<List<T>>((MapSizeHexes.Width+_buffer) / _grouping));\n          for(var x = 0; x < backingStore[y].Capacity; x++) {\n            backingStore[y].Add(new List<T>(_grouping*_grouping));\n          }\n        }\n\n        var result = Parallel.For(0, backingStore.Capacity, y => {\n          var boardRow    = backingStore[y];\n          for(var x = 0;  x < boardRow.Capacity;  x++) {\n            var boardCell = backingStore[y][x];\n            for (var i=0; i<_grouping; i++) {\n              for (var j=0; j<_grouping; j++) {\n                var coords = HexCoords.NewUserCoords(x*_grouping+j,y*_grouping+i);\n                boardCell.Add(IsOnboard(coords) ? initializer(coords) : default(T));\n              }\n            }\n          }\n        } );\n      }\n\n      /// <inheritdoc/>>\n      public override T this[HexCoords coords] { \n        get { \n          var v = coords.User;\n          return IsOnboard(coords) \n            ? backingStore [v.Y/_grouping]\n                           [v.X/_grouping]\n                           [(v.Y % _grouping) * _grouping + v.X % _grouping]\n            : default(T);\n        }\n        internal set {\n          var v = coords.User;\n          backingStore [v.Y/_grouping]\n                       [v.X/_grouping]\n                       [(v.Y % _grouping) * _grouping + v.X % _grouping] = value;\n        }\n      }\n\n      /// <inheritdoc/>\n      public override void ForEach(Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n        foreach(var hex in backingStore.SelectMany(lllh=>lllh.ToList())\n                                       .SelectMany(llh =>llh.ToList())\n                                       .Where(h=>h!=null)) \n          action(hex);\n      }\n\n      /// <inheritdoc/>>\n      public override void ForEach(Func<T,bool> predicate, Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n        foreach(var hex in backingStore.SelectMany(lllh=>lllh.ToList())\n                                       .SelectMany(llh =>llh.ToList())\n                                       .Where(h=>h!=null && predicate(h))) \n          action(hex);\n      }\n\n      /// <inheritdoc/>>\n      public override ParallelLoopResult ParallelForEach(Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n        return Parallel.ForEach<T>(\n          backingStore.SelectMany(lllh=>lllh.ToList())\n                      .SelectMany(llh =>llh.ToList())\n                      .Where(h=>h!=null), \n          hex => action(hex)\n        );\n      }\n\n      /// <inheritdoc/>>\n      public override ParallelLoopResult ParallelForEach(Func<T,bool> predicate, Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n        return Parallel.ForEach<T>(\n          backingStore.SelectMany(lllh=>lllh.ToList())\n                      .SelectMany(llh =>llh.ToList())\n                      .Where(h=>h!=null && predicate(h)), \n          hex => action(hex)\n        );\n      }\n\n      private List<List<List<T>>> backingStore { get; set; }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/BoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize     = System.Drawing.Size;\n\n  /// <summary>Abstract specification and partial implementation of the <c>BoardStorage</c> required by <c>HexBoard</c>.</summary>\n  /// <typeparam name=\"T\">The type of the information being stored. \n  /// If {T} implements IDisposable then the Dispose() method will dispose all elements.</typeparam>\n  public abstract class BoardStorage<T> : IDisposable {\n    /// <summary>Initializes a new instance with the specified hex extent.</summary>\n    /// <param name=\"sizeHexes\"></param>\n    protected BoardStorage(HexSize sizeHexes) {\n      MapSizeHexes   = sizeHexes;\n    }\n\n    /// <summary>Extent in hexes of the board, as a <see cref=\"System.Drawing.Size\"/> struct.</summary>\n    public       HexSize MapSizeHexes           { get; private set; }\n\n    /// <summary>Returns the <c>THex</c> instance at the specified coordinates.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    public abstract T this[HexCoords coords] { get; internal set; }\n\n    /// <summary>Returns whether the hex with <see cref=\"HexCoords\"/> <c>coords</c> is \n    /// within the extent of the board.</summary>\n    public          bool IsOnboard(HexCoords coords) { \n      return 0<=coords.User.X && coords.User.X < MapSizeHexes.Width\n          && 0<=coords.User.Y && coords.User.Y < MapSizeHexes.Height;\n    }\n\n    /// <summary>Perform the specified <c>action</c> serially on all hexes.</summary>\n    public abstract void ForEach(Action<T> action);\n\n    /// <summary>Perform the specified <c>action</c> serially on all hexes satisfying <paramref name=\"predicate\"/>/>.</summary>\n    public abstract void ForEach(Func<T,bool> predicate, Action<T> action);\n\n    /// <summary>Perform the specified <c>action</c> in parallel on all hexes.</summary>\n    public abstract ParallelLoopResult ParallelForEach(Action<T> action);\n\n    /// <summary>Perform the specified <c>action</c> in parallel on all hexes satisfying <paramref name=\"predicate\"/>.</summary>\n    public abstract ParallelLoopResult ParallelForEach(Func<T,bool> predicate, Action<T> action);\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (typeof(T).GetInterfaces().Contains(typeof(IDisposable))) {\n            ForEach(i => ((IDisposable)i).Dispose());\n          }\n        }\n        _isDisposed = true;\n      }\n    }\n    /// <summary>Finalize this instance.</summary>\n    ~BoardStorage() { Dispose(false); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/DebugTracing.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>enumerationof known debugging trace flags.</summary>\n [SuppressMessage(\"Microsoft.Naming\", \"CA1726:UsePreferredTerms\", MessageId = \"Flags\")]\n  [Flags]public enum Traces  {\n    /// <summary>TODO</summary>\n    None            = 0x00000,\n    /// <summary>TODO</summary>\n    Caching         = 0x00001,\n    /// <summary>TODO</summary>\n    FieldOfView     = 0x00002,\n    /// <summary>TODO</summary>\n    Mouse           = 0x00004,\n    /// <summary>TODO</summary>\n    MouseMove       = 0x00008,\n    /// <summary>TODO</summary>\n    MainForm        = 0x00010,\n    /// <summary>TODO</summary>\n    Initialization  = 0x00020,\n    /// <summary>TODO</summary>\n    Docking         = 0x00040,\n    /// <summary>TODO</summary>\n    MenuEvents      = 0x00080,\n    /// <summary>TODO</summary>\n    KeyEvents       = 0x00100,\n    /// <summary>TODO</summary>\n    Sizing          = 0x00200,\n    /// <summary>TODO</summary>\n    ScrollEvents    = 0x00400,\n    /// <summary>TODO</summary>\n    ToolTipEvents   = 0x00800,\n    /// <summary>TODO</summary>\n    Paint           = 0x01000,\n    /// <summary>TODO</summary>\n    PaintMap        = 0x02000,\n    /// <summary>TODO</summary>\n    PaintDetail     = 0x04000,\n    /// <summary>TODO</summary>\n    FindPathEnqueue = 0x08000,\n    /// <summary>TODO</summary>\n    FindPathDequeue = 0x10000,\n    /// <summary>TODO</summary>\n    FindPathDetail  = 0x20000,\n    /// <summary>TODO</summary>\n    FindPathShortcut= 0x40000\n  }\n\n  internal static partial class NativeMethods {\n    [StructLayout(LayoutKind.Sequential)]\n    internal sealed class SystemTime {\n      public ushort year;\n      public ushort month;\n      public ushort weekday;\n      public ushort day;\n      public ushort hour;\n      public ushort minute;\n      public ushort second;\n      public ushort millisecond;\n\n      public override string ToString() {\n        return string.Format(CultureInfo.InvariantCulture,\"{0,2}:{1,2}:{2,2}.{3,3}\", \n          this.hour, this.minute, this.second, this.millisecond);\n      }\n    }\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"Kernel32.dll\")]\n    internal static extern void GetSystemTime([In,Out] SystemTime st);\n  }\n\n  /// <summary>TODO</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public static partial class DebugTracing {\n    /// <summary>TODO</summary>\n    public static Traces EnabledTraces { get; set; }\n\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, string format, params object[] args) {\n      Trace(traces, false, string.Format(format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, bool newLine, string format, params object[] args) {\n      Trace(traces, newLine, string.Format(format,args));\n    }\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n    public static void Trace(Traces traces, bool newLine, string description) {\n      TraceDetail(traces, newLine, description);\n    }\n\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string format, params object[] args) {\n      LogTime(traces, false, string.Format(format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, bool newLine, string format, params object[] args) {\n      LogTime(traces, newLine, string.Format(format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string description) {\n      LogTime(traces, false, description);\n    }\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n    public static void LogTime(Traces traces, bool newLine, string description) {\n      LogTimeDetail(traces, newLine, description);\n    }\n\n    static partial void TraceDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void TraceDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        System.Diagnostics.Trace.WriteLine(description);\n      }\n    }\n\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        var st = new NativeMethods.SystemTime();\n        NativeMethods.GetSystemTime(st);\n\n        System.Diagnostics.Trace.Write(\"{0} - \", st.ToString());\n        Trace(traces, false, description);\n      }\n    }\n  }\n\n    /// <summary>TODO</summary>\n  public static partial class Extensions {\n    #if TRACE\n      public static void Trace(this Traces @this, string format, params object[] args) {\n        DebugTracing.Trace(@this,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.Trace(@this,newLine,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string description) {\n        DebugTracing.Trace(@this,newLine,description);\n      }\n\n      public static void LogTime(this Traces @this, string format, params object[] args) {\n        DebugTracing.LogTime(@this,format,args);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.LogTime(@this,newLine,format,args);\n      }\n      public static void LogTime(this Traces @this, string description) {\n        DebugTracing.LogTime(@this,description);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string description) {\n        DebugTracing.LogTime(@this,newLine,description);\n      }\n    #else\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void Trace(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string description) {}\n\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void LogTime(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      public static void LogTime(this Traces @this, string description) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      public static void LogTime(this Traces @this, bool newLine, string description) {}\n    #endif\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/EnumExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reflection;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Type-safe extension methods for parsing Enums.</summary>\n    public static partial class EnumExtensions{\n      #region Enum Parsing utilities\n      /// <summary>Typesafe wrapper for <c>Enum.GetValues(typeof(TEnum).</c></summary>\n      public static ReadOnlyCollection<TEnum> EnumGetValues<TEnum>() {\n        return new ReadOnlyCollection<TEnum>((TEnum[])(Enum.GetValues(typeof(TEnum))));\n      }\n\n      /// <summary>TODO</summary>\n     [SuppressMessage(\"Microsoft.Design\", \"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n      public static ReadOnlyCollection<string> EnumGetNames<TEnum>() where TEnum : struct {\n        return new ReadOnlyCollection<string>((string[])(Enum.GetNames(typeof(TEnum))));\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value) where TEnum : struct {\n        return ParseEnum<TEnum>(value,true);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value, bool checkConstants) where TEnum : struct {\n        TEnum enumValue;\n        if (!TryParseEnum<TEnum>(value, out enumValue) && checkConstants) \n              throw new ArgumentOutOfRangeException(\"value\",value,\"Enum type: \" + typeof(TEnum).Name);\n\n        return enumValue;\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static bool TryParseEnum<TEnum>(string value, out TEnum enumValue) where TEnum : struct {\n        return Enum.TryParse<TEnum>(value, out enumValue)  \n           &&  Enum.IsDefined(typeof(TEnum),enumValue);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ToObject()</c>.</summary>\n      /// <typeparam name=\"TEnum\"></typeparam>\n      public static TEnum EnumParse<TEnum>(char c, string lookup) {\n        if (lookup==null) throw new ArgumentNullException(\"lookup\");\n        var index = lookup.IndexOf(c);\n        if (index == -1) throw new ArgumentOutOfRangeException(\"c\",c,\"Enum Type: \" + typeof(TEnum).Name);\n\n        return (TEnum) Enum.ToObject(typeof(TEnum), index);\n      }\n      #endregion\n    }\n}\n#region Deprecated code\nnamespace PGNapoleonics.HexUtilities.Common {\nusing System.IO;\n  public static partial class EnumExtensions{\n    #region InvalidDataException Throwers\n    /// <summary>Deprecated</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(MemberInfo type, object data) {\n      if (type == null) \n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"Unknown: Invalid: '{0}'\", data));\n      else\n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"{1}: Invalid: '{0}'\", data, type.Name));\n    }\n    ///  <summary>Deprecated:</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(string parseType, int lineNo, \n      object section, string error, Exception ex, object data) {\n      throw new InvalidDataException(\n          string.Format(CultureInfo.InvariantCulture,\n            \"{0}: {3}\\n  for section {2} on line # {1}:\\n   {4}\",  \n              parseType, lineNo, section, error, data), ex);\n    }\n    #endregion\n  }\n}\n#endregion"
  },
  {
    "path": "codeplex/HexUtilities/Common/Extensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class EventHandlerExtensions {\n    /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler<T> @this, object sender, T e) \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this PropertyChangedEventHandler @this, object sender, T e)  \n      where T : PropertyChangedEventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler @this, object sender, T e)  \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/FastList.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Joe Duffy's Simple (Fast) List enumerator.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common.FastIterator {\n  /// <summary>Adapted implementation of Joe Duffy's Simple (Fast) List enumerator.</summary>\n  /// <a href=\"http://www.bluebytesoftware.com/blog/2008/09/21/TheCostOfEnumeratingInNET.aspx\">\n  /// The Cost of Enumeration in DotNet</a>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class FastList<TItem> : IEnumerable<TItem>\n      ,IFastEnumerable<TItem> ,IForEachable<TItem>, IForEachable2<TItem>\n  {\n    private TItem[] _array;\n\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    public FastList(TItem[] array) { _array = array; }\n\n    IEnumerator                       IEnumerable.GetEnumerator(){\n      return new ClassicEnumerable<TItem>(_array);\n    }\n    IEnumerator<TItem>         IEnumerable<TItem>.GetEnumerator(){\n      return new ClassicEnumerable<TItem>(_array);\n    }\n    IFastEnumerator<TItem> IFastEnumerable<TItem>.GetEnumerator(){\n      return new FastEnumerable<TItem>(_array);\n    }\n\n    /// <summary>IForEachable{TItem} implementation.</summary>\n    public void ForEach(Action<TItem> action) {\n#if CHECKED\n      if (action==null) throw new ArgumentNullException(\"action\");\n#endif\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    action(a[i]);\n    }\n\n    /// <summary>IForEachable2{TItem} implementation</summary>\n    public void ForEach(FastIteratorFunctor<TItem> functor) {\n#if CHECKED\n      if (functor==null) throw new ArgumentNullException(\"functor\");\n#endif\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    functor.Invoke(a[i]);\n    }\n\n    /// <summary>Gets the item at location <paramref name=\"index\"/>.</summary>\n    public TItem this[int index] { get { return _array[index]; } }\n  }\n\n  /// <summary>Optimized ForEach.</summary>\n  /// <remarks>\n  /// The idea behind IFastEnumerable{TItem} (and specifically IFastEnumerator{TItem}) is to return\n  /// the current element during the call to MoveNext itself.  This cuts the number of\n  /// interface method calls necessary to enumerate a list in half.  The impact to performance\n  /// isn’t huge, but it was enough to cut our overhead from about 3X to 2.3X.  Every little\n  /// bit counts.\n  /// </remarks>\n  /// <typeparam name=\"TItem\"></typeparam>\n  public interface IFastEnumerable<TItem> {\n    /// <summary>Returns the items of a list in order.</summary>\n    IFastEnumerator<TItem> GetEnumerator();\n  }\n    /// <summary>Returns the items of a list in order.</summary>\n  public interface IFastEnumerator<T>{\n    /// <summary>Return the next item in the enumeration.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1045:DoNotPassTypesByReference\", MessageId = \"0#\")]\n    bool MoveNext(ref T item);\n  }\n\n  /// <summary>Delegated ForEach - <c>action</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// The IForEachable{T} interface is a push model: the caller provides a delegate and the \n  /// ForEach method is responsible for invoking it once per element in the collection.\n  /// ForEach doesn’t return until this is done.  In addition to having far fewer method\n  /// calls to enumerate a collection, there isn’t a single interface method call.\n  /// Delegate dispatch is also much faster than interface method dispatch.  The result is\n  /// nearly twice as fast as the classic IEnumerator{T} pattern (when /o+ isn’t defined).  \n  /// Now we’re really getting somewhere!\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable<TItem>{\n    /// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n    void ForEach(Action<TItem> action);\n  }\n\n  /// <summary>Functored ForEach - <c>functor</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// Clients will pass an instance of the Functor{T} class with the Invoke method\n  /// overridden.  The implementation of ForEach then looks quite a bit like \n  /// IForEachable{T}’s, just with virtual method calls in place of delegate calls:\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable2<TItem> {\n    /// <summary>Perform the action specified by <paramref name=\"functor\"/> for every item in the enumeration.</summary>\n    void ForEach(FastIteratorFunctor<TItem> functor);\n  }\n\n  /// <summary>Abstract base class for a <c>FastList</c> functor.</summary>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public abstract class FastIteratorFunctor<TItem>{\n    /// <summary>Perform the action associated with this functor on <paramref name=\"item\"/>.</summary>\n    public abstract void Invoke(TItem item);\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>standard</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public class ClassicEnumerable<TItem> : IEnumerator<TItem>, IDisposable {\n    internal ClassicEnumerable(TItem[] a) { _a = a; }\n\n    private TItem[] _a;\n    private int     _index = -1;\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool   MoveNext() { return ++_index < _a.Length; }\n\n    /// <summary>Return the current item in the enumeration</summary>\n    public TItem       Current  { get { return _a[_index]; } }\n    object IEnumerator.Current  { get { return Current; } }\n\n    /// <summary>Reset the enumerator to the start of the enumeration.</summary>\n    public void Reset() { _index = -1; }\n\n    #region IDisposable implementation with Finalizer\n    private bool isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!isDisposed) {\n        if (disposing) {\n        }\n      }\n    }\n    /// <summary>Destructor.</summary>\n    ~ClassicEnumerable() { Dispose(false); }\n    #endregion\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>fast</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public class FastEnumerable<TItem> : IFastEnumerator<TItem> {\n    /// <summary>Construct a new instance from array <c>a</c>.</summary>\n    /// <param name=\"a\">The array of type <c>TItem</c> to make enumerable.</param>\n    internal FastEnumerable(TItem[] a) { _a = a; } \n\n    private TItem[] _a;\n    private int     _index = -1;\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool MoveNext(ref TItem item) {\n      TItem[] a = _a;\n      int i;\n      if ((i = ++_index) >= a.Length)     return false;\n      item = a[i];\n      return true;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/HeapPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.HexUtilities.Common;\n\nnamespace PG_Napoleonics.HexUtilities.Common2 {\n  /// <summary>Heap-On-Top (HOT) Priority Queue implementation.</summary>\n  /// <typeparam name=\"TKey\">Struct type for the keys used to prioritize values..</typeparam>\n  /// <typeparam name=\"TValue\">Type of the queue elements.</typeparam>\n  /// <remarks>\n  /// \n  /// </remarks>\n  /// <seealso cref=\"http://en.wikipedia.org/wiki/Heapsort\"/>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class HotPriorityQueueList<TKey, TValue> \n    : ICollection<HexKeyValuePair<TKey,TValue>>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey>, IComparable\n  {\n    private List<HexKeyValuePair<TKey,TValue>> _list = new List<HexKeyValuePair<TKey,TValue>>(512);\n\n    public void Add(HexKeyValuePair<TKey,TValue> item) { _list.Add(item); }\n\n    public IPriorityQueue<TKey,TValue> GetPriorityQueue() {\n      var queue = new HeapPriorityQueue(_list);\n      _list     = null;\n      return queue;\n    }\n\n    public IEnumerator<HexKeyValuePair<TKey,TValue>> GetEnumerator() { return _list.GetEnumerator(); }\n\n    int  ICollection<HexKeyValuePair<TKey,TValue>>.Count      { get {return _list.Count;} }\n    bool ICollection<HexKeyValuePair<TKey,TValue>>.IsReadOnly { get {return false;} }\n\n    void ICollection<HexKeyValuePair<TKey,TValue>>.Clear() { throw new InvalidOperationException(\"Clear\"); }\n    bool ICollection<HexKeyValuePair<TKey,TValue>>.Contains(HexKeyValuePair<TKey,TValue> item) { \n      return _list.Contains(item); \n    }\n    void ICollection<HexKeyValuePair<TKey,TValue>>.CopyTo(HexKeyValuePair<TKey,TValue>[] array, int index) {\n      _list.CopyTo(array,index);\n    }\n    IEnumerator IEnumerable.GetEnumerator() { return _list.GetEnumerator(); }\n    bool ICollection<HexKeyValuePair<TKey,TValue>>.Remove(HexKeyValuePair<TKey,TValue> item) {\n      throw new InvalidOperationException(\"Remove\"); \n    }\n\n    /// <summary>Fast (but unstable) implementation of PriorityQueue.</summary>\n    /// <typeparam name=\"TPriority\"></typeparam>\n    /// <typeparam name=\"TValue\"></typeparam>\n    private sealed class HeapPriorityQueue : IPriorityQueue<TKey,TValue> {\n      readonly MinListHeap _minHeap;\n\n      /// <summary>Initializes a new instance of the HeapPriorityQueue class.</summary>\n      public HeapPriorityQueue() { _minHeap = new MinListHeap(); }\n\n      /// <summary>Initializes a new HeapPriorityQueue class with elements copied from the specified collection.</summary>\n      /// <param name=\"collection\">The collection whose elements are copied to the new HeapPriorityQueue.</param>\n      public HeapPriorityQueue(IEnumerable<HexKeyValuePair<TKey, TValue>> collection) : base() {\n        if (collection == null) throw new ArgumentNullException(\"collection\");\n        foreach (var item in collection) _minHeap.Add(item);\n      }\n      /// <summary>Initializes a new HeapPriorityQueue, reusing the storage of the specified List.</summary>\n      /// <param name=\"collection\">The List to be contents of the new HeapPriorityQueue.</param>\n      public HeapPriorityQueue(List<HexKeyValuePair<TKey, TValue>> list) : base() {\n        if (list == null) throw new ArgumentNullException(\"collection\");\n        _minHeap = new MinListHeap(list);\n      }\n\n      public bool Any() { return _minHeap.Any(); }\n\n      public void Enqueue(TKey priority, TValue value) { \n        Enqueue(new HexKeyValuePair<TKey,TValue>(priority,value)); \n      }\n      public void Enqueue(HexKeyValuePair<TKey,TValue> item) {\n        _minHeap.Add(new HexKeyValuePair<TKey,TValue>(item.Key, item.Value));\n      }\n\n      public bool TryDequeue(out HexKeyValuePair<TKey,TValue> result) {\n        if (_minHeap.Any())  {\n          result = _minHeap.ExtractFirst();\n          return true;\n        }\n        result = new HexKeyValuePair<TKey,TValue>();\n        return false;\n      }\n\n      public bool TryPeek(out HexKeyValuePair<TKey,TValue> result) {\n        if (_minHeap.Any())  {\n          result = _minHeap.Peek();\n          return true;\n        }\n        result = new HexKeyValuePair<TKey,TValue>();\n        return false;\n      }\n\n      /// <summary>\n      /// MinHeap from ZeraldotNet (http://zeraldotnet.codeplex.com/)\n      /// Modified by Roy Triesscheijn (http://royalexander.wordpress.com)    \n      /// -Moved method variables to class variables\n      /// -Added English Exceptions and comments (instead of Chinese)    \n      /// Adapted by PIeter Geerkens:\n      /// </summary>    \n      private sealed class MinListHeap {  \n        /// <summary>Construct a new heap with default capacity of 16.</summary>\n        public MinListHeap() : this(16) { }\n\n        /// <summary>Construct a new heap with the specified capacity.</summary>\n        public MinListHeap(int capacity) { \n          _items = new List<HexKeyValuePair<TKey,TValue>>(capacity); \n        }\n\n        /// <summary>Initializes a new heap from the specified list, resuing the storage and \n        /// heapifying <i>in-place</i>.</summary>\n        public MinListHeap(List<HexKeyValuePair<TKey,TValue>> list) {\n          _items = list;\n\n          // Min-Heapify by sifting-down from last parent in heap.\n          var start = (list.Count - 1) / 2;\n          while (start >= 0) { \n            var root = start;\n            var end  = list.Count - 1;\n\n            while (root*2 + 1 <= end) { \n              var child = root*2 + 1;       // (root*2 + 1 points to the left child)\n              var swap  = root;             // (keeps track of child to swap with)\n\n              // (check if root is smaller than left child)\n              if (list[swap].CompareTo(list[child]) > 0)\n                swap = child;\n\n              // (check if right child exists, and if it's bigger than what we're currently swapping with)\n              if (child+1 <= end && list[swap].CompareTo(list[child+1]) > 0 )\n                swap = child + 1;\n\n              // (check if we need to swap at all)\n              if (swap == root) break;\n\n              // swap and repeat to continue sifting down the child now\n              var temp = list[root]; list[root] = list[swap]; list[swap] = temp;\n              root = swap;\n            }\n              \n            start = start - 1;\n          }\n        }\n\n        /// <inheritdoc/>\n        public int Count    { get { return _items.Count; } }\n\n        /// <inheritdoc/>\n        public bool Any()   { return _items.Any(); }\n\n        /// <inheritdoc/>\n        public void Clear() { _items.Clear(); }\n\n        /// <inheritdoc/>\n        public void Add(HexKeyValuePair<TKey,TValue> item) {            \n          _items.Add(item);\n          var child  = Count-1;\n          var parent = (child-1) >> 1;\n\n          while (child > 0  &&  _items[parent].CompareTo(_items[child]) > 0) {\n            var heap = _items[parent];   _items[parent] = _items[child];   _items[child] = heap;  // swap\n            child  = parent;\n            parent = (child-1) >> 1;\n          }\n        }\n\n        /// <inheritdoc/>\n        public HexKeyValuePair<TKey,TValue> ExtractFirst() {\n          if (_items.Count == 0) throw new InvalidOperationException(\"The heap is empty.\");\n\n          // save first item for return later.\n          HexKeyValuePair<TKey, TValue> toReturn = _items[0];\n\n          // Remove the first item if there will only be 0 or 1 items left after doing so.  \n          if (_items.Count <= 2) \n            _items.RemoveAt(0);\n          else { \n            // Remove the first item and move the last item to the front.\n            _items[0] = _items[_items.Count - 1];\n            _items.RemoveAt(_items.Count - 1);\n\n            MinHeapifyDownn(0);\n          }\n\n          // Return the item from the heap\n          return toReturn;\n        }\n\n        void MinHeapifyDownn(int current) {\n          while (true) {\n\n            // identify smallest of parent and borh children\n            int leftChild = 2 * current + 1, smallest;\n            if (leftChild < _items.Count)    smallest = GetSmallest(leftChild,current);\n            else break;\n\n            int rightChild = leftChild + 1;\n            if (rightChild < _items.Count)   smallest = GetSmallest(rightChild,smallest);\n\n            // if nothing to swap, we're done\n            if (current == smallest)  break;\n\n            // swap smallest value up\n            var temp         = _items[current];\n            _items[current]  = _items[smallest];\n            _items[smallest] = temp;\n\n            // follow swapped value down and repeat until the tree is a heap\n            current = smallest;\n          }\n        }\n\n        int GetSmallest(int child, int smallest) {\n          return _items[child].Key.CompareTo(_items[smallest].Key) < 0\n                ? child\n                : smallest;\n        }\n\n        /// <inheritdoc/>\n        public HexKeyValuePair<TKey,TValue> Peek()         { \n          // Returns the first item\n          if (_items.Count == 0) throw new InvalidOperationException(\"The heap is empty.\");\n          return _items[0]; \n        }\n\n        List<HexKeyValuePair<TKey,TValue>> _items;\n\n        /// <summary>Min-Heapify by sifting-down from last parent in heap.</summary>\n        void MinHeapify() {\n          var start = (_items.Count - 1) / 2;\n          while (start >= 0) { \n            var root = start;\n            var end  = _items.Count - 1;\n\n            while (root*2 + 1 <= end) { \n              var child = root*2 + 1;       // (root*2 + 1 points to the left child)\n              var swap  = root;             // (keeps track of child to swap with)\n\n              // (check if root is smaller than left child)\n              if (_items[swap].CompareTo(_items[child]) > 0)\n                swap = child;\n\n              // (check if right child exists, and if it's bigger than what we're currently swapping with)\n              if (child+1 <= end && _items[swap].CompareTo(_items[child+1]) > 0 )\n                swap = child + 1;\n\n              // (check if we need to swap at all)\n              if (swap == root) break;\n\n              // swap and repeat to continue sifting down the child now\n              var temp = _items[root]; _items[root] = _items[swap]; _items[swap] = temp;\n              root = swap;\n            }\n              \n            start = start - 1;\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/ImmutableStack.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Eric Lippert's implementation for use in A*.</summary>\n  /// <remarks>An implementation of immutable stack for use in A* as a 'Path to here'..</remarks>\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx\">Path Finding Using A* Part THree</a>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ImmutableStackCollection<T> : IEnumerable<T> {\n\n    /// <summary>Gets the top item on the stack.</summary>\n    public T                 TopItem      { get; private set; }\n    /// <summary>Gets the remainder of the stack.</summary>\n    public ImmutableStackCollection<T> Remainder    { get; private set; }\n    /// <summary>Returns a new ImmutableStack by adding <paramref name=\"item\"/> to this stack.</summary>\n    public ImmutableStackCollection<T> Push(T item) { return new ImmutableStackCollection<T>(item, this); }\n\n    /// <summary>Construct a new empty instance.</summary>\n    public ImmutableStackCollection(T start) : this(start, null) {}\n    /// <summary>Construct a new instance by Push-ing <paramref name=\"item\"/> onto <paramref name=\"remainder\"/>.</summary>\n    private ImmutableStackCollection(T item, ImmutableStackCollection<T> remainder) {\n      TopItem   = item;\n      Remainder = remainder;\n    }\n\n    /// <summary>Returns the stackitems in order from top to bottom.</summary>\n    public IEnumerator<T> GetEnumerator() {\n      for (ImmutableStackCollection<T> p = this; p != null; p = p.Remainder)  yield return p.TopItem;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/IntMatrix2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Row-major order representation of an immutable integer matrix.</summary>\n  /// <remarks> Represents Points as row vectors and planes as column vectors.\n  /// This representation is standard for computer graphics, though opposite \n  /// to standard mathematical (and physics) representation, and treats \n  /// row vectors as contravariant and column vectors as covariant.</remarks>\n  [DebuggerDisplay(\"(({M11},{M12}), ({M21},{M22}), ({M31},{M32}), {M33}))\")]\n  public struct IntMatrix2D : IEquatable<IntMatrix2D>, IFormattable {\n    static IntMatrix2D TransposeMatrix = new IntMatrix2D(0,1, 1,0);\n    /// <summary>TODO</summary>\n    public static IntMatrix2D Transpose(IntMatrix2D matrix) {\n      return matrix * TransposeMatrix;\n    }\n\n    #region Properties\n    /// <summary>Get the x-scale component.</summary>\n    public int M11 { get; private set; }\n    /// <summary>Get the X-shear component</summary>\n    public int M12 { get; private set; }\n    /// <summary>Get the y-shear component</summary>\n    public int M21 { get; private set; }\n    /// <summary>Get the Y-scale component</summary>\n    public int M22 { get; private set; }\n    /// <summary>Get the x-translation component</summary>\n    public int M31 { get; private set; }\n    /// <summary>Get the y-translationcomponent</summary>\n    public int M32 { get; private set; }\n    /// <summary>Ge the normalization component</summary>\n    public int M33 { get; private set; }\n    /// <summary>Get the identity matrix.</summary>\n    public static readonly IntMatrix2D Identity = new IntMatrix2D(1,0,0,1,0,0, 1);\n    #endregion\n\n    #region Constructors\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector v.</summary>\n    /// <param name=\"vector\">the translation vector</param>\n    public IntMatrix2D(IntVector2D vector)  : this(1,0, 0,1, vector.X,vector.Y, 1) {}\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation (dx,dy).</summary>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int dx, int dy)  : this(1,0, 0,1, dx,dy,1) {}\n    /// <summary> Initialies a new <code>IntMatrix2D</code> with a rotation.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1025:ReplaceRepetitiveArgumentsWithParamsArray\")]\n    public IntMatrix2D(int m11, int m12, int m21, int m22) : this(m11,m12, m21,m22, 0,0, 1) {}\n    /// <summary>Copy Constructor for a new <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m\">Source IntegerMatrix</param>\n    public IntMatrix2D(IntMatrix2D m) : this(m.M11,m.M21, m.M12,m.M22, m.M31,m.M32, m.M33) { }\n    /// <summary>Initializes a new fully-specificed <code>IntMatrix2D</code> .</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy) : this(m11,m12,m21,m22,dx,dy,1) {}\n    /// <summary>Initializes a new fully-specificed non-normed <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    /// <param name=\"norm\">Normalization component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy, int norm) : this() {\n//      if (norm <= 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter norm must be > 0.\");\n      if (norm <= 0) norm = 1;\n      M11 = m11;  M12 = m12;\n      M21 = m21;  M22 = m22;\n      M31 = dx;   M32 = dy;   M33 = norm;\n    }\n    #endregion\n\n    #region operators\n    /// <summary>(Contravariant) Vector application.</summary>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <returns>New IntVector2D resulting from application of this matrix to vector v.</returns>\n    public static IntVector2D operator * (IntVector2D v, IntMatrix2D m) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M21 + m.M31,   v.X * m.M12 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>Matrix multiplication.</summary>\n    /// <param name=\"m1\">Prepended transformation.</param>\n    /// <param name=\"m2\">Appended transformation.</param>\n    /// <returns></returns>\n    public static IntMatrix2D operator * (IntMatrix2D m1, IntMatrix2D m2) {\n      return new IntMatrix2D (\n        m1.M11*m2.M11 + m1.M12*m2.M21,           m1.M11*m2.M12 + m1.M12*m2.M22,\n        m1.M21*m2.M11 + m1.M22*m2.M21,           m1.M21*m2.M12 + m1.M22*m2.M22,\n        m1.M31*m2.M11 + m1.M32*m2.M21 + m2.M31,  m1.M31*m2.M12 + m1.M32*m2.M22 + m2.M32,  m1.M33 * m2.M33\n      );\n    }\n    /// <summary>Returns the result of applying the (row) vector <c>v</c> to the matrix <c>m</c>.</summary>\n    public static IntVector2D Multiply(IntVector2D v, IntMatrix2D m) { return v * m; }\n    /// <summary>Returns the <c>IntMatrix2D</c> representing the transformation <c>m1</c> composed with <c>m2</c>.</summary>\n    public static IntMatrix2D Multiply(IntMatrix2D m1, IntMatrix2D m2) { return m1 * m2; }\n    #endregion\n\n    /// <summary>Vector Rotation (only).</summary>\n    /// <param name=\"v\">IntVector2D to be rotated.</param>\n    /// <returns>New IntVector2D resulting from rotaion (only) of vector v by this matrix \n    /// (ignoring any translation components of this matrix).</returns>\n    public IntVector2D Rotate(IntVector2D v) {\n      return new IntVector2D (v.X * M11 + v.Y * M12, v.X * M21 + v.Y * M22, v.W * M33).Normalize();\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      return (obj is IntMatrix2D) && this.Equals((IntMatrix2D)obj); \n    }\n    /// <inheritdoc/>\n    public bool          Equals(IntMatrix2D other)              { return this == other; }\n    /// <inheritdoc/>\n    public static bool operator != (IntMatrix2D lhs, IntMatrix2D rhs) { return ! (lhs == rhs); }\n    /// <inheritdoc/>\n    public static bool operator == (IntMatrix2D lhs, IntMatrix2D rhs) {\n      return lhs.M11== rhs.M11 && lhs.M12 == rhs.M12\n          && lhs.M21== rhs.M21 && lhs.M22 == rhs.M22\n          && lhs.M31== rhs.M31 && lhs.M32 == rhs.M32 && lhs.M33 == rhs.M33;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return M11 ^ M12 ^ M21 ^ M22 ^ M31 ^ M32 ^ M33; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return ToString(\"G\", CultureInfo.InvariantCulture);\n    }\n    /// <summary>Returns a string representation of the matrix.</summary>\n    /// <param name=\"format\"></param>\n    /// <param name=\"formatProvider\"></param>\n    /// <returns></returns>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      return string.Format(\"(({0},{1}), ({2},{3}), ({4},{5}), {6})\",  \n        M11.ToString(format,formatProvider), M12.ToString(format,formatProvider),\n        M21.ToString(format,formatProvider), M22.ToString(format,formatProvider),\n        M31.ToString(format,formatProvider), M32.ToString(format,formatProvider), M33.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/IntVector2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Globalization;\n\n#pragma warning disable 1587\n/// <summary>Shared technoloiges across the library, and useful gadgets.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Representation of an immutable integer 2D vector.</summary>\n  [DebuggerDisplay(\"({X},{Y},{W})\")]\n  public struct IntVector2D : IEquatable<IntVector2D>, IFormattable {\n    /// <summary>Returns the origin vector.</summary>\n    public static readonly IntVector2D Empty = new IntVector2D(Point.Empty);\n\n    #region Properties\n    /// <summary>Get the x-component.</summary>\n    public int X { get; private set; }\n    /// <summary>Get the y-component.</summary>\n    public int Y { get; private set; }\n    /// <summary>Get the w-component (ie scale factor).</summary>\n    public int W { get; private set; }\n    #endregion\n\n    #region Constructors\n    /// <summary>Construct a new instance from <paramref name=\"point\"/>.</summary>\n    public IntVector2D(Point point)              : this(point.X, point.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"size\"/>.</summary>\n    public IntVector2D(Size size)                : this(size.Width, size.Height, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"intVector2D\"/>.</summary>\n    public IntVector2D(IntVector2D intVector2D)  : this(intVector2D.X, intVector2D.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"x\"/> and .</summary>\n    public IntVector2D(int x, int y)             : this(x, y, 1) {}\n    /// <summary>Construct a new instance from x, y, and w.</summary>\n    internal IntVector2D(int x, int y, int norm) : this() {\n//      if (norm <= 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter 'norm' must be > 0.\");\n      if (norm == 0) norm = 1;\n      X = x;\n      Y = y;\n      W = norm;\n    }\n    #endregion\n\n    /// <summary>Returns a new instance with coordinates normalized using integer arithmetic.</summary>\n    public IntVector2D Normalize() {\n      switch (W) {\n        case 0:   throw new InvalidOperationException(\"IntVector2D is uninitialized.\");\n        case 1:   return this;\n        case 2:   return new IntVector2D(X >> 1, Y >> 1);\n        case 4:   return new IntVector2D(X >> 2, Y >> 2);\n        case 8:   return new IntVector2D(X >> 3, Y >> 3);\n\n        case 3:                                \n        default:  var x = X; var i = 0; while(x<0) {i--; x+=W;} // TODO - Is there a better way?\n                  var y = Y; var j = 0; while(y<0) {j--; y+=W;}\n                  return new IntVector2D(i, j);\n      }\n    }\n\n    #region Scalar operators\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (IntVector2D v, int s) {\n      return new IntVector2D(v.X*s, v.Y*s);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, int i) {\n      return new IntVector2D(v.X/i, v.Y/i);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, float s) {\n      return new IntVector2D((int)Math.Floor(v.X/(float)s), (int)Math.Floor(v.Y/(float)s));\n    }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (IntVector2D v, int s) { return v * s; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, int i)   { return v / i; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, float s) { return v / s; }\n    #endregion\n\n    #region Vector operators\n    /// <summary>Scalar (Inner, or Dot) Product of two <code>IntVector2D</code> as an Int32.</summary>\n    public static int operator * (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.X + v1.Y*v2.Y;\n    }\n    /// <summary>Z component of the 'Vector'- or Cross-Product of two <code>IntVector2D</code>s</summary>\n    /// <returns>A pseudo-scalar (it reverses sign on exchange of its arguments).</returns>\n    public static int operator ^ (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.Y - v1.Y*v2.X;\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D operator + (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X+v2.X, v1.Y+v2.Y);\n    }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D operator - (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X-v2.X, v1.Y-v2.Y);\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D Add  (IntVector2D v1, IntVector2D v2) { return v1 + v2; }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D Subtract (IntVector2D v1, IntVector2D v2) { return v1 - v2; }\n\n    /// <summary>Returns the vector corss-product of v1 and v2.</summary>\n    public static int CrossProduct (IntVector2D v1, IntVector2D v2) { return v1 ^ v2; }\n    /// <summary>Returns the inner- / scalar / dot-product of v1 and v2.</summary>\n    public static int InnerProduct (IntVector2D v1, IntVector2D v2) { return v1 * v2; }\n    /// <summary>Obsolete - use InnerProduct operaotr instead.</summary>\n    [Obsolete(\"Deprecated (as really confusing) - use InnerProduct instead.\")]\n    public static int Xor (IntVector2D v1, IntVector2D v2) { return InnerProduct(v1, v2); }\n\n    #endregion\n\n    #region Casts\n    /// <summary>Returns a new instance initialized from point.</summary>\n    public static implicit operator IntVector2D (Point point) { return new IntVector2D(point);  }\n    /// <summary>Returns a new instance initialized from size.</summary>\n    public static implicit operator IntVector2D (Size size)   { return new IntVector2D(size);  }\n    /// <summary>Returns a new Point instance initialized from vector.</summary>\n    public static implicit operator Point (IntVector2D vector) { return new Point(vector.X, vector.Y); }\n    /// <summary>Returns a new Size instance initialized from vector.</summary>\n    public static implicit operator Size (IntVector2D vector)  { return new Size(vector.X, vector.Y);  }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as IntVector2D?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return X << 16  ^  Y  ^  W; }\n\n    /// <inheritdoc/>\n    public bool Equals(IntVector2D other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (IntVector2D lhs, IntVector2D rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (IntVector2D lhs, IntVector2D rhs) {\n      return (lhs.X == rhs.X)  &&  (lhs.Y == rhs.Y)  &&  (lhs.W == rhs.W);\n    }\n    #endregion\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"G\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'V' or 'v': Vector formatting - Vector output like (nn,mm);\n    /// - 'G' or 'g': General formatting - same as 'V' or 'v';  \n    /// - 'I' or 'i': 2-Dimensional  vector formatting as 11I + 22J;\n    /// - 'W' or 'w': 3-Dimensional  vector formatting as 11I + 22J = 33K;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// For the 2-D and 3-D vector formatting (ie 'I', 'i', 'W', or 'w'), the case of the \n    /// unit vectors follows that of the supplied formatting command character.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0 || Char.IsDigit(format[0])) format = \"G\";\n      var formatChar = format[0];\n      format = \"D\" + format.Substring(1);\n      string layout;\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'G':\n        case 'g': \n        case 'V':\n        case 'v':   layout = \"({0}, {1})\"; break;\n        case 'I':   layout = \"{0}I + {1}J\"; break;\n        case 'i':   layout = \"{0}i + {1}j\"; break;\n        case 'W':   layout = \"{0}I + {1}J + {2}K\"; break;\n        case 'w':   layout = \"{0}i + {1}j + {2}k\"; break;\n      }\n      return string.Format(layout, X.ToString(format,formatProvider),\n                                   Y.ToString(format,formatProvider),\n                                   W.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/PointExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class PointExtensions {\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int valueX, int valueY) {\n      return new Point(@this.X * valueX, @this.Y * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float valueX, float valueY) {\n      return new PointF(@this.X,@this.Y).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float valueX, float valueY) {\n      return new PointF(@this.X * valueX, @this.Y * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/SizeExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class SizeExtensions {\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int valueX, int valueY) {\n      return new Size(@this.Width * valueX, @this.Height * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float valueX, float valueY) {\n      return new SizeF(@this).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float valueX, float valueY) {\n      return new SizeF(@this.Width * valueX, @this.Height * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "codeplex/HexUtilities/Common/UserCoordsRectangle.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Stores a rectangular board region as a a location and extent of <see cref=\"HexCoords\"/>.</summary>\n  [DebuggerDisplay(\"({Location}):({Size})\")]\n  public struct CoordsRectangle : IEquatable<CoordsRectangle> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public CoordsRectangle(HexCoords location, HexCoords size)  : this(new Rectangle(location.User, size.User)) {}\n    /// <summary>TODO</summary>\n    internal CoordsRectangle(int x, int y, int width, int height) : this(new Rectangle(x,y,width,height)) {}\n    /// <summary>TODO</summary>\n    private CoordsRectangle(Rectangle rectangle) : this() { Rectangle = rectangle; }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public int       Bottom     { get { return Rectangle.Bottom; } }\n    /// <summary>TODO</summary>\n    public int       Height     { get { return Rectangle.Height; } }\n    /// <summary>TODO</summary>\n    public bool      IsEmpty    { get { return Rectangle.IsEmpty; } }\n    /// <summary>TODO</summary>\n    public int       Left       { get { return Rectangle.Left; } }\n    /// <summary>TODO</summary>\n    public HexCoords Location   { get { return HexCoords.NewUserCoords(Rectangle.Location); } }\n    /// <summary>TODO</summary>\n    public int       Right      { get { return Rectangle.Right; } }\n    /// <summary>TODO</summary>\n    public HexCoords Size       { get { return HexCoords.NewUserCoords(Rectangle.Size); } }\n    /// <summary>TODO</summary>\n    public int       Top        { get { return Rectangle.Top; } }\n    /// <summary>TODO</summary>\n    public int       Width      { get { return Rectangle.Width; } }\n    /// <summary>TODO</summary>\n    public int       X          { get { return Rectangle.X; } }\n    /// <summary>TODO</summary>\n    public int       Y          { get { return Rectangle.Y; } }\n\n    /// <summary>TODO</summary>\n    public Rectangle Rectangle  { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords UpperLeft  { get { return HexCoords.NewUserCoords(Left,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords UpperRight { get { return HexCoords.NewUserCoords(Right,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerLeft  { get { return HexCoords.NewUserCoords(Left,Bottom); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerRight { get { return HexCoords.NewUserCoords(Right,Bottom); } }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return string.Format(\"({0},{1}):({2},{3})\",X,Y,Width,Height);\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as CoordsRectangle?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Rectangle.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(CoordsRectangle other) { return this == other; }\n\n    /// <summary>Tests value inequality of two CoordsRectangle instances.</summary>\n    public static bool operator != (CoordsRectangle lhs, CoordsRectangle rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value equality of two CoordsRectangle instances.</summary>\n    public static bool operator == (CoordsRectangle lhs, CoordsRectangle rhs) { \n      return lhs.Rectangle == rhs.Rectangle; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/CustomCoordsFactory.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n  public static class CustomCoords {\n\n    /// <summary>Return the coordinate vector of this hex in the Custom frame.</summary>\n    public static IntVector2D UserToCustom(this HexCoords @this) {\n      return @this.User * MatrixUserToCustom;\n    }\n    /// <summary>Return the coordinate vector of this hex in the User frame.</summary>\n    public static HexCoords CustomToUser(this IntVector2D @this) {\n      return HexCoords.NewUserCoords(@this * MatrixUserToCustom);\n    }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D matrix) { SetMatrices(matrix,matrix); }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D userToCustom, IntMatrix2D customToUser) {\n      MatrixUserToCustom = userToCustom;\n      MatrixCustomToUser = customToUser;\n    }\n\n    /// <summary>Gets the conversion matrix from Custom to Rectangular (User) coordinates.</summary>\n    public static IntMatrix2D MatrixCustomToUser { get; private set; }\n\n    /// <summary>Gets the conversion matrix from Rectangular (User) to Custom coordinates.</summary>\n    public static IntMatrix2D MatrixUserToCustom { get; private set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/Dodecant.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  using HexsideMap = Func<Hexside,Hexside>;\n\n  /// <summary>Extension methods to support the identification of and translation between Dodecants.</summary>\n  internal class Dodecant {\n    #region Mod6 - replace an integer modulo operation with a lookup into a table twice as long \n    private static readonly IList<Hexside> _hexsideMap = new Hexside[] {\n      Hexside.North, Hexside.Northeast, Hexside.Southeast, \n      Hexside.South, Hexside.Southwest, Hexside.Northwest,\n\n      Hexside.North, Hexside.Northeast, Hexside.Southeast, \n      Hexside.South, Hexside.Southwest, Hexside.Northwest \n    };\n    #endregion\n\n    //           Sextant map\n    //                    X-axis\n    //         \\     |     /\n    //           \\ 3 | 2 /\n    //             \\ | / \n    //          4    +    1     \n    //             / | \\\n    //           / 5 | 0 \\  \n    //         /     |     \\\n    //             Y-axis\n    public static IFastList<Dodecant> Dodecants = new FastList<Dodecant>( new Dodecant[] {\n      new Dodecant( 0, new IntMatrix2D( 1, 0,  0, 1)), //  CW  from Hexside.North\n      new Dodecant( 1, new IntMatrix2D( 0,-1,  1, 1)), //  CW  from Hexside.Northwest\n      new Dodecant( 2, new IntMatrix2D(-1,-1,  1, 0)), //  CW  from Hexside.Southwest\n      new Dodecant( 3, new IntMatrix2D(-1, 0,  0,-1)), //  CW  from Hexside.South\n      new Dodecant( 4, new IntMatrix2D( 0, 1, -1,-1)), //  CW  from Hexside.Southeast\n      new Dodecant( 5, new IntMatrix2D( 1, 1, -1, 0)), //  CW  from Hexside.Northeast\n\n      new Dodecant( 6, new IntMatrix2D(-1,-1,  0, 1)), // CCW  from Hexside.North\n      new Dodecant( 7, new IntMatrix2D( 0,-1, -1, 0)), // CCW  from Hexside.Northeast\n      new Dodecant( 8, new IntMatrix2D( 1, 0, -1,-1)), // CCW  from Hexside.Southeast\n      new Dodecant( 9, new IntMatrix2D( 1, 1,  0,-1)), // CCW  from Hexside.South\n      new Dodecant(10, new IntMatrix2D( 0, 1,  1, 0)), // CCW  from Hexside.Southwest\n      new Dodecant(11, new IntMatrix2D(-1, 0,  1, 1))  // CCW  from Hexside.Northwest\n    } );\n\n    private Dodecant(int hexsideBase, IntMatrix2D matrix) {\n       var sign  = Math.Sign(matrix.Determinant);\n      HexsideMap = hexside => _hexsideMap[hexsideBase + sign * (int)hexside];\n      Matrix     = matrix;\n    }\n\n    public Dodecant(Dodecant dodecant, IntMatrix2D matrixOrigin) {\n      HexsideMap = dodecant.HexsideMap;\n      Matrix     = dodecant.Matrix * matrixOrigin;\n    }\n\n    public  Func<Hexside, Hexside> HexsideMap { get; private set; }\n    public  IntMatrix2D            Matrix     { get; private set; }\n\n    #region TranslateDodecant\n    public Action<HexCoords> TranslateDodecant(Action<HexCoords> action) {\n      return (coords) => action(HexCoords.NewCanonCoords(coords.Canon * this.Matrix));\n    }\n    public Func<HexCoords,T> TranslateDodecant<T>(Func<HexCoords,T> func) {\n      return (coords) => func(HexCoords.NewCanonCoords(coords.Canon * this.Matrix));\n    }\n    public Func<HexCoords,Hexside,T> TranslateDodecant<T>(Func<HexCoords,Hexside,T> func) {\n      return (coords,hexside) => func(HexCoords.NewCanonCoords(coords.Canon * this.Matrix), HexsideMap(hexside));\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/FieldOfView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>Implementation of IFov using a backing array of BitArray.</summary>\n  internal class ArrayFieldOfView : IFov {\n    private readonly object _syncLock = new object();\n\n    public ArrayFieldOfView(IFovBoard<IHex> board) {\n      _isOnboard  = h => board.IsOnboard(h);\n      _fovBacking = new BitArray[board.MapSizeHexes.Width]; \n      for (var i=0; i< board.MapSizeHexes.Width; i++)\n        _fovBacking[i] = new BitArray(board.MapSizeHexes.Height);\n    }\n\n    public bool this[HexCoords coords] { \n      get { \n        return _isOnboard(coords) && _fovBacking[coords.User.X][coords.User.Y];\n      } \n      internal set { \n        lock(_syncLock) {\n          if (_isOnboard(coords)) { _fovBacking[coords.User.X][coords.User.Y] = value; } \n        }\n      }\n    } BitArray[] _fovBacking;\n\n    Func<HexCoords,bool> _isOnboard;\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/FovCone.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>Field-of-View cone for shadow-casting implementation.</summary>\n  [DebuggerDisplay(\"{RiseRun} at {Range}; VTop: {VectorTop}; VBot: {VectorBottom}\")]\n  public struct FovCone : IEquatable<FovCone> {\n    #region Constructors\n    /// <summary>Construct a new FovCone instance.</summary>\n    internal FovCone(int range, IntVector2D top, IntVector2D bottom, RiseRun riseRun) : this() {\n      this.Range        = range;\n      this.RiseRun      = riseRun;\n      this.VectorTop    = top;\n      this.VectorBottom = bottom;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>The distance from the observer at which this FovCone was generated.</summary>\n    public int          Range        { get; private set; }\n    /// <summary>The pitch angle at which visibility begisn for this FovCone. </summary>\n    public RiseRun      RiseRun      { get; private set; }\n    /// <summary>The maximum yaw angle for this FovCone.</summary>\n    public IntVector2D  VectorBottom { get; private set; }\n    /// <summary>The minimum yaw angle for this FovCone.</summary>\n    public IntVector2D  VectorTop    { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return string.Format(CultureInfo.InvariantCulture,\n        \"Y={0}, TopVector={1}, BottomVector={2}, RiseRun={3}\",\n                                  Range, VectorTop, VectorBottom, RiseRun);\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as FovCone?;\n      return other.HasValue  &&  this == other.Value;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() {\n      return VectorTop.GetHashCode() ^ Range.GetHashCode() \n           ^ RiseRun.GetHashCode()   ^ VectorBottom.GetHashCode();\n    }\n\n    /// <inheritdoc/>\n    public bool Equals(FovCone other) { return this == other; }\n\n    /// <summary>Tests value-inequality of two <c>FovCone</c> instances.</summary>\n    public static bool operator != (FovCone @this, FovCone rhs) { return ! ( @this == rhs); }\n\n    /// <summary>Tests value-equality of two <c>FovCone</c> instances.</summary>\n    public static bool operator == (FovCone @this, FovCone rhs) {\n      return @this.Range        == rhs.Range  \n         &&  @this.RiseRun      == rhs.RiseRun\n         &&  @this.VectorTop    == rhs.VectorTop \n         &&  @this.VectorBottom == rhs.VectorBottom;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/FovFactory.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>Extension methods for interface IFovBoard {IHex}.</summary>\n  public static class FovBoardExtensions {\n    /// <summary>Returns the field-of-view on <c>board</c> from the hex specified by coordinates <c>coords</c>.</summary>\n    [Obsolete(\"Use GetFieldOfView(HexCoords) instead.\")]\n    public static IFov GetFov(this IFovBoard<IHex> @this, HexCoords origin) {\n      return @this.GetFieldOfView(origin);\n    }\n\n#if NET45\n    /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n    public static Task<IFov> GetFieldOfViewAsync(this IFovBoard<IHex> @this, HexCoords origin) {\n      return @this.GetFieldOfViewAsync(origin, 1);\n    }\n    /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n    public static Task<IFov> GetFieldOfViewAsync(this IFovBoard<IHex> @this, HexCoords origin, int height) {\n      return @this.GetFieldOfViewAsync(origin, FovTargetMode.EqualHeights, height);\n    }\n    /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n    public static Task<IFov> GetFieldOfViewAsync(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode) {\n      return @this.GetFieldOfViewAsync(origin, targetMode, 1);\n    }\n    /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n    public static Task<IFov> GetFieldOfViewAsync(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode, int height) {\n      return Task.Run<IFov>(\n        () => @this.GetFieldOfView(origin, targetMode, height, 0)\n      );\n    }\n    /// <summary>Gets a Field-of-View for this board asynchronously.</summary>\n    public static Task<IFov> GetFieldOfViewAsync(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode, int height, int hexesPerMile) {\n      return Task.Run<IFov>(\n        () => @this.GetFieldOfView(origin, targetMode, height, hexesPerMile)\n      );\n    }\n#endif\n\n    /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n    public static IFov GetFieldOfView(this IFovBoard<IHex> @this, HexCoords origin) {\n      return @this.GetFieldOfView(origin, 1);\n    }\n    /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n    public static IFov GetFieldOfView(this IFovBoard<IHex> @this, HexCoords origin, int height) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      return @this.GetFieldOfView(origin, FovTargetMode.EqualHeights, height, 0);\n    }\n    /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n    public static IFov GetFieldOfView(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode) {\n      return @this.GetFieldOfView(origin, targetMode, 1, 0);\n    } \n    /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n    public static IFov GetFieldOfView(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode, int heightOfMan) {\n      return @this.GetFieldOfView(origin, targetMode, heightOfMan, 0);\n    } \n    /// <summary>Gets a Field-of-View for this board synchronously.</summary>\n    public static IFov GetFieldOfView(this IFovBoard<IHex> @this, HexCoords origin, FovTargetMode targetMode, int heightOfMan, int hexesPerMile) {\n      Traces.FieldOfView.Trace(\"GetFieldOfView\");\n      var fov = new ArrayFieldOfView(@this);\n      if (@this.IsPassable(origin))\n        ShadowCasting.ComputeFieldOfView(origin, @this, targetMode, coords => fov[coords] = true, heightOfMan, hexesPerMile);\n\n      return fov;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  [Obsolete(\"Use Extension methods instead.\")]\n  public static class FovFactory {\n    /// <summary>TODO</summary>\n  [Obsolete(\"Use Extension methods instead.\")]\n    public static IFov GetFieldOfView(IFovBoard<IHex> board, HexCoords origin) {\n      if (board==null) throw new ArgumentNullException(\"board\");\n      return board.GetFieldOfView(origin);\n    }\n    /// <summary>TODO</summary>\n  [Obsolete(\"Use Extension methods instead.\")]\n    public static IFov GetFieldOfView(IFovBoard<IHex> board, HexCoords origin, FovTargetMode targetMode) {\n      return board.GetFieldOfView(origin, targetMode);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/FovQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>A queue of FovCOne objects to be processed</summary>\n  /// <remarks> This implementation tracks the last added item as Pending, and merges all \n  /// subsequently added items with the same Range and RiseRun values prior to the Pending \n  /// item being Dequeued'</remarks>\n  [DebuggerDisplay(\"Count={Count}\")]\n  internal class FovConeQueue : Queue<FovCone> {\n    internal FovConeQueue() : this(0) {}\n    internal FovConeQueue(int capacity) : base(capacity) { Pending = null; }\n\n    FovCone?        Pending;\n\n    /// <summary>Returns the number of elemnts in the queue.</summary>\n    public new int Count { get { return base.Count + (Pending.HasValue ? 1 : 0); } }\n\n    /// <inheritdoc/>\n    public new FovCone Dequeue() {\n      if ( base.Count > 0 ) { return base.Dequeue(); }\n      if (Pending.HasValue) { var cache = Pending.Value; Pending = null; return cache; }\n      throw new InvalidOperationException(\"Queue empty.\");\n    }\n\n    /// <summary>Adds a new item to the queue.</summary>\n    /// <remarks>If cone has the same range and RiseRun as Pending, then Pending is extended by \n    /// merging the two.\n    /// \n    /// Otherwise Pending is added to the base queue and cone becomes the new pending item.</remarks>\n    public new void Enqueue(FovCone cone) {\n      if ( ! Pending.HasValue) {\n        Pending = cone;\n      } else if (Pending.Value.Range == cone.Range && Pending.Value.RiseRun == cone.RiseRun) {\n        Pending = new FovCone(cone.Range, Pending.Value.VectorTop, cone.VectorBottom, cone.RiseRun);\n      } else {\n        base.Enqueue(Pending.Value);\n        Pending = cone;\n      }\n    }\n\n    #region Save - perhaps is referenced by client\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new void Clear() { base.Clear(); Pending = null; }\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new bool Contains(FovCone cone) { \n    //  return base.Contains(cone) || (Pending.HasValue && Pending.Value==cone); \n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new void CopyTo(FovCone[] array, int index) { \n    //  base.CopyTo(array,index); \n    //  if (Pending.HasValue) array[index + base.Count] = Pending.Value;\n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new IEnumerator<FovCone> GetEnumerator() { \n    //  return ToList().GetEnumerator();\n    //}\n\n    ///// <summary>Returns and removes the top item in the queue.</summary>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new FovCone Peek() {\n    //  if ( base.Count > 0 ) { return base.Peek(); }\n    //  if (Pending.HasValue) { return Pending.Value; }\n    //  throw new InvalidOperationException(\"Queue empty.\");\n    //}\n\n    ///// <inheritdoc/>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //public new FovCone[] ToArray() { return ToList().ToArray(); }\n\n    ///// <summary></summary>\n    //[SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    //List<FovCone> ToList() {\n    //  var list = new List<FovCone>(Count);  \n    //  foreach(var item in this) list.Add(item);\n    //  if (Pending.HasValue) list.Add(Pending.Value);\n    //  return list;\n    //}\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/RiseRun.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"RiseRun: ({Rise} over {Run})\")]\n  public struct RiseRun : IEquatable<RiseRun>, IComparable<RiseRun> {\n    #region Constructors\n    /// <summary>Creates a new instance of the RiseRUn struct.</summary>\n    /// <param name=\"rise\"></param>\n    /// <param name=\"run\"></param>\n    internal RiseRun(int rise, int run) : this() {\n      this.Rise = rise;\n      this.Run  = run;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Delta-height in units of elevation: meters.</summary>\n    public int Rise { get; private set; }\n    /// <summary>Delta-width in units of distance:  hexes.</summary>\n    public int Run  { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { return string.Format(CultureInfo.InvariantCulture,\"Rise={0}; Run={1}\", Rise, Run); }\n\n    #region Value equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as RiseRun?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Rise / Run; }\n\n    /// <inheritdoc/>\n    public bool Equals(RiseRun other) { return this == other; }\n\n    #region Operators and  IComparable<RiseRun> implementations: \n    /// <summary>Test Value-Inequality.</summary>\n    public static bool operator != (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) != 0; }\n    /// <summary>Test Value-Equality.</summary>\n    public static bool operator == (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) == 0; }\n\n    /// <summary>Less Than operator</summary>\n    public static bool operator <  (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) <  0; }\n    /// <summary>Less Than or Equals operator</summary>\n    public static bool operator <= (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) <= 0; }\n    /// <summary>Greater Thanoperator</summary>\n    public static bool operator >  (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) >  0; }\n    /// <summary>Greater Than or Equals operator</summary>\n    public static bool operator >= (RiseRun lhs, RiseRun rhs) { return lhs.CompareTo(rhs) >= 0; }\n    /// <summary>Less-Than comparaator.</summary>\n    public int CompareTo(RiseRun other) { \n      return (this.Rise * other.Run).CompareTo(other.Rise * this.Run);\n    }\n    #endregion\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/ShadowCastingFov.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading.Tasks;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\n\n#pragma warning disable 1587\n/// <summary>Fast efficient <b>Shadow-Casting</b> \n/// implementation of 3D Field-of-View on a <see cref=\"Hexgrid\"/> map.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n\n  /// <summary>Credit: Eric Lippert</summary>\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2011/12/29/shadowcasting-in-c-part-six.aspx\">Shadow Casting in C# Part Six</a>\n    /// <remarks>\n    /// It is important for realiism that observerHeight > board[observerCoords].ElevationASL, \n    /// or no parallax over the current ground elevation will be observed. TerrainHeight is the \n    /// ElevationASL of the hex, plus the height of any blocking in the hex, usually due to terrain \n    /// but sometimes occuppying units will block vision as well. Control this in the implementation \n    /// of IFovBoard {IHex} with the definition of the observerHeight, targetHeight, and \n    /// terrainHeight delegates.\n    /// </remarks>\n  public static partial class ShadowCasting {\n    /// <summary>Get or set whether to force serial execution of FOV calculation.</summary>\n    /// <remarks>Defaults true when DEBUG defined; otherwise false.</remarks>\n    public static bool InSerial   { get; set; }\n\n    /// <summary>Set to use decimeters as height unit instead of feet.</summary>\n    public static bool UseMetric  { get; set; }\n\n    /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a flat earth.</summary>\n    /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n    /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n    /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n    /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n    public static void ComputeFieldOfView(\n      HexCoords            coordsObserver,\n      IFovBoard<IHex>      board,\n      FovTargetMode        targetMode, \n      Action<HexCoords>    setFieldOfView\n    ) {\n      ComputeFieldOfView(coordsObserver, board, targetMode, setFieldOfView, 1, 0);\n    }\n    /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a flat earth.</summary>\n    /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n    /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n    /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n    /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n    /// <param name=\"defaultHeight\">Height used for observer and target when targetMode = EqualHeights/</param>\n    public static void ComputeFieldOfView(\n      HexCoords            coordsObserver,\n      IFovBoard<IHex>      board,\n      FovTargetMode        targetMode, \n      Action<HexCoords>    setFieldOfView,\n      int                  defaultHeight\n    ) {\n      ComputeFieldOfView(coordsObserver, board, targetMode, setFieldOfView, defaultHeight, 0);\n    }\n\n    /// <summary>Calculate Field-of-View from a specified TargetMode, assuming a spherical earth\n    /// and height measured in feet if <code>hexesPerMile</code> is not equal 0.</summary>\n    /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n    /// <param name=\"board\">A reference to an IFovBoard {IHex} instance.</param>\n    /// <param name=\"targetMode\">TargetMode value for determining target visibility.</param>\n    /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n    /// <param name=\"defaultHeight\">Height used for observer and target when targetMode = EqualHeights/</param>\n    /// <param name=\"hexesPerMile\">Number of hexes per mile (ie 1/4000 of planet radius).</param>\n    /// <remarks>Adjusts visibility for curvature of the Earth. This is the only version of \n    /// ComputeFieldOfView that is <b>not</b> scale invariant for height, and assumes that height\n    /// is measured in feet.\n    /// </remarks>\n    /// <a href=\"http://mathcentral.uregina.ca/qq/database/QQ.09.02/shirley3.html\">Hidden by the Curvature of the Earth</a>\n    public static void ComputeFieldOfView(\n      HexCoords            coordsObserver,\n      IFovBoard<IHex>      board,\n      FovTargetMode        targetMode, \n      Action<HexCoords>    setFieldOfView,\n      int                  defaultHeight,\n      int                  hexesPerMile\n    ) {\n      int CalculationHeightUnits = UseMetric ?   5  // convert metres to  cm  for greater precision\n                                             :  12; // convert feet to inches for greater precision\n\n      Func<HexCoords,int> elevationTarget;\n      int                 elevationObserver;\n      switch (targetMode) {\n        case FovTargetMode.TargetHeightEqualZero:\n          elevationTarget   = coords => board.ElevationGroundASL(coords);\n          elevationObserver = board.ElevationObserverASL(coordsObserver);\n          break;\n\n        default:\n        case FovTargetMode.TargetHeightEqualActual:\n          elevationTarget   = coords => board.ElevationTargetASL(coords);\n          elevationObserver = board.ElevationObserverASL(coordsObserver);\n          break;\n\n        case FovTargetMode.EqualHeights: \n          elevationTarget   = coords => board.ElevationGroundASL(coords) + defaultHeight;\n          elevationObserver = elevationTarget(coordsObserver);\n          break;\n      }\n\n      Func<HexCoords,int> deltaHeight = GetDeltaHeight(coordsObserver,hexesPerMile,CalculationHeightUnits);\n\n      ShadowCasting.ComputeFieldOfView(\n        coordsObserver, \n        board.FovRadius - 1, \n        elevationObserver * CalculationHeightUnits,\n        board.IsOnboard,\n        coords => elevationTarget(coords) * CalculationHeightUnits - deltaHeight(coords),\n        (coords,hexside) => board.ElevationHexsideASL(coords,hexside) * CalculationHeightUnits - deltaHeight(coords),\n        setFieldOfView\n      );\n    }\n\n    private static Func<HexCoords,int> GetDeltaHeight(\n      HexCoords coordsObserver,\n      int       hexesPerMile,\n      int       calculationHeightUnits\n    ) {\n      if (hexesPerMile == 0) \n        return coords => 0;\n      else if (UseMetric)\n        return ( coords => (coordsObserver.Range(coords) * coordsObserver.Range(coords))\n                         * calculationHeightUnits * 2 / (9 * hexesPerMile * hexesPerMile) );\n      else\n        return ( coords => (coordsObserver.Range(coords) * coordsObserver.Range(coords))\n                         * calculationHeightUnits * 2 / (3 * hexesPerMile * hexesPerMile) );\n      ;\n    }\n\n    /// <summary>Calculate Field-of-View from a detailed prescription.</summary>\n    /// <param name=\"coordsObserver\">Cordinates of observer;s hex.</param>\n    /// <param name=\"radius\">Maximum radius for Field-of-View.</param>\n    /// <param name=\"heightObserver\">Height (ASL) of the observer's eyes.</param>\n    /// <param name=\"isOnboard\">Returns whether this hex on the baoard.</param>\n    /// <param name=\"heightTarget\">Returns ground level (ASL) of supplied hex.</param>\n    /// <param name=\"heightTerrain\">Returns height (ASL) of terrain in supplied hex.</param>\n    /// <param name=\"setFieldOfView\">Sets a hex as visible in the Field-of-View.</param>\n    private static void ComputeFieldOfView(\n      HexCoords                   coordsObserver, \n      int                         radius, \n      int                         heightObserver,\n      Func<HexCoords,bool>        isOnboard,\n      Func<HexCoords,int>         heightTarget, \n      Func<HexCoords,Hexside,int> heightTerrain,\n      Action<HexCoords>           setFieldOfView\n    ) {\n      if (setFieldOfView==null) throw new ArgumentNullException(\"setFieldOfView\");\n      FieldOfViewTrace(true, \" - Coords = \" + coordsObserver.User.ToString());\n      var matrixOrigin = new IntMatrix2D(coordsObserver.Canon);\n\n      if (radius >= 0) setFieldOfView(coordsObserver);    // Always visible to self!\n\n      Action<Dodecant> dodecantFov = d => {\n        var dodecant = new Dodecant(d,matrixOrigin);\n        _mapCoordsDodecant = hex => dodecant.TranslateDodecant<HexCoords>(v=>v)(hex);\n\n        ComputeFieldOfViewInDodecantZero(\n          radius,\n          heightObserver,\n          dodecant.TranslateDodecant(isOnboard),\n          dodecant.TranslateDodecant(heightTarget),\n          dodecant.TranslateDodecant(heightTerrain),\n          dodecant.TranslateDodecant(setFieldOfView)\n        );\n      };\n      #if DEBUG\n        InSerial = true;\n      #endif\n      if (InSerial) {\n        Dodecant.Dodecants.ForEach(dodecantFov);\n      } else {\n        Parallel.ForEach(Dodecant.Dodecants, dodecantFov);\n      }\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"radius\"></param>\n    /// <param name=\"heightObserver\"></param>\n    /// <param name=\"isOnboard\"></param>\n    /// <param name=\"heightTarget\"></param>\n    /// <param name=\"heightTerrain\"></param>\n    /// <param name=\"setFieldOfView\"></param>\n    private static void ComputeFieldOfViewInDodecantZero(\n      int                         radius,\n      int                         heightObserver,\n      Func<HexCoords,bool>        isOnboard,\n      Func<HexCoords,int>         heightTarget,\n      Func<HexCoords,Hexside,int> heightTerrain,\n      Action<HexCoords>           setFieldOfView\n    ) {\n\n      var currentCoords = HexCoords.NewCanonCoords(0,1);\n      if ( ! isOnboard(currentCoords) ) return;\n\n      if (radius > 0) setFieldOfView(currentCoords);\n\n      var queue   = new FovConeQueue();\n      var current = new FovCone(\n                    2,\n                    new IntVector2D(1,2), \n                    new IntVector2D(0,1), \n                    new RiseRun(2 * (heightTerrain(currentCoords,Hexside.North) - heightObserver), 1) );\n      while (current.Range <= radius) {\n        current = ComputeFoVForRange(heightObserver, isOnboard, heightTarget, heightTerrain, setFieldOfView, queue, current);\n      }\n    }\n\n    /// <summary>Processes the supplied FovCone and returns the next FovCone to process.</summary>\n    /// <param name=\"heightObserver\"></param>\n    /// <param name=\"isOnboard\"></param>\n    /// <param name=\"heightTarget\"></param>\n    /// <param name=\"heightTerrain\"></param>\n    /// <param name=\"setFieldOfView\"></param>\n    /// <param name=\"queue\"></param>\n    /// <param name=\"cone\"></param>\n    /// <returns></returns>\n    /// <remarks>\n    /// This method: \n    /// (1) marks points inside the cone-arc that are within the radius of the field \n    ///     of view; and \n    /// (2) computes which portions of the following column are in the field of view, \n    ///     queueing them for later processing. \n    ///\n    /// This algorithm is \"center-to-center\"; a more sophisticated algorithm \n    /// would say that a cell is visible if neighbour is *any* straight line segment that \n    /// passes through *any* portion of the origin cell and any portion of the target \n    /// cell, passing through only transparent cells along the way. This is the \n    /// \"Permissive Field Of View\" algorithm, and it is much harder to implement.\n    ///\n    /// Search for transitions from opaque to transparent or transparent to opaque and \n    /// use those to determine what portions of the *next* column are visible from the \n    /// origin.\n    /// </remarks>\n    private static FovCone ComputeFoVForRange(\n      int                         heightObserver, \n      Func<HexCoords,bool>        isOnboard, \n      Func<HexCoords,int>         heightTarget, \n      Func<HexCoords,Hexside,int> heightTerrain, \n      Action<HexCoords>           setFieldOfView, \n      FovConeQueue                queue, \n      FovCone                     cone\n    ) {\n      Action<FovCone> enqueue = queue.Enqueue;\n\n      var range         = cone.Range;\n      var topVector     = cone.VectorTop;\n      var topRiseRun    = cone.RiseRun;\n      var bottomVector  = cone.VectorBottom;\n\n      // track the overlap-cone between adjacent hexes as we move down.\n      var overlapVector = cone.VectorTop;\n      var hexX          = XFromVector(range, topVector);\n      FieldOfViewTrace(false, \"DQ:   ({0}) from {1}\", cone, hexX);\n\n      do {\n        while (overlapVector.GT(bottomVector)) {\n          var coordsCurrent   = HexCoords.NewCanonCoords(hexX,range);\n          var hexVectorBottom = VectorHexBottom(coordsCurrent);\n          if (isOnboard(coordsCurrent)) { \n            #region Set current hex parameters\n            var hexVectorTop  = VectorHexTop(coordsCurrent);\n            var hexElevation  = heightTarget(coordsCurrent);\n            var hexHeight     = heightTerrain(coordsCurrent,Hexside.North);\n            var hexRiseRun    = new RiseRun(hexHeight-heightObserver, range);\n            #endregion\n\n            #region Check visibility of current hex\n            var riseRun = new RiseRun(hexElevation-heightObserver, coordsCurrent.RangeFromOrigin);\n            if ( riseRun >= cone.RiseRun  \n            && bottomVector.LE(coordsCurrent.Canon) && coordsCurrent.Canon.LE(topVector)  \n            ) {\n              setFieldOfView(coordsCurrent);\n              FieldOfViewTrace(false,\"    Set visible: {0} / {1}; {2} >= {3}\", \n                  _mapCoordsDodecant(coordsCurrent), coordsCurrent.ToString(), riseRun, cone.RiseRun);\n            }\n            #endregion\n\n            #region Check hex transition\n            if (hexRiseRun > topRiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, hexVectorTop, topRiseRun, 0);\n              topRiseRun = hexRiseRun;\n            } else if (hexRiseRun > cone.RiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 1);\n              topRiseRun = hexRiseRun;\n            } else if (hexRiseRun < cone.RiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 2);\n              topRiseRun = cone.RiseRun;\n            }\n            #endregion\n          }\n\n          overlapVector = VectorMax(hexVectorBottom, bottomVector); \n          if (hexVectorBottom.GT(bottomVector))      -- hexX;\n        }\n\n        #region Dequeue next cone\n        if (queue.Count == 0) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 3);\n          cone        = queue.Dequeue();\n          break;\n        } else {\n          cone        = queue.Dequeue();\n          if(cone.Range != range) {\n            topVector = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 4);\n            break;\n          }\n          FieldOfViewTrace(false, \"DQ:   ({0}) from {1}\", cone, hexX);\n        }\n        #endregion\n\n        #region Check cone transition\n        if (cone.RiseRun > topRiseRun) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, cone.VectorTop, topRiseRun, 5);\n          topRiseRun  = cone.RiseRun;\n        } else if (cone.RiseRun < topRiseRun) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 6);\n          topRiseRun  = cone.RiseRun;\n        }\n        #endregion\n\n        overlapVector = topVector;\n        bottomVector  = cone.VectorBottom;\n      } while(true);\n\n      // Pick-up any cone portion at bottom of range still unprocessed\n      if (topVector.GT(bottomVector))\n        LogAndEnqueue(enqueue, range, topVector, bottomVector, cone.RiseRun, 7);\n\n      return cone;\n    }\n\n    #region Tracing partial methods\n    /// <summary>For tracing: maps HexCoords back to original hex.</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1823:AvoidUnusedPrivateFields\")]\n    static Func<HexCoords, HexCoords> _mapCoordsDodecant;\n\n    static partial void FieldOfViewTrace(string format, params object[] paramArgs);\n    static partial void FieldOfViewTrace(bool newline, string format, params object[] paramArgs);\n    #if TRACE\n    static partial void FieldOfViewTrace(string format, params object[] paramArgs) {\n      Traces.FieldOfView.Trace(format, paramArgs);\n    }\n    static partial void FieldOfViewTrace(bool newline, string format, params object[] paramArgs) {\n      Traces.FieldOfView.Trace(newline, format, paramArgs);\n    }\n    #endif\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FieldOfView/ShadowCastingFov_Utilities.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  public static partial class ShadowCasting {\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"code\")]\n    static IntVector2D LogAndEnqueue(Action<FovCone> enqueue, int range, IntVector2D top, \n            IntVector2D bottom, RiseRun riseRun, int code\n    ) {\n      if( top.GT(bottom)) {\n        var cone = new FovCone(range+1, top, bottom, riseRun);\n        FieldOfViewTrace(false, \"  EQ: ({0}) code: {1}\",cone,code);\n        enqueue(cone);\n        return bottom;\n      } else {\n        return top;\n      }\n    }\n\n    static int XFromVector(int y, IntVector2D v) {\n      return (-2 * v.Y + v.X * (3 * y + 1) + (3 * v.Y) - 1) / (3 * v.Y);\n    }\n    /// <summary>Helper IntMatrix2D for <c>VectorHexTop</c>.</summary>\n    static IntMatrix2D matrixHexTop    = new IntMatrix2D(3,0,  0,3,  2, 1);\n    /// <summary>Helper IntMatrix2D for <c>VectorHexBottom</c>.</summary>\n    static IntMatrix2D matrixHexBottom = new IntMatrix2D(3,0,  0,3, -2,-1);\n\n    /// <summary>IntVector2D for top corner of cell Canon(i,j).</summary>\n    /// <remarks>\n    /// In first dodecant; The top corner for hex (i,j) is determined \n    /// (from close visual inspection) as:\n    ///       (i,j) + 1/3 * (2,1)\n    /// which reduces to:\n    ///       (i + 2/3, j + 1/3) == 1/3 * (3x + 2, 3y + 1)\n    /// </remarks>\n    static IntVector2D VectorHexTop(HexCoords hex) { return hex.Canon * matrixHexTop; }\n    /// <summary>IntVector2D for bottom corner of cell Canon(i,j).</summary>\n    /// <remarks>\n    /// In first dodecant; The bottom corner for hex (i,j) is determined \n    /// (from close visual inspection) as:\n    ///       (i,j) + 1/3 * (-2,-1)\n    /// which reduces to:\n    ///       (i - 2/3, j - 1/3) == 1/3 * (3x - 2, 3y - 1)\n    /// </remarks>\n    static IntVector2D VectorHexBottom(HexCoords hex)  { return hex.Canon * matrixHexBottom;  }\n\n    // These are here (instead of IntVector2D.cs) because they are \"upside-down\" for regular use.\n    static IntVector2D VectorMax(IntVector2D lhs, IntVector2D rhs) {\n      return lhs.GT(rhs) ? lhs : rhs; \n    }\n    static bool GT(this IntVector2D lhs, IntVector2D rhs) { return lhs.X*rhs.Y > lhs.Y*rhs.X; }\n    static bool LE(this IntVector2D lhs, IntVector2D rhs) { return ! lhs.GT(rhs); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/FlatBoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize     = System.Drawing.Size;\n\n  /// <summary>A row-major <c>BoardStorage</c> implementation optimized for small maps, \n    /// providing both serial and parallel initialization.</summary>\n    public sealed class FlatBoardStorage<T> : BoardStorage<T> {\n      /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n      /// initialized using <paramref name=\"initializer\"/>.</summary>\n      /// <param name=\"sizeHexes\"><c>Size</c> structure speccifying the Width and Height of \n      /// the desired board storage.</param>\n      /// <param name=\"initializer\"></param>\n      /// <remarks>\n      /// If the conditional compilation constant DEBUG is defined then the board\n      /// storage is initialized serially; otherwise it is initialized in parallel.\n      /// </remarks>\n      public FlatBoardStorage(HexSize sizeHexes, Func<HexCoords,T> initializer)\n        #if DEBUG\n         : this (sizeHexes,initializer,false) {\n        #else\n         : this (sizeHexes,initializer,true) {\n        #endif\n      }\n\n      /// <summary>Construct a new instance of extent <paramref name=\"sizeHexes\"/> and \n      /// initialized using <paramref name=\"initializer\"/>.</summary>\n      /// <param name=\"sizeHexes\"><c>Size</c> structure speccifying the Width and Height of \n      /// the desired board storage.</param>\n      /// <param name=\"initializer\"></param>\n      /// <param name=\"inParallel\">Boolean indicating how the board should be initialized: \n      /// in parallel or serially.</param>\n      public FlatBoardStorage(HexSize sizeHexes, Func<HexCoords,T> initializer, bool inParallel) \n        : base (sizeHexes\n      ) {\n        if (initializer==null) throw new ArgumentNullException(\"initializer\");\n\n        backingStore  = new List<List<T>>(MapSizeHexes.Height);\n\n        if (inParallel) {\n            for(var y = 0;  y < backingStore.Capacity;  y++) {\n              backingStore.Add(new List<T>(MapSizeHexes.Width));\n            }\n            Parallel.For(0, backingStore.Capacity, y => {\n              var boardRow    = backingStore[y];\n              for(var x = 0;  x < boardRow.Capacity;  x++) {\n                boardRow.Add(initializer(HexCoords.NewUserCoords(x,y)));\n              }\n            } );\n        } else {\n            for(var y=0; y< sizeHexes.Height; y++) {\n              backingStore.Add(new List<T>(MapSizeHexes.Width));\n              for(var x=0; x<MapSizeHexes.Width; x++) {\n                backingStore[y].Add(initializer(HexCoords.NewUserCoords(x,y)));\n              }\n            }\n        }\n      }\n\n      /// <inheritdoc/>>\n      public override T this[HexCoords coords] { \n        get { \n          return IsOnboard(coords) ? backingStore[coords.User.Y][coords.User.X] \n                                   : default(T);\n        }\n        internal set {\n          if (IsOnboard(coords))\n            backingStore [coords.User.Y][coords.User.X] = value;\n        }\n      }\n\n      /// <inheritdoc/>\n      public override void ForEach(Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n\n        foreach(var hex in backingStore.SelectMany(lh => lh.ToList()))\n          action(hex);\n      }\n\n      /// <inheritdoc/>\n      public override void ForEach(Func<T,bool> predicate, Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n\n        foreach(var hex in backingStore.SelectMany(lh => lh.ToList())\n                                       .Where(lh => predicate(lh)))\n          action(hex);\n      }\n\n      /// <inheritdoc/>\n      public override ParallelLoopResult ParallelForEach(Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n\n        return Parallel.ForEach<T>(backingStore.SelectMany(lh => lh.ToList()),\n          hex=>action(hex));\n      }\n\n      /// <inheritdoc/>\n      public override ParallelLoopResult ParallelForEach(Func<T,bool> predicate, Action<T> action) {\n        if (action==null) throw new ArgumentNullException(\"action\");\n\n        return Parallel.ForEach<T>(backingStore.SelectMany(lh => lh.ToList())\n                                               .Where(lh => predicate(lh)),\n          hex=>action(hex));\n      }\n\n      private List<List<T>> backingStore { get; set; }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Hex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\n#pragma warning disable 1587\n/// <summary>A library of utilities and controls for buillding strategy simulation games on hexagonal-grid \n/// mapboards.</summary>\n/// <remarks>\n/// To get started, explore how the two sample maps <see cref=\"TerrainMap\"/> and <see cref=\"MazeMap\"/> override\n/// the base class <see cref=\"MapDisplay<THex>\"/>, and how the sample form <see cref=\"HexgridExampleForm\"/>\n/// overrides the base control <see cref=\"HexgridPanel\"/>. The Collaboration diagram for MapDisplay<THex>\n/// provides a good overview fof the library structure.\n/// \n/// Brought to you by <b>PG Software Solutions Inc.</b>, a quality software provider.\n/// \n/// Our products are more than <b>Pretty Good Software</b>; ... they're <b>Pretty Great Solutions!</b></remarks>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>Abstract implementation of the interface <see Cref=\"IHex\"/>.</summary>\n  [DebuggerDisplay(\"Coords: {Coords} / ElevLevel: {ElevationLevel}\")]\n  public abstract class Hex<TDrawingSurface,TPath> : IHex, IEquatable<Hex<TDrawingSurface,TPath>>  {\n    /// <summary>Construct a new Hex instance at location <paramref name=\"coords\"/>.</summary>\n    protected Hex(HexCoords coords) : this(coords,0) { }\n    /// <summary>Construct a new Hex instance at location <paramref name=\"coords\"/>.</summary>\n    protected Hex(HexCoords coords, int elevationLevel) {\n      Coords         = coords; \n      ElevationLevel = elevationLevel;\n    }\n\n    /// <inheritdoc/>\n    public          HexCoords Coords         { get; private set; }\n\n    /// <inheritdoc/>\n    public          int       ElevationLevel { get; private set; }\n\n    /// <inheritdoc/>\n    public virtual  int       HeightObserver { get { return 1; } }\n\n    /// <inheritdoc/>\n    public virtual  int       HeightTarget   { get { return 1; } }\n\n    /// <inheritdoc/>\n    public abstract int       HeightTerrain  { get; }\n\n    /// <inheritdoc/>\n    public abstract int       StepCost(Hexside hexsideExit);\n\n    /// <summary>Default implementation, assuming no blocking hexside terrain.</summary>\n    public virtual  int       HeightHexside(Hexside hexside) { return HeightTerrain; }\n\n    /// <summary>TODO</summary>\n    public abstract void      Paint(TDrawingSurface graphics);\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool  Equals(object obj) { return this.Equals(obj as Hex<TDrawingSurface,TPath>); }\n\n    /// <inheritdoc/>\n    public override int   GetHashCode()      { return Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(Hex<TDrawingSurface,TPath> other) { return other!=null  &&  Coords.Equals(other.Coords); }\n    #endregion\n  }\n\n  /// <summary>Extension methods for <see Cref=\"Hex\"/>.</summary>\n  public static partial class HexExtensions {\n    /// <summary>Returns the requested neighbours for this hex.</summary>\n    /// <param name=\"this\">TODO</param>\n    /// <param name=\"here\">TODO</param>\n    /// <returns></returns>\n    public static IEnumerable<NeighbourHex> GetNeighbourHexes(\n      this INavigableBoard<IHex> @this, IHex here\n    ) {\n      if (@this  == null) throw new ArgumentNullException(\"this\");\n      return @this.GetAllNeighbours(here).Where(n => n.Hex!=null);\n    }\n    /// <summary>All neighbours of this hex, as an <see cref=\"IEnumerable {NeighbourHex}\"/></summary>\n    public static IEnumerable<NeighbourHex> GetAllNeighbours(\n      this INavigableBoard<IHex> @this,  IHex here\n    ) {\n      if (@this  == null) throw new ArgumentNullException(\"this\");\n      return HexsideExtensions.HexsideList.Select(hexside => \n            new NeighbourHex(@this[here.Coords.GetNeighbour(hexside)], hexside.Reversed()));\n    }\n\n    /// <summary>The <i>Manhattan</i> distance from this hex to that at <c>coords</c>.</summary>\n    public static int Range(this IHex @this, IHex target) { \n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (target==null) throw new ArgumentNullException(\"target\");\n\n      return @this.Coords.Range(target.Coords); \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/HexBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint    = System.Drawing.Point;\n  using HexSize     = System.Drawing.Size;\n  using RectangleF  = System.Drawing.RectangleF;\n\n  using ILandmarks  = ILandmarkCollection;\n  using CoordsRect  = CoordsRectangle;\n\n  /// <summary>TODO </summary>\n  public delegate BoardStorage<THex> BoardStorageInitializer<THex,TPath>()\n  where THex : class, IHex;\n\n  /// <summary>Abstract implementation of a hexgrid map-board.</summary>\n  /// <typeparam name=\"THex\">TODO</typeparam>\n  /// <typeparam name=\"TPath\">TODO</typeparam>\n  /// <remarks>No Finalizer is implemented as the class possesses no unmanaged resources.</remarks>\n  public abstract class HexBoard<THex,TPath> : IHexBoard<THex>, IDisposable where THex : class, IHex {\n\n    /// <summary>By default, landmark all four corners and midpoints of all 4 sides.</summary>\n    /// <remarks>Pre-processing time on start-up can be reduced by decreasing the number of landmarks,\n    /// though at the possible expense of longer path-finding times.</remarks>\n    /// <param name=\"size\"></param>\n    protected static IFastList<HexCoords> DefaultLandmarks(HexSize size) {\n      return new HexPoint[] { new HexPoint(           0,             0),\n                              new HexPoint(size.Width/2,             0),\n                              new HexPoint(size.Width-1,             0),\n                              new HexPoint(           0, size.Height/2),\n                              new HexPoint(size.Width-1, size.Height/2),\n                              new HexPoint(           0, size.Height-1),\n                              new HexPoint(size.Width/2, size.Height-1),\n                              new HexPoint(size.Width-1, size.Height-1)\n                            }.Select(p => HexCoords.NewUserCoords(p)).ToFastList();\n    }\n\n    /// <summary>Returns an array of six <see cref=\"HexPoint\"/>s describing the corners of a hex on this <see cref=\"HexBoard{THex,TPath}\"/>.</summary>\n    /// <param name=\"gridSize\">Dimensions of a hex on this <see cref=\"HexBoard{THex,TPath}\"/> in pixels.</param>\n    protected static HexPoint[] HexgridPathPoints(HexSize gridSize) {\n      return new HexPoint[] { new HexPoint(gridSize.Width*1/3,              0  ), \n                              new HexPoint(gridSize.Width*3/3,              0  ),\n                              new HexPoint(gridSize.Width*4/3,gridSize.Height/2),\n                              new HexPoint(gridSize.Width*3/3,gridSize.Height  ),\n                              new HexPoint(gridSize.Width*1/3,gridSize.Height  ),\n                              new HexPoint(             0,    gridSize.Height/2)\n                            };\n    }\n\n    #region Constructors\n    /// <summary>Initializes the internal contents of <see cref=\"HexBoard{THex,TPath}\"/> with landmarks as specified for pathfinding.</summary>\n    /// <param name=\"sizeHexes\">Extent in hexes of the board being initialized, as a <see cref=\"System.Drawing.Size\"/>.</param>\n    /// <param name=\"gridSize\">Extent in pixels of the layout grid for the hexagons, as a <see cref=\"System.Drawing.Size\"/>.</param>\n    /// <param name=\"landmarkCoords\"><see cref=\"IFastList{HexCoords}\"/> of the hexes to be used as Path-Finding landmarks.</param>\n    /// <param name=\"hexgridPath\">Implementation of a graphics path for the hex border.</param>\n    /// <param name=\"boardStorage\">TODO</param>\n    protected HexBoard(HexSize sizeHexes, HexSize gridSize, IFastList<HexCoords> landmarkCoords, \n      Func<HexSize,TPath> hexgridPath, BoardStorageInitializer<THex,TPath> boardStorage\n    ) : this(sizeHexes,gridSize,hexgridPath,boardStorage) {\n      SetLandmarks(landmarkCoords);\n    }\n    private HexBoard(HexSize sizeHexes, HexSize gridSize, Func<HexSize,TPath> hexgridPath\n      , BoardStorageInitializer<THex,TPath> boardStorage\n    ) {\n      if (hexgridPath  == null) throw new ArgumentNullException(\"hexgridPath\");\n      if (boardStorage == null) throw new ArgumentNullException(\"boardStorage\");\n\n      MapScale      = 1.00F;\n      IsTransposed  = false;\n      MapSizeHexes  = sizeHexes;\n      GridSize      = gridSize;\n      HexgridPath   = hexgridPath(gridSize);\n      _boardHexes   = boardStorage();\n    }\n\n    [SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\")]\n    private void SetLandmarks(IFastList<HexCoords> landmarkCoords) {\n      ILandmarks tempLandmarks = null;\n      ILandmarks landmarks     = null;\n      try {\n        tempLandmarks = LandmarkCollection.CreateLandmarks(this, landmarkCoords);\n        landmarks     = tempLandmarks;\n        tempLandmarks = null;\n      } finally { if (tempLandmarks != null) tempLandmarks.Dispose(); }\n\n      Landmarks = landmarks;\n    }\n    #endregion\n\n    #region Properties & Fields\n    /// <summary>Offset of hex centre from upper-left corner, as a <see cref=\"HexSize\"/> struct.</summary>\n    public             HexSize    CentreOfHexOffset { get { return new HexSize(GridSize.Width * 2/3, GridSize.Height /2); } }\n    /// <summary>TODO </summary>\n    protected virtual  int        ElevationBase     { get {return  0;} } //!< Height in units of elevation level 0 (zero).\n    /// <summary>TODO </summary>\n    protected virtual  int        ElevationStep     { get {return 10;} } //!< Height increase in units of each elevation level.\n    /// <inheritdoc/>\n    public virtual     int        FovRadius         { get; set; }\n    /// <summary>TODO </summary>\n    public    virtual  int        HeightOfMan       { get {return  1;} } //!< Height in metres.\n    /// <inheritdoc/>\n    public             IHexgrid   Hexgrid           { \n      get {return TransposableHexgrid.GetNewGrid(IsTransposed,GridSize,MapScale);}\n    }\n    ///  <inheritdoc/>\n    public             HexSize    GridSize          { get; private set; }\n    ///  <inheritdoc/>\n    public             TPath      HexgridPath       { get; private set; }\n     ///  <inheritdoc/>\n    public             bool       IsTransposed      { get; set; }\n    /// <inheritdoc/>\n    public             ILandmarks Landmarks         { get; private set; }\n    ///  <inheritdoc/>\n    public             float      MapScale          { get; set; }\n    ///  <inheritdoc/>\n    public             HexSize    MapSizeHexes      { get; private set; }\n    ///  <inheritdoc/>\n    public             HexSize    MapSizePixels     { \n      get { return MapSizeHexes * new IntMatrix2D(GridSize.Width,                0, \n                                                               0,   GridSize.Height, \n                                                GridSize.Width/3, GridSize.Height/2); }\n    }\n    /// <inheritdoc/>\n    public             int        RangeCutoff       { get; set; }\n    /// <inheritdoc/>\n    public             THex  this[HexCoords coords] { get { return _boardHexes[coords];} }\n\n    private   IBoardStorage<THex> _boardHexes;\n    #endregion\n\n    #region Methods\n    /// <inheritdoc/>\n    public virtual   int  GetDirectedCostToExit(IHex hex, Hexside hexsideExit) {\n      //return hex==null ? -1 \n      //                 : this[hex.Coords].StepCost(hexsideExit);\n      return hex==null ? -1 \n                       : hex.StepCost(hexsideExit);\n    }\n    ///// <summary>TODO</summary>\n    //public async Task<ILandmarks> GetLandmarksAsync(System.Threading.CancellationToken token) {\n    //    if (_landmarks == null) _landmarks = await LandmarkCollection.CreateLandmarksAsync(this, _landmarkCoords, token);\n    //    return _landmarks; \n    //}\n    /// <inheritdoc/>\n    public           int  ElevationGroundASL(HexCoords coords) {\n      return ElevationBase + this[coords].ElevationLevel * ElevationStep;\n    }\n    /// <inheritdoc/>\n    public           int  ElevationHexsideASL(HexCoords coords, Hexside hexside) {\n      var hex = this[coords];\n      return ElevationBase + hex.ElevationLevel * ElevationStep + hex.HeightHexside(hexside);\n    }\n    /// <inheritdoc/>\n    public           int  ElevationTargetASL(HexCoords coords) {\n      return ElevationGroundASL(coords) + HeightOfMan;\n    }\n    /// <inheritdoc/>\n    public           int  ElevationObserverASL(HexCoords coords) {\n      return ElevationGroundASL(coords) + HeightOfMan;\n    }\n    /// <inheritdoc/>\n    public           int  ElevationTerrainASL(HexCoords coords) {\n      return ElevationGroundASL(coords) + this[coords].HeightTerrain;\n    }\n\n    /// <summary>Perform <paramref name=\"action\"/> for all neighbours of <paramref name=\"coords\"/>.</summary>\n    public           void ForAllNeighbours(HexCoords coords, Action<THex,Hexside> action) {\n      _boardHexes.ForAllNeighbours(coords,action);\n    }\n\n    /// <inheritdoc/>\n    public           void ForEach(Action<THex> action) { _boardHexes.ForEach(action); }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"action\"></param>\n    public           void ForEachHex(Action<IHex> action) { _boardHexes.ForEach(action); }\n\n    /// <summary>Returns the location and extent in hexes, as a <see cref=\"CoordsRectangle\"/>, of the current clipping region.</summary>\n    protected  CoordsRect GetClipInHexes(RectangleF visibleClipBounds, HexSize boardSizeHexes) {\n      var left    = Math.Max((int)visibleClipBounds.Left  /GridSize.Width  - 1, 0);\n      var top     = Math.Max((int)visibleClipBounds.Top   /GridSize.Height - 1, 0);\n      var right   = Math.Min((int)visibleClipBounds.Right /GridSize.Width  + 1, boardSizeHexes.Width);\n      var bottom  = Math.Min((int)visibleClipBounds.Bottom/GridSize.Height + 1, boardSizeHexes.Height); \n      return new CoordsRectangle (left, top, right-left, bottom-top);\n    }\n    \n    /// <inheritdoc/>\n    public virtual   int  Heuristic(int range) { return range; }\n\n    /// <inheritdoc/>\n    public           bool IsOnboard(HexCoords coords)  { return _boardHexes.IsOnboard(coords); }\n\n    /// <inheritdoc/>\n    public virtual   bool IsPassable(HexCoords coords) { return IsOnboard(coords); }\n\n    /// <inheritdoc/>\n    public           THex Neighbour(HexCoords coords, Hexside hexside) {\n      return _boardHexes.Neighbour(coords,hexside);\n    }\n\n    /// <inheritdoc/>\n    public virtual   int  StepCost(HexCoords coords, Hexside hexsideExit) {\n      return IsOnboard(coords) ? this[coords].StepCost(hexsideExit) : -1;\n    }\n    #endregion\n\n    #region IDisposable implementation (w/o Finalizer as the class possesses no unmanaged resources.)\n    private bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <inheritdoc/>\n    protected virtual void Dispose(bool disposing) {\n      if (! _isDisposed) {\n        if (disposing) {\n          var path = HexgridPath as IDisposable;\n          if (path != null) {  path.Dispose(); path = null;}\n          if (Landmarks   != null) { Landmarks.Dispose();   Landmarks   = null; }\n          if (_boardHexes != null) { _boardHexes.Dispose(); _boardHexes = null;}\n        }\n        _isDisposed = true;\n      }\n    }\n    #endregion\n  }\n}\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n\n  /// <summary>Extensions for the HexBoard class.</summary>\n  public static partial class HexBoardExtensions {\n    /// <summary>Returns a least-cost path from the hex <c>source</c> to the hex <c>target.</c></summary>\n    public static IDirectedPathCollection GetDirectedPath(this IHexBoard<IHex> @this, IHex source, IHex target) {\n      return GetDirectedPath(@this, source, target, false);\n    }\n    /// <summary>Returns a least-cost path from the hex <c>source</c> to the hex <c>target.</c></summary>\n    public static IDirectedPathCollection GetDirectedPath(this IHexBoard<IHex> @this, IHex source, IHex target\n      ,bool forceUnidirectional) {\n      if (@this  == null) throw new ArgumentNullException(\"this\");\n      if (source == null) throw new ArgumentNullException(\"source\");\n      if (target == null) throw new OperationCanceledException(\"target\");\n\n      if (@this.IsPassable(source.Coords)  &&  @this.IsPassable(target.Coords)) {\n        return (target.Coords.Range(source.Coords) <= @this.RangeCutoff  ||  forceUnidirectional)\n              ? UnidirectionalPathfinder.FindDirectedPathFwd(@this, source, target)\n              : (new BidirectionalPathfinder(@this, source, target)).PathRev;\n      } else\n        return default(IDirectedPathCollection);\n    }\n\n    /// <summary>Returns an <see cref=\"BidirectionalPathfinder\"/>.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"source\"></param>\n    /// <param name=\"target\"></param>\n    /// <returns>Returns an <see cref=\"IPathfinder{IHex}\"/> with a shortest path from <paramref name=\"source\"/> to <paramref name=\"target\"/>\n    /// as well as statistice on the Bidirectional path determination.</returns>\n    public static IPathfinder<IHex> GetBidirectionalPathfinder(this INavigableBoard<IHex> @this, IHex source, IHex target) {\n      return new BidirectionalPathfinder(@this, source, target);\n    }\n    /// <summary>Returns an <see cref=\"UnidirectionalPathfinder\"/>.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"source\"></param>\n    /// <param name=\"target\"></param>\n    /// <returns>Returns an <see cref=\"IPathfinder{IHex}\"/> with a shortest path from <paramref name=\"source\"/> to <paramref name=\"target\"/>\n    /// as well as statistice on the Unidirectional path determination.</returns>\n    public static IPathfinder<IHex> GetUnidirectionalPathfinder(this INavigableBoard<IHex> @this, IHex source, IHex target) {\n      return new UnidirectionalPathfinder(@this, source, target);\n    }\n\n#if NET45\n    /// <summary>Asynchronously returns a least-cost path from the hex <c>source</c> to the hex <c>target.</c></summary>\n    public static Task<IDirectedPathCollection> GetDirectedPathAsync(\n      this IHexBoard<IHex> @this, IHex source,  IHex target\n    ) {\n      return @this.GetDirectedPathAsync(source, target, false);\n    }\n    /// <summary>Asynchronously returns a least-cost path from the hex <c>source</c> to the hex <c>target.</c></summary>\n    public static Task<IDirectedPathCollection> GetDirectedPathAsync(\n      this IHexBoard<IHex> @this, IHex source,  IHex target, bool forceUnidirectional\n    ) {\n      if (@this == null) throw new ArgumentNullException(\"this\");\n      return Task.Run<IDirectedPathCollection>(\n          () => @this.GetDirectedPath(source, target, forceUnidirectional)\n      );\n    }\n#endif\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/HexCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Coordinate structure for hexagonal grids that abstracts the distinction \n  /// between rectangular (User) and canonical (Canon) bases (basis vectors, or reference \n  /// frame).</summary>\n  /// <remarks>\n  /// An obtuse reference frmae, with basis vectors at 120 degrees, eases most grid \n  /// calculations and movement operations; a rectangular reference frmae is easier for \n  /// most user interactions, and optimal for board storage. This structure hides the\n  /// distinction betwene them, and automatically converting from one to the other on \n  /// demand (and caching the result).\n  /// </remarks>\n  [DebuggerDisplay(\"User: {User}\")]\n  public struct HexCoords : IEquatable<HexCoords>, IFormattable  {\n    #region static members\n    /// <summary>Origin of the Canon(ical) coordinate frame.</summary>\n    public static HexCoords EmptyCanon { get { return _EmptyCanon; } }\n    /// <summary>Origin of the Rectangular (User) coordinate frame.</summary>\n    public static HexCoords EmptyUser  { get { return _EmptyUser; } }\n\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (IntVector2D vector){ return new HexCoords(true, vector); }\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Rectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (IntVector2D vector){ return new HexCoords(false,vector); }\n    /// <summary>Create a new instance located at the specified x and y offsets as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (int x, int y) { return new HexCoords(true, x,y); }\n    /// <summary>Create a new instance located at the specified x and y offsets as interpreted in the ectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (int x, int y) { return new HexCoords(false,x,y); }\n\n    static readonly IntMatrix2D MatrixUserToCanon = new IntMatrix2D(2, 1,  0,2,  0,0,  2);\n    static readonly IntMatrix2D MatrixCanonToUser = new IntMatrix2D(2,-1,  0,2,  0,1,  2);\n\n    static readonly HexCoords _EmptyCanon  = HexCoords.NewCanonCoords(0,0);\n    static readonly HexCoords _EmptyUser   = HexCoords.NewUserCoords(0,0);\n\n    static readonly IntVector2D vectorN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D vectorNE = new IntVector2D( 1, 0);\n    static readonly IntVector2D vectorSE = new IntVector2D( 1, 1);\n    static readonly IntVector2D vectorS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D vectorSW = new IntVector2D(-1, 0);\n    static readonly IntVector2D vectorNW = new IntVector2D(-1,-1);\n\n    static readonly IntVector2D[] HexsideVectors = new IntVector2D[] {\n      vectorN,  vectorNE, vectorSE, vectorS,  vectorSW, vectorNW\n    };\n    #endregion\n\n    #region Constructors\n    private HexCoords(bool isCanon, int x, int y) : this(isCanon, new IntVector2D(x,y)) {}\n    private HexCoords(bool isCanon, IntVector2D vector) : this() {\n      if (isCanon) { Canon = vector; userHasValue  = false; }\n      else         { User  = vector; canonHasValue = false; }\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Returns an <c>IntVector2D</c> representing the Canonical (obtuse) coordinates of this hex.</summary>\n    public  IntVector2D Canon {\n      get { return canonHasValue ? _Canon : ( Canon = _User * MatrixUserToCanon); }\n      private set { _Canon = value; canonHasValue = true; userHasValue = false; }\n    } private IntVector2D _Canon;\n    private bool canonHasValue;\n\n    /// <summary>Returns an <c>IntVector2D</c> representing the User (rectangular) coordinates of this hex.</summary>\n    public  IntVector2D User  {\n      get { return userHasValue ? _User : ( User = _Canon * MatrixCanonToUser); }\n      private set { _User = value;  userHasValue = true; canonHasValue = false; }\n    } private IntVector2D _User;\n    private bool userHasValue;\n    #endregion\n\n    #region Methods\n    /// <summary>Returns an <c>HexCoords</c> for the hex in direction <c>hexside</c> from this one.</summary>\n    public HexCoords GetNeighbour(Hexside hexside) {\n      return NewCanonCoords(Canon + HexsideVectors[(int)hexside]); \n    }\n\n    /// <summary>Returns all neighbouring hexes as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours() { \n      for (var hexside=0; hexside<HexsideVectors.Length; hexside++)\n        yield return new NeighbourCoords(NewCanonCoords(Canon + HexsideVectors[hexside]),\n                                        (Hexside)hexside); \n    }\n\n    /// <summary>Returns set of hexes at direction(s) specified by <c>hexsides</c>, as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours(Hexsides hexsides) { \n      return GetNeighbours().Where(n=>hexsides.HasFlag(n.Hexside));\n    }\n\n    /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from this one.</summary>\n    public int       Range(HexCoords coords) { \n      var deltaX = coords.Canon.X - Canon.X;\n      var deltaY = coords.Canon.Y - Canon.Y;\n      return ( Math.Abs(deltaX) + Math.Abs(deltaY) + Math.Abs(deltaX-deltaY) ) / 2;\n    }\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"g\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'C' or 'c': Canonical formatting - Int2Vector output of the Canonical coordinates for this hex;\n    /// - 'G' or 'g': General formatting - same as 'R';  \n    /// - 'R' or 'r': Range formatting - Scalar output of the Range of this hex from canonical (0,0);\n    /// - 'U' or 'u': Custom formatting - Int2Vector output of the Custom coordinates for this hex;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// The lower-case format comands prefix a descriptive string on the output (ie one of \"Canon: \",\n    /// \"User: \", \"Custom: \", or \"Range: \" respectivelly), while the upper-case commands do not.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0) format = \"G\";\n      var formatChar = format[0];\n      format = format.Substring(1);\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'C':   return this.Canon.ToString(format, formatProvider);\n        case 'G':   return this.User.ToString(format, formatProvider);\n        case 'U':   return this.UserToCustom().ToString(format, formatProvider);\n        case 'R':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n\n        case 'c':   return \"Canon: \"  + this.Canon.ToString(format, formatProvider);\n        case 'g':   return \"User: \"   + this.User.ToString(format, formatProvider);\n        case 'u':   return \"Custom: \" + this.UserToCustom().ToString(format, formatProvider);\n        case 'r':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return \"Range: \"  + this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n      }\n    }\n\n    /// <summary>Vector sum; <see cref=\"Add\"/>.</summary>\n    public static HexCoords operator + (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon + rhs.Canon);\n    }\n\n    /// <summary>Vector difference; <see cref=\"Subtract\"/>.</summary>\n    public static HexCoords operator - (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon - rhs.Canon);\n    }\n    /// <summary>(Canonical) vector sum of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Add(HexCoords lhs, HexCoords rhs) { return lhs + rhs; }\n    /// <summary>(Canonical) vector difference of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Subtract(HexCoords lhs, HexCoords rhs) { return lhs - rhs; }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as HexCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return User.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(HexCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (HexCoords lhs, HexCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (HexCoords lhs, HexCoords rhs) { return lhs.User == rhs.User; }\n    #endregion\n  } \n}\n"
  },
  {
    "path": "codeplex/HexUtilities/HexGrid.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\n#pragma warning disable 1587\n/// <summary>Display-technology-independent utilities for implementation of hex-grids..</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint  = System.Drawing.Point;\n  using HexPointF = System.Drawing.PointF;\n  using HexPoints = IList<System.Drawing.Point>;\n  using HexSize   = System.Drawing.Size;\n  using HexSizeF  = System.Drawing.SizeF;\n  using HexMatrix = System.Drawing.Drawing2D.Matrix;\n\n  /// <summary>C# implementation of the hex-picking algorithm noted below.</summary>\n  /// <remarks>Mathemagically (left as exercise for the reader) our 'picking' matrices are these, assuming: \n  ///  - origin at upper-left corner of hex (0,0);\n  ///  - 'straight' hex-axis vertically down; and\n  ///  - 'oblique'  hex-axis up-and-to-right (at 120 degrees from 'straight').</remarks>\n  /// <a href=\"file://Documentation/HexGridAlgorithm.mht\">Hex-grid Algorithms</a>\n  public abstract class TransposableHexgrid : IHexgrid {\n    /// <summary>Return a new instance of either <see cref=\"RightWayHexgrid\"/> or <see cref=\"TransposedHexgrid\"/> as appropriate.</summary>\n    public static   IHexgrid  GetNewGrid(bool isTransposed, HexSize gridSize, float scale) {\n      return GetNewGrid(isTransposed,gridSize,scale,HexSize.Empty);\n    }\n    /// <summary>Return a new instance of either <see cref=\"RightWayHexgrid\"/> or <see cref=\"TransposedHexgrid\"/> as appropriate.</summary>\n    public static   IHexgrid  GetNewGrid(bool isTransposed, HexSize gridSize, float scale, HexSize margin) {\n      return isTransposed ? (IHexgrid) new TransposedHexgrid(gridSize, scale, margin)\n                          : (IHexgrid) new RightWayHexgrid(gridSize, scale, margin);\n    }\n\n    /// <summary>Return a new instance of <c>Hexgrid</c>.</summary>\n    protected TransposableHexgrid(HexSize gridSize, float scale, HexSize margin) {\n      GridSize    = gridSize;\n      Scale       = scale;\n      Margin      = margin;\n\n      GridSizeF   = GridSize.Scale(Scale);\n      HexCorners = new List<HexPoint>() {\n        new HexPoint(GridSize.Width*1/3,              0  ), \n        new HexPoint(GridSize.Width*3/3,              0  ),\n        new HexPoint(GridSize.Width*4/3,GridSize.Height/2),\n        new HexPoint(GridSize.Width*3/3,GridSize.Height  ),\n        new HexPoint(GridSize.Width*1/3,GridSize.Height  ),\n        new HexPoint(             0,    GridSize.Height/2),\n        new HexPoint(GridSize.Width*1/3,              0  )\n      }.AsReadOnly();\n    }\n\n    #region Properties\n    /// <inheritdoc/>\n    public          HexSize   GridSize     { get; private set; }\n    /// <inheritdoc/>\n    public          HexSizeF  GridSizeF    { get; private set; }\n    /// <inheritdoc/>\n    public          HexPoints HexCorners   { get; private set; }\n    /// <inheritdoc/>\n    public abstract bool      IsTransposed { get; }\n    /// <inheritdoc/>\n    public          HexSize   Margin       { get; set; }\n    /// <inheritdoc/>\n    public          float     Scale        { get; private set; }\n\n    /// <summary><see cref=\"HexMatrix\"/> for 'picking' the <B>X</B> hex coordinate</summary>\n    private         HexMatrix _matrixX     { \n      get { return new HexMatrix(\n          (3.0F/2.0F)/GridSizeF.Width,  (3.0F/2.0F)/GridSizeF.Width,\n                 1.0F/GridSizeF.Height,       -1.0F/GridSizeF.Height,  -0.5F,-0.5F); } \n    }\n    /// <summary><see cref=\"HexMatrix\"/> for 'picking' the <B>Y</B> hex coordinate</summary>\n    private         HexMatrix _matrixY     { \n      get { return new HexMatrix(\n                                 0.0F,  (3.0F/2.0F)/GridSizeF.Width,\n                2.0F/GridSizeF.Height,         1.0F/GridSizeF.Height,  -0.5F,-0.5F); } \n    }\n    #endregion\n\n    #region Methods\n    /// <summary>Scroll position on the (possibly transposed) HexGrid.</summary>\n    public virtual  HexPoint  GetScrollPosition(HexPoint scrollPosition) { return scrollPosition; }\n\n    /// <inheritdoc/>\n    public virtual  HexSize   GetSize(HexSize mapSizePixels, float mapScale) {\n      return HexSize.Ceiling(mapSizePixels.Scale(mapScale)); \n    }\n\n    /// <inheritdoc/>\n    public virtual  HexCoords GetHexCoords(HexPoint point, HexSize autoScroll) {\n      // Adjust for origin not as assumed by GetCoordinate().\n      var grid    = new HexSize((int)(GridSizeF.Width*2F/3F), (int)GridSizeF.Height);\n      point      -= autoScroll + grid - Margin;\n\n      return HexCoords.NewCanonCoords( GetCoordinate(_matrixX, point), \n                                       GetCoordinate(_matrixY, point) );\n    }\n    /// <inheritdoc/>\n    public virtual  HexCoords GetHexCoords(HexPointF point, HexSizeF autoScroll) {\n      // Adjust for origin not as assumed by GetCoordinate().\n      var grid  = new HexSizeF(GridSizeF.Width*2F/3F, GridSizeF.Height);\n      point    -= autoScroll + grid - new HexSizeF(Margin.Width,Margin.Height);\n\n      return HexCoords.NewCanonCoords( GetCoordinate(_matrixX, point), \n                                       GetCoordinate(_matrixY, point) );\n    }\n\n    /// <inheritdoc/>\n    public virtual  HexPoint  HexCenterPoint(HexCoords coordsNewULHex) {\n      var offset = new HexSize((int)(GridSizeF.Width*2F/3F), (int)GridSizeF.Height);\n      return HexOrigin(coordsNewULHex) + offset;\n    }\n\n    /// <summary>Returns the pixel coordinates of the center of the specified hex.</summary>\n    /// <param name=\"coords\"><see cref=\"HexCoords\"/> specification for which pixel center is desired.</param>\n    /// <returns>Pixel coordinates of the center of the specified hex.</returns>\n    private         HexPoint  HexOrigin(HexCoords coords) {\n      return new HexPoint(\n        (int)(GridSizeF.Width  * coords.User.X),\n        (int)(GridSizeF.Height * coords.User.Y   + GridSizeF.Height/2 * (coords.User.X+1)%2)\n      );\n    }\n\n    /// <inheritdoc/>\n    public virtual  HexPoint  ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex, CoordsRectangle visibleRectangle) {\n      return HexCenterPoint(HexCoords.NewUserCoords(\n              coordsNewCenterHex.User - ( new IntVector2D(visibleRectangle.Size.User) / 2 )\n      ));\n    }\n\n    /// <summary>Calculates a (canonical X or Y) grid-coordinate for a point, from the supplied 'picking' matrix.</summary>\n    /// <param name=\"matrix\">The 'picking-matrix' matrix</param>\n    /// <param name=\"point\">The screen point identifying the hex to be 'picked'.</param>\n    /// <returns>A (canonical X or Y) grid coordinate of the 'picked' hex.</returns>\n\t  static int GetCoordinate (HexMatrix matrix, HexPoint point){\n      var points = new HexPoint[] {point};\n      matrix.TransformPoints(points);\n\t\t  return (int) Math.Floor( (points[0].X + points[0].Y + 2F) / 3F );\n\t  }\n    /// <summary>Calculates a (canonical X or Y) grid-coordinate for a point, from the supplied 'picking' matrix.</summary>\n    /// <param name=\"matrix\">The 'picking-matrix' matrix</param>\n    /// <param name=\"point\">The screen point identifying the hex to be 'picked'.</param>\n    /// <returns>A (canonical X or Y) grid coordinate of the 'picked' hex.</returns>\n\t  static int GetCoordinate (HexMatrix matrix, HexPointF point){\n      var points = new HexPointF[] {point};\n      matrix.TransformPoints(points);\n\t\t  return (int) Math.Floor( (points[0].X + points[0].Y + 2F) / 3F );\n\t  }\n    #endregion\n\n    /// <summary>A right-way hexgrid (with flat-top/pointy-sided hexes); the rectangular i-axis running \n    /// horizontally out to the right; and the rectangular j-axis running vertically down from the upper-left corner \n    /// (which remains coordinate (0,0) for both User (rectangular) and Canon (obtuse) coordinate frames.</summary>\n    internal sealed class RightWayHexgrid : TransposableHexgrid {\n      /// <summary>Returns a <see cref=\"RightWayHexgrid\"/> instance.</summary>\n      public RightWayHexgrid(HexSize gridSize, float scale, HexSize margin) : base(gridSize, scale, margin) { }\n\n      public override bool IsTransposed { get {return false;} }\n    }\n\n    /// <summary>A transposed hexgrid (with pointy-top/flat-sided hexes); the rectangular i-axis running \n    /// verticallly down; and the rectangular j-axis running horizontally out to the right from the upper-left corner \n    /// (which remains coordinate (0,0) for both User (rectangular) and Canon (obtuse) coordinate frames.</summary>\n    internal sealed class TransposedHexgrid : TransposableHexgrid {\n      /// <summary>Returns a <see cref=\"TransposedHexgrid\"/> instance.</summary>\n      public TransposedHexgrid(HexSize gridSize, float scale, HexSize margin) : base(gridSize, scale, margin) {}\n\n      /// <inheritdoc/>\n      public override HexPoint GetScrollPosition(HexPoint scrollPosition) { \n        return TransposePoint(scrollPosition); \n      }\n\n      public override bool IsTransposed { get {return true;} }\n\n      /// <inheritdoc/>\n      public override HexSize  GetSize(HexSize mapSizePixels, float mapScale) { \n        return TransposeSize(base.GetSize(mapSizePixels, mapScale)); \n      }\n\n      /// <inheritdoc/>\n      public override HexCoords GetHexCoords(HexPoint point, HexSize autoScroll) {\n        return base.GetHexCoords(TransposePoint(point), TransposeSize(autoScroll));\n      }\n      /// <inheritdoc/>\n      public override HexPoint HexCenterPoint(HexCoords coordsNewULHex) {\n        return TransposePoint(base.HexCenterPoint(coordsNewULHex));\n      }\n\n      static HexPoint TransposePoint(HexPoint point) { return new HexPoint(point.Y, point.X); }\n      static HexSize  TransposeSize(HexSize  size)   { return new HexSize (size.Height, size.Width); }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/HexUtilities.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{013628E1-60E2-40A6-91D4-8B446F397A0A}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexUtilities</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexUtilities</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45, HotPriorityQueue, TraceFoV</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>\n    </DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45, HotPriorityQueue</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexUtilities.xml</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45, HotPriorityQueue,TraceFoV</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45, HotPriorityQueue, TraceFoV</DefineConstants>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>NET45, HotPriorityQueue</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45, HotPriorityQueue,TraceFoV</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRulesLessCA1303.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Common\\BlockedBoardStorage32x32.cs\" />\n    <Compile Include=\"Common\\BoardStorage.cs\" />\n    <Compile Include=\"Common\\DebugTracing.cs\" />\n    <Compile Include=\"Common\\EnumExtensions.cs\" />\n    <Compile Include=\"Common\\EnumHelper.cs\" />\n    <Compile Include=\"Common\\Extensions.cs\" />\n    <Compile Include=\"Common\\FastList.cs\" />\n    <Compile Include=\"Common\\ImmutableStack.cs\" />\n    <Compile Include=\"Common\\IntMatrix2D.cs\" />\n    <Compile Include=\"Common\\IntVector2D.cs\" />\n    <Compile Include=\"Common\\PointExtensions.cs\" />\n    <Compile Include=\"Common\\SizeExtensions.cs\" />\n    <Compile Include=\"Common\\UserCoordsRectangle.cs\" />\n    <Compile Include=\"CustomCoordsFactory.cs\" />\n    <Compile Include=\"Common\\FlatBoardStorage.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexCoords.cs\" />\n    <Compile Include=\"Hexside.cs\" />\n    <Compile Include=\"Hexsides.cs\" />\n    <Compile Include=\"Common\\IBoardStorage.cs\" />\n    <Compile Include=\"FieldOfView\\IFieldOfView.cs\" />\n    <Compile Include=\"IHex.cs\" />\n    <Compile Include=\"IHexBoard.cs\" />\n    <Compile Include=\"IHexgrid.cs\" />\n    <Compile Include=\"IMapDisplay.cs\" />\n    <Compile Include=\"NeighbourCoords.cs\" />\n    <Compile Include=\"NeighbourHex.cs\" />\n    <Compile Include=\"Pathfinding\\BidirectionalPathfinder.cs\" />\n    <Compile Include=\"Pathfinding\\ConcurrentHashSet.cs\" />\n    <Compile Include=\"Pathfinding\\DictPriorityQueue.cs\" />\n    <Compile Include=\"HexGrid.cs\" />\n    <Compile Include=\"Hex.cs\" />\n    <Compile Include=\"HexBoard.cs\" />\n    <Compile Include=\"Pathfinding\\HexKeyValuePair.cs\" />\n    <Compile Include=\"Pathfinding\\HotPriorityQueue.cs\" />\n    <Compile Include=\"Pathfinding\\HotPriorityQueueueList.cs\" />\n    <Compile Include=\"Pathfinding\\IDirectedPathCollection.cs\" />\n    <Compile Include=\"Pathfinding\\ILandmark.cs\" />\n    <Compile Include=\"Pathfinding\\INavigableBoard.cs\" />\n    <Compile Include=\"Pathfinding\\IPathfinder.cs\" />\n    <Compile Include=\"Pathfinding\\IPriorityQueue.cs\" />\n    <Compile Include=\"Pathfinding\\Landmark.cs\" />\n    <Compile Include=\"Pathfinding\\DirectedPathCollection.cs\" />\n    <Compile Include=\"Pathfinding\\LandmarkCollection.cs\" />\n    <Compile Include=\"Pathfinding\\UnidirectionalPathfinder.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"FieldOfView\\FieldOfView.cs\" />\n    <Compile Include=\"FieldOfView\\FovFactory.cs\" />\n    <Compile Include=\"FieldOfView\\FovCone.cs\" />\n    <Compile Include=\"FieldOfView\\FovQueue.cs\" />\n    <Compile Include=\"FieldOfView\\RiseRun.cs\" />\n    <Compile Include=\"FieldOfView\\ShadowCastingFov.cs\" />\n    <Compile Include=\"FieldOfView\\Dodecant.cs\" />\n    <Compile Include=\"FieldOfView\\ShadowCastingFov_Utilities.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexUtilities/Hexside.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Enumeration of the six hexagonal directions.</summary>\n  public enum Hexside {\n    /// <summary>The hexside on the top of the hex.</summary>\n    North,    \n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast,    \n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast,    \n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South,    \n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest,   \n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest\n  }\n\n\n  /// <summary>Common <i>extension methods</i> for <c>Hexside</c> and <c>HexSideFlags</c>.</summary>\n  public static partial class HexsideExtensions {\n    /// <summary><c>Static List {Hexside}</c> for enumerations.</summary>\n    public static readonly ReadOnlyCollection<Hexside> HexsideList \n      = EnumExtensions.EnumGetValues<Hexside>().ToList().AsReadOnly();\n      \n    internal static readonly ReadOnlyCollection<Hexsides> HexsideFlags\n      = HexsideList.Select(h=>EnumExtensions.ParseEnum<Hexsides>(h.ToString()))\n                   .ToList().AsReadOnly();\n\n    /// <summary>Static List {HexSideFlags} for enumerations.</summary>\n    public static readonly IEnumerable<Hexsides> HexsideCollection = HexsideFlags;\n\n    /// <summary>The <c>Hexside</c> corresponding to this <c>HexsideFlag</c>, or -1 if it doesn't exist.</summary>\n    public static Hexside IndexOf(this Hexsides @this) {\n      return (Hexside)HexsideFlags.IndexOf(@this);\n    }\n\n    /// <summary>The <c>HexsideFlag</c> corresponding to this <c>HexSide</c>.</summary>\n    public static Hexsides Direction(this Hexside @this) { return HexsideFlags[(int)@this]; }\n\n    /// <summary>Returns the reversed, or opposite, <c>Hexside</c> to the supplied value.</summary>\n    /// <param name=\"this\"></param>\n    public static Hexside Reversed(this Hexside @this) {\n      return (@this <= Hexside.Southeast) ? (@this + 3) : (@this - 3);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/HexsideFlags.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Flags for combinations of the six hexagonal directions.</summary>\n  [Flags]public enum Hexsides {\n    /// <summary>The selection of no hexsides.</summary>\n    None      = 0x00,\n    /// <summary>The hexside on the top of the hex.</summary>\n    North     = 1 << Hexside.North,\n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast = 1 << Hexside.Northeast,\n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast = 1 << Hexside.Southeast,\n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South     = 1 << Hexside.South,\n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest = 1 << Hexside.Southwest,\n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest = 1 << Hexside.Northwest,\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class HexsidesExtensions {\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool AreAllClear(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//,\"Value must not be 0.\");\n      return (@this & testBits) == 0;\n    }\n    /// <summary>Tests (without boxing) if all flags are set.</summary>\n    public static bool AreAllSet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) == testBits;\n    }\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool IsAnySet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) != 0;\n    }\n    /// <summary>Clears the bits clearBits in this.</summary>\n    public static Hexsides ClearBits(this Hexsides @this, Hexsides bits) {\n      return @this & ~bits;\n    }\n    /// <summary>Sets the bits setBits in this.</summary>\n    public static Hexsides SetBits(this Hexsides @this, Hexsides bits) {\n      return @this | bits;\n    }\n    /// <summary>Performs action for all bits set in this.</summary>\n    public static void ForEach(this Hexsides @this, Action<Hexsides> action) {\n      if (action == null) throw new ArgumentNullException(\"action\");\n      for (UInt32 bit = 1; bit != 0; bit <<= 1) {\n        var flag = (Hexsides) bit;\n        if (@this.IsAnySet(flag)) action(flag);\n      }\n    }\n\n    private static readonly int[] LookupTable = Enumerable.Range(0,256).Select(CountBits).ToArray();\n\n    private static int CountBits(int value) {\n      int count = 0;\n      for (int i=0; i < 8; i++) { count += (value >> i) & 1; }\n      return count;\n    }\n\n    /// <summary>Returns the count of of set bit-flags in the argument.</summary>\n    /// <param name=\"this\"></param>\n    public static int BitCount(this Hexsides @this) { return LookupTable[(int)@this]; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/IMapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows;\n\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint  = System.Drawing.Point;\n  using HexSize   = System.Drawing.Size;\n\n  /// <summary>(Technology-independent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplay {\n    /// <summary>TODO</summary>\n     int      FovRadius       { get; set; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the goal hex for path-fnding.</summary>\n    HexCoords GoalHex         { get; set; }\n    /// <summary>Gets the extens in pixels of the grid upon whch hexes are to be laid out.</summary>\n    /// <remarks>>Width is 3/4 of the point-to-point width of each hex, and Height is the full height.\n    /// Hexes should be defined assumed flat-topped and pointy-sided, and the entire board transposed \n    /// if necessary.</remarks>\n    HexSize   GridSize        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the hex currently under the mouse.</summary>\n    HexCoords HotspotHex      { get; set; }\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    bool      IsTransposed    { get; set; }\n    /// <summary>Gets or sets the index (-1 for none) of the path-finding <see cref=\"Landmark\"/> to show.</summary>\n     int      LandmarkToShow  { get; set; }\n    /// <summary>Current scaling factor for map display.</summary>\n    float     MapScale        { get; set; } \n    /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n    HexSize   MapSizePixels   { get; }\n    /// <summary>Gets the display name for this HexgridPanel host.</summary>\n    string    Name            { get; }\n    /// <summary>Gets the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    IDirectedPathCollection Path        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the start hex for path-finding.</summary>\n    HexCoords StartHex        { get; set; }\n    ///// <summary>Gets or sets whether to display the FIeld-of-View for <see Cref=\"HotspotHex\"/>.</summary>\n    //bool   ShowFov            { get; set; }\n    ///// <summary>Gets or sets whether to display the hexgrid.</summary>\n    //bool   ShowHexgrid        { get; set; }\n    ///// <summary>Gets or sets whether to display the shortest path from <see Cref=\"StartHex\"/> to <see Cref=\"GoalHex\"/>.</summary>\n    //bool   ShowPath           { get; set; }\n    ///// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n    //bool   ShowPathArrow      { get; set; }\n    ///// <summary>Gets or sets whether to display the shortest path from <see Cref=\"StartHex\"/> to <see Cref=\"GoalHex\"/>.</summary>\n    //bool   ShowRangeLine      { get; set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/NeighbourCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"{Coords} at {Hexside}\")]\n  public struct NeighbourCoords : IEquatable<NeighbourCoords> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourCoords(HexCoords coords, Hexside hexside) : this() {\n      Coords = coords; Hexside = hexside;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public Hexside   Hexside   { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords Coords    { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\"Neighbour: {0} at {1}\", Coords.User,Hexside);\n    }\n\n    /// <summary>TODO</summary>\n    public static Func<NeighbourCoords,T> Bind<T>(Func<HexCoords,T> f) {\n      return n => f(n.Coords);\n    }\n\n    #region Value Equality - on Coords field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as NeighbourCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int  GetHashCode() { return Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourCoords lhs, NeighbourCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourCoords lhs, NeighbourCoords rhs) { \n      return lhs.Coords == rhs.Coords; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/NeighbourHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"NeighbourHex: {Hex.Coords} exits to {HexsideEntry}\")]\n  public struct NeighbourHex : IEquatable<NeighbourHex> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex) : this(hex, null) {}\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex, Hexsides hexside)  : this(hex,hexside.IndexOf()) {}\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex, Hexside? hexsideIndex) : this() {\n      Hex          = hex;\n      HexsideEntry = hexsideIndex ?? 0;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>The Hex</summary>\n    public IHex    Hex          { get; private set; }\n\n    /// <summary>The hexside through which the agent enters this hex from the neighbour.</summary>\n    public Hexside HexsideEntry { get; private set; }\n\n    /// <summary>The hexside through which the agent exits this hex to return to the neighbour.</summary>\n    public Hexside HexsideExit  { get {return HexsideEntry.Reversed();} }\n\n    /// <summary>TODO</summary> <deprecated/>\n    [Obsolete(\"Use HexsideEntry instead.\")]\n    public Hexside HexsideIndex { get {return HexsideEntry;} }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\n        \"NeighbourHex: {0} exits to {1}\", Hex.Coords, HexsideEntry);\n    }\n\n    #region Value Equality - on Hex field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj)                  {\n      var other = obj as NeighbourHex?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Hex.Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourHex other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourHex lhs, NeighbourHex rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourHex lhs, NeighbourHex rhs) {\n      return lhs.Hex.Coords == rhs.Hex.Coords;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/BidirectionalPathfinder.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\n#pragma warning disable 1587\n/// <summary>A fast efficient serial implementation of <b>Bidirectional ALT</b> (<b>A*</b> with <b>L</b>andmarks\n/// and <b>T</b>riangle-inequality heuristic) <b>path-finding</b> on a <see cref=\"Hexgrid\"/> map.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  using DirectedPath    = DirectedPathCollection;\n  using IDirectedPath   = IDirectedPathCollection;\n  using IPriorityQueue  = IPriorityQueue<int,IDirectedPathCollection>;\n  using IDictionary     = IDictionary<HexCoords,IDirectedPathCollection>;\n\n  /// <summary>Interface of common data structures exposed to <see cref=\"BidirectionalPathfinder.DirectionalPathfinder\"/>s.</summary>\n  internal interface IPathHalves {\n    int              BestSoFar { get; }\n    ISet<HexCoords>  ClosedSet { get; }\n\n    void             SetBestSoFar(IDirectedPath pathRev, IDirectedPath pathFwd);\n  }\n\n  /// <summary>C# (serial) implementation of NBA* path-finding algorithm by Pijls &amp; Post (Adapted).</summary>\n  /// <remarks>Adapted to hex-grids, and using a suggestion by Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz.</remarks>\n  /// <see cref=\"UnidirectionalPathfinder\"/>\n  /// See also: <a href=\"http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/GW05.pdf\">Computing Point-to-Point Shortest Paths from Extenal Memory - Andrew V. Goldberg &amp; Renato F. Werneck</a>\n  /// See also: <a href=\"http://homepages.dcc.ufmg.br/~chaimo/public/ENIA11.pdf\">PNBA*: A Parallel Bidirectional Heuristic Search Algorithm - Luis Henrique Oliveira Rios &amp; Luiz Chaimowicz</a>\n  /// See also: <a href=\"http://repub.eur.nl/res/pub/16100/ei2009-10.pdf\">Yet Another Bidirectional Algorithm for Shortest Paths - Wim Pijls &amp; Henk Post </a>\n  /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">A* Algorithm Notes</a>\n  public sealed class BidirectionalPathfinder : Pathfinder, IPathHalves {\n    /// <summary>Returns an <c>IPath</c> for the optimal path from coordinates <paramref name=\"source\"/> to <paramref name=\"target\"/>.</summary>\n    /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// <see cref=\"FindDirectedPathRev\"/>\n    public static IDirectedPath FindDirectedPathFwd(INavigableBoard<IHex> board, IHex source, IHex target) {\n      return (new BidirectionalPathfinder(board, source, target)).PathRev;\n    }\n    /// <summary>As <see cref=\"FindDirectedPathFwd\"/>, except with the steps stacked in reverse for more convenient use.</summary>\n    /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// <remarks>\n    /// The path steps are ordered in reverse as the forward half-path has been stacked \n    /// onto the reverse half-path during post-processing, instead of the reverse.\n    /// </remarks>\n    /// <see cref=\"FindDirectedPathFwd\"/>\n    public static IDirectedPath FindDirectedPathRev(INavigableBoard<IHex> board, IHex source, IHex target) {\n      return (new BidirectionalPathfinder(board, source, target)).PathFwd;\n    }\n\n    /// <summary>Calculates an <c>IPath</c> for the optimal path from coordinates .</summary>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n    public BidirectionalPathfinder(INavigableBoard<IHex> board, IHex source, IHex target) \n    : base(board, source, target, new HashSet<HexCoords>()) {\n      Pathfinder.TraceFindPathDetailInit(Source.Coords, Target.Coords);\n\n      _bestSoFar        = int.MaxValue;\n      var pathfinderFwd = new BidirectionalPathfinder.DirectionalPathfinder.PathfinderRev(board, source, target, this);\n      var pathfinderRev = new BidirectionalPathfinder.DirectionalPathfinder.PathfinderFwd(board, source, target, this);\n\n      // Alternate searching from each direction and calling the other direction\n      pathfinderFwd.Partner = pathfinderRev;\n      var pathfinder        = pathfinderRev.Partner\n                            = pathfinderFwd;\n\n      while (! pathfinder.IsFinished())  pathfinder = pathfinder.Partner; \n\n      TraceFindPathDone(ClosedSet.Count);\n    }\n   \n    #region Properties\n    /// <summary>Retrieve the found path in walking order: first step at top of stack to target at bottom.</summary>\n    /// <see cref=\"BidirectionalPathfinder.PathRev\"/>\n    public    IDirectedPath       PathFwd   { get { return MergePaths(_pathFwd, _pathRev); } }\n    /// <summary>Retrieve the found path in reverse walking order: target at top of stack to first step at bottom.</summary>\n    /// <see cref=\"BidirectionalPathfinder.PathFwd\"/>\n    public    IDirectedPath       PathRev   { get { return MergePaths(_pathRev, _pathFwd); } }\n\n    /// <see cref=\"PathFwd\"/>\n    [Obsolete(\"Deprecated - use property PathFwd instead.\")]\n    public    IDirectedPath       Path      { get {return PathFwd;} }\n    #endregion\n\n    #region IPathHalves implementation\n    /// <summary>Retrieves the cost of the shortest path found so far.</summary>\n              int     IPathHalves.BestSoFar { get {return _bestSoFar;} } int _bestSoFar;\n    /// <summary>Updates the record of the shortest path found so far.</summary>\n    /// <param name=\"pathFwd\">The half-path obtained by searching backward from the target (so stacked forwards).</param>\n    /// <param name=\"pathRev\">The half-path obtained by searching forward from the source (so stacked backwards).</param>\n              void    IPathHalves.SetBestSoFar(IDirectedPath pathRev, IDirectedPath pathFwd) {\n      if (pathFwd==null  ||  pathRev==null) return;\n\n      if( pathFwd.TotalCost + pathRev.TotalCost < _bestSoFar) {\n        _pathRev    = pathRev; \n        _pathFwd    = pathFwd; \n        _bestSoFar  = _pathRev.TotalCost + _pathFwd.TotalCost;\n\n        Pathfinder.TraceFindPathDetailBestSoFar(pathFwd.PathStep.Hex.Coords, pathRev.PathStep.Hex.Coords, _bestSoFar);\n      }\n    }\n\n              /// <summary>TODO</summary>\n    private static  IDirectedPath MergePaths(IDirectedPath targetPath, IDirectedPath sourcePath) {\n      if (sourcePath != null) {\n        while (sourcePath.PathSoFar != null) {\n          var hexside = sourcePath.PathStep.HexsideExit;\n          var cost    = sourcePath.TotalCost - (sourcePath = sourcePath.PathSoFar).TotalCost;\n          targetPath  = targetPath.AddStep(sourcePath.PathStep.Hex, hexside, cost);\n        }\n      }\n      return targetPath;\n    }\n\n    /// <summary>The half-path obtained by searching backward from the target (so stacked forwards).</summary>\n    private   IDirectedPath       _pathFwd;\n    /// <summary>The half-path obtained by searching forward from the source (so stacked backwards).</summary>\n    private   IDirectedPath       _pathRev;\n    #endregion\n\n    /// <summary>The shared algorithm of the forward- and backward-searches.</summary>\n    [DebuggerDisplay(\"\")]\n    internal abstract class DirectionalPathfinder : Pathfinder {\n      // Common settings for both directions\n      /// <param name=\"board\">Board on which this path search is taking place.</param>\n      /// <param name=\"start\">Start hex for this half of the bidirectional path search.</param>\n      /// <param name=\"goal\">Goal hex for this this half of the bidirectional path search.</param>\n      /// <param name=\"pathHalves\"></param>\n      protected DirectionalPathfinder(INavigableBoard<IHex> board, IHex start, IHex goal, IPathHalves pathHalves)\n      : base(board, start, goal, pathHalves.ClosedSet) {\n        PathHalves  = pathHalves;\n        OpenSet     = new Dictionary<HexCoords, IDirectedPath>();\n        Queue       = new HotPriorityQueue<IDirectedPath>(0,256);\n      }\n\n      #region Properties\n      private     int                   BestSoFar   { get {return PathHalves.BestSoFar;} }\n      protected   ILandmarkCollection   Landmarks   { get {return Board.Landmarks;} }\n      internal    DirectionalPathfinder Partner     { get; set; }\n      protected   IPathHalves           PathHalves  { get; private set; }\n\n      /// <summary>The start hex for this directional path search (Source for Fwd; Target for Rev).</summary>\n      protected abstract IHex           Start       { get; }\n      /// <summary>The goal hex for this directional path search (Target for Fwd; Source for Rev).</summary>\n      protected abstract IHex           Goal        { get; }\n\n      protected     IDictionary         OpenSet     { get; private set; }\n      protected     IPriorityQueue      Queue       { get; private set; }\n      #endregion\n\n      #region Methods\n      private             void          ExpandHex(IDirectedPath path, Hexside hexside) {\n        var here  = path.PathStep.Hex;\n        var there = Board[here.Coords.GetNeighbour(hexside)];\n        if (there != null  &&  ! ClosedSet.Contains(there.Coords) ) {\n          var cost = StepCost(here, hexside, there);\n          if( (cost > 0)\n          &&  (path.TotalCost+cost < BestSoFar  ||  ! OpenSet.ContainsKey(there.Coords))\n          ) {\n            var key     = path.TotalCost + cost + Heuristic(there.Coords);\n            var newPath = path.AddStep(there,HexsideDirection(hexside),cost);\n\n            TraceFindPathEnqueue(there.Coords, key, 0);\n\n            IDirectedPath oldPath;\n            if ( ! OpenSet.TryGetValue(there.Coords, out oldPath))  {\n              OpenSet.Add(there.Coords, newPath);\n              Queue.Enqueue(key, newPath);\n            } else if (newPath.TotalCost < oldPath.TotalCost) {\n              OpenSet.Remove(there.Coords);\n              OpenSet.Add(there.Coords, newPath);\n              Queue.Enqueue(key, newPath);\n            }\n\n            SetBestSoFar(newPath, GetPartnerPath(there.Coords));\n          }\n        }\n      }\n      private             int           FrontierMinimum() { \n        HexKeyValuePair<int,IDirectedPath> item;\n        return (Queue.TryPeek(out item) ? item.Key : int.MaxValue); \n      }\n      private             IDirectedPath GetPartnerPath(HexCoords coords) {\n        IDirectedPath path;\n        Partner.OpenSet.TryGetValue(coords,out path);\n        return path;\n      }\n      private             int           Heuristic(HexCoords coords) { \n        return Landmarks.Max(landmark => LandmarkHeuristic(landmark,coords));\n      }\n      protected abstract  Hexside       HexsideDirection(Hexside hexside);\n      internal            bool          IsFinished(){\n        HexKeyValuePair<int,IDirectedPath> item;\n        if ( Queue.TryDequeue(out item)) {\n          var path   = item.Value;\n          var coords = path.PathStep.Hex.Coords;\n\n          OpenSet.Remove(coords);\n          if( ! ClosedSet.Contains(coords) ) {\n\n            TraceFindPathDequeue(GetType().Name,coords, path.TotalCost, path.HexsideExit, item.Key, 0);\n\n            if (item.Key < BestSoFar\n            &&  path.TotalCost + Partner.FrontierMinimum() - Partner.Heuristic(coords) < BestSoFar\n            ) {\n              HexsideExtensions.HexsideList.ForEach(hexside => ExpandHex(path, hexside));\n            }\n            ClosedSet.Add(coords);\n          }\n          return ! Queue.Any();\n        }\n        return true;\n      }\n      private             int           LandmarkHeuristic(ILandmark landmark, HexCoords here){\n        return LandmarkPotential(landmark,here) - LandmarkPotential(landmark,Goal.Coords);\n      }\n      protected abstract  int           LandmarkPotential(ILandmark landmark, HexCoords coords);\n      protected abstract  void          SetBestSoFar(IDirectedPath fwdPath, IDirectedPath revPath);\n      protected           void          StartPath(IHex start) {\n        var path            = new DirectedPath(start);\n        OpenSet.Add(path.PathStep.Hex.Coords, path);\n        Queue.Enqueue (0, path);\n      }\n      protected abstract  int           StepCost(IHex here, Hexside hexside, IHex there);\n      #endregion\n\n      /// <summary>A <see cref=\"DirectedPath\"/> from start to join-point obtained by searching forwards from start.</summary>\n      /// <remarks>\n      /// <i>Source</i> and <i>Target</i> refer to the path beginning and ending hexes from the client \n      /// perspective; <c>Start</c> and <c>Goal</c> refer to the directional beginning and ending hexes\n      /// of the path from the algorithmic perspective. In the case of a reverse half-search, such as\n      /// in the implementation of PathfinderRev, the Target becomes the Start, and the Source becomes\n      /// the Goal, rather than the usual other way around.\n      /// </remarks>\n      internal sealed class PathfinderFwd : DirectionalPathfinder {\n        /// <summary>Create a new instance of <see cref=\"PathfinderFwd\"/>, a forward-searching <see cref=\"DirectionalPathfinder\"/>.</summary>\n        /// <param name=\"board\">Board on which this path search is taking place.</param>\n        /// <param name=\"source\">Source hex for this path search, the start for the directional path search.</param>\n        /// <param name=\"target\">Target hex for this path search, the goal for the directional path search.</param>\n        /// <param name=\"pathHalves\"></param>\n        internal PathfinderFwd(INavigableBoard<IHex> board, IHex source, IHex target, IPathHalves pathHalves)\n        : base (board,source,target,pathHalves) {\n          TraceFindPathDetailDirection(\"Fwd\", Goal.Coords - Start.Coords);\n          StartPath(Start);\n        }\n\n        protected override IHex    Start { get {return Source;} }\n        protected override IHex    Goal  { get {return Target;} }\n\n        protected override Hexside HexsideDirection(Hexside hexside) { return hexside; }\n        protected override int     LandmarkPotential(ILandmark landmark, HexCoords coords) {\n          return landmark.DistanceFrom(coords);\n        }\n        protected override void    SetBestSoFar(IDirectedPath selfPath, IDirectedPath partnerPath) {\n          PathHalves.SetBestSoFar(partnerPath, selfPath);\n        }\n        protected override int     StepCost(IHex here, Hexside hexside, IHex there) {\n          return Board.GetDirectedCostToExit(here, HexsideDirection(hexside));\n        }\n      }\n\n      /// <summary>A <see cref=\"DirectedPath\"/> from join-point to goal obtained by searching backwards from goal.</summary>\n      /// <remarks>\n      /// <i>Source</i> and <i>Target</i> refer to the path beginning and ending hexes from the client \n      /// perspective; <c>Start</c> and <c>Goal</c> refer to the directional beginning and ending hexes\n      /// of the path from the algorithmic perspective. In the case of a reverse half-search, such as\n      /// in the implementation of BidirectionalPathfinder, the Target becomes the Start, and the\n      /// Source becomes the Goal. This transition occurs in the constructor of <see cref=\"Pathfinder\"/>.\n      /// </remarks>\n      internal sealed class PathfinderRev : DirectionalPathfinder {\n        /// <summary>Create a new instance of <see cref=\"PathfinderRev\"/>, a backward-searching <see cref=\"DirectionalPathfinder\"/>.</summary>\n        /// <param name=\"board\">Board on which this path search is taking place.</param>\n        /// <param name=\"source\">Source hex for this path search, the goal for the directional path search.</param>\n        /// <param name=\"target\">Target hex for this path search, the start for the directional path search.</param>\n        /// <param name=\"pathHalves\"></param>\n        internal PathfinderRev(INavigableBoard<IHex> board, IHex source, IHex target, IPathHalves pathHalves)\n        : base (board,source,target,pathHalves)  {\n          TraceFindPathDetailDirection(\"Fwd\", Goal.Coords - Start.Coords);\n          StartPath(Start);\n        }\n\n        protected override IHex    Start { get {return Target;} }\n        protected override IHex    Goal  { get {return Source;} }\n\n        protected override Hexside HexsideDirection(Hexside hexside) { return hexside.Reversed(); }\n        protected override int     LandmarkPotential(ILandmark landmark, HexCoords coords) {\n          return landmark.DistanceTo(coords);\n        }\n        protected override void    SetBestSoFar(IDirectedPath selfPath, IDirectedPath partnerPath) {\n          PathHalves.SetBestSoFar(selfPath, partnerPath);\n        }\n        protected override int     StepCost(IHex here, Hexside hexside, IHex there) {\n          return Board.GetDirectedCostToExit(there, HexsideDirection(hexside));\n        }\n      }\n    }\n  }\n}\n\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/BlueRajaPriorityQueue.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities.BlueRaja {\n   public interface PriorityQueueNode \n    {\n        /// <summary>\n        /// The Priority to insert this node at.  Must be set BEFORE adding a node to the queue\n        /// </summary>\n        double Priority { get; set; }\n\n        /// <summary>\n        /// <b>Used by the priority queue - do not edit this value.</b>\n        /// Represents the order the node was inserted in\n        /// </summary>\n        long InsertionIndex { get; set; }\n\n        /// <summary>\n        /// <b>Used by the priority queue - do not edit this value.</b>\n        /// Represents the current position in the queue\n        /// </summary>\n        int QueueIndex { get; set; }\n    }\n  /// <summary>\n    /// An implementation of a min-Priority Queue using a heap.  Has O(1) .Contains()!\n    /// See https://bitbucket.org/BlueRaja/high-speed-priority-queue-for-c/wiki/Getting%20Started for more information\n    /// </summary>\n    /// <typeparam name=\"T\">The values in the queue.  Must implement the PriorityQueueNode interface</typeparam>\n    public sealed class HeapPriorityQueue<T> : IPriorityQueue<double,T>\n        where T : PriorityQueueNode, \n    {\n        private int _numNodes;\n        private readonly T[] _nodes;\n        private long _numNodesEverEnqueued;\n\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n      public bool Any() { return _numNodes > 0; }\n\n        /// <summary>\n        /// Instantiate a new Priority Queue\n        /// </summary>\n        /// <param name=\"maxNodes\">The max nodes ever allowed to be enqueued (going over this will cause an exception)</param>\n        public HeapPriorityQueue(int maxNodes)\n        {\n            _numNodes = 0;\n            _nodes = new T[maxNodes + 1];\n            _numNodesEverEnqueued = 0;\n        }\n\n        /// <summary>\n        /// Returns the number of nodes in the queue.  O(1)\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                return _numNodes;\n            }\n        }\n\n        /// <summary>\n        /// Returns the maximum number of items that can be enqueued at once in this queue.  Once you hit this number (ie. once Count == MaxSize),\n        /// attempting to enqueue another item will throw an exception.  O(1)\n        /// </summary>\n        public int MaxSize\n        {\n            get\n            {\n                return _nodes.Length - 1;\n            }\n        }\n\n        /// <summary>\n        /// Removes every node from the queue.  O(n) (So, don't do this often!)\n        /// </summary>\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        public void Clear()\n        {\n            for(int i = 1; i < _nodes.Length; i++)\n                _nodes[i] = null;\n            _numNodes = 0;\n        }\n\n        /// <summary>\n        /// Returns (in O(1)!) whether the given node is in the queue.  O(1)\n        /// </summary>\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        public bool Contains(T node)\n        {\n            return (_nodes[node.QueueIndex] == node);\n        }\n\n        /// <summary>\n        /// Enqueue a node - .Priority must be set beforehand!  O(log n)\n        /// </summary>\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        public void Enqueue(double priority, T node)\n        {\n            node.Priority = priority;\n            _numNodes++;\n            _nodes[_numNodes] = node;\n            node.QueueIndex = _numNodes;\n            node.InsertionIndex = _numNodesEverEnqueued++;\n            CascadeUp(_nodes[_numNodes]);\n        }\n\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        private void Swap(T node1, T node2)\n        {\n            //Swap the nodes\n            _nodes[node1.QueueIndex] = node2;\n            _nodes[node2.QueueIndex] = node1;\n\n            //Swap their indicies\n            int temp = node1.QueueIndex;\n            node1.QueueIndex = node2.QueueIndex;\n            node2.QueueIndex = temp;\n        }\n\n        //Performance appears to be slightly better when this is NOT inlined o_O\n        private void CascadeUp(T node)\n        {\n            //aka Heapify-up\n            int parent = node.QueueIndex / 2;\n            while(parent >= 1)\n            {\n                T parentNode = _nodes[parent];\n                if(HasHigherPriority(parentNode, node))\n                    break;\n\n                //Node has lower priority value, so move it up the heap\n                Swap(node, parentNode); //For some reason, this is faster with Swap() rather than (less..?) individual operations, like in CascadeDown()\n\n                parent = node.QueueIndex / 2;\n            }\n        }\n\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        private void CascadeDown(T node)\n        {\n            //aka Heapify-down\n            T newParent;\n            int finalQueueIndex = node.QueueIndex;\n            while(true)\n            {\n                newParent = node;\n                int childLeftIndex = 2 * finalQueueIndex;\n\n                //Check if the left-child is higher-priority than the current node\n                if(childLeftIndex > _numNodes)\n                {\n                    //This could be placed outside the loop, but then we'd have to check newParent != node twice\n                    node.QueueIndex = finalQueueIndex;\n                    _nodes[finalQueueIndex] = node;\n                    break;\n                }\n\n                T childLeft = _nodes[childLeftIndex];\n                if(HasHigherPriority(childLeft, newParent))\n                {\n                    newParent = childLeft;\n                }\n\n                //Check if the right-child is higher-priority than either the current node or the left child\n                int childRightIndex = childLeftIndex + 1;\n                if(childRightIndex <= _numNodes)\n                {\n                    T childRight = _nodes[childRightIndex];\n                    if(HasHigherPriority(childRight, newParent))\n                    {\n                        newParent = childRight;\n                    }\n                }\n\n                //If either of the children has higher (smaller) priority, swap and continue cascading\n                if(newParent != node)\n                {\n                    //Move new parent to its new index.  node will be moved once, at the end\n                    //Doing it this way is one less assignment operation than calling Swap()\n                    _nodes[finalQueueIndex] = newParent;\n\n                    int temp = newParent.QueueIndex;\n                    newParent.QueueIndex = finalQueueIndex;\n                    finalQueueIndex = temp;\n                }\n                else\n                {\n                    //See note above\n                    node.QueueIndex = finalQueueIndex;\n                    _nodes[finalQueueIndex] = node;\n                    break;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns true if 'higher' has higher priority than 'lower', false otherwise.\n        /// Note that calling HasHigherPriority(node, node) (ie. both arguments the same node) will return false\n        /// </summary>\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        private bool HasHigherPriority(T higher, T lower)\n        {\n            return (higher.Priority < lower.Priority ||\n                (higher.Priority == lower.Priority && higher.InsertionIndex < lower.InsertionIndex));\n        }\n\n        /// <summary>\n        /// Removes the head of the queue (node with highest priority; ties are broken by order of insertion), and returns it.  O(log n)\n        /// </summary>\n        public bool TryDequeue(out T result)\n        {\n          if ( ! Any()) {\n            result = default(T);\n            return false;\n          }\n\n            result = _nodes[1];\n            Remove(result);\n            return true;\n        }\n\n        /// <summary>\n        /// Returns the head of the queue, without removing it (use Dequeue() for that).  O(1)\n        /// </summary>\n        public bool TryPeek(out T result)\n        {\n          if ( ! Any()) {\n            result = default(T);\n            return false;\n          }\n\n            result = _nodes[1];\n            return true;\n        }\n\n        /// <summary>\n        /// This method must be called on a node every time its priority changes while it is in the queue.  \n        /// <b>Forgetting to call this method will result in a corrupted queue!</b>\n        /// O(log n)\n        /// </summary>\n        #if NET_VERSION_4_5\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        #endif\n        public void UpdatePriority(T node, double priority)\n        {\n            node.Priority = priority;\n            OnNodeUpdated(node);\n        }\n\n        private void OnNodeUpdated(T node)\n        {\n            //Bubble the updated node up or down as appropriate\n            int parentIndex = node.QueueIndex / 2;\n            T parentNode = _nodes[parentIndex];\n\n            if(parentIndex > 0 && HasHigherPriority(node, parentNode))\n            {\n                CascadeUp(node);\n            }\n            else\n            {\n                //Note that CascadeDown will be called if parentNode == node (that is, node is the root)\n                CascadeDown(node);\n            }\n        }\n\n        /// <summary>\n        /// Removes a node from the queue.  Note that the node does not need to be the head of the queue.  O(log n)\n        /// </summary>\n        public void Remove(T node)\n        {\n            if(_numNodes <= 1)\n            {\n                _nodes[1] = null;\n                _numNodes = 0;\n                return;\n            }\n\n            //Make sure the node is the last node in the queue\n            bool wasSwapped = false;\n            T formerLastNode = _nodes[_numNodes];\n            if(node.QueueIndex != _numNodes)\n            {\n                //Swap the node with the last node\n                Swap(node, formerLastNode);\n                wasSwapped = true;\n            }\n\n            _numNodes--;\n            _nodes[node.QueueIndex] = null;\n\n            if(wasSwapped)\n            {\n                //Now bubble formerLastNode (which is no longer the last node) up or down as appropriate\n                OnNodeUpdated(formerLastNode);\n            }\n        }\n\n        public IEnumerator<T> GetEnumerator()\n        {\n            for(int i = 1; i <= _numNodes; i++)\n                yield return _nodes[i];\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// <b>Should not be called in production code.</b>\n        /// Checks to make sure the queue is still in a valid state.  Used for testing/debugging the queue.\n        /// </summary>\n        public bool IsValidQueue()\n        {\n            for(int i = 1; i < _nodes.Length; i++)\n            {\n                if(_nodes[i] != null)\n                {\n                    int childLeftIndex = 2 * i;\n                    if(childLeftIndex < _nodes.Length && _nodes[childLeftIndex] != null && HasHigherPriority(_nodes[childLeftIndex], _nodes[i]))\n                        return false;\n\n                    int childRightIndex = childLeftIndex + 1;\n                    if(childRightIndex < _nodes.Length && _nodes[childRightIndex] != null && HasHigherPriority(_nodes[childRightIndex], _nodes[i]))\n                        return false;\n                }\n            }\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/ConcurrentHashSet.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Provides a thread-safe hash set data structure.</summary>\n  /// <typeparam name=\"TKey\">Specifies the type of elements in the hash set.</typeparam>\n  /// <typeparam name=\"TValue\">Type of the element value in the hash set.</typeparam>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  public class ConcurrentHashSet<TKey, TValue> : ISet<TKey> where TKey : IEquatable<TKey>\n  {\n    private readonly HashSet<TKey> _hashSet  = new  HashSet<TKey>();\n    private readonly object        _syncLock = new object();\n\n    /// <summary>Initializes a new instance of the <c>ConcurrentHashSet</c> class.</summary>\n    public ConcurrentHashSet() {}\n\n    /// <summary>Initializes a new instance of the <c>ConcurrentHashSet</c> class that \n    /// contains elements copied from the specified collection.</summary>\n    /// <param name=\"collection\">The collection whose elements are copied to the new \n    /// <c>ConcurrentHashSet</c>.</param>\n    public ConcurrentHashSet(IEnumerable<TKey> collection)\n    {\n      if (collection == null) throw new ArgumentNullException(\"collection\");\n      foreach (var item in collection) _hashSet.Add(item);\n    }\n\n    /// <inheritdoc/>\n    public int                     Count      { get { lock (_syncLock) return _hashSet.Count; } }\n\n    /// <inheritdoc/>\n    public IEqualityComparer<TKey> Comparer   { get { lock (_syncLock) return _hashSet.Comparer; } }\n\n    /// <inheritdoc/>\n    public bool                    IsReadOnly { get { lock (_syncLock) return false; } }\n\n    /// <inheritdoc/>\n    bool ISet<TKey>.Add(TKey item) { lock (_syncLock) return _hashSet.Add(item); }\n    /// <inheritdoc/>\n    public void Add(TKey item) { lock (_syncLock) _hashSet.Add(item); }\n\n    /// <inheritdoc/>\n    public void Clear() { lock(_syncLock) _hashSet.Clear(); }\n\n    /// <inheritdoc/>\n    public bool Contains(TKey item) { lock (_syncLock) return _hashSet.Contains(item); }\n\n    /// <inheritdoc/>\n    public void CopyTo(TKey[] array)\n    {\n      lock (_syncLock) _hashSet.CopyTo(array);\n    }\n    /// <inheritdoc/>\n    public void CopyTo(TKey[] array, int index, int count)\n    {\n      lock (_syncLock) _hashSet.CopyTo(array, index, count);\n    }\n    /// <inheritdoc/>\n    public void CopyTo(TKey[] array, int arrayIndex)\n    {\n      lock (_syncLock) _hashSet.CopyTo(array, arrayIndex);\n    }\n\n    /// <inheritdoc/>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n    public IEqualityComparer<HashSet<TKey>> CreateSetComparer() { \n      return HashSet<TKey>.CreateSetComparer(); \n    }\n\n    /// <inheritdoc/>\n    public void ExceptWith(IEnumerable<TKey> other) {\n      lock (_syncLock) _hashSet.ExceptWith(other);\n    }\n\n    /// <inheritdoc/>\n    IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }\n\n    /// <inheritdoc/>\n    public IEnumerator<TKey> GetEnumerator()\n    {\n        var arr = new TKey[_hashSet.Count];\n        CopyTo(arr);\n        return ((IEnumerable<TKey>)arr).GetEnumerator();\n    }\n\n    /// <inheritdoc/>\n    public void GetObjectData(\n      System.Runtime.Serialization.SerializationInfo info,\n      System.Runtime.Serialization.StreamingContext  context) {\n        lock (_syncLock) _hashSet.GetObjectData(info, context);\n    }\n\n    /// <inheritdoc/>\n    public void IntersectWith (IEnumerable<TKey> other) {\n      lock (_syncLock) _hashSet.IntersectWith(other);\n    }\n\n    /// <inheritdoc/>\n    public bool IsProperSubsetOf (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.IsProperSubsetOf(other);\n    }\n\n    /// <inheritdoc/>\n    public bool IsProperSupersetOf (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.IsProperSupersetOf(other);\n    }\n\n    /// <inheritdoc/>\n    public bool IsSubsetOf (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.IsSubsetOf(other);\n    }\n\n    /// <inheritdoc/>\n    public bool IsSupersetOf (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.IsSupersetOf(other);\n    }\n\n    /// <inheritdoc/>\n    public virtual void OnDeserialization(Object sender) {\n      lock (_syncLock) _hashSet.OnDeserialization(sender);\n    }\n\n    /// <inheritdoc/>\n    public bool Overlaps (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.Overlaps(other);\n    }\n\n    /// <inheritdoc/>\n    public bool Remove (TKey item) {\n      lock (_syncLock) return _hashSet.Remove(item);\n    }\n\n    /// <inheritdoc/>\n    public int RemoveWhere (Predicate<TKey> match) {\n      lock (_syncLock) return _hashSet.RemoveWhere(match);\n    }\n\n    /// <inheritdoc/>\n    public bool SetEquals (IEnumerable<TKey> other) {\n      lock (_syncLock) return _hashSet.SetEquals(other);\n    }\n\n    /// <inheritdoc/>\n    public void SymmetricExceptWith (IEnumerable<TKey> other) {\n      lock (_syncLock) _hashSet.SymmetricExceptWith(other);\n    }\n\n    /// <inheritdoc/>\n    public void TrimExcess() {\n      lock (_syncLock) _hashSet.TrimExcess();\n    }\n\n    /// <inheritdoc/>\n    public void UnionWith (IEnumerable<TKey> other) {\n      lock (_syncLock) _hashSet.UnionWith(other);\n    }\n  }\n}"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/DictPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n\n  /// <summary>TODO</summary>\n  public static class PriorityQueueFactory {\n    /// <summary>TODO</summary>\n    public static IPriorityQueue<TPriority,TValue> NewDictionaryQueue<TPriority,TValue>()\n    where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority> {\n      return new DictionaryPriorityQueue<TPriority,TValue>();\n    }\n\n    /// <summary>TODO</summary>\n    public static IPriorityQueue<int,TValue> NewHotPriorityQueue<TValue>() {\n      return new HotPriorityQueue<TValue>();\n    }\n  }\n\n\n  /// <summary>Stable (insertion-order preserving for equal-priority elements) PriorityQueue implementation.</summary>\n  /// <remarks>Eric Lippert's C# implementation of PriorityQueue for use by the A* algorithm.</remarks>\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/08/path-finding-using-a-in-c-3-0-part-three.aspx\">Path Finding Using A* Part Three</a>\n  /// <typeparam name=\"TPriority\">Type of the queue-item prioirty.</typeparam>\n  /// <typeparam name=\"TValue\">Type of the queue-item value.</typeparam>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class DictionaryPriorityQueue<TPriority,TValue> \n    : IPriorityQueue<TPriority,TValue>\n    where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority>\n  {\n    IDictionary<TPriority,Queue<TValue>> _list = new SortedDictionary<TPriority,Queue<TValue>>();\n\n    /// <inheritdoc/>\n    bool IPriorityQueue<TPriority,TValue>.Any() { return this.Any; }\n\n    /// <summary>Returns true exactly when the queue is not empty.</summary>\n    public bool Any { get { return this.Count > 0; } }\n\n    /// <inheritdoc/>\n    public int  Count { get { return _list.Count; } }\n\n    /// <inheritdoc/>\n    public void Enqueue(TPriority priority, TValue value) { \n      Enqueue(new HexKeyValuePair<TPriority,TValue>(priority,value)); \n    }\n    /// <inheritdoc/>\n    public void Enqueue(HexKeyValuePair<TPriority,TValue> item) {\n      Queue<TValue> queue;\n      if( ! _list.TryGetValue(item.Key, out queue) ) {\n        queue = new Queue<TValue>();\n        _list.Add(item.Key, queue);\n      }\n      queue.Enqueue(item.Value);\n    }\n\n    /// <inheritdoc/>\n    public bool TryDequeue(out HexKeyValuePair<TPriority,TValue> result) {\n      if (_list.Count > 0)  {\n        var pair = _list.First();\n        var v    = pair.Value.Dequeue();\n        result   = new HexKeyValuePair<TPriority,TValue>(pair.Key,v);\n        if( pair.Value.Count == 0)  _list.Remove(pair.Key);\n        return true;\n      }\n      result = default(HexKeyValuePair<TPriority,TValue>);\n      return false;\n    }\n\n    /// <inheritdoc/>\n    public bool TryPeek(out HexKeyValuePair<TPriority,TValue> result) {\n      if (_list.Count > 0)  {\n        var pair = _list.First();\n        var v    = pair.Value.Peek();\n        result   = new HexKeyValuePair<TPriority,TValue>(pair.Key,v);\n        return true;\n      }\n      result = default(HexKeyValuePair<TPriority,TValue>);\n      return false;\n    }\n\n    /// <summary>TODO</summary>\n    public void Clear() { _list.Clear(); }\n\n    /// <summary>TODO</summary>\n    public bool Contains(TValue value) { \n      return Enumerable().Select(i => i.Value).Contains(value);\n    }\n\n    /// <summary>TODO</summary>\n    public void CopyTo(HexKeyValuePair<TPriority,TValue>[] array, int arrayIndex) { \n      if (array==null) throw new ArgumentNullException(\"array\");\n      foreach(var item in Enumerable()) array[arrayIndex++] = item;\n    }\n\n    /// <summary>TODO</summary>\n    public HexKeyValuePair<TPriority,TValue> Dequeue() { \n      HexKeyValuePair<TPriority,TValue> result;\n      if (this.TryDequeue(out result)) return result;\n      throw new InvalidOperationException();\n    }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n    public IEnumerator<HexKeyValuePair<TPriority,TValue>> GetEnumerator() {\n      foreach(var item in Enumerable()) \n        yield return item;\n    }\n\n    /// <summary>TODO</summary>\n    public HexKeyValuePair<TPriority,TValue> Peek() { \n      HexKeyValuePair<TPriority,TValue> result;\n      if (this.TryPeek(out result)) return result;\n      throw new InvalidOperationException();\n    }\n\n    /// <summary>TODO</summary>\n    public HexKeyValuePair<TPriority,TValue>[] ToArray() { return Enumerable().ToArray(); }\n\n    IEnumerable<HexKeyValuePair<TPriority,TValue>> Enumerable() {\n      return _list.SelectMany(l => l.Value.Select(i => new HexKeyValuePair<TPriority,TValue>(l.Key, i)));\n    }\n\n    #region Not implemented yet - Synchronization and Clone\n#if false\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public bool IsSynchronized { get { return false; } }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public object SyncRoot     { get { return null; } }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public object Clone() { throw new NotSupportedException(); }\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    public void TrimExcess() { throw new NotSupportedException(); }\n#endif\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/DirectedPathCollection.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nusing System.Diagnostics;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n\n  [DebuggerDisplay(\"TotalCost={TotalCost} / TotalSteps={TotalSteps}\")]\n  internal sealed class DirectedPathCollection : IDirectedPathCollection {\n    #region Properties\n    IDirectedPathCollection IDirectedPathCollection.PathSoFar { get { return PathSoFar; } }\n\n    /// <inheritdoc/>\n    public Hexside                  HexsideExit { get { return PathStep.HexsideExit; } }\n    /// <inheritdoc/>\n    public IDirectedPathCollection  PathSoFar   { get; private set; }\n    /// <inheritdoc/>\n    public NeighbourHex             PathStep    { get; private set; }\n    /// <inheritdoc/>\n    public HexCoords                StepCoords  { get { return PathStep.Hex.Coords; } }\n    /// <inheritdoc/>\n    public int                      TotalCost   { get; private set; }\n    /// <inheritdoc/>\n    public int                      TotalSteps  { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public IDirectedPathCollection AddStep(IHex hex, Hexside hexsideExit, int stepCost) {\n      return AddStep(new NeighbourHex(hex,hexsideExit), stepCost);\n    }\n    /// <inheritdoc/>\n    public IDirectedPathCollection AddStep(NeighbourHex neighbour, int stepCost) {\n      return new DirectedPathCollection(this, neighbour, TotalCost + stepCost);\n    }\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      if (PathSoFar == null) \n        return string.Format(CultureInfo.InvariantCulture,\"Hex: {0} arrives with TotalCost={1,3}\",\n          PathStep.Hex.Coords, TotalCost);\n      else\n        return string.Format(CultureInfo.InvariantCulture,\"Hex: {0} exits {1} with TotalCost={2,3}\",\n          PathStep.Hex.Coords, PathStep.HexsideEntry, TotalCost);\n    }\n    public string StatusText { \n      get { return string.Format(CultureInfo.InvariantCulture,\n                  \"Path Length: {0}/{1}\", TotalCost,TotalSteps);\n      }\n    }\n\n    /// <summary>Returns the ordered sequence of sub-paths comprising this DirectedPath.</summary>\n    public IEnumerator<IDirectedPathCollection> GetEnumerator() {\n      yield return this;\n      for (var p = (IDirectedPathCollection)this; p.PathSoFar != null; p = p.PathSoFar) \n        yield return p.PathSoFar;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }\n\n    /////////////////////////////  Internals  //////////////////////////////////\n    /// <summary>Returns a DirectedPath composed by extending this DirectedPath by one hex.</summary>\n    internal DirectedPathCollection(IHex start) : this(null, new NeighbourHex(start), 0) {}\n\n    /// <summary>Returns a DirectedPath composed by extending this DirectedPath by one hex.</summary>\n    internal DirectedPathCollection(DirectedPathCollection nextSteps, NeighbourHex neighbour, int totalCost) {\n      PathStep    = neighbour;\n      PathSoFar   = nextSteps;\n      TotalCost   = totalCost;\n      TotalSteps  = nextSteps==null ? 0 : nextSteps.TotalSteps+1;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/HexKeyValuePair.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>an immutable struct representing an associtaed Key and Value pair with equality\n  /// and  comparabilitye of instances defined by the supplied TKey type.</summary>\n  public struct HexKeyValuePair<TKey,TValue> \n    : IEquatable<HexKeyValuePair<TKey,TValue>>, \n      IComparable<HexKeyValuePair<TKey,TValue>>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey> \n  {\n    /// <summary>Constructs a new HexKeyValuePair instance.</summary>\n    internal HexKeyValuePair(TKey key, TValue value) : this() {\n      Key   = key;\n      Value = value;\n    }\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public TKey   Key     { get; private set; }\n    /// <summary>TODO</summary>\n    public TValue Value   { get; private set; }\n    #endregion\n\n    #region Value equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) {\n      var other = obj as HexKeyValuePair<TKey,TValue>?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Key.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(HexKeyValuePair<TKey,TValue> other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) != 0;\n    }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) == 0;\n    }\n\n    #region IComparable implementation\n    /// <summary>Tests whether lhs &lt; rhs.</summary>\n    public static bool operator <  (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) < 0;;\n    }\n    /// <summary>Tests whether lhs &lt;= rhs.</summary>\n    public static bool operator <= (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) <= 0;;\n    }\n    /// <summary>Tests whether lhs &gt;= rhs.</summary>\n    public static bool operator >= (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) >= 0;\n    }\n    /// <summary>Tests whether lhs &gt; rhs.</summary>\n    public static bool operator >  (HexKeyValuePair<TKey,TValue> lhs, HexKeyValuePair<TKey,TValue> rhs) {\n      return lhs.CompareTo(rhs) > 0;\n    }\n    /// <inheritdoc/>\n    public int CompareTo(HexKeyValuePair<TKey,TValue> other) { return this.Key.CompareTo(other.Key); }\n    #endregion\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/HotPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Heap-On-Top (HOT) Priority Queue implementation with a key of type <c>int</c>.</summary>\n  /// <typeparam name=\"TValue\">Type of the queue-item value.</typeparam>\n  /// <remarks>\n  /// \n  /// </remarks>\n  /// <a href=\"http://en.wikipedia.org/wiki/Heapsort\">Wikepedia - Heapsort</a>/>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n    Justification=\"The suffix 'PriorityQueue' has an unambiguous meaning in the application domain.\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class HotPriorityQueue<TValue> : IPriorityQueue<int,TValue> {\n\n    int                                                _baseIndex;\n    int                                                _preferenceWidth;\n    IPriorityQueue<int, TValue>                        _queue;\n    IDictionary<int, HotPriorityQueueList<int,TValue>> _lists;\n\n    /// <summary>Constructs a new instance with a preferenceWidth of 0 bits.</summary>\n    /// <remarks>PreferenceWidth is the number of low-order bits on the key that are for \n    /// alignment, the remainder being the actual left-shifted distance estimate.</remarks>\n    public HotPriorityQueue() : this(0) {}\n    /// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n    /// <remarks></remarks>\n    /// <paramref name=\"preferenceWidth\">the number of low-order bits on \n    /// the key that are for alignment, the remainder being the actual left-shifted distance \n    /// estimate.</paramref>\n    public HotPriorityQueue(int preferenceWidth) : this(preferenceWidth, 2048) {}\n    /// <summary>returns a new instance with a preferenceWidth of shift bits.</summary>\n    /// <remarks></remarks>\n    /// <param name=\"preferenceWidth\">the number of low-order bits on \n    /// the key that are for alignment, the remainder being the actual left-shifted distance \n    /// estimate.</param>\n    /// <param name=\"initialSize\">Maximum size of the Heap-On-Top; initial Pool size will be \n    /// set at 7/8 of this value. Powers of 2 work best for a value.</param>\n    public HotPriorityQueue(int preferenceWidth, int initialSize) { \n      PoolSize         = initialSize >> 3 * 7;\n      _baseIndex       = 0;\n      _preferenceWidth = preferenceWidth; \n      _queue           = new HotPriorityQueueList<int,TValue>(initialSize).PriorityQueue;\n#if UseSortedDictionary\n      _lists = new SortedDictionary<int, HotPriorityQueueList<int, TValue>>();\n#else\n      _lists = new SortedList<int, HotPriorityQueueList<int,TValue>>();\n#endif\n    }\n\n    /// <summary>Returns whether any elements exist in the heap.</summary>\n    bool IPriorityQueue<int,TValue>.Any()    { return this.Any; }\n\n    /// <summary>Returns whether any elements exist in the heap.</summary>\n    public bool Any      { get { return _queue.Count > 0  ||  _lists.Count > 0; } }\n\n    /// <summary>Returns the number of elements in the heap.</summary>\n    public int  Count    { get { return _queue.Count; } }\n\n    /// <summary>The number of elements which are handled by a straight HeapPriorityQueue.</summary>\n    /// <remarks>\n    /// When the number of elements exceeds this value, additional lists are created \n    /// to handle the overflow elements of lower priority (higher <c>TKey</c> values.\n    /// </remarks>\n    public int  PoolSize { get; set; }\n\n    /// <inheritdoc/>\n    public void Enqueue(int priority, TValue value) {\n      Enqueue(new HexKeyValuePair<int,TValue>(priority,value));\n    }\n    /// <inheritdoc/>\n    public void Enqueue(HexKeyValuePair<int,TValue> item) {\n      var index = item.Key >> _preferenceWidth;\n      if (index <= _baseIndex) {\n        _queue.Enqueue(item);\n      } else if (_lists.Count == 0  &&  _queue.Count < PoolSize) {\n        _baseIndex = index;\n        _queue.Enqueue(item);\n      } else {\n        HotPriorityQueueList<int,TValue> list;\n        if( ! _lists.TryGetValue(index, out list) ) {\n          list = new HotPriorityQueueList<int,TValue>();\n          _lists.Add(index, list);\n        }\n        list.Add(item);\n      }\n    }\n\n    /// <inheritdoc/>\n    public bool TryDequeue(out HexKeyValuePair<int,TValue> result) {\n      if (_queue.TryDequeue(out result)) return true;\n      else if (_lists.Count > 0)         return (_queue = GetNextQueue()).TryDequeue(out result);\n      else                               return false;\n    }\n\n    /// <inheritdoc/>\n    public bool TryPeek(out HexKeyValuePair<int,TValue> result) {\n      if (_queue.TryPeek(out result))  return true;\n      else if (_lists.Count > 0)       return (_queue = GetNextQueue()).TryPeek(out result);\n      else                             return false;\n    }\n\n    /// <summary>TODO</summary>\n    private IPriorityQueue<int,TValue> GetNextQueue() {\n      var list   = _lists.First();\n      _lists.Remove(list.Key);\n      _baseIndex = list.Key;\n\n      return list.Value.PriorityQueue;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/HotPriorityQueueList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.PathFinding {\n  /// <summary>Heap-On-Top (HOT) Priority Queue implementation.</summary>\n  /// <typeparam name=\"TKey\">Struct type for the keys used to prioritize values..</typeparam>\n  /// <typeparam name=\"TValue\">Type of the queue elements.</typeparam>\n  /// <remarks>\n  /// \n  /// </remarks>\n  /// <seealso cref=\"http://en.wikipedia.org/wiki/Heapsort\"/>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n    \"CA1710:IdentifiersShouldHaveCorrectSuffix\"), DebuggerDisplay(\"Count={Count}\")]\n  public sealed class HotPriorityQueueList<TKey, TValue> \n    : ICollection<HexKeyValuePair<TKey,TValue>>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey>, IComparable\n  {\n    public HotPriorityQueueList() : this(1024) {}\n\n    public HotPriorityQueueList(int capacity) {\n      _list = new List<HexKeyValuePair<TKey,TValue>>(capacity);\n    }\n\n    public int  Count      { get {return _list.Count;} }\n    public bool IsReadOnly { get {return false;} }\n\n    public void Add(HexKeyValuePair<TKey,TValue> item) { _list.Add(item); }\n\n    public IPriorityQueue<TKey,TValue> PriorityQueue { \n      get { return new MinListHeap(ref _list); }\n    }\n\n    public IEnumerator<HexKeyValuePair<TKey,TValue>> GetEnumerator() {\n      return _list.GetEnumerator();\n    }\n\n    public void Clear() { _list.Clear(); }\n\n    public bool Contains(HexKeyValuePair<TKey,TValue> item) { \n      return _list.Contains(item); \n    }\n\n    public void CopyTo(HexKeyValuePair<TKey,TValue>[] array, int arrayIndex) {\n      _list.CopyTo(array,arrayIndex);\n    }\n\n    public bool Remove(HexKeyValuePair<TKey,TValue> item) {\n      throw new InvalidOperationException(\"Remove\"); \n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return _list.GetEnumerator(); }\n\n    List<HexKeyValuePair<TKey,TValue>> _list;\n\n    /// <summary>List implementation of a binary MinHeap PriorityQueue.</summary>    \n    private sealed class MinListHeap : IPriorityQueue<TKey,TValue> {  \n      /// <summary>Construct a new heap with default capacity of 16.</summary>\n      public MinListHeap() : this(16) { }\n\n      /// <summary>Construct a new heap with the specified capacity.</summary>\n      public MinListHeap(int capacity) { \n        _items = new List<HexKeyValuePair<TKey,TValue>>(capacity); \n      }\n\n      public MinListHeap(ref List<HexKeyValuePair<TKey,TValue>> list) {\n        if (list == null) throw new ArgumentNullException(\"list\");\n\n        _items = list;\n        for(var start = (_items.Count-1) / 2; start >=0; start--) MinHeapifyDown(start);\n        list = null;\n      }\n\n      /// <inheritdoc/>\n      public int Count    { get { return _items.Count; } }\n\n      /// <inheritdoc/>\n      public bool Any()   { return _items.Any(); }\n\n      /// <inheritdoc/>\n      public void Clear() { _items.Clear(); }\n\n      /// <inheritdoc/>\n      public void Enqueue(TKey key, TValue value) {\n        Enqueue(new HexKeyValuePair<TKey,TValue>(key,value));\n      }\n\n      /// <inheritdoc/>\n      public void Enqueue(HexKeyValuePair<TKey,TValue> item) {            \n        _items.Add(item);\n        var child  = Count-1;\n        var parent = (child-1) / 2;\n\n        while (child > 0  &&  _items[parent] > _items[child]) {\n          var heap = _items[parent];  _items[parent] = _items[child];  _items[child] = heap;\n          child  = parent;\n          parent = (child-1) / 2;\n        }\n      }\n\n      /// <inheritdoc/>\n      public bool TryDequeue(out HexKeyValuePair<TKey,TValue> result) {\n        if (_items.Count == 0) {\n          result = default(HexKeyValuePair<TKey,TValue>);\n          return false;\n        }\n\n        result = _items[0];\n\n        // Remove the first item if there will only be 0 or 1 items left after doing so.  \n        if (_items.Count <= 2) \n          _items.RemoveAt(0);\n        else { \n          // Remove the first item and move the last item to the front.\n          _items[0] = _items[_items.Count - 1];\n          _items.RemoveAt(_items.Count - 1);\n\n          MinHeapifyDown(0);\n        }\n        return true;\n      }\n\n      /// <inheritdoc/>\n      public bool TryPeek(out HexKeyValuePair<TKey,TValue> result) {\n        if (_items.Count == 0) {\n          result = default(HexKeyValuePair<TKey,TValue>); \n          return false;\n        } \n\n        result = _items[0];\n        return true;\n      }\n\n      List<HexKeyValuePair<TKey,TValue>> _items;  // backing store\n\n      /// <summary>Min-Heapify by sifting-down from last parent in heap.</summary>\n      void MinHeapifyDown(int current) {\n\n        int leftChild;\n        while ( (leftChild = 2*current + 1) < _items.Count) {\n\n          // identify smallest of parent and both children\n          var smallest   = _items[leftChild] < _items[current] ? leftChild \n                                                               : current;\n          var rightChild = leftChild + 1;\n          if (rightChild < _items.Count && _items[rightChild] < _items[smallest])\n            smallest = rightChild;\n\n          // if nothing to swap, ... then the tree is a heap\n          if (current == smallest)  break;\n          \n          // swap smallest value up\n          var temp         = _items[current];\n          _items[current]  = _items[smallest];\n          _items[smallest] = temp;\n\n          // follow swapped value down and repeat until the tree is a heap\n          current = smallest;\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/HotPriorityQueueueList.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Heap-On-Top (HOT) Priority Queue implementation.</summary>\n  /// <typeparam name=\"TKey\">Struct type for the keys used to prioritize values..</typeparam>\n  /// <typeparam name=\"TValue\">Type of the queue elements.</typeparam>\n  /// <remarks>\n  /// \n  /// </remarks>\n  /// <a href=\"http://en.wikipedia.org/wiki/Heapsort\">Wikepedia - Heapsort</a>/>\n  [DebuggerDisplay(\"Count={Count}\")]\n  internal sealed class HotPriorityQueueList<TKey, TValue> \n    : ICollection<HexKeyValuePair<TKey,TValue>>\n    where TKey : struct, IEquatable<TKey>, IComparable<TKey>\n  {\n    /// <inheritdoc/>\n    public HotPriorityQueueList() : this(1024) {}\n\n    /// <inheritdoc/>\n    public HotPriorityQueueList(int capacity) {\n      _list = new List<HexKeyValuePair<TKey,TValue>>(capacity);\n    }\n\n    /// <inheritdoc/>\n    public int  Count      { get {return _list.Count;} }\n\n    /// <inheritdoc/>\n    public bool IsReadOnly { get {return false;} }\n\n    /// <inheritdoc/>\n    public void Add(HexKeyValuePair<TKey,TValue> item) { _list.Add(item); }\n\n    /// <inheritdoc/>\n    public IPriorityQueue<TKey,TValue> PriorityQueue { \n      get { return new MinListHeap(ref _list); }\n    }\n\n    /// <inheritdoc/>\n    public IEnumerator<HexKeyValuePair<TKey,TValue>> GetEnumerator() {\n      return _list.GetEnumerator();\n    }\n\n    /// <inheritdoc/>\n    public void Clear() { _list.Clear(); }\n\n    /// <inheritdoc/>\n    public bool Contains(HexKeyValuePair<TKey,TValue> item) { \n      return _list.Contains(item); \n    }\n\n    /// <inheritdoc/>\n    public void CopyTo(HexKeyValuePair<TKey,TValue>[] array, int arrayIndex) {\n      _list.CopyTo(array,arrayIndex);\n    }\n\n    /// <inheritdoc/>\n    public bool Remove(HexKeyValuePair<TKey,TValue> item) {\n      throw new InvalidOperationException(\"Remove\"); \n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return _list.GetEnumerator(); }\n\n    List<HexKeyValuePair<TKey,TValue>> _list;  // < backing store\n\n    /// <summary>List implementation of a binary MinHeap PriorityQueue.</summary>    \n    private sealed class MinListHeap : IPriorityQueue<TKey,TValue> {\n      #region Constructors\n      /// <summary>Construct a new heap with default capacity of 16.</summary>\n      public MinListHeap() : this(16) { }\n\n      /// <summary>Construct a new heap with the specified capacity.</summary>\n      public MinListHeap(int capacity) { \n        _items = new List<HexKeyValuePair<TKey,TValue>>(capacity); \n      }\n\n      public MinListHeap(ref List<HexKeyValuePair<TKey,TValue>> list) {\n        if (list == null) throw new ArgumentNullException(\"list\");\n\n        _items = list;\n        for(var start = (_items.Count-1) / 2; start >=0; start--) MinHeapifyDown(start);\n        list = null;\n      }\n      #endregion\n\n      /// <summary>Returns true exactly when the heap has at least one element.</summary>\n      public bool Any     { get {  return _items.Count > 0; } }\n\n      /// <inheritdoc/>\n      public int  Count   { get { return _items.Count; } }\n\n      /// <inheritdoc/>\n      bool IPriorityQueue<TKey,TValue>.Any()   { return Any; }\n\n      /// <inheritdoc/>\n      public void Clear() { _items.Clear(); }\n\n      /// <inheritdoc/>\n      public void Enqueue(TKey key, TValue value) {\n        Enqueue(new HexKeyValuePair<TKey,TValue>(key,value));\n      }\n\n      /// <inheritdoc/>\n      public void Enqueue(HexKeyValuePair<TKey,TValue> item) {            \n        _items.Add(item);\n        var child  = Count-1;\n        var parent = (child-1) / 2;\n\n        while (child > 0  &&  _items[parent] > _items[child]) {\n          var heap = _items[parent];  _items[parent] = _items[child];  _items[child] = heap;\n          child  = parent;\n          parent = (child-1) / 2;\n        }\n      }\n\n      /// <inheritdoc/>\n      public bool TryDequeue(out HexKeyValuePair<TKey,TValue> result) {\n        if (_items.Count == 0) {\n          result = default(HexKeyValuePair<TKey,TValue>);\n          return false;\n        }\n\n        result = _items[0];\n\n        // Remove the first item if neighbour will only be 0 or 1 items left after doing so.  \n        if (_items.Count <= 2) \n          _items.RemoveAt(0);\n        else { \n          // Remove the first item and move the last item to the front.\n          _items[0] = _items[_items.Count - 1];\n          _items.RemoveAt(_items.Count - 1);\n\n          MinHeapifyDown(0);\n        }\n        return true;\n      }\n\n      /// <inheritdoc/>\n      public bool TryPeek(out HexKeyValuePair<TKey,TValue> result) {\n        if (_items.Count == 0) {\n          result = default(HexKeyValuePair<TKey,TValue>); \n          return false;\n        } \n\n        result = _items[0];\n        return true;\n      }\n\n      private List<HexKeyValuePair<TKey,TValue>> _items;  //!< backing store\n\n      /// <summary>Min-Heapify by sifting-down from last parent in heap.</summary>\n      private void MinHeapifyDown(int current) {\n\n        int leftChild;\n        while ( (leftChild = 2*current + 1) < _items.Count) {\n\n          // identify smallest of parent and both children\n          var smallest   = _items[leftChild] < _items[current] ? leftChild \n                                                               : current;\n          var rightChild = leftChild + 1;\n          if (rightChild < _items.Count && _items[rightChild] < _items[smallest])\n            smallest = rightChild;\n\n          // if nothing to swap, ... then the tree is a heap\n          if (current == smallest)  break;\n          \n          // swap smallest value up\n          var temp         = _items[current];\n          _items[current]  = _items[smallest];\n          _items[smallest] = temp;\n\n          // follow swapped value down and repeat until the tree is a heap\n          current = smallest;\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/IDirectedNavigableBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>Interface required to make use of A* Path Finding utility.</summary>\n  public interface IDirectedNavigableBoard {\n    /// <summary>The cost of entering the hex at location <c>coords</c> heading <c>hexside</c>.</summary>\n    int   StepCost(HexCoords coords, Hexside hexsideExit);\n\n    /// <summary>Returns an A* heuristic value from the supplied hexagonal Manhattan distance <c>range</c>.</summary>\n    /// <remarks>Returning the supplied range multiplied by the cheapest movement \n    /// cost for a single hex is usually suffficient. Note that <c>heuristic</c> <b>must</b> be monotonic \n    /// in order for the algorithm to perform properly and reliably return an optimum path.</remarks>\n    int   Heuristic(int range);\n\n    /// <summary>Returns whether the hex at location <c>coords</c>is \"on board\".</summary>\n    bool  IsOnboard(HexCoords coords);\n\n    /// <summary>Cost to extend path by exiting the hex at <c>coords</c> through <c>hexside</c>.</summary>\n    int  DirectedStepCost(IHex hex, Hexside hexsideExit);\n\n    /// <summary>Returns the collecction of defined landmarks on this board.</summary>\n    LandmarkCollection Landmarks { get; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/IPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>TODO</summary>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  public interface IPriorityQueue<TPriority,TValue> \n    where TPriority : struct, IEquatable<TPriority>, IComparable<TPriority>\n  {\n    /// <summary>Returns whether any elements exist in the heap.</summary>\n    bool Any();\n\n    /// <summary>The number of items in the queue.</summary>\n    int  Count { get; }\n\n    /// <summary>Creates and adds an entry with the specified <c>priority</c> and <c>value</c> to the queue.></summary>\n    /// <param name=\"priority\">The <c>TPriority</c> value for the new entry.</param>\n    /// <param name=\"value\">The <c>TValue</c> value for the new entry.</param>\n    void Enqueue(TPriority priority, TValue value);\n\n    /// <summary>Adds the specified <c>HexKeyValuePair</c> to the queue.</summary>\n    /// <param name=\"item\">The <c>HexKeyValuePair {Tpriority,TValue}</c> entry to be added to the queue. </param>\n    void Enqueue(HexKeyValuePair<TPriority,TValue> item);\n\n    /// <summary>Returns whether the top queue entry has been successfully stored in <c>result</c> \n    /// and removed from the queue.</summary>\n    bool TryDequeue(out HexKeyValuePair<TPriority,TValue> result);\n\n    /// <summary>Returns whether the top queue entry has been successfully stored in <c>result</c>.</summary>\n    bool TryPeek(out HexKeyValuePair<TPriority,TValue> result);\n  }\n\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/Landmark.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>A board location storing shortest-path distances to every board hex.</summary>\n  /// <remarks>\n  /// A board location that stores shortest-path distances for every board hex, for use in \n  /// computing an accurate A* heuristic. A simple Dijkstra implementation is used to generate the \n  /// distances upon creation.\n  /// No Finalizer is implemented as the class possesses no unmanaged resources.\n  /// </remarks>\n  [DebuggerDisplay(\"Coords={Coords}\")]\n  public sealed partial class Landmark : ILandmark, IDisposable {\n    /// <summary>Populates and returns a new landmark at the specified board coordinates.</summary>\n    /// <param name=\"board\">IBoard{IHex} on which the landmark is to be created.</param>\n    /// <param name=\"coords\">Coordinates on <c>board</c> where this landmark is to be created.</param>\n    public Landmark(HexCoords coords, IHexBoard<IHex> board) {\n      Board  = board;\n      Coords = coords;\n      FillLandmark();\n    }\n\n    /// <summary>TODO</summary>\n    public IHexBoard<IHex> Board  { get; private set; }\n    /// <summary>Board coordinates for the landmark location.</summary>\n    public HexCoords       Coords { get; private set; }\n\n    /// <summary>Returns the shortest-path directed-distance to the specified hex <b>from</b> the landmark.</summary>\n    public int DistanceTo  (HexCoords coords) { return backingStore[0][coords]; }\n    /// <summary>Returns the shortest-path directed-distance from the specified hex <b>to</b> the landmark.</summary>\n    public int DistanceFrom(HexCoords coords) { return backingStore[1][coords]; }\n\n    private static Func<IHexBoard<IHex>, Func<IHex,Hexside,IHex,int>>[] DirectedCostDelegates = \n      new Func<IHexBoard<IHex>, Func<IHex,Hexside,IHex,int>>[] {\n          /* Cost from here to there */ (board) => (here,hexside,there) => board.GetDirectedCostToExit(here, hexside),\n          /* Cost from there to here */ (board) => (here,hexside,there) => board.GetDirectedCostToExit(there, hexside.Reversed())\n      };\n\n    private BoardStorage<short>[] backingStore;\n\n    /// <inheritdoc/>\n    public void FillLandmark() {\n      if (Board != null) {\n        backingStore = new BoardStorage<short>[2] {\n          new BlockedBoardStorage32x32<short>(Board.MapSizeHexes, c => -1),\n          new BlockedBoardStorage32x32<short>(Board.MapSizeHexes, c => -1)\n        };\n\n        for (var i = 0; i < 2; i++) {\n          var landmark  = Board[Coords];\n          if (landmark != null)\n            FindPathDetailTrace(true, \"Find distances from {0}\", landmark.Coords);\n\n            #if HotPriorityQueue\n              var queue = PriorityQueueFactory.NewHotPriorityQueue<IHex>();\n            #else\n              var queue = PriorityQueueFactory.NewDictionaryQueue<int, IHex>();\n            #endif\n            queue.Enqueue (0, landmark);\n\n            FillLandmarkDetail(queue, backingStore[i], DirectedCostDelegates[i](Board));\n        }\n      }\n    }\n\n    private void FillLandmarkDetail(IPriorityQueue<int,IHex> queue, \n      BoardStorage<short> store, Func<IHex,Hexside,IHex,int> directedStepCost\n    ) {\n      HexKeyValuePair<int,IHex> item;\n      while (queue.TryDequeue(out item)) {\n        var here = item.Value;\n        var key  = item.Key;\n        if( store[here.Coords] > 0 ) continue;\n\n        FindPathDetailTrace(\"Dequeue Path at {0} w/ cost={1,4}.\", here, key);\n\n        store[here.Coords] = (short)key;\n\n        HexsideExtensions.HexsideList.ForEach( hexside =>\n          ExpandNode(store,directedStepCost,queue,here,key,hexside)\n        );\n      }\n    }\n\n    private void ExpandNode(BoardStorage<short> store, Func<IHex,Hexside,IHex,int> directedStepCost, \n      IPriorityQueue<int,IHex> queue, IHex here, int key, Hexside hexside\n    ) {\n      var neighbourCoords = here.Coords.GetNeighbour(hexside);\n      var neighbourHex    = Board[neighbourCoords];\n\n      if (neighbourHex != null) {\n        var cost = directedStepCost(here, hexside, neighbourHex);\n        if (cost > 0  &&  store[neighbourCoords] == -1) {\n\n          FindPathDetailTrace(\"   Enqueue {0}: {1,4}\", neighbourCoords, cost);\n\n          queue.Enqueue(key + cost, neighbourHex);\n        }\n      }\n    }\n\n    #region IDisposable implementation\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (backingStore!=null) {\n            if (backingStore[0] != null) backingStore[0].Dispose();\n            if (backingStore[1] != null) backingStore[1].Dispose();\n          }\n        }\n        _isDisposed = true;\n      }\n    }\n    #endregion\n\n    #region Tracing partial methods\n    static partial void FindPathDetailTrace(string format, params object[] paramArgs);\n    static partial void FindPathDetailTrace(bool newline, string format, params object[] paramArgs);\n    #if TRACE\n    static partial void FindPathDetailTrace(string format, params object[] paramArgs) {\n      Traces.FindPathDetail.Trace(format, paramArgs);\n    }\n    static partial void FindPathDetailTrace(bool newline, string format, params object[] paramArgs) {\n      Traces.FindPathDetail.Trace(newline, format, paramArgs);\n    }\n    #endif\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/LandmarkCollection.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  /// <summary>A <b>ReadOnlyCollection</b> of defined <see cref=\"Landmark\"/> locations.</summary>\n  public sealed class LandmarkCollection : IFastList<ILandmark>, ILandmarkCollection {\n    /// <summary>Creates a populated <see cref=\"Collection{T}\"/> of <see cref=\"Landmark\"/>\n    /// instances.</summary>\n    /// <param name=\"board\">The board on which the collection of landmarks is to be instantiated.</param>\n    /// <param name=\"landmarkCoords\">Board coordinates of the desired landmarks</param>\n    public static ILandmarkCollection CreateLandmarks(\n      IHexBoard<IHex> board, \n      IFastList<HexCoords> landmarkCoords\n    ) {\n      if (landmarkCoords==null) throw new ArgumentNullException(\"landmarkCoords\");\n\n      ILandmarkCollection tempLandmarks = null, landmarks = null;\n      try {\n        tempLandmarks = new LandmarkCollection( (\n                              from coords in landmarkCoords.AsParallel().AsOrdered()\n                              where board.IsOnboard(coords) \n                              select new Landmark(coords,board)\n                        ).ToList<ILandmark>() );\n        landmarks     = tempLandmarks;\n        tempLandmarks = null;\n      } finally { if (tempLandmarks != null) tempLandmarks.Dispose(); }\n      return landmarks;\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"board\"></param>\n    /// <param name=\"landmarkCoords\"></param>\n    /// <param name=\"token\"></param>\n    /// <returns></returns>\n    public static Task<ILandmarkCollection> CreateLandmarksAsync(\n      IHexBoard<IHex>      board, \n      IFastList<HexCoords> landmarkCoords,\n      CancellationToken    token\n    ) {\n      return Task.Run( () => CreateLandmarks(board,landmarkCoords) );\n    }\n\n    /// <summary>TODO</summary>\n    public ParallelLoopResult ResetLandmarks() {\n      return Parallel.For(0, Count, i => { var l = this[i]; if (l!=null) l.FillLandmark(); } );\n    }\n\n    private LandmarkCollection(IList<ILandmark> list) { // : base(list.ToArray()) {\n      fastList = list.ToFastList();\n    }\n\n    /// <inheritdoc/>\n    public int IndexOf(ILandmark item) { return fastList.IndexOf(item); }\n\n    #region IFastList implemenation\n    /// <inheritdoc/>\n    public IEnumerator<ILandmark>                         GetEnumerator(){\n      return ((IEnumerable<ILandmark>)this).GetEnumerator();;\n    }\n    IEnumerator                               IEnumerable.GetEnumerator(){\n      return ((IEnumerable)fastList).GetEnumerator();\n    }\n    IEnumerator<ILandmark>         IEnumerable<ILandmark>.GetEnumerator(){\n      return ((IEnumerable<ILandmark>)fastList).GetEnumerator();\n    }\n    IFastEnumerator<ILandmark> IFastEnumerable<ILandmark>.GetEnumerator(){\n      return ((IFastEnumerable<ILandmark>)fastList).GetEnumerator();\n    }\n\n    /// <inheritdoc/>\n    public void ForEach(Action<ILandmark> action) {fastList.ForEach(action);}\n    /// <inheritdoc/>\n    public void ForEach(FastIteratorFunctor<ILandmark> functor) {fastList.ForEach(functor);}\n\n    /// <inheritdoc/>\n    public int       Count           { get {return fastList.Count;} }\n    /// <inheritdoc/>\n    public ILandmark this[int index] { get {return fastList[index]; } }\n\n    IFastList<ILandmark> fastList;\n    #endregion\n\n    #region IDisposable implementation\n    private bool isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    private void Dispose(bool disposing) {\n      if (!isDisposed) {\n        if (disposing) {\n          var disposable = fastList as IDisposable;\n          if (disposable != null) disposable.Dispose();\n\n          fastList = null;\n        }\n      }\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/Path.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.PathFinding {\n  /// <summary>Structure returned by the A* Path Finding utility.</summary>\n  public interface IPath\n  { \n    Hexside   HexsideExit { get; }\n    HexCoords StepCoords  { get; }\n    IPath     PathSoFar   { get; }\n    int       TotalCost   { get; }\n    int       TotalSteps  { get; }\n  }\n\n  /// <summary>Eric Lippert's implementation for use in A*, modified for a hex-grid.</summary>\n  /// <remarks>An implementation of 'path' using an immutable stack.</remarks>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx</cref>\n  /// <typeparam name=\"TNode\">The type of a path-'node'.</typeparam>\n  internal sealed class Path : IPath\n  {\n    #region IPath implementation\n    public Hexside   HexsideExit { get; private set; }\n    public HexCoords StepCoords  { get; private set; }\n    public IPath     PathSoFar   { get; private set; }\n    public int       TotalCost   { get; private set; }\n    public int       TotalSteps  { get; private set; }\n    #endregion\n\n    public override string ToString() {\n      return string.Format(CultureInfo.InvariantCulture,\n        \"Hex: {0} with TotalCost={1,3} (as {2}/{3})\",\n        StepCoords, TotalCost, TotalCost>>16, TotalCost &0xFFFF);\n    }\n\n    //public IEnumerator<HexCoords> GetEnumerator() {\n    //  for (var p = (IPath)this; p.StepCoords != null; p = p.PathSoFar) \n    //    yield return p.StepCoords;\n    //}\n\n    /////////////////////////////  Internals  //////////////////////////////////\n    internal Path(HexCoords start) : this(null, start, Hexside.North, 0) { }\n\n    internal Path    AddStep(NeighbourCoords neighbour, int stepCost) {\n      return new Path(this, neighbour.Coords, neighbour.Hexside, TotalCost + stepCost);\n    }\n\n    private  Path(Path previousSteps, HexCoords step, Hexside direction, int totalCost) {\n      HexsideExit  = direction;\n      StepCoords   = step;\n      PathSoFar    = previousSteps;\n      TotalCost    = totalCost;\n      TotalSteps   = previousSteps==null ? 0 : previousSteps.TotalSteps+1;\n    }\n  }\n\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/PathFinderFwd.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#define FastList\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.PathFinding;\n\nnamespace PGNapoleonics.HexUtilities.PathFinding {\n  /// <summary>Interface required to make use of A* Path Finding utility.</summary>\n  public interface IDirectedNavigableBoard : INavigableBoard {\n\n    /// <summary>Cost to extend path by exiting the hex at <c>coords</c> through <c>hexside</c>.</summary>\n    int  DirectedStepCost(IHex hex, Hexside hexsideExit);\n\n    /// <summary>Returns the collecction of defined landmarks on this board.</summary>\n    LandmarkCollection Landmarks { get; }\n  }\n\n  /// <summary>(Adapted) C# implementation of A* path-finding algorithm by Eric Lippert.</summary>\n  /// <remarks><quote>\n  /// A nice property of the A* algorithm is that it finds the optimal path in a reasonable \n  /// amount of time provided that:\n  ///   • the estimating function never overestimates the distance to the goal. \n  ///     (Think about what happens if the estimating function sometimes overestimates the distance;\n  ///     if the optimal path is one of the ones overestimated then it will possibly not make it to \n  ///     the front of the priority queue before a nonoptimal solution is found.)\n  ///   • calling the estimating function does not take very long.\n  /// One way to ensure that the estimating function never overestimates the distance is to always \n  /// estimate zero. If you do so then this becomes Dijkstra's algorithm. However, the better your \n  /// estimating function can get without going over (this really should have been called the \n  /// \"The Price Is Right\" algorithm...) the faster this will identify the truly optimal path.\n  ///\n  /// Unfortunately, the space complexity of this algorithm can be really quite high on complicated \n  /// graphs. There are more complex versions of this algorithm which can deal with the space complexity.\n  /// </quote>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/10/path-finding-using-a-in-c-3-0-part-four.aspx</cref>\n  /// \n  /// Adapted to hex-grids, and to weight the most direct path favourably for better (visual) \n  /// behaviour on a hexgrid.\n  /// </remarks>\n  /// <param name=\"start\"></param>\n  /// <param name=\"goal\"></param>\n  /// <param name=\"board\"></param>\n  /// <returns></returns>\n  public partial class Pathfinder {\n    /// <summary>Returns an <c>IPath</c> for the optimal path from coordinates <c>start</c> to <c>goal</c>.</summary>\n    /// <param name=\"start\">Coordinates for the <c>last</c> step on the desired path.</param>\n    /// <param name=\"goal\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// ///<remarks>Note that <c>heuristic</c> <b>must</b> be monotonic in order for the algorithm to perform properly.</remarks>\n    /// <seealso cref=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\"/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1011:ConsiderPassingBaseTypesAsParameters\")]\n    public static IDirectedPath FindDirectedPath(\n      IHex start,\n      IHex goal,\n      IDirectedNavigableBoard board\n    ) {\n      if (board==null) throw new ArgumentNullException(\"board\"); \n      return FindDirectedPath(start, goal, board.DirectedStepCost,\n                                     board.Heuristic, board.IsOnboard);\n    }\n\n    /// <summary>Returns an <c>IPath</c> for the optimal path from coordinates <c>start</c> to <c>goal</c>.</summary>\n    /// <param name=\"start\">Coordinates for the <c>last</c> step on the desired path.</param>\n    /// <param name=\"goal\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"directedStepCost\">Cost to extend path by hex at <c>coords</c> from hex at direction <c>hexside</c>.</param>\n    /// <param name=\"heuristic\">Returns a monotonic (ie locally admissible) cost estimate from a range value.</param>\n    /// <param name=\"isOnboard\">Returns whether the coordinates specified are \"on board\".</param>\n    /// ///<remarks>Note that <c>heuristic</c> <b>must</b> be monotonic in order for the algorithm to perform properly.</remarks>\n    /// <seealso cref=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\"/>\n    public static IDirectedPath FindDirectedPath (\n      IHex start,\n      IHex goal,\n      Func<IHex, Hexside, int> directedStepCost,\n      Func<int,int>            heuristic,\n      Func<HexCoords,bool>     isOnboard\n    ) {\n      if (start==null)      throw new ArgumentNullException(\"start\"); \n      if (goal==null)       throw new ArgumentNullException(\"goal\"); \n      if (directedStepCost==null)   throw new ArgumentNullException(\"directedStepCost\"); \n      if (heuristic==null)  throw new ArgumentNullException(\"heuristic\"); \n      if (isOnboard==null)  throw new ArgumentNullException(\"isOnboard\"); \n\n      var queue  = new DictionaryPriorityQueue<int, DirectedPath>();\n\n      var functor = new PathQueueFunctor(start,goal,heuristic,directedStepCost,queue);\n\n      queue.Enqueue (0, new DirectedPath(goal));\n\n      HexKeyValuePair<int,DirectedPath> item;\n      while (queue.TryDequeue(out item)) {\n        if (functor.PathFound(item)) return functor.Path;\n      }\n      return null; \n    }\n\n    /// <summary><c>Static List&lt;Hexside></c> for enumerations.</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \n      \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\")]\n    public static readonly FastList<Hexside> FastHexsideList \n      = new FastList<Hexside>(Utilities.EnumGetValues<Hexside>().ToArray());\n\n    private class PathQueueFunctor {\n      public DirectedPath Path { get; set; }\n\n      public PathQueueFunctor(IHex start, IHex goal, Func<int,int> heuristic, \n        Func<IHex, Hexside, int> stepCost, \n        IPriorityQueue<int, DirectedPath> queue\n      ) {\n        _vectorGoal = goal.Coords.Canon - start.Coords.Canon;\n\n        TraceFlags.FindPathDetail.Trace(true, \"Find path from {0} to {1}; vectorGoal = {2}\", \n                                              start.Coords, goal.Coords, _vectorGoal);\n        Path        = null;\n\n        _start      = start;\n        _heuristic  = heuristic;\n        _open       = (IDictionary<HexCoords,IDirectedPath>) new Dictionary<HexCoords, IDirectedPath>();\n        _stepCost   = stepCost;\n        _queue      = queue;\n      }\n\n      public bool PathFound(HexKeyValuePair<int,DirectedPath> item) {\n        var path = item.Value;\n        var hex  = path.PathStep.Hex;\n        if( _closed.Contains(hex.Coords) ) return false;\n\n        _open.Add(item.Value.PathStep.Hex.Coords, item.Value);\n\n        TraceFlags.FindPathDequeue.Trace(\n          \"Dequeue Path at {0} w/ cost={1,4} at {2}; estimate={3,4}:{4,4}.\", \n          item.Value.PathStep.Hex.Coords, item.Value.TotalCost, item.Value.HexsideExit, \n          item.Key >> 16, item.Key & 0xFFFF);\n\n        if(hex.Coords.Equals(_start.Coords)) { \n          Path = path;\n          return true; \n        }\n\n        _closed.Add(hex.Coords);\n\n        FastHexsideList.ForEach((Action<Hexside>)(hexside => Invoke(path, hexside)));\n        return false;\n      }\n\n      public void Invoke(DirectedPath path, Hexside hexside) {\n        var here  = path.PathStep.Hex;\n        var there = here.Board[here.Coords.GetNeighbour(hexside)];\n        if (there != null  &&  ! _open.ContainsKey(there.Coords)) {\n          var cost = _stepCost(there, hexside.Reversed());\n          if (cost > 0) {\n            var newPath  = path.AddStep(there, hexside, cost);\n            var estimate = Estimate(_heuristic, _vectorGoal, _start.Coords, newPath.PathStep.Hex.Coords, newPath.TotalCost);\n            TraceFlags.FindPathEnqueue.Trace(\"   Enqueue {0}: estimate={1,4}:{2,3}\",\n                there.Coords, estimate>>16, estimate & 0xFFFF);\n            _queue.Enqueue(estimate, newPath);\n          }\n        }\n      }\n\n      IHex                            _start;\n//      IHex                            _goal;\n      Func<int,int>                   _heuristic;\n      Func<IHex, Hexside, int>        _stepCost;\n\n      IDictionary<HexCoords,IDirectedPath> _open;\n      ISet<HexCoords>                 _closed = new HashSet<HexCoords>();\n      IntVector2D                     _vectorGoal;\n      IPriorityQueue<int, DirectedPath>    _queue;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/PathShortcut.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.PathFinding;\n\nnamespace PGNapoleonics.HexUtilities.PathFinding {\n  public class PathShortcut {\n    public IDirectedPath DirectedPath { get; private set; }\n    public IHex          Goal         { get; private set; }\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1062:Validate arguments of public methods\", MessageId = \"2\")]\n    public PathShortcut(IHex start, IHex goal, IDirectedNavigableBoard board) { \n      DirectedPath = BidirectionalPathfinder.FindDirectedPathFwd(start, goal, board);\n      Goal         = goal;\n    }\n\n    //static void ExtendShortcut(IHex goal, IntVector2D vectorGoal,\n    //  IPriorityQueue<int, DirectedPath> queue,\n    //  DirectedPath path,\n    //  Func<int,int> heuristic\n    //) {\n    //  foreach (var shortcut in path.PathStep.Hex.Shortcuts) {\n    //    var pathFwd = shortcut.DirectedPath;\n    //    var newPath = path;\n    //    var hexside = pathFwd.PathStep.HexsideEntry;\n    //    if (newPath.PathStep.Hex.Equals(pathFwd.PathStep.Hex)) pathFwd = pathFwd.PathSoFar;\n    //    while (pathFwd.PathSoFar != null) {\n    //      var step     = pathFwd.PathStep;\n    //      var cost     = pathFwd.TotalCost - pathFwd.PathSoFar.TotalCost;\n    //      newPath      = newPath.AddStep(new NeighbourHex(step.Hex, hexside.Reversed()), cost);\n    //      var estimate = Pathfinder.Estimate(heuristic, vectorGoal, goal.Coords, \n    //                        newPath.PathStep.Hex.Coords, newPath.TotalCost);\n    //      queue.Enqueue(estimate, newPath);\n    //      TraceFlags.FindPathDetail.Trace(\"   Enqueue {0}: {1,4}:{2,3}\",\n    //          step.Hex.Coords, estimate >> 16, estimate & 0xFFFF);\n    //      hexside      = step.HexsideEntry;\n    //      pathFwd      = pathFwd.PathSoFar;\n    //    }\n    //  }\n    //}\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/PathFinding/UnidirectionalPathfinder.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities.Pathfinding {\n  using DirectedPath  = DirectedPathCollection;\n  using IDirectedPath = IDirectedPathCollection;\n\n  /// <summary>(Adapted) C# implementation of A* path-finding algorithm by Eric Lippert.</summary>\n  /// <remarks>\n  /// <para>\n  /// \"A nice property of the A* algorithm is that it finds the optimal path in a reasonable \n  /// amount of time provided that:\n  ///   • the estimating function never overestimates the distance to the goal. \n  ///     (Think about what happens if the estimating function sometimes overestimates the distance;\n  ///     if the optimal path is one of the ones overestimated then it will possibly not make it to \n  ///     the front of the priority queue before a nonoptimal solution is found.)\n  ///   • calling the estimating function does not take very long.\n  /// </para><para>\n  /// \"One way to ensure that the estimating function never overestimates the distance is to always \n  /// estimate zero. If you do so then this becomes Dijkstra's algorithm. However, the better your \n  /// estimating function can get without going over (this really should have been called the \n  /// \"The Price Is Right\" algorithm...) the faster this will identify the truly optimal path.\n  /// </para><para>\n  /// \"Unfortunately, the space complexity of this algorithm can be really quite high on complicated \n  /// graphs. There are more complex versions of this algorithm which can deal with the space complexity.\"\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/10/path-finding-using-a-in-c-3-0-part-four.aspx\"></a>\n  /// </para><para>\n  /// Adapted to hex-grids, and to weight the most direct path favourably for better (visual) \n  /// behaviour on a hexgrid.\n  /// </para><para>\n  /// See also: <a href=\"http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html\">Notes - A-star Algorithm</a>\n  /// <seealso cref=\"PGNapoleonics.HexUtilities.Pathfinding.BidirectionalPathfinder\"/>\n  /// </para>\n  /// </remarks>\n  /// <see cref=\"BidirectionalPathfinder\"/>\n  public sealed class UnidirectionalPathfinder : Pathfinder {\n    /// <summary>Returns an <c>IDirectedPath</c> for the optimal path from coordinates <c>start</c> to <c>goal</c>.</summary>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n    /// <returns>A <c>IDirectedPathCollection</c>  for the shortest path found, or null if no path was found.</returns>\n    /// <remarks>\n    /// <para>Note that the Heuristic provided by <paramref name=\"board\"/> <b>must</b> be monotonic in order for the algorithm to perform properly.</para>\n    /// <seealso cref=\"PGNapoleonics.HexUtilities.Pathfinding.UnidirectionalPathfinder\"/>\n    /// </remarks>\n    public static IDirectedPath FindDirectedPathFwd(INavigableBoard<IHex> board, IHex source, IHex target) {\n      return (new UnidirectionalPathfinder(board,source,target)).Path;\n    }\n\n    static int Estimate(Func<int,int> heuristic, IntVector2D vectorGoal, HexCoords start, \n            HexCoords hex, int totalCost) {\n      var estimate   = heuristic(start.Range(hex)) + totalCost;\n      var preference = Preference(vectorGoal, start.Canon - hex.Canon);\n      return (estimate << 16) + preference;\n    }\n\n    static int Preference(IntVector2D vectorGoal, IntVector2D vectorHex) {\n      return (0xFFFF & Math.Abs(vectorGoal ^ vectorHex ));\n    }\n\n    /// <summary>Creates a new <see cref=\"Pathfinder\"/> instance implementing a unidirectional A* from \n    /// <paramref name=\"source\"/> to <paramref name=\"target\"/>.</summary>\n    /// <param name=\"board\">An object satisfying the interface <c>INavigableBoardFwd</c>.</param>\n    /// <param name=\"source\">Coordinates for the <c>first</c> step on the desired path.</param>\n    /// <param name=\"target\">Coordinates for the <c>last</c> step on the desired path.</param>\n    public UnidirectionalPathfinder(INavigableBoard<IHex> board, IHex source, IHex target) \n    : base(board,source,target,new HashSet<HexCoords>()\n    ) {\n      if (board==null) throw new ArgumentNullException(\"board\");\n\n      StepCost  = (hex,hexside) => board.GetDirectedCostToExit(hex,hexside);\n      Heuristic = board.Heuristic;\n      Path      = GetPath();\n\n      TraceFindPathDone(ClosedSet.Count);\n    }\n\n    private IDirectedPath GetPath() {\n      VectorGoal  = Target.Coords.Canon - Source.Coords.Canon;\n      OpenSet     = new HashSet<HexCoords>();\n      Queue       = new DictionaryPriorityQueue<int, IDirectedPath>();\n\n      TraceFindPathDetailInit(Source.Coords, Target.Coords);\n\n      Queue.Enqueue (0, new DirectedPath(Target));\n\n      HexKeyValuePair<int,IDirectedPath> item;\n      while (Queue.TryDequeue(out item)) {\n        var path = item.Value;\n        var step = path.PathStep.Hex;\n\n        OpenSet.Add(step.Coords);\n        if( ClosedSet.Contains(step.Coords) ) continue;\n\n        TraceFindPathDequeue(\"Rev\",step.Coords, path.TotalCost, path.HexsideExit, item.Key>>16, \n                            (int) ((int)(item.Key & 0xFFFFu) - 0x7FFF));\n\n        if(step.Equals(Source))     return path;\n\n        ClosedSet.Add(step.Coords);\n\n        foreach (var neighbour in Board.GetNeighbourHexes(step)) {\n          ExpandNeighbour(path,neighbour);\n        }\n      }\n\n      return null;\n    }\n\n    void ExpandNeighbour(IDirectedPath path, NeighbourHex neighbour) {\n      if ( ! OpenSet.Contains(neighbour.Hex.Coords)) {\n        var cost = StepCost(neighbour.Hex, neighbour.HexsideExit);\n        if (cost > 0) {\n          var newPath = path.AddStep(neighbour, cost);\n          var key     = Estimate(Heuristic, VectorGoal, Source.Coords, \n                                 neighbour.Hex.Coords, newPath.TotalCost);\n\n          TraceFindPathEnqueue(neighbour.Hex.Coords, key>>16, (int)(key & 0xFFFFu));\n\n          Queue.Enqueue(key, newPath);\n        }\n      }\n    }\n\n    /// <inheritdoc/>\n    public  IDirectedPath                     Path        { get; private set; }\n\n    private Func<int,int>                     Heuristic   { get; set; }\n    private ISet<HexCoords>                   OpenSet     { get; set; }\n    private IPriorityQueue<int,IDirectedPath> Queue       { get; set; }\n    private Func<IHex, Hexside, int>          StepCost    { get; set; }\n    private IntVector2D                       VectorGoal  { get; set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexUtilities/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexUtilities\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexUtilities\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a1e55325-42d1-4c8f-8bcc-9fea6112318e\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "codeplex/HexUtilities/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/HexgridExampleWinForms.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{CEB56CDC-BB94-405B-B6AF-302587C14A82}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>HexgridExampleWinForms</RootNamespace>\n    <AssemblyName>HexgridExampleWinForms</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"UserControl1.cs\">\n      <SubType>UserControl</SubType>\n    </Compile>\n    <Compile Include=\"UserControl1.Designer.cs\">\n      <DependentUpon>UserControl1.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"WinForms\\ExceptionDialog.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.Designer.cs\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\GdiRasterOps.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n    <Service Include=\"{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.en-US.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinForms\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinForms\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"1d5a152c-a3f2-4a9c-9496-b448fa66ecfa\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/UserControl1.Designer.cs",
    "content": "﻿namespace HexgridExampleWinForms\n{\n    partial class UserControl1\n    {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing && (components != null))\n            {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Component Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify \n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent()\n        {\n            components = new System.ComponentModel.Container();\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/UserControl1.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Data;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace HexgridExampleWinForms\n{\n    public partial class UserControl1: UserControl\n    {\n        public UserControl1()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/GdiRasterOps.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  internal static partial class GdiRasterOps {\n    public const int SrcCopy                 = 0x00CC0020; /* dest = source                   */ \n    public const int SrcPaint                = 0x00EE0086; /* dest = source OR dest           */\n    public const int SrcAnd                  = 0x008800C6; /* dest = source AND dest          */\n    public const int SrcInvert               = 0x00660046; /* dest = source XOR dest          */\n    public const int SrcErase                = 0x00440328; /* dest = source AND (NOT dest )   */ \n    public const int NotSrcCopy              = 0x00330008; /* dest = (NOT source)             */\n    public const int NotSrcErase             = 0x001100A6; /* dest = (NOT src) AND (NOT dest) */ \n    public const int MergeCopy               = 0x00C000CA; /* dest = (source AND pattern)     */ \n    public const int MergePaint              = 0x00BB0226; /* dest = (NOT source) OR dest     */\n    public const int PatCopy                 = 0x00F00021; /* dest = pattern                  */ \n    public const int PatPaint                = 0x00FB0A09; /* dest = DPSnoo                   */\n    public const int PatInvert               = 0x005A0049; /* dest = pattern XOR dest         */\n    public const int DstInvert               = 0x00550009; /* dest = (NOT dest)               */\n    public const int Blackness               = 0x00000042; /* dest = BLACK                    */ \n    public const int Whiteness               = 0x00FF0062; /* dest = WHITE                    */\n//    public const int CaptureBlt              = 0x40000000; /* Include layered windows */ \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n\t\t/// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n    [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", \n      MessageId = \"0\", Justification=\"Research suggests the Code Analysis message is incorrect.\")]\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n    /// <summary>TODO</summary>\n    [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n    [ResourceExposure(ResourceScope.None)] \n    public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n                                     HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n    /// <summary>Message Cracker for HiWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 HIWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return ((val32 >> 16) & 0xFFFF);\n    }\n\n    /// <summary>Message Cracker for LoWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 LOWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return (val32 & 0xFFFF);\n    }\n  }\n\n    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n  public static partial class ControlExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n      \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ScrollBarCommand.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  #pragma warning disable 1570,1591\n  /// <summary>TODO</summary>\n  internal enum ScrollBarCommand {\n      SB_LINEUP           = 0,  //!< TODO\n      SB_LINELEFT         = 0,  //!< TODO\n      SB_LINEDOWN         = 1,  //!< TODO\n      SB_LINERIGHT        = 1,  //!< TODO\n      SB_PAGEUP           = 2,  //!< TODO\n      SB_PAGELEFT         = 2,  //!< TODO\n      SB_PAGEDOWN         = 3,  //!< TODO\n      SB_PAGERIGHT        = 3,  //!< TODO\n      SB_THUMBPOSITION    = 4,  //!< TODO\n      SB_THUMBTRACK       = 5,  //!< TODO\n      SB_TOP              = 6,  //!< TODO\n      SB_LEFT             = 6,  //!< TODO\n      SB_BOTTOM           = 7,  //!< TODO\n      SB_RIGHT            = 7,  //!< TODO\n      SB_ENDSCROLL        = 8   //!< TODO\n  }\n  #pragma warning restore 1570,1591\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>A Last-chance THread Exception handler.</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public class ThreadExceptionHandler {\n    /// <summary>Handles the thread exception.</summary> \n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1031:DoNotCatchGeneralExceptionTypes\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1303:Do not pass literals as localized parameters\", \n      MessageId = \"System.Windows.Forms.MessageBox.Show(System.String,System.String,\"\n                + \"System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1804:RemoveUnusedLocals\", MessageId = \"result\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1300:SpecifyMessageBoxOptions\")]\n    public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) {\n      if (sender==null) throw new ArgumentNullException(\"sender\");\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if(e.Exception is NotImplementedException \n      || e.Exception is NotSupportedException\n      || e.Exception is InvalidOperationException\n      ) {\n          MessageBox.Show(e.Exception.Message, \n            \"Application Error\", \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Information);\n      } else {\n        try {\n          var result = ShowThreadExceptionDialog(e.Exception);\n          Application.ExitThread();\n        }\n        catch {  // Fatal error, terminate program\n          try {\n            MessageBox.Show(\"Fatal Error in Unhandled Exception Handler.\", \n              \"Fatal Application Error\", \n              MessageBoxButtons.OK, \n              MessageBoxIcon.Stop);\n          }\n          finally { Application.Exit(); }\n        }\n      }\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private static DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var errorMessage= \n        \"Unhandled Exception:\" + Environment.NewLine + Environment.NewLine +\n        ex.Message + Environment.NewLine + Environment.NewLine +\n        ex.GetType() + Environment.NewLine + Environment.NewLine +\n        \"Stack Trace:\" + Environment.NewLine +\n        ex.StackTrace;\n\n      var dialog = new ExceptionDialog(errorMessage);\n      try {\n        dialog.Show();\n      } finally { if (dialog!=null) dialog.Dispose(); }\n      return DialogResult.Abort;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.TRANSPARENT;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void Invalidate2() { \n\t\t\tInvalidate2(new Rectangle(this.Location,this.Size));\n\t\t} \n    /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n    /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n    public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\ttry {\n\t\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t\t} catch (InvalidOperationException e) { \n\t\t\t\t\tMessageBox.Show(\"Why is \" + e.Message + \"\\n occurring in\\n\" +\n\t\t\t\t\t\t\"TransparentPanel.Invalidate2(Rectangle r).\");\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"pevent\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs e) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public static partial class WinFormsExtensions {\n    /// <summary>Reflect to set Double-Buffering on Control.</summary>\n    /// <param name=\"control\">Control to operate on.</param>\n    /// <param name=\"setting\">New value for parameter.</param>\n    public static void MakeDoubleBuffered(this Control control, bool setting)\n    {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      control.GetType()\n             .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n             .SetValue(control, setting, null);\n    }\n\n    /// <summary>Use COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n    public static CreateParams SetCompositedStyle(this Control control, CreateParams parameters) {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      if (parameters==null) throw new ArgumentNullException(\"parameters\");\n      parameters.ExStyle |= (int)WindowStylesEx.COMPOSITED;\n      return parameters;\n    }\n  }\n\n  /// <summary>TODO</summary>/>\n  public static partial class PaddingExtensions {\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Point Offset(this Padding @this) { return new Point(@this.Left, @this.Top); }\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Size OffsetSize(this Padding @this) { return new Size(@this.Left, @this.Top); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>\n  /// Windows Messages\n  /// Defined in winuser.h from Windows SDK v6.1\n  /// Documentation pulled from MSDN.\n  /// </summary>\n  public enum WM : int //: uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    NULL = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    CREATE = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    DESTROY = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    MOVE = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    SIZE = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    ACTIVATE = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SETFOCUS = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KILLFOCUS = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    ENABLE = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SETREDRAW = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SETTEXT = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GETTEXT = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GETTEXTLENGTH = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    PAINT = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    CLOSE = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QUERYENDSESSION = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QUERYOPEN = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    ENDSESSION = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    QUIT = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    ERASEBKGND = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SYSCOLORCHANGE = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    SHOWWINDOW = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WININICHANGE = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SETTINGCHANGE = WM.WININICHANGE,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DEVMODECHANGE = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ACTIVATEAPP = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FONTCHANGE = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever there is a change in the system time.\n    /// </summary>\n    TIMECHANGE = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CANCELMODE = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SETCURSOR = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MOUSEACTIVATE = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    CHILDACTIVATE = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QUEUESYNC = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GETMINMAXINFO = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PAINTICON = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    ICONERASEBKGND = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NEXTDLGCTL = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SPOOLERSTATUS = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DRAWITEM = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MEASUREITEM = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DELETEITEM = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKEYTOITEM = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CHARTOITEM = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SETFONT = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GETFONT = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SETHOTKEY = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GETHOTKEY = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QUERYDRAGICON = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    COMPAREITEM = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GETOBJECT = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    COMPACTING = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete]\n    COMMNOTIFY = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGING = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGED = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete]\n    POWER = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    COPYDATA = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CANCELJOURNAL = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    NOTIFY = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    INPUTLANGCHANGEREQUEST = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    INPUTLANGCHANGE = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCARD = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    HELP = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    USERCHANGED = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NOTIFYFORMAT = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    CONTEXTMENU = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    STYLECHANGING = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    STYLECHANGED = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DISPLAYCHANGE = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GETICON = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SETICON = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCREATE = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDESTROY = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCALCSIZE = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHITTEST = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPAINT = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCACTIVATE = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GETDLGCODE = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SYNCPAINT = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMOUSEMOVE = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDOWN = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONUP = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDBLCLK = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDOWN = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONUP = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDBLCLK = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDOWN = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONUP = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDBLCLK = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDOWN = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONUP = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDBLCLK = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    INPUT_DEVICE_CHANGE = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    INPUT = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYFIRST = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KEYDOWN = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KEYUP = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    CHAR = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DEADCHAR = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYDOWN = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYUP = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SYSCHAR = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SYSDEADCHAR = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UNICHAR = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYLAST = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_STARTCOMPOSITION = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_ENDCOMPOSITION = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITION = 0x010F,\n    /// <summary>TODO</summary>\n    IME_KEYLAST = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    INITDIALOG = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    COMMAND = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SYSCOMMAND = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    TIMER = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    HSCROLL = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    VSCROLL = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    INITMENU = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    INITMENUPOPUP = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MENUSELECT = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MENUCHAR = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    ENTERIDLE = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MENURBUTTONUP = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MENUDRAG = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MENUGETOBJECT = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UNINITMENUPOPUP = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MENUCOMMAND = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    CHANGEUISTATE = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UPDATEUISTATE = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QUERYUISTATE = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CTLCOLORMSGBOX = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CTLCOLOREDIT = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CTLCOLORLISTBOX = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CTLCOLORBTN = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CTLCOLORDLG = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CTLCOLORSCROLLBAR = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CTLCOLORSTATIC = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MOUSEFIRST = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MOUSEMOVE = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDOWN = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONUP = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDBLCLK = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDOWN = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONUP = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDBLCLK = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDOWN = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONUP = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDBLCLK = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEWHEEL = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n    /// </summary>\n    XBUTTONDOWN = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONUP = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONDBLCLK = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEHWHEEL = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MOUSELAST = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    PARENTNOTIFY = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    ENTERMENULOOP = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    EXITMENULOOP = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NEXTMENU = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    SIZING = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CAPTURECHANGED = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    MOVING = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    POWERBROADCAST = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DEVICECHANGE = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MDICREATE = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MDIDESTROY = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MDIACTIVATE = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MDIRESTORE = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MDINEXT = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MDIMAXIMIZE = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MDITILE = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MDICASCADE = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MDIICONARRANGE = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MDIGETACTIVE = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MDISETMENU = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    ENTERSIZEMOVE = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    EXITSIZEMOVE = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DROPFILES = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MDIREFRESHMENU = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SETCONTEXT = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_NOTIFY = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    IME_CONTROL = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITIONFULL = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SELECT = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_CHAR = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_REQUEST = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYDOWN = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYUP = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSEHOVER = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSELEAVE = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSEHOVER = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSELEAVE = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WTSSESSION_CHANGE = 0x02B1,\n    /// <summary>TODO</summary>\n    TABLET_FIRST = 0x02c0,\n    /// <summary>TODO</summary>\n    TABLET_LAST = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    CUT = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    COPY = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    PASTE = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    CLEAR = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    UNDO = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERFORMAT = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERALLFORMATS = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DESTROYCLIPBOARD = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DRAWCLIPBOARD = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PAINTCLIPBOARD = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VSCROLLCLIPBOARD = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SIZECLIPBOARD = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    ASKCBFORMATNAME = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    CHANGECBCHAIN = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HSCROLLCLIPBOARD = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QUERYNEWPALETTE = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PALETTEISCHANGING = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PALETTECHANGED = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    HOTKEY = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINT = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINTCLIENT = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    APPCOMMAND = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    THEMECHANGED = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    CLIPBOARDUPDATE = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCOMPOSITIONCHANGED = 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    DWMNCRENDERINGCHANGED = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMCOLORIZATIONCOLORCHANGED = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWINDOWMAXIMIZEDCHANGE = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    GETTITLEBARINFOEX = 0x033F,\n    /// <summary>TODO</summary>\n    HANDHELDFIRST = 0x0358,\n    /// <summary>TODO</summary>\n    HANDHELDLAST = 0x035F,\n    /// <summary>TODO</summary>\n    AFXFIRST = 0x0360,\n    /// <summary>TODO</summary>\n    AFXLAST = 0x037F,\n    /// <summary>TODO</summary>\n    PENWINFIRST = 0x0380,\n    /// <summary>TODO</summary>\n    PENWINLAST = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    APP = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    USER = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    CPL_LAUNCH = USER+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    CPL_LAUNCHED = USER+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SYSTIMER = 0x118\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n  [SuppressMessage(\"Microsoft.Design\", \"CA1028:EnumStorageShouldBeInt32\")]\n\t[Flags]public enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLButton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRButton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMButton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXButton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXButton2\t= 0x40\n\t}\n\n  /// <summary>TODO</summary>\n\tpublic static class WindowsMouseInput {\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static System.Drawing.Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new System.Drawing.Point(\n\t\t\t\t\t (int)(short)(lParam.ToInt64() & 0x0000ffff), \n\t\t\t\t\t (int)(short)(lParam.ToInt64() >> 16)\n\t\t\t\t);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static Int16 WheelDelta(IntPtr wParam) {\n\t\t\treturn (Int16)(wParam.ToInt64() >> 16);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr LParam(Point point) {\n\t\t\tif (point.X<Int16.MinValue || point.X > Int16.MaxValue\n      ||  point.Y<Int16.MinValue || point.Y > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point\",point,\n\t\t\t\t\t\"Must be a valid Point struct.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr WParam (Int16 wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (Int16)mouseKeys;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWinForms/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>PInvoke WindowStyles (Extended) Enum.</summary>\n  [Flags]internal enum WindowStylesEx\n  {\n    /// <summary>TODO</summary>\n    NONE = 0x00000000,\n    /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n    ACCEPTFILES = 0x00000010,\n    /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n    APPWINDOW = 0x00040000,\n    /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n    CLIENTEDGE = 0x00000200,\n    /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n    /// <remarks>\n    /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </remarks>\n    COMPOSITED = 0x02000000,\n    /// <summary>Includes a question mark in the title bar of the window.</summary>\n    /// <remarks>\n    /// When the user clicks the question mark, the cursor changes to a question mark \n    /// with a pointer. If the user then clicks a child window, the child receives a \n    /// WM_HELP message. The child window should pass the message to the parent window \n    /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n    /// The Help application displays a pop-up window that typically contains help for\n    /// the child window.  \n    /// CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n    /// </remarks>\n    CONTEXTHELP = 0x00000400,\n    /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n    /// <remarks>\n    /// If this style is specified, the dialog manager recurses into children of this \n    /// window when performing navigation operations such as handling the TAB key, \n    /// an arrow key, or a keyboard mnemonic.\n    /// </remarks>\n    CONTROLPARENT = 0x00010000,\n    /// <summary>Creates a window that has a double border.</summary>\n    /// <remarks>\n    /// The window can, optionally, be created with a title bar by specifying the \n    /// WS_CAPTION style in the dwStyle parameter.\n    /// </remarks>\n    DLGMODALFRAME = 0x00000001,\n    /// <summary>\n    /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </summary>\n    LAYERED = 0x00080000,\n    /// <summary>\n    /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. \n    /// </summary>\n    LAYOUTRTL = 0x00400000,\n    /// <summary>\n    /// Creates a window that has generic left-aligned properties. This is the default.\n    /// </summary>\n    LEFT = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\n    /// </summary>\n    LEFTSCROLLBAR = 0x00004000,\n    /// <summary>The window text is displayed using left-to-right reading-order properties.</summary>\n    /// <remarks>\n    /// This is the default.\n    /// </remarks>\n    LTRREADING = 0x00000000,\n    /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n    MDICHILD = 0x00000040,\n    /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n    /// <remarks>\n    /// Windows 2000/XP: A top-level window created with this style does not become the \n    /// foreground window when the user clicks it. \n    /// \n    /// The system does not bring this window to the foreground when the user minimizes \n    /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n    /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n    /// default. To force the window to appear on the taskbar, use the APPWINDOW \n    /// style.\n    /// </remarks>\n    NOACTIVATE = 0x08000000,\n    /// <summary>\n    /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\n    /// </summary>\n    NOINHERITLAYOUT = 0x00100000,\n    /// <summary>\n    /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n    /// </summary>\n    NOPARENTNOTIFY = 0x00000004,\n    /// <summary>Combines the CLIENTEDGE and WINDOWEDGE styles.</summary>\n    OVERLAPPEDWINDOW = WINDOWEDGE | CLIENTEDGE,\n    /// <summary>Combines the WINDOWEDGE, TOOLWINDOW, and TOPMOST styles.</summary>\n    PALETTEWINDOW = WINDOWEDGE | TOOLWINDOW | TOPMOST,\n    /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n    /// <remarks>\n    /// This depends on the window class. This style has an effect only if the \n    /// shell language is Hebrew, Arabic, or another language that supports \n    /// reading-order alignment; otherwise, the style is ignored.\n    /// \n    /// Using the RIGHT style for static or edit controls has the same \n    /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n    /// style with button controls has the same effect as using BS_RIGHT and \n    /// BS_RIGHTBUTTON styles.\n    /// </remarks>\n    RIGHT = 0x00001000,\n    /// <summary>\n    /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\n    /// </summary>\n    RIGHTSCROLLBAR = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\n    /// </summary>\n    RTLREADING = 0x00002000,\n    /// <summary>\n    /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\n    /// </summary>\n    STATICEDGE = 0x00020000,\n    /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n    /// <remarks>\n    /// A tool window has a title bar that is shorter than a normal title bar, and the \n    /// window title is drawn using a smaller font. A tool window does not appear in \n    /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n    /// tool window has a system menu, its icon is not displayed on the title bar. \n    /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n    /// </remarks>\n    TOOLWINDOW = 0x00000080,\n    /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should be placed above all \n    /// non-topmost windows and should stay above them, even when the window is \n    /// deactivated. To add or remove this style, use the SetWindowPos function.\n    /// </remarks>\n    TOPMOST = 0x00000008,\n    /// <summary>Specifies that a window should be painted after all siblings.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should not be painted until \n    /// siblings beneath the window (that were created by the same thread) have been \n    /// painted. The window appears transparent because the bits of underlying sibling \n    /// windows have already been painted.\n    /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n    /// </remarks>\n    TRANSPARENT = 0x00000020,\n    /// <summary>Specifies that a window has a border with a raised edge.</summary>\n    WINDOWEDGE = 0x00000100\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n    </startup>\n</configuration>"
  },
  {
    "path": "codeplex/HexgridExampleWpf/App.xaml",
    "content": "﻿<Application x:Class=\"HexgridExampleWpf.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             StartupUri=\"MainWindow.xaml\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/App.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Data;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nnamespace HexgridExampleWpf {\n  /// <summary>\n  /// Interaction logic for App.xaml\n  /// </summary>\n  public partial class App : Application {\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/CommandComboBox.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace HexgridExampleWpf {\n  public sealed partial class CommandComboBox : ComboBox, ICommandSource {\n    public CommandComboBox() : base() { ; }\n\n    #region Dependency Property (static) Backing Stores\n    // Using DependencyProperties as the backing store enables animation, styling, binding, etc...\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandProperty =\n      DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(CommandComboBox),\n              new UIPropertyMetadata(null,new PropertyChangedCallback(CommandChanged)));\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandParameterProperty =\n      DependencyProperty.Register(\"CommandParameter\", typeof(object), typeof(CommandComboBox), \n              new UIPropertyMetadata(null));\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandTargetProperty =\n      DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(CommandComboBox),\n              new UIPropertyMetadata(null));\n    #endregion\n\n    public ICommand      Command          {\n      get { return (ICommand)GetValue(CommandProperty); }\n      set { SetValue(CommandProperty, value); }\n    }\n    public object        CommandParameter {\n      get { return (object)GetValue(CommandParameterProperty); }\n      set { SetValue(CommandParameterProperty, value); }\n    }\n    public IInputElement CommandTarget    {\n      get { return (IInputElement)GetValue(CommandTargetProperty); }\n      set { SetValue(CommandTargetProperty, value); }\n    }\n\n    #region Event Handlers\n    /// <summary>Command dependency property change callback.</summary>\n    private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n      var cs = (CommandComboBox)d;\n      cs.HookUpCommand((ICommand)e.OldValue, (ICommand)e.NewValue);\n    }\n\n    /// <inheritdoc/>\n    /// <remarks>\n    /// If Command is defined, moving the slider will invoke the command; \n    /// Otherwise, the slider will behave normally. \n    /// </remarks>\n    protected override void OnSelectionChanged(SelectionChangedEventArgs e) {\n      base.OnSelectionChanged(e);\n\n      if (this.Command != null) {\n        RoutedCommand command = Command as RoutedCommand;\n\n        if (command != null)\n          command.Execute(CommandParameter, CommandTarget);\n        else\n          ((ICommand)Command).Execute(CommandParameter);\n      }\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) {\n      base.OnMouseLeftButtonUp(e);\n\n      var command = Command;\n      var parameter = CommandParameter;\n      var target = CommandTarget;\n\n      var routedCmd = command as RoutedCommand;\n      if (routedCmd != null && routedCmd.CanExecute(parameter, target))\n      {\n          routedCmd.Execute(parameter, target);\n      }\n      else if (command != null && command.CanExecute(parameter))\n      {\n          command.Execute(parameter);\n      }\n    }\n    /// <summary>TODO</summary>\n    private            void CanExecuteChanged(object sender, EventArgs e) {\n      if (this.Command != null)    {\n        var routed = this.Command as RoutedCommand;\n        if (routed == null)       // If not a RoutedCommand. \n          this.IsEnabled = Command.CanExecute(CommandParameter);\n        else                      // Else a RoutedCommand. \n          this.IsEnabled = routed.CanExecute(CommandParameter, CommandTarget);\n      }\n    }\n    #endregion\n\n    /// <summary>Add a new command to the Command Property. </summary>\n    private void HookUpCommand(ICommand oldCommand, ICommand newCommand) {\n      if (oldCommand != null)   oldCommand.CanExecuteChanged -= this.CanExecuteChanged;\n      if (newCommand != null)   newCommand.CanExecuteChanged += this.CanExecuteChanged;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/CommandSlider.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace HexgridExampleWpf {\n  public sealed partial class CommandSlider : Slider, ICommandSource {\n    public CommandSlider() : base() { ; }\n\n    #region Dependency Property (static) Backing Stores\n    // Using DependencyProperties as the backing store enables animation, styling, binding, etc...\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandProperty =\n      DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(CommandSlider),\n              new UIPropertyMetadata(null,new PropertyChangedCallback(CommandChanged)));\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandParameterProperty =\n      DependencyProperty.Register(\"CommandParameter\", typeof(object), typeof(CommandSlider), \n              new UIPropertyMetadata(null));\n    /// <summary>TODO</summary>\n    public static readonly DependencyProperty CommandTargetProperty =\n      DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(CommandSlider),\n              new UIPropertyMetadata(null));\n    #endregion\n\n    public ICommand      Command          {\n      get { return (ICommand)GetValue(CommandProperty); }\n      set { SetValue(CommandProperty, value); }\n    }\n    public object        CommandParameter {\n      get { return (object)GetValue(CommandParameterProperty); }\n      set { SetValue(CommandParameterProperty, value); }\n    }\n    public IInputElement CommandTarget    {\n      get { return (IInputElement)GetValue(CommandTargetProperty); }\n      set { SetValue(CommandTargetProperty, value); }\n    }\n\n    #region Event Handlers\n    /// <summary>Command dependency property change callback.</summary>\n    private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n      var cs = (CommandSlider)d;\n      cs.HookUpCommand((ICommand)e.OldValue, (ICommand)e.NewValue);\n    }\n\n    /// <inheritdoc/>\n    /// <remarks>\n    /// If Command is defined, moving the slider will invoke the command; \n    /// Otherwise, the slider will behave normally. \n    /// </remarks>\n    protected override void OnValueChanged(double oldValue, double newValue) {\n      base.OnValueChanged(oldValue, newValue);\n\n      if (this.Command != null) {\n        RoutedCommand command = Command as RoutedCommand;\n\n        if (command != null)\n          command.Execute(CommandParameter, CommandTarget);\n        else\n          ((ICommand)Command).Execute(CommandParameter);\n      }\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) {\n      base.OnMouseLeftButtonUp(e);\n\n      var command = Command;\n      var parameter = CommandParameter;\n      var target = CommandTarget;\n\n      var routedCmd = command as RoutedCommand;\n      if (routedCmd != null && routedCmd.CanExecute(parameter, target))\n      {\n          routedCmd.Execute(parameter, target);\n      }\n      else if (command != null && command.CanExecute(parameter))\n      {\n          command.Execute(parameter);\n      }\n    }\n    /// <summary>TODO</summary>\n    private            void CanExecuteChanged(object sender, EventArgs e) {\n      if (this.Command != null)    {\n        var routed = this.Command as RoutedCommand;\n        if (routed == null)       // If not a RoutedCommand. \n          this.IsEnabled = Command.CanExecute(CommandParameter);\n        else                      // Else a RoutedCommand. \n          this.IsEnabled = routed.CanExecute(CommandParameter, CommandTarget);\n      }\n    }\n    #endregion\n\n    /// <summary>Add a new command to the Command Property. </summary>\n    private void HookUpCommand(ICommand oldCommand, ICommand newCommand) {\n      if (oldCommand != null)   oldCommand.CanExecuteChanged -= this.CanExecuteChanged;\n      if (newCommand != null)   newCommand.CanExecuteChanged += this.CanExecuteChanged;\n    }\n  }\n}"
  },
  {
    "path": "codeplex/HexgridExampleWpf/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n           <Word>Alt</Word>\n           <Word>coloured</Word>\n           <Word>Coords</Word>\n           <Word>Ctl</Word>\n           <Word>Eachable</Word>\n           <Word>Fov</Word>\n           <Word>Fwd</Word>\n           <Word>functor</Word>      <Word>functors</Word>\n           <Word>hexgrid</Word>\n           <Word>HexgridUtilities</Word>\n           <Word>hexside</Word>      <Word>hexsides</Word>\n           <Word>Hotspot</Word>\n           <Word>lhs</Word>\n           <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n           <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n           <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n           <Word>Napoleonics</Word>\n           <Word>Neighbour</Word>    <Word>Neighbours</Word>\n           <Word>rhs</Word>\n           <Word>c</Word>\n           <Word>f</Word>\n           <Word>g</Word>\n           <Word>h</Word>\n           <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n           <Word>m</Word>\n           <Word>p</Word>\n           <Word>Pathfinding</Word>\n           <Word>s</Word>\n           <Word>v</Word>\n           <Word>w</Word>\n           <Word>x</Word>      <Word>dx</Word>\n           <Word>y</Word>      <Word>dy</Word>\n           <Word>z</Word>      <Word>dz</Word>\n           <Word>wParam</Word>\n           <Word>lParam</Word>\n           <Word>params</Word>\n         </Recognized>\n         <Deprecated>\n           <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n           <Acronym>ASL</Acronym>\n           <Acronym>Fov</Acronym>\n           <Acronym>PG</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "codeplex/HexgridExampleWpf/HexgridExampleWpf.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{6CEB2C15-1E1A-446C-92C6-77BC49833742}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridExampleWpf</RootNamespace>\n    <AssemblyName>HexgridExampleWpf</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexGridExampleWpf\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexGridExampleWpf\\bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"WindowsFormsIntegration\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"App.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n      <CustomToolNamespace>PGNapoleonics.HexGridExample2</CustomToolNamespace>\n    </ApplicationDefinition>\n    <Page Include=\"MainWindow.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Compile Include=\"App.xaml.cs\">\n      <DependentUpon>App.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"CommandComboBox.cs\" />\n    <Compile Include=\"CommandSlider.cs\" />\n    <Compile Include=\"MainWindow.xaml.cs\">\n      <DependentUpon>MainWindow.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\">\n      <CustomToolNamespace>PGNapoleonics.HexGridExample2</CustomToolNamespace>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExample2\\HexgridPanelExample.csproj\">\n      <Project>{bea36fda-557c-4fda-94a2-48a21a0c31fc}</Project>\n      <Name>HexgridPanelExample</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridExampleWpf/MainWindow.xaml",
    "content": "﻿<Window Name=\"mainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:System=\"clr-namespace:System;assembly=mscorlib\"\n        xmlns:local=\"clr-namespace:PGNapoleonics.HexgridExampleWpf\"\n        xmlns:Properties=\"clr-namespace:HexgridExampleWpf.Properties\" \n        xmlns:HexgridPanel=\"clr-namespace:PGNapoleonics.HexgridPanel;assembly=HexgridPanel\" \n        xmlns:HexCommon=\"clr-namespace:PGNapoleonics.HexgridExamples;assembly=HexgridExampleCommon\"\n        x:Class=\"HexgridExampleWpf.MainWindow\"\n\n        Title=\"Hexgrid Utilities WPF Example\" Height=\"422\" Width=\"782\" Loaded=\"Window_Loaded\" \n        SizeToContent=\"WidthAndHeight\" ScrollViewer.VerticalScrollBarVisibility=\"Disabled\"\n        >\n   <Window.Resources>\n      <CollectionViewSource Source=\"{Binding MapSelectionItems}\" x:Key=\"mapSelectionItems\" />\n   </Window.Resources>\n\n   <Window.CommandBindings>\n      <CommandBinding Command=\"Refresh\" Executed=\"RefreshCmdExecuted\" CanExecute=\"RefreshCmdCanExecute\"/>\n   </Window.CommandBindings>\n\n   <DockPanel x:Name=\"_dockPanel\" Cursor=\"Arrow\" \n\t\tScrollViewer.VerticalScrollBarVisibility=\"Disabled\" >\n      <StackPanel Name=\"toolbarControls\" DockPanel.Dock=\"Top\" \n\t\t\tHeight=\"25\" \n\t\t\tVerticalAlignment=\"Top\" \n\t\t\tOrientation=\"Horizontal\" >\n         <StackPanel.Background>\n            <LinearGradientBrush EndPoint=\"0.5,1\" MappingMode=\"RelativeToBoundingBox\" StartPoint=\"0.5,0\">\n               <GradientStop Color=\"White\" Offset=\"0\"/>\n               <GradientStop Color=\"#994040A0\" Offset=\"1\"/>\n            </LinearGradientBrush>\n         </StackPanel.Background>\n         <ToggleButton x:Name=\"buttonTransposeMap\" \n\t\t\t\t      Content=\"Transpose\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n              Focusable=\"False\"\n              IsChecked=\"{Binding HexgridPanel.IsTransposed, Mode=TwoWay, FallbackValue=False, UpdateSourceTrigger=PropertyChanged}\"\n\t\t\t\t      ToolTip=\"Toggles transposition of the current map.\" Margin=\"3,0\"/>\n         <ToggleButton x:Name=\"buttonRangeLine\" \n\t\t\t\t      Content=\"Range Line\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n              Focusable=\"False\"\n              IsChecked=\"{Binding Model.ShowRangeLine, Mode=TwoWay, FallbackValue=False, UpdateSourceTrigger=PropertyChanged}\"\n              Command=\"Refresh\"\n\t\t\t\t      ToolTip=\"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex and Hotspot-Hex.\" \n              Margin=\"3,0\">\n         </ToggleButton>\n         <ToggleButton x:Name=\"buttonPathArrow\" \n\t\t\t\t      Content=\"Path Arrow\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n              Focusable=\"False\"\n              IsChecked=\"{Binding Model.ShowPathArrow, Mode=TwoWay, FallbackValue=True, UpdateSourceTrigger=PropertyChanged}\"\n              Command=\"Refresh\"\n\t\t\t\t      ToolTip=\"Toggle display of Path Arrow.\" \n              Margin=\"3,0\"/>\n         <ToggleButton x:Name=\"buttonFieldOfView\" \n\t\t\t\t      Content=\"FOV\" \n\t\t\t\t      Width=\"75\" \n\t\t\t\t      ClickMode=\"Press\" \n              Focusable=\"False\"\n              IsChecked=\"{Binding Model.ShowFov, Mode=TwoWay, FallbackValue=True, UpdateSourceTrigger=PropertyChanged}\"\n              Command=\"Refresh\"\n\t\t\t\t      ToolTip=\"Toggles display of current Field-of-View\" Margin=\"3,0,0,0\" \n        />\n         <local:CommandSlider x:Name=\"sliderFovRadius\" Width=\"116\" TickFrequency=\"5\" \n      \t      Maximum=\"60\" SmallChange=\"1\" LargeChange=\"5\" \n      \t      Focusable=\"False\" AutoToolTipPlacement=\"TopLeft\"\n      \t      Value=\"{Binding Model.FovRadius, FallbackValue=20, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n      \t      Command=\"Refresh\"\n      \t      CommandParameter=\"SetMapDirty\"\n      \t      ToolTip=\"Range beyond which Fast PathFinding is used instead of Stable PathFinding.\" \n      \t      Margin=\"0,0,3,0\" TickPlacement=\"TopLeft\" Background=\"#FFE0E0E0\" Foreground=\"#FF6C6C6C\" \n              />\n         <ComboBox x:Name=\"comboBoxMapSelection\" \n\t\t\t\t      Width=\"90\" \n              Margin=\"3,0\" \n              Focusable=\"False\"\n\t\t\t\t      ToolTip=\"Selects map to display.\"\n              SelectedIndex=\"{Binding SelectedMapIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n              >\n            <ListBoxItem x:Name=\"TerrainMap\" Content=\"Terrain Map\"/>\n            <ListBoxItem x:Name=\"MazeMap\"    Content=\"Maze Map\"/>\n         </ComboBox>\n         <Label Content=\"Landmark to Show:\" HorizontalContentAlignment=\"Right\" Width=\"115\" Margin=\"3,0,0,0\"/>\n         <local:CommandComboBox x:Name=\"menuItemLandmarks\" Width=\"60\" Margin=\"0,0,3,0\"\n              Focusable=\"False\"\n              ItemsSource=\"{Binding LandmarkItems}\"\n              SelectedIndex=\"{Binding Model.LandmarkToShow, Mode=TwoWay}\"\n              Command=\"Refresh\" CommandParameter=\"SetMapDirty\"\n              />\n      </StackPanel>\n      <StackPanel DockPanel.Dock=\"Bottom\"  \n\t\t\tHeight=\"25\" \n\t\t\tVerticalAlignment=\"Top\">\n         <StackPanel.Background>\n            <LinearGradientBrush EndPoint=\"0.5,1\" StartPoint=\"0.5,0\">\n               <GradientStop Color=\"#664040A0\" Offset=\"1\"/>\n               <GradientStop Color=\"#994040A0\"/>\n            </LinearGradientBrush>\n         </StackPanel.Background>\n         <Label x:Name=\"statusLabel\" Content=\"Status display\"/>\n      </StackPanel>\n      <ScrollViewer \n\t\t\tx:Name=\"_scrollViewer\" \n\t\t\tClipToBounds=\"True\" \n\t\t\tHorizontalContentAlignment=\"Stretch\" \n\t\t\tVerticalContentAlignment=\"Stretch\" \n\t\t\tVerticalScrollBarVisibility=\"Disabled\">\n         <WindowsFormsHost x:Name=\"_host\" \n\t\t\t\tScrollViewer.VerticalScrollBarVisibility=\"Disabled\" \n\t\t\t\tScrollViewer.CanContentScroll=\"True\">\n            <HexgridPanel:BufferedHexgridScrollable \n                  AutoScrollMinSize=\"200,100\" \n                  Margin=\"5, 5, 5, 5\" \n                  Size=\"1445,920\" \n                  />\n         </WindowsFormsHost>\n      </ScrollViewer>\n   </DockPanel>\n</Window>\n   "
  },
  {
    "path": "codeplex/HexgridExampleWpf/MainWindow.xaml.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexgridExamples;\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nusing MyMapDisplay = PGNapoleonics.HexgridPanel.MapDisplay<PGNapoleonics.HexUtilities.MapGridHex>;\n\nnamespace PGNapoleonics.HexgridExampleWpf {\n  /// <summary>TODO</summary>\n  public partial class MainWindow : Window {\n    /// <summary>TODO</summary>\n    public MainWindow() {\n      InitializeComponent();\n      this.DataContext = this;\n    }\n\n    void RefreshCmdExecuted(object target, ExecutedRoutedEventArgs e) { \n      if (e.Parameter != null) HexgridPanel.SetMapDirty();\n      HexgridPanel.Refresh();  \n    }\n    void RefreshCmdCanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = true; }\n\n    private void Window_Loaded (object sender, RoutedEventArgs e) {\n      HexgridPanel = (HexgridScrollable) _host.Child;\n      _host.Child.Focus();\n\n      HexgridPanel.DataContext.SetScales(_scales);\n      HexgridPanel.ScaleIndex   = _scales.Select((f,i) => new {value=f, index=i})\n                                         .Where(s => s.value==1.0F)\n                                         .Select(s => s.index).FirstOrDefault(); \n      HexgridPanel.MouseMove   += this.hexgridPanel_MouseMove;\n\n      var sink = sender as System.Windows.Interop.IKeyboardInputSink;\n      if (sink != null) \n        ((System.Windows.Interop.IKeyboardInputSink)sender).TabInto\n              (new System.Windows.Input.TraversalRequest(FocusNavigationDirection.First));\n      SelectedMapIndex     = 0;\n    }\n\n    /// <summary>TODO</summary>\n    public   HexgridScrollable HexgridPanel { get; private set; }\n    /// <summary>TODO</summary>\n    public   IMapDisplayWinForms       Model        { get { return HexgridPanel.DataContext.Model; } }\n\n    /// <summary>TODO</summary>\n    public   int               SelectedMapIndex  { \n      get { return _selectedMapIndex; } \n      set {\n        _selectedMapIndex = value;\n        var mapName = ((ListBoxItem)comboBoxMapSelection.Items[_selectedMapIndex]).Name;\n        switch (mapName) {\n          case \"MazeMap\":    HexgridPanel.SetModel(SetMapBoard(new MazeMap(),    Model.FovRadius)); break;\n          case \"TerrainMap\": HexgridPanel.SetModel(SetMapBoard(new TerrainMap(), Model.FovRadius)); break;\n          default:            break;\n        }\n        sliderFovRadius.Value = Model.FovRadius;\n        HexgridPanel.Refresh();\n      }\n    } int _selectedMapIndex = 0;\n\n    static readonly List<float> _scales = new List<float> {0.707F,  0.841F, 1.000F, 1.189F, 1.414F};\n\n    MyMapDisplay SetMapBoard(MyMapDisplay mapBoard, int fovRadius) {\n      mapBoard.FovRadius  = fovRadius;\n      RefreshLandmarkMenu(mapBoard);\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*mapBoard.MapSizeHexes.Height-1, 2));\n      return mapBoard;\n    }\n\n    /// <summary>TODO</summary>\n    public ObservableCollection<ListBoxItem> LandmarkItems {\n      get { return _landmarkItems; }\n    } ObservableCollection<ListBoxItem> _landmarkItems \n      = new ObservableCollection<ListBoxItem>() { new ListBoxItem(){Name=\"None\", Content=\"None\"} }; \n\n    void RefreshLandmarkMenu(MyMapDisplay model) {\n      Model.LandmarkToShow = 0;\n      while(LandmarkItems.Count > 1) LandmarkItems.RemoveAt(1);\n\n      foreach(var item in \n        model.Landmarks.Select((l,i) => new ListBoxItem {\n            Name=String.Format(\"No_{0}\",i),\n            Content=String.Format(CultureInfo.InvariantCulture, \"{0}\", l.Coords)\n        } ) ) {\n        LandmarkItems.Add(item);\n      }\n      HexgridPanel.SetMapDirty();\n    }\n\n    void hexgridPanel_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {\n      var hotHex       = Model.HotspotHex;\n      statusLabel.Content = string.Format(CultureInfo.InvariantCulture,\n        \"Hotspot Hex: {0:gi3} / {0:uI4} / {0:c5}; {1:r6}; Path Length = {2}\",\n        hotHex, Model.StartHex - hotHex, (Model.Path==null ? 0 : Model.Path.TotalCost));\n    }\n  }\n}\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  using System;\n  using System.Runtime.InteropServices;\n\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\",\n      \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification = \"Research suggests the Code Analysis message is incorrect.\")]\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\",\n      \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n[assembly: CLSCompliant(true)]\n[assembly: NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWpf\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleWpf\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n  //(used if a resource is not found in the page, \n  // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n  //(used if a resource is not found in the page, \n  // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18444\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWpf.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridExampleWpf.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "codeplex/HexgridExampleWpf/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18444\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridExampleWpf.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridExampleWpf/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "codeplex/HexgridPanel/Common/EmptyBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using HexSize         = System.Drawing.Size;\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyBoard : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public EmptyBoard() : base(new HexSize(1,1), new HexSize(26,30), (path,c) => new EmptyGridHex(c)) {\n      FovRadius = 20;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyGridHex : MapGridHex, IHex {\n    /// <summary>TODO</summary>\n    public EmptyGridHex(HexCoords coords) : base(coords,0) {}\n\n    /// <summary>TODO</summary>\n    public override int           HeightTerrain { get { return 0;   } }\n    /// <summary>TODO</summary>\n    public override int           StepCost(Hexside hexsideExit) { return -1; }\n    ///  <inheritdoc/>\n    public override void          Paint(Graphics graphics) { ; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/Common/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary></summary>\n  public class HexEventArgs : MouseEventArgs {\n    /// <summary>TODO</summary>\n    public HexCoords  Coords       { get; private set; }\n\n    /// <summary>TODO</summary>\n    public bool     Alt          { get { return ModifierKeys.Hasflag(Keys.Alt);  } }\n    /// <summary>TODO</summary>\n    public bool     Control      { get { return ModifierKeys.Hasflag(Keys.Control); } }\n    /// <summary>TODO</summary>\n    public bool     Shift        { get { return ModifierKeys.Hasflag(Keys.Shift); } }\n\n    /// <summary>TODO</summary>\n    public Keys     ModifierKeys { get; private set; }\n\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords) \n      : this(coords, Keys.None, MouseButtons.None,0,0,0,0) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, Keys modifierKeys) \n      : this(coords, modifierKeys, MouseButtons.None,0,0,0,0) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, Keys modifierKeys, \n      MouseButtons buttons, int clicks, int x, int y, int delta)\n      : base(buttons,clicks,x,y,delta) {\n      Coords       = coords;\n      ModifierKeys = modifierKeys;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/Common/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Globalization;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\n#pragma warning disable 1587\n/// <summary>WinForms-specific utilities, including implementation of the subclasses HexgridPanel\n/// and MapDisplay<THex>, utilizing the System.Windows.Forms technology.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridPanel {\n  using Int32ValueEventArgs = ValueChangedEventArgs<Int32>;\n  using IDirectedPath       = IDirectedPathCollection;\n  using MapGridHex          = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>Abstract class representing the basic game board.</summary>\n  /// <typeparam name=\"THex\">Type of the hex for which a game board is desired.</typeparam>\n  public abstract class MapDisplay<THex> : HexBoard<THex,GraphicsPath>, IMapDisplayWinForms\n    where THex : MapGridHex {\n\n    /// <summary>TODO</summary>\n    protected delegate THex InitializeHex(GraphicsPath hexgridPath, HexCoords coords);\n\n    /// <summary>TODO</summary>\n    private static GraphicsPath GetGraphicsPath(Size gridSize) {\n      GraphicsPath path     = null;\n      GraphicsPath tempPath = null;\n      try {\n        tempPath  = new GraphicsPath();\n        tempPath.AddLines(new Point[] {\n          new Point(gridSize.Width*1/3,              0  ), \n          new Point(gridSize.Width*3/3,              0  ),\n          new Point(gridSize.Width*4/3,gridSize.Height/2),\n          new Point(gridSize.Width*3/3,gridSize.Height  ),\n          new Point(gridSize.Width*1/3,gridSize.Height  ),\n          new Point(             0,    gridSize.Height/2),\n          new Point(gridSize.Width*1/3,              0  )\n        } );\n        path     = tempPath;\n        tempPath = null;\n      } finally { if(tempPath!=null) tempPath.Dispose(); }\n      return path;\n    }\n\n    #region Constructors\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, InitializeHex initializeHex) \n    : this(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes)) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, InitializeHex initializeHex, IFastList<HexCoords> landmarkCoords) \n    : base(sizeHexes, gridSize, landmarkCoords, GetGraphicsPath\n      #if FlatBoardStorage\n        ,() => new FlatBoardStorage<THex>(sizeHexes, coords => initializeHex(board,coords))\n      #else\n        ,() => new BlockedBoardStorage32x32<THex>(sizeHexes, coords => initializeHex(GetGraphicsPath(gridSize),coords))\n      #endif\n    ) {\n      InitializeProperties();\n      var grid = TransposableHexgrid.GetNewGrid(false,gridSize,1.0F);\n    }\n\n    void InitializeProperties() {\n      GoalHex         = \n      HotspotHex      = \n      StartHex        = HexCoords.EmptyUser;\n      ShadeBrushAlpha = 78;\n      ShadeBrushColor = Color.Black;\n      ShowFov         = true;\n      ShowHexgrid     = true;\n      ShowPath        = true;\n      ShowPathArrow   = true;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Gets or sets the Field-of-View for the current <see cref=\"HotspotHex\"/>, as an <see cref=\"IFov\"/> object.</summary>\n    public virtual  IFov          Fov             {\n      get { return _fov ?? (_fov = this.GetFieldOfView(ShowRangeLine ? StartHex : HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    /// <inheritdoc/>\n    public override int           FovRadius       { set { RangeCutoff = base.FovRadius = value; Fov = null; } }\n    /// <inheritdoc/>\n    public virtual  HexCoords     GoalHex         { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public virtual  HexCoords     HotspotHex      { \n      get { return _hotSpotHex; }\n      set { if (IsOnboard(value)) _hotSpotHex = value; if (!ShowRangeLine) _fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public          int           LandmarkToShow  { get; set; }\n    /// <inheritdoc/>\n    public          string        Name            { get {return \"MapDisplay\";} }\n    /// <inheritdoc/>\n    public          IDirectedPath Path            { \n      get { return _path ?? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])); } \n    } IDirectedPath _path;\n    /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          byte          ShadeBrushAlpha { get; set; }\n    /// <summary>Gets or sets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          Color         ShadeBrushColor { get; set; }\n    /// <summary>Gets or sets whether to display the FIeld-of-View for <see cref=\"HotspotHex\"/>.</summary>\n    public          bool          ShowFov         { get; set; }\n    /// <summary>Gets or sets whether to display the hexgrid.</summary>\n    public          bool          ShowHexgrid     { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowPath        { get; set; }\n    /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n    public          bool          ShowPathArrow   { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowRangeLine   { \n      get { return _showRangeLine; } \n      set { _showRangeLine = value; if (_showRangeLine) Fov = null; }\n    } bool _showRangeLine = false;\n    /// <inheritdoc/>\n    public virtual  HexCoords     StartHex        { \n      get { return _startHex; }\n      set { if (IsOnboard(value)) _startHex = value; _path = null; if (ShowRangeLine) _fov = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(PointF point, SizeF size) {\n      return GetClipInHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n\n    /// <summary>Wrapper for MapDisplayPainter.PaintHighlight.</summary>\n    public    virtual  void PaintHighlight(Graphics graphics) { MapDisplayPainter.PaintHighlight(this,graphics); }\n\n    /// <summary>Wrapper for MapDisplayPainter.PaintMap.</summary>\n    public    virtual  void PaintMap(Graphics graphics) { MapDisplayPainter.PaintMap(this,graphics); }\n\n    /// <summary>Wrapper for MapDisplayPainter.PaintShading.</summary>\n    public    virtual  void PaintShading(Graphics graphics) { MapDisplayPainter.PaintShading(this,graphics); }\n\n    /// <summary>Wrapper for MapDisplayPainter.PaintUnits.</summary>\n    public    virtual  void PaintUnits(Graphics graphics) { MapDisplayPainter.PaintUnits(this,graphics); }\n\n    /// <summary>Returns the translation transform-@this for the upper-left corner of the specified hex.</summary>\n    /// <param name=\"coords\">Type: HexCoords - \n    /// Coordinates of the hex to be painted next.</param>\n    public Matrix TranslateToHex(HexCoords coords) {\n      var offset  = UpperLeftOfHex(coords);\n      return new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n    }\n\n    /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n    public Point UpperLeftOfHex(HexCoords coords) {\n      return new Point(\n        coords.User.X * GridSize.Width,\n        coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n      );\n    }\n\n    /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n    public Point CentreOfHex(HexCoords coords) {\n      return UpperLeftOfHex(coords) + CentreOfHexOffset;\n    }\n    #endregion\n\n    /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n    /// <param name=\"coords\">Type HexCoords - \n    /// Hex for which to return Landmark distanace.</param>\n    /// <param name=\"landmarkToShow\">Type int - \n    /// Index of the Landmark from which to display distances.</param>\n    public virtual string LandmarkDistance(HexCoords coords, int landmarkToShow) { \n      if (landmarkToShow < 0  ||  Landmarks.Count <= landmarkToShow) return \"\";\n\n      return string.Format(CultureInfo.CurrentCulture,\"{0,3}\", Landmarks[landmarkToShow].DistanceFrom(coords));\n    }\n\n    /// <summary>TODO</summary>\n    private void Host_FovRadiusChanged(object sender, Int32ValueEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      FovRadius = RangeCutoff = e.Value;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ValueChangedEventArgs<T> : EventArgs {\n    /// <summary>TODO</summary>\n    public ValueChangedEventArgs(T value) : base() { Value = value; }\n    /// <summary>TODO</summary>\n    public T Value { get; private set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/CustomDictionary.xsd",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n   <xs:element name=\"Dictionary\">\n      <xs:complexType>\n         <xs:sequence>\n            <xs:element name=\"Words\">\n               <xs:complexType>\n                  <xs:sequence>\n                     <xs:element name=\"Unrecognized\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element name=\"Word\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"Recognized\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Word\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"Deprecated\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element name=\"Term\">\n                                 <xs:complexType>\n                                    <xs:simpleContent>\n                                       <xs:extension base=\"xs:string\">\n                                          <xs:attribute name=\"PreferredAlternate\" type=\"xs:string\" use=\"required\" />\n                                       </xs:extension>\n                                    </xs:simpleContent>\n                                 </xs:complexType>\n                              </xs:element>\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                     <xs:element name=\"DiscreteExceptions\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Term\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                  </xs:sequence>\n               </xs:complexType>\n            </xs:element>\n            <xs:element name=\"Acronyms\">\n               <xs:complexType>\n                  <xs:sequence>\n                     <xs:element name=\"CasingExceptions\">\n                        <xs:complexType>\n                           <xs:sequence>\n                              <xs:element maxOccurs=\"unbounded\" name=\"Acronym\" type=\"xs:string\" />\n                           </xs:sequence>\n                        </xs:complexType>\n                     </xs:element>\n                  </xs:sequence>\n               </xs:complexType>\n            </xs:element>\n         </xs:sequence>\n      </xs:complexType>\n   </xs:element>\n</xs:schema>"
  },
  {
    "path": "codeplex/HexgridPanel/HexGridPanel.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"$this.TrayLargeIcon\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>False</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridPanel.Designer.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridPanel {\n  public partial class HexgridPanel {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n        if (_mapBuffer!=null) _mapBuffer.Dispose();\n        if (_model  != null)  _model.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      this.SuspendLayout();\n      // \n      // HexgridPanel\n      // \n      this.AutoScroll = true;\n      this.AutoSize = true;\n      this.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Drawing.Imaging;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n  /// <summary>Sub-class implementation of a <b>WinForms</b> Panel with integrated <see cref=\"Hexgrid\"/> support.</summary>\n  [DockingAttribute(DockingBehavior.AutoDock)]\n  [Obsolete(\"Use PGNapoleonics.HexgridPanel.HexgridScrollable instead.\")]\n  public partial class HexgridPanel : TiltAwarePanel, ISupportInitialize {\n    #region Constructors\n    /// <summary>Creates a new instance of HexgridPanel.</summary>\n    public HexgridPanel() : base() {\n      InitializeComponent();\n    }\n    #endregion\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n      ScaleList     = new List<float>() {1.000F}.AsReadOnly();\n//      SetModel(new EmptyBoard());\n      Model         = new EmptyBoard();\n      HotspotHex    = HexCoords.EmptyUser;\n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n      this.MakeDoubleBuffered(true);\n    }\n    #endregion\n\n    #region Events\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    public event EventHandler<HexEventArgs> HotspotHexChange;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseAltClick;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseCtlClick;\n    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseLeftClick;\n    /// <summary>Announces a mouse right-click. </summary>\n    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Properties\n    /// <summary>MapBoard hosting this panel.</summary>\n    public MapDisplay<MapGridHex> Model    { \n      get { return _model; }\n      set {  if (_model != null) _model.Dispose(); \n             _model = value; \n             SetScrollLimits(_model);   \n             SetMapDirty();\n          }\n    } MapDisplay<MapGridHex> _model = new EmptyBoard();\n\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public     HexCoords    HotspotHex     { get; private set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsAltKeyDown   { get {return ModifierKeys.Hasflag(Keys.Alt);} }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsCtlKeyDown   { get {return ModifierKeys.Hasflag(Keys.Control);} }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsShiftKeyDown { get { return ModifierKeys.Hasflag(Keys.Shift); } }\n\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    [Browsable(true)]\n    public     bool         IsTransposed   { \n      get { return Model.IsTransposed; }\n      set { Model.IsTransposed = value;  SetScrollLimits(Model); }\n    }\n\n    /// <inheritdoc/>\n    public     Size         MapSizePixels  { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public     float        MapScale       { \n      get { return Model.MapScale; } \n      private set { Model.MapScale = value;  SetScrollLimits(Model); } \n    }\n\n    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    public     HexCoords    PanelCenterHex { \n      get { return GetHexCoords( PointToClient(new Point(Size.Round(ClientSize.Scale(0.50F))) ) ); }\n    }\n\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int      ScaleIndex     { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(ScaleList.Count-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue;\n              MapScale    = ScaleList[ScaleIndex];\n\n              OnScaleChange(EventArgs.Empty); \n            }\n          } \n    } int _scaleIndex;\n\n    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    public IList<float>     ScaleList      { get; private set; }\n    #endregion\n\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public         void SetMapDirty() { MapBuffer = null; }\n\n    /// <summary>Set property Scales (array of supported map scales as IList {float}.</summary>\n    public         void SetScaleList(IList<float> scales) { ScaleList = new ReadOnlyCollection<float>(scales); }\n\n    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    public virtual void SetScrollLimits(IMapDisplayWinForms model) {\n      if (model == null) return;\n      var smallChange              = Size.Ceiling(model.GridSize.Scale(MapScale));\n      HorizontalScroll.SmallChange = smallChange.Width;\n      VerticalScroll.SmallChange   = smallChange.Height;\n\n      var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n      HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n      VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n      var size                     = Hexgrid.GetSize(MapSizePixels,MapScale);\n      if (AutoScrollMinSize != size) {\n        AutoScrollMinSize          = size;\n        HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, Padding.Left + Padding.Right \n                                   + size.Width  - ClientSize.Width));\n        VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, Padding.Top + Padding.Bottom \n                                   + size.Height - ClientSize.Height));\n        Invalidate();\n      }\n    }\n\n    #region Grid Coordinates\n    /// <inheritdoc/>\n    protected IHexgrid    Hexgrid         { get {return Model.Hexgrid;} }\n    /// <summary>Gets the current Panel AutoScrollPosition.</summary>\n    public    Point       ScrollPosition  { get { return AutoScrollPosition; } }\n\n    CoordsRectangle       GetClipInHexes(PointF point, SizeF size) {\n      return Model.GetClipInHexes(point, size);\n    }\n\n    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    public virtual CoordsRectangle VisibleRectangle {\n      get { return GetClipInHexes( AutoScrollPosition.Scale(-1.0F/MapScale), \n                                         ClientSize.Scale( 1.0F/MapScale) );\n      }\n    }\n\n    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public HexCoords GetHexCoords(Point point) {\n      return Hexgrid.GetHexCoords(point, new Size(AutoScrollPosition));\n    }\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(HexCoords coordsNewULHex) {\n      return Hexgrid.HexCenterPoint(coordsNewULHex);\n    }\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    protected Point ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n      return Hexgrid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n    }\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if(IsHandleCreated) {\n//        base.OnPaint(e);\n\n        var g = e.Graphics;\n        var scroll = Hexgrid.GetScrollPosition(AutoScrollPosition);\n        if (DesignMode) { g.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n        g.Clear(Color.Black);\n        g.DrawRectangle(Pens.Black, ClientRectangle);\n\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.ScaleTransform(MapScale,MapScale);\n\n        var state = g.Save();\n        g.DrawImageUnscaled(MapBuffer, Point.Empty);\n\n        g.Restore(state); state = g.Save();\n        Model.PaintUnits(g);\n\n        g.Restore(state); state = g.Save();\n        Model.PaintShading(g);\n\n        g.Restore(state); state = g.Save();\n        Model.PaintHighlight(g);\n      }\n    }\n    static readonly Matrix TransposeMatrix = new Matrix(0F,1F, 1F,0F, 0F,0F);\n    #endregion\n\n    #region Double-Buffering\n    /// <summary>Gets or sets the backing buffer for the map underlay. Setting to null  forces a repaint.</summary>\n    Bitmap MapBuffer     { \n      get { return _mapBuffer ?? ( _mapBuffer = PaintBuffer()); } \n      set { if (_mapBuffer!=null) _mapBuffer.Dispose(); _mapBuffer = value; }\n    } Bitmap _mapBuffer;\n\n    /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n    Bitmap PaintBuffer() {\n      var size      = MapSizePixels;\n\n      Bitmap buffer     = null;\n      Bitmap tempBuffer = null;\n      try {\n        tempBuffer = new Bitmap(size.Width,size.Height, PixelFormat.Format32bppPArgb);\n        using(var g = Graphics.FromImage(tempBuffer)) {\n          g.Clear(Color.White);\n          Model.PaintMap(g);\n        }\n        buffer     = tempBuffer;\n        tempBuffer = null;\n      } finally { if (tempBuffer!=null) tempBuffer.Dispose(); }\n      return buffer;\n    }\n    #endregion\n\n    #region Mouse event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseClick(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      Traces.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\",\n                                      Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n      var eventArgs = new HexEventArgs(GetHexCoords(e.Location), ModifierKeys,e.Button,e.Clicks,e.X,e.Y,e.Delta);\n\n      if (e.Button == MouseButtons.Middle) base.OnMouseClick(eventArgs);\n      else if (e.Button == MouseButtons.Right) OnMouseRightClick(eventArgs);\n      else if (IsAltKeyDown && !IsCtlKeyDown) OnMouseAltClick(eventArgs);\n      else if (IsCtlKeyDown) OnMouseCtlClick(eventArgs);\n      else OnMouseLeftClick(eventArgs);\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseMove(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      var newHex = GetHexCoords(e.Location);\n      if (newHex != HotspotHex)\n        OnHotspotHexChange(new HexEventArgs(newHex));\n      HotspotHex = newHex;\n\n      base.OnMouseMove(e);\n    }\n\n    /// <summary>Raise the MouseAltClick event.</summary>\n    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick.Raise(this, e); }\n    /// <summary>Raise the MouseCtlClick event.</summary>\n    protected virtual void OnMouseCtlClick(HexEventArgs e) { MouseCtlClick.Raise(this, e); }\n    /// <summary>Raise the MouseLeftClic event.</summary>\n    protected virtual void OnMouseLeftClick(HexEventArgs e) { MouseLeftClick.Raise(this, e); }\n    /// <summary>Raise the MouseRightClick event.</summary>\n    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this, e); }\n    /// <summary>Raise the HotspotHexChange event.</summary>\n    protected virtual void OnHotspotHexChange(HexEventArgs e) { HotspotHexChange.Raise(this, e); }\n    /// <summary>Raise the ScaleChange event.</summary>\n    protected virtual void OnScaleChange(EventArgs e) {\n      ScaleChange.Raise(this, e);\n      Invalidate();\n    }\n\n    /// <inheritdoc/>\n    protected override void OnMouseWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      Traces.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Model.Name, e.ToString());\n\n      if (Control.ModifierKeys.Hasflag(Keys.Control))   ScaleIndex += Math.Sign(e.Delta);\n      else if (IsShiftKeyDown)                          base.OnMouseHwheel(e);\n      else                                              base.OnMouseWheel(e);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridPanel.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{388AD675-D18E-4DFA-ABB9-55AB3EA993A2}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridPanel</RootNamespace>\n    <AssemblyName>HexgridPanel</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>\n    </DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\HexgridPanel.XML</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <NoWarn>1607</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>NET45</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Accessibility\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"WinForms\\BufferedGraphicsExtensions.cs\" />\n    <Compile Include=\"BufferedHexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"BufferedHexgridScrollable.Designer.cs\">\n      <DependentUpon>BufferedHexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Common\\EmptyBoard.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"Common\\HexEventArgs.cs\" />\n    <Compile Include=\"HexgridPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridPanel.Designer.cs\">\n      <DependentUpon>HexgridPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Common\\MapDisplay.cs\" />\n    <Compile Include=\"IMapDisplayWinForms.cs\" />\n    <Compile Include=\"MapDisplayPainter.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\TiltAwarePanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridScrollable.Designer.cs\">\n      <DependentUpon>HexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridViewModel.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\LayeredScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\LayeredScrollable.Designer.cs\">\n      <DependentUpon>LayeredScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ViewModelBase.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.Designer.cs\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\GdiRasterOps.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\ThreadExceptionHandler.cs\" />\n    <Compile Include=\"WinForms\\TiltAwareScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"HexgridPanel.resx\">\n      <DependentUpon>HexgridPanel.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.en-US.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"CustomDictionary.xsd\">\n      <SubType>Designer</SubType>\n    </None>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n      <SubType>Designer</SubType>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class HexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n//        _bufferedGraphicsContext.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing WpfInput = System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridPanel {\n\n  /// <summary>Sub-class implementation of a <b>WinForms</b> Panel with integrated <see cref=\"TransposableHexgrid\"/> support.</summary>\n  [DockingAttribute(DockingBehavior.AutoDock)]\n  public partial class HexgridScrollable : TiltAwareScrollableControl, ISupportInitialize {\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    public HexgridScrollable() : base() {\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n      RefreshCmd  = new RelayCommand(o => { if (o != null) { SetMapDirty(); }  Refresh(); } );\n      DataContext = new HexgridViewModel(this);\n      SetScaleList (new float[] {1.00F});\n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n    }\n    #endregion\n\n    #region Events\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    public event EventHandler<HexEventArgs> HotspotHexChange;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseAltClick;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseCtlClick;\n    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseLeftClick;\n    /// <summary>Announces a mouse right-click. </summary>\n    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public HexgridViewModel        DataContext       { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public         SizeF           GridSizeF         { get { return DataContext.Model.GridSize.Scale(MapScale); } }\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public         HexCoords       HotspotHex        { get { return DataContext.HotspotHex; } }\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsAltKeyDown      { get { return ModifierKeys.Hasflag(Keys.Alt); } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsCtlKeyDown      { get { return ModifierKeys.Hasflag(Keys.Control); } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsShiftKeyDown    { get { return ModifierKeys.Hasflag(Keys.Shift); } }\n    /// <summary>TODO</summary>\n    public         bool            IsMapDirty        { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public         bool            IsUnitsDirty      { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public         bool            IsTransposed      { \n      get { return DataContext.IsTransposed; }\n      set { DataContext.IsTransposed = value;  SetScrollLimits(DataContext.Model); }\n    }\n    /// <inheritdoc/>\n    public         Size            MapSizePixels     { get { return DataContext.Model.MapSizePixels; } } // + MapMargin.Scale(2);} }\n    /// <summary>Current scaling factor for map display.</summary>\n    public         float           MapScale          { get { return DataContext.MapScale; } }\n//    /// <summary>MapBoard hosting this panel.</summary>\n//    public         IMapDisplay     Model             { get { return DataContext.Model; } }\n    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    public         HexCoords       PanelCenterHex    { \n      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ); }\n    }\n    /// <summary>TODO</summary>\n    public WpfInput.ICommand       RefreshCmd        { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int             ScaleIndex        { \n      get { return DataContext.ScaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(DataContext.Scales.Count-1, value));\n            var CenterHex           = PanelCenterHex;\n            DataContext.ScaleIndex  = newValue; \n\n//            SetScrollLimits(DataContext.Model);\n            SetScroll(CenterHex);\n            OnScaleChange(EventArgs.Empty); \n          } \n    }\n    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    public virtual CoordsRectangle VisibleRectangle  {\n      get { return GetClipInHexes( AutoScrollPosition.Scale(-1.0F/MapScale), \n                                         ClientSize.Scale( 1.0F/MapScale) );\n      }\n    }\n    #endregion\n\n    #region Methods\n    /// <summary>TODO</summary>\n    public         void CenterOnHex(HexCoords coords) {\n      AutoScrollPosition = ScrollPositionToCenterOnHex(coords);\n      IsMapDirty = true;\n      Invalidate();\n    }\n\n    /// <summary>TODO</summary>\n        CoordsRectangle GetClipInHexes(PointF point, SizeF size) { return DataContext.Model.GetClipInHexes(point, size); }\n    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public    HexCoords GetHexCoords(Point point) {\n      return DataContext.Grid.GetHexCoords(point, new Size(AutoScrollPosition));\n    }\n\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public virtual void SetMapDirty() { Invalidate(ClientRectangle); }\n\n    /// <summary>TODO</summary>\n    public         void SetModel(IMapDisplayWinForms model) {\n      SetScrollLimits(DataContext.Model);   \n      DataContext.Model = model;\n      SetMapDirty();\n    }\n\n    /// <summary>TODO</summary>\n    public         void SetPanelSize() {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(Traces.Sizing,\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n      SetScroll(PanelCenterHex);\n    }\n\n    /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n    public virtual void SetScroll(HexCoords newCenterHex) {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(Traces.Sizing,\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n      SetScrollLimits(DataContext.Model);\n\n      CenterOnHex(newCenterHex);\n    }\n\n    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    public virtual void SetScrollLimits(IMapDisplayWinForms model) {\n      if (model == null  ||  !AutoScroll) return;\n      var smallChange              = Size.Ceiling(model.GridSize.Scale(MapScale));\n      HorizontalScroll.SmallChange = smallChange.Width;\n      VerticalScroll.SmallChange   = smallChange.Height;\n\n      var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n      HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n      VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n      var size                     = DataContext.Grid.GetSize(MapSizePixels,MapScale)\n                                   + Margin.Size;\n      if (AutoScrollMinSize != size) {\n        AutoScrollMinSize          = size;\n        HorizontalScroll.Maximum   = Math.Max(HorizontalScroll.Minimum, \n                                     Math.Min(HorizontalScroll.Maximum, \n                                              Margin.Horizontal  + size.Width - ClientSize.Width));\n        VerticalScroll.Maximum     = Math.Max(VerticalScroll.Minimum, \n                                     Math.Min(VerticalScroll.Maximum, \n                                              Margin.Vertical   + size.Height - ClientSize.Height));\n        Invalidate();\n      }\n    }\n    #endregion\n\n    #region Grid Coordinates\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(HexCoords coordsNewULHex) {\n      return DataContext.Grid.HexCenterPoint(coordsNewULHex);\n    }\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    protected Point ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n      return DataContext.Grid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n    }\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n\n      if(IsHandleCreated) { \n        var g      = e.Graphics;\n        if (DesignMode) { g.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n        g.Clip = new Region(e.ClipRectangle);\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n\n        var scroll = DataContext.Grid.GetScrollPosition(AutoScrollPosition);\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.TranslateTransform(Margin.Left,Margin.Top);\n        g.ScaleTransform(MapScale,MapScale);\n        Traces.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, g.VisibleClipBounds);\n\n        var state = g.Save();\n        RenderMap(g);\n\n        g.Restore(state); state = g.Save();\n        RenderUnits(g);\n\n        g.Restore(state); state = g.Save();\n        RenderShading(g);\n\n        g.Restore(state); state = g.Save();\n        RenderHighlight(g);\n\n        g.Restore(state);\n      }\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderMap(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, g.VisibleClipBounds);\n      DataContext.Model.PaintMap(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderUnits(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintUnits(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderShading(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintShading(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderHighlight(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintHighlight(g);\n    }\n\n    /// <summary>TODO</summary>\n    static protected Matrix TransposeMatrix { get {return new Matrix(0F,1F, 1F,0F, 0F,0F); } }\n    #endregion\n\n    /// <summary>TODO</summary>\n    protected override void OnMarginChanged(EventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnMarginChanged(e);\n      DataContext.Margin = Margin;\n    }\n\n    #region Mouse event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseClick(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      Traces.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n                                      Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n      var coords    = GetHexCoords(e.Location);\n      var eventArgs = new HexEventArgs(coords, ModifierKeys,e.Button,e.Clicks,e.X,e.Y,e.Delta);\n\n           if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n      else if (e.Button == MouseButtons.Right)    this.OnMouseRightClick(eventArgs);\n      else if (IsAltKeyDown  && !IsCtlKeyDown)    this.OnMouseAltClick(eventArgs);\n      else if (IsCtlKeyDown)                      this.OnMouseCtlClick(eventArgs);\n      else                                        this.OnMouseLeftClick(eventArgs);\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseMove(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n      base.OnMouseMove(e);\n    }\n\n    /// <summary>Raise the MouseAltClick event.</summary>\n    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick.Raise(this,e); }\n    /// <summary>Raise the MouseCtlClick event.</summary>\n    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.GoalHex = e.Coords;\n      MouseCtlClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseLeftClick event.</summary>\n    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.StartHex = e.Coords;\n      MouseLeftClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseRightClick event.</summary>\n    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this,e); }\n   /// <summary>Raise the HotspotHexChange event.</summary>\n    protected virtual void OnHotspotHexChange(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.HotspotHex = e.Coords;\n      HotspotHexChange.Raise(this,e);\n      Refresh();\n    }\n\n    /// <summary>Raise the ScaleChange event.</summary>\n    protected virtual void OnScaleChange(EventArgs e) {\n      SetMapDirty();\n      OnResize(e);\n      Invalidate();\n      ScaleChange.Raise(this, e);\n    }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      SetScrollLimits(DataContext.Model);\n      base.OnResize(e);\n    }\n    #endregion\n\n    #region MouseWheel & Scroll event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      Traces.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Name, e.ToString());\n\n      if (Control.ModifierKeys.Hasflag(Keys.Control)) ScaleIndex += Math.Sign(e.Delta);\n      else if (IsShiftKeyDown)                        base.OnMouseHwheel(e);\n      else                                            base.OnMouseWheel(e);\n      var he = e as HandledMouseEventArgs;\n      if (he != null) he.Handled = true;\n    }\n\n    /// <summary>TODO</summary>\n    public void ScrollPanelVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollPanelHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.Hasflag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n    #endregion\n\n    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    public IList<float>     Scales        { \n      get { return DataContext.Scales; }\n      private set { DataContext.SetScales(value); }\n    }\n\n    /// <summary>TODO</summary>\n    public void SetScaleList (IList<float> scales) { Scales = new ReadOnlyCollection<float>(scales); }\n  }\n\n\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class HexgridViewModel {\n    /// <summary>TODO</summary>\n    public HexgridViewModel(PGNapoleonics.HexgridPanel.HexgridScrollable panel) {\n      HotspotHex    = HexCoords.EmptyUser;\n\n      Panel         = panel;\n\n      Panel.HotspotHexChange  += HotspotHexChange;\n      Panel.MarginChanged     += MarginChanged;\n//      Panel.MouseAltClick     += MouseAltClick;\n//      Panel.MouseCtlClick     += GoalHexChange;\n//      Panel.MouseRightClick   += MouseRightClick;\n//      Panel.ScaleChange       += ScaleChange;\n\n      Scales    = new List<float>() {1.000F}.AsReadOnly();\n      Model     = new EmptyBoard();\n      Grid   = GetHexgrid();\n    }\n\n    HexgridScrollable Panel { get; set; }\n\n    ///// <summary>Return new AutoScrollPosition for applied muse-wheel scroll.</summary>\n    //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n    //  Func<int,Point> newAutoScroll)\n    //{\n    //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n    //  var steps = (delta+remainder) \n    //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  remainder = (delta+remainder) \n    //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  return newAutoScroll(scroll.SmallChange * steps);\n    //}\n    ///// <summary>TODO</summary>\n    //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n    //  return new ScrollEventArgs(\n    //    ScrollEventType.ThumbTrack,\n    //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n    //    isHorizontal ? -newScroll.X : -newScroll.Y,\n    //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n    //  );\n    //}\n\n    /// <summary>TODO</summary>\n    //public void SetModel(IMapDisplayWinForms model) {\n    //  Model = model;   \n    //}\n\n    IHexgrid GetHexgrid() { \n      var margin          = Margin.OffsetSize();\n      return TransposableHexgrid.GetNewGrid(IsTransposed,Model.GridSize,MapScale,margin);\n    }\n\n    #region Properties\n    ///// <summary>TODO</summary>\n    //public WpfInput.ICommand RefreshCmd { \n    //  get { return _refreshCmd; } private set {_refreshCmd = value; } \n    //} WpfInput.ICommand _refreshCmd;\n\n    /// <summary>MapBoard hosting this panel.</summary>\n    public IMapDisplayWinForms Model           {\n        get { return _model; }\n        set { var model = _model as IDisposable; if (model != null) model.Dispose(); _model = value; }\n    } IMapDisplayWinForms _model;\n\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public HexCoords   HotspotHex      { get; set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsAltKeyDown   { get { return HexgridScrollable.IsAltKeyDown; } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsCtlKeyDown   { get { return HexgridScrollable.IsCtlKeyDown; } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsShiftKeyDown { get { return HexgridScrollable.IsShiftKeyDown; } }\n\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public bool        IsTransposed    { \n      get { return _isTransposed; }\n      set { _isTransposed = value;  \n            Grid = GetHexgrid();\n            if (Panel.IsHandleCreated) Panel.SetScrollLimits(Model);   \n          }\n    } bool _isTransposed;\n\n    /// <inheritdoc/>\n    public Size        MapSizePixels   { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public float       MapScale        { \n      get { return Model.MapScale; } \n      private set { Model.MapScale = value; } \n    }\n\n    /// <inheritdoc/>\n    public Padding     Margin          { \n      get { return _margin; } \n      set { _margin = value; Grid.Margin = new Size(_margin.Left, _margin.Top); }\n    } Padding _margin;\n\n    /// <summary>TODO</summary>\n    public    bool     IsMapDirty      { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public    bool     IsUnitsDirty    { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Panel.Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n\n    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    public IList<float> Scales         { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int ScaleIndex      { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue;\n              MapScale    = Scales[ScaleIndex];\n              Grid        = TransposableHexgrid.GetNewGrid(IsTransposed,Model.GridSize,MapScale);\n              ScaleChange.Raise(this, EventArgs.Empty);\n            }\n          } \n    } int _scaleIndex;\n    #endregion\n\n    /// <summary>TODO</summary>\n    public void SetScales (IList<float> scales) {\n      Scales = new ReadOnlyCollection<float>(scales);\n    }\n    #region Events\n    /// <summary>TODO</summary>\n    void MarginChanged(object sender, EventArgs e) { Margin = Panel.Margin; }\n\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    void HotspotHexChange(object sender, HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n    }\n\n//    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> GoalHexChange;\n//    /// <summary>Announces that the Path-Start hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> StartHexChange;\n//    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseAltClick;\n//    /// <summary>Announces a mouse right-click. </summary>\n//    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Grid Coordinates\n    /// <inheritdoc/>\n    public IHexgrid   Grid        { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public SizeF      GridSizeF      { get { return Model.GridSize.Scale(MapScale); } }\n\n    //CoordsRectangle  GetClipInHexes(PointF point, SizeF size) {\n    //  return Model.GetClipInHexes(point, size);\n    //}\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point     HexCenterPoint(HexCoords coordsNewULHex) {\n      return Grid.HexCenterPoint(coordsNewULHex);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/IMapDisplayWinForms.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>(Technology-dependent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplayWinForms : IMapDisplay{\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"point\">Upper-left corner in pixels of the clipping region.</param>\n    /// <param name=\"size\">Width and height of the clipping region in pixels.</param>\n    CoordsRectangle GetClipInHexes(PointF point, SizeF size);\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"visibleClipBounds\">Rectangular extent in pixels of the clipping region.</param>\n    CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds);\n\n    /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n    /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n    void  PaintHighlight(Graphics graphics);\n\n    /// <summary>TODO</summary>\n    /// <param name=\"graphics\"></param>\n    void  PaintShading(Graphics graphics);\n\n    /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n    void  PaintMap(Graphics graphics);\n    /// <summary>Paint the intermediate layer of the display, graphics that changes infrequently between refreshes.</summary>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    void  PaintUnits(Graphics graphics);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/MapDisplayPainter.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n  internal static class MapDisplayPainter {\n    /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n    public static void PaintMap<THex>(this MapDisplay<THex> @this, Graphics graphics\n      ) where THex : MapGridHex { \n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var container = graphics.BeginContainer(); // Set all transformations relative to current origin!\n      var clipHexes  = @this.GetClipInHexes(graphics.VisibleClipBounds);\n      graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;\n      var font       = SystemFonts.MenuFont;\n      var brush      = Brushes.Black;\n      var textOffset = new Point((@this.GridSize.Scale(0.50F)\n                     - new SizeF(font.Size,font.Size).Scale(0.8F)).ToSize());\n      @this.PaintForEachHex(graphics, clipHexes, coords => {\n        @this[coords].Paint(graphics);\n        if (@this.ShowHexgrid) graphics.DrawPath(Pens.Black, @this.HexgridPath);\n        if (@this.LandmarkToShow > 0) {\n          graphics.DrawString(@this.LandmarkDistance(coords,@this.LandmarkToShow-1), font, brush, textOffset);\n        }\n      } );\n      graphics.EndContainer(container); \n    }\n\n    /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n    public static void PaintHighlight<THex>(this MapDisplay<THex> @this, Graphics graphics\n      ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      var container = graphics.BeginContainer();\n      graphics.Transform = @this.TranslateToHex(@this.StartHex);\n      graphics.DrawPath(Pens.Red, @this.HexgridPath);\n\n      if (@this.ShowPath) {\n        graphics.EndContainer(container); container = graphics.BeginContainer();\n        @this.PaintPath(graphics,@this.Path);\n      }\n\n      if (@this.ShowRangeLine) {\n        graphics.EndContainer(container); container = graphics.BeginContainer();\n        var target = @this.CentreOfHex(@this.HotspotHex);\n        graphics.DrawLine(Pens.Red, @this.CentreOfHex(@this.StartHex), target);\n        graphics.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n        graphics.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n      }\n      graphics.EndContainer(container); \n    }\n\n    public static void PaintShading<THex>(this MapDisplay<THex> @this, Graphics graphics\n      ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      var container = graphics.BeginContainer();\n\n      if (@this.ShowFov) {\n        var clipHexes  = @this.GetClipInHexes(graphics.VisibleClipBounds);\n        using(var shadeBrush = new SolidBrush(Color.FromArgb(@this.ShadeBrushAlpha, @this.ShadeBrushColor))) {\n          @this.PaintForEachHex(graphics, clipHexes, coords => {\n            if (@this.Fov!=null && ! @this.Fov[coords]) { graphics.FillPath(shadeBrush, @this.HexgridPath);  }\n          } );\n        }\n      }\n\n      graphics.EndContainer(container); \n    }\n\n    /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n    /// for each hex on <paramref name=\"graphics\"/>.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Graphics object for the canvas being painted.</param>\n    /// <param name=\"clipHexes\">Type: CoordRectangle - \n    /// The rectangular extent of hexes to be painted.</param>\n    /// <param name=\"paintAction\">Type: Action {HexCoords} - \n    /// The paint action to be performed for each hex.</param>\n    public static void PaintForEachHex<THex>(this MapDisplay<THex> @this, Graphics graphics, \n      CoordsRectangle clipHexes, Action<HexCoords> paintAction\n    ) where THex : MapGridHex {\n      @this.ForEachHex(hex => {\n        if (clipHexes.Left <= hex.Coords.User.X  &&  hex.Coords.User.X <= clipHexes.Right\n        &&  clipHexes.Top  <= hex.Coords.User.Y  &&  hex.Coords.User.Y <= clipHexes.Bottom) {\n          graphics.Transform = @this.TranslateToHex(hex.Coords);\n          paintAction(hex.Coords);\n        }\n      } );\n      return;\n    }\n\n    /// <summary>Paint the current shortese path.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPathCollection\"/> - \n    /// A directed path (ie linked-list> of hexes to be painted.</param>\n    public static void PaintPath<THex>(this MapDisplay<THex> @this, Graphics graphics, IDirectedPathCollection path\n    ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        while (path != null) {\n          var coords = path.PathStep.Hex.Coords;\n          graphics.Transform = @this.TranslateToHex(coords);\n          graphics.FillPath(brush, @this.HexgridPath);\n\n          if (@this.ShowPathArrow) @this.PaintPathArrow(graphics, path);\n\n          path = path.PathSoFar;\n        }\n      }\n    }\n\n    /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPathCollection\"/> - \n    /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>\n    static void PaintPathArrow<THex>(this MapDisplay<THex> @this, Graphics graphics, IDirectedPathCollection path\n    ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      if (path==null) throw new ArgumentNullException(\"path\");\n\n      graphics.TranslateTransform(@this.CentreOfHexOffset.Width, @this.CentreOfHexOffset.Height);\n      if (path.PathSoFar == null)    @this.PaintPathDestination(graphics);\n      else                           @this.PaintPathArrow(graphics, path.PathStep.HexsideEntry);\n    }\n\n    /// <summary>Paint the direction arrow for each hex of the current shortest path.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"hexside\">Type: <see cref=\"Hexside\"/> - \n    /// Direction from this hex in which the next step is made.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    static void PaintPathArrow<THex>(this MapDisplay<THex> @this, Graphics graphics, Hexside hexside\n    ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var unit = @this.GridSize.Height/8.0F;\n      graphics.RotateTransform(60 * (int)hexside);\n      graphics.DrawLine(Pens.Black, 0,unit*4,       0,  -unit);\n      graphics.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n      graphics.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n    }\n\n    /// <summary>Paint the destination indicator for the current shortest path.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    static void PaintPathDestination<THex>(this MapDisplay<THex> @this, Graphics graphics\n    ) where THex : MapGridHex {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var unit = @this.GridSize.Height/8.0F;\n      graphics.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n      graphics.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n    }\n\n    /// <summary>Paint the intermediate layer of the display, graphics that changes infrequently between refreshes.</summary>\n    /// <param name=\"this\">Type: MapDisplay{THex} - The map to be painted.</param>\n    /// <param name=\"graphics\">Type: Graphics - Object representing the canvas being painted.</param>\n    public static void PaintUnits<THex>(this MapDisplay<THex> @this, Graphics graphics) where THex : MapGridHex {\n      if (@this    == null) throw new ArgumentNullException(\"this\");\n      if (graphics == null) throw new ArgumentNullException(\"graphics\");\n      /* NO-OP - Not implemented in examples. */\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class GraphicsExtensions {\n    /// <summary>TODO</summary>\n    public static void PreserveState(this Graphics @this, Action<Graphics> drawingCommands) {\n      if (@this != null  &&  drawingCommands != null) {\n        var state = @this.Save();\n        drawingCommands(@this);\n        @this.Restore(state);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridPanel\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridPanel\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"16392062-b876-4417-a826-7928e7883e80\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.*\")]\n[assembly: AssemblyFileVersion(\"6.4\")]\n"
  },
  {
    "path": "codeplex/HexgridPanel/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridPanel.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridPanel.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to - Fatal Application Error.\n        /// </summary>\n        internal static string FatalApplicationError {\n            get {\n                return ResourceManager.GetString(\"FatalApplicationError\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Fatal Error in Last-Chance Exception Handler..\n        /// </summary>\n        internal static string FatalThreadingError {\n            get {\n                return ResourceManager.GetString(\"FatalThreadingError\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to \n        ///From: .\n        /// </summary>\n        internal static string From {\n            get {\n                return ResourceManager.GetString(\"From\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ThreadExceptionEventArgs is null \n        ///From: .\n        /// </summary>\n        internal static string NullThreadExceptionArgs {\n            get {\n                return ResourceManager.GetString(\"NullThreadExceptionArgs\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to .\n        /// </summary>\n        internal static string NulSender {\n            get {\n                return ResourceManager.GetString(\"NulSender\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to - Severe Application Error.\n        /// </summary>\n        internal static string SevereApplicationError {\n            get {\n                return ResourceManager.GetString(\"SevereApplicationError\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"FatalApplicationError\" xml:space=\"preserve\">\n    <value>- Fatal Application Error</value>\n  </data>\n  <data name=\"FatalThreadingError\" xml:space=\"preserve\">\n    <value>Fatal Error in Last-Chance Exception Handler.</value>\n  </data>\n  <data name=\"From\" xml:space=\"preserve\">\n    <value>\nFrom: </value>\n  </data>\n  <data name=\"NullThreadExceptionArgs\" xml:space=\"preserve\">\n    <value>ThreadExceptionEventArgs is null \nFrom: </value>\n  </data>\n  <data name=\"NulSender\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"SevereApplicationError\" xml:space=\"preserve\">\n    <value>- Severe Application Error</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridPanel/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n    /// <summary>TODO</summary>\n    protected ViewModelBase(string displayName) { DisplayName = displayName; }\n\n    /// <summary>TODO</summary>\n    public            string DisplayName                { get; private set; }\n    /// <summary>TODO</summary>\n    protected virtual bool   ThrowOnInvalidPropertyName { get { return true; } }\n\n    /// <summary>Raised when a property on this object has a new value.</summary>\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    /// <summary>Raises this object's PropertyChanged event.</summary>\n    /// <param name=\"propertyName\">The property that has a new value.</param>\n    protected virtual void OnPropertyChanged(string propertyName) {\n      this.VerifyPropertyName(propertyName);\n      this.PropertyChanged.Raise(this, new PropertyChangedEventArgs(propertyName));\n    }\n\n    /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n    [Conditional(\"DEBUG\"), DebuggerStepThrough]\n    public void VerifyPropertyName(string propertyName) {\n      if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n        string msg = \"Invalid property name: \" + propertyName;\n        if (this.ThrowOnInvalidPropertyName)       throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n        Debug.Fail(msg);\n      }\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n        }\n        _isDisposed = true;\n      }\n    }\n    /// <summary>Finalize this instance.</summary>\n    ~ViewModelBase() { Dispose(false); }\n    #endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class CommandViewModel : ViewModelBase { \n    /// <summary>TODO</summary>\n    public CommandViewModel(string displayName, ICommand command) : base(displayName) { \n      if (command == null) throw new ArgumentNullException(\"command\"); \n      this.Command = command; \n    } \n    /// <summary>TODO</summary>\n    public ICommand Command { get; private set; } \n  }\n\n  /// <summary>TODO</summary>\n  public class RelayCommand : ICommand { \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute, Predicate<object> canExecute) { \n      if (execute == null) throw new ArgumentNullException(\"execute\");\n      if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n      _execute    = execute; \n      _canExecute = canExecute;\n    } \n  \n    /// <summary>TODO</summary>\n    [DebuggerStepThrough] \n    public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n    /// <summary>TODO</summary>\n    public event EventHandler CanExecuteChanged { \n      add    { CommandManager.RequerySuggested += value; } \n      remove { CommandManager.RequerySuggested -= value; } \n    }\n  \n    /// <summary>TODO</summary>\n    public void Execute(object parameter) { _execute(parameter); }\n\n    readonly Action<object>    _execute; \n    readonly Predicate<object> _canExecute; \n  }\n\n  ///// <summary>TODO</summary>\n  //public class RelayCommand<T> : ICommand { \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n  //    if (execute == null) throw new ArgumentNullException(\"execute\");\n  //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n  //    _execute    = execute; \n  //    _canExecute = canExecute;\n  //  } \n  \n  //  /// <summary>TODO</summary>\n  //  [DebuggerStepThrough] \n  //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n  //  /// <summary>TODO</summary>\n  //  public event EventHandler CanExecuteChanged { \n  //    add    { CommandManager.RequerySuggested += value; } \n  //    remove { CommandManager.RequerySuggested -= value; } \n  //  }\n  \n  //  /// <summary>TODO</summary>\n  //  public void Execute(T parameter) { _execute(parameter); }\n\n  //  readonly Action<T>    _execute; \n  //  readonly Predicate<object> _canExecute; \n  //}\n\n  /// <summary>TODO</summary>\n  public abstract class WorkspaceViewModel : ViewModelBase {\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel(string displayName) : base (displayName) {\n      _closeCommand = new RelayCommand(param => this.OnRequestClose());\n    }\n\n    /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n    public virtual ICommand CloseCommand { get { return _closeCommand; } } ICommand _closeCommand;\n\n    /// <summary>Raised when this workspace should be removed from the UI.</summary>\n    public event EventHandler RequestClose;\n\n    void OnRequestClose()  { RequestClose.Raise(this,EventArgs.Empty); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/BufferedGraphicsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.WinForms {\n  using System;\n  using System.Runtime.ConstrainedExecution;\n\n  /// <summary>TODO</summary>\n  public static partial class BufferedGraphicsExtensions {\n    /// <summary>TODO</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    /// <param name=\"virtualSize\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public static void Render(this BufferedGraphics @this, \n      Graphics target, \n      Point    scrollPosition, \n      Size     virtualSize\n    ) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n\n      if (target != null) {\n        using (var targetDC = new GraphicsDeviceContext(target))\n        using (var sourceDC = new GraphicsDeviceContext(@this.Graphics)) {\n          NativeMethods.BitBlt(\n                  targetDC.HandleRef,\n                  scrollPosition.X,  scrollPosition.Y, \n                  virtualSize.Width, virtualSize.Height, \n                  sourceDC.HandleRef,\n                                 0,                 0, \n                  GdiRasterOps.SrcCopy);\n        }\n      }\n    }\n\n    private class GraphicsDeviceContext : SafeHandle {\n      public GraphicsDeviceContext(Graphics graphics) : base((IntPtr)0,true) {\n        _graphics = graphics;\n        handle    = graphics.GetHdc(); \n      }\n\n      private Graphics  _graphics;\n\n      public  HandleRef HandleRef { get {  return new HandleRef(_graphics,handle); } }\n\n      public override bool IsInvalid { get { return handle == (IntPtr)0;; } }\n\n      [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]\n      override protected bool ReleaseHandle() {\n        _graphics.ReleaseHdc(handle);\n        return true;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/GdiRasterOps.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  internal static partial class GdiRasterOps {\n    public const int SrcCopy                 = 0x00CC0020; /* dest = source                   */ \n    public const int SrcPaint                = 0x00EE0086; /* dest = source OR dest           */\n    public const int SrcAnd                  = 0x008800C6; /* dest = source AND dest          */\n    public const int SrcInvert               = 0x00660046; /* dest = source XOR dest          */\n    public const int SrcErase                = 0x00440328; /* dest = source AND (NOT dest )   */ \n    public const int NotSrcCopy              = 0x00330008; /* dest = (NOT source)             */\n    public const int NotSrcErase             = 0x001100A6; /* dest = (NOT src) AND (NOT dest) */ \n    public const int MergeCopy               = 0x00C000CA; /* dest = (source AND pattern)     */ \n    public const int MergePaint              = 0x00BB0226; /* dest = (NOT source) OR dest     */\n    public const int PatCopy                 = 0x00F00021; /* dest = pattern                  */ \n    public const int PatPaint                = 0x00FB0A09; /* dest = DPSnoo                   */\n    public const int PatInvert               = 0x005A0049; /* dest = pattern XOR dest         */\n    public const int DstInvert               = 0x00550009; /* dest = (NOT dest)               */\n    public const int Blackness               = 0x00000042; /* dest = BLACK                    */ \n    public const int Whiteness               = 0x00FF0062; /* dest = WHITE                    */\n//    public const int CaptureBlt              = 0x40000000; /* Include layered windows */ \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/LayeredScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class LayeredScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/LayeredScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using PaintAction = Action<Graphics>;\n\n    /// <summary>TODO</summary>\n  public partial class LayeredScrollable : ScrollableControl, ISupportInitialize { //, IMessageFilter {\n    /// <summary>TODO</summary>\n    public LayeredScrollable() {\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n//\t\t\tApplication.AddMessageFilter(this);\n\n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n\n      Layers = new LayerCollection(this.CreateGraphics(), DisplayRectangle.Size);\n    }\n    #endregion\n\n    /// <summary>TODO</summary>\n    public    LayerCollection   Layers    { get; private set; }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      Layers.Resize(ClientRectangle);\n      base.OnResize(e);\n    }\n\n    //#region IMessageFilter implementation\n    ///// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    ///// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    ///// that with focus) with adjusted delta.\n    ///// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    ///// Dont forget to add this to constructor:\n    ///// \t\t\tApplication.AddMessageFilter(this);\n    ///// </remarks>\n    ///// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    ///// <returns>Success (true) or failure (false) to OS.</returns>\n    //[System.Security.Permissions.PermissionSetAttribute(\n    //  System.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n    //public bool PreFilterMessage(ref Message m) {\n    //  if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n    //  var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n    //  var ctl\t  = Control.FromHandle(hWnd);\n    //  if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n    //    switch((WM)m.Msg) {\n    //      case WM.MOUSEHWHEEL:\n    //      case WM.MOUSEWHEEL:\n    //        DebugTracing.Trace(TraceFlags.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, ((WM)m.Msg)); \n    //        return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n    //      default: break;\n    //    }\n    //  }\n    //  return false;\n    //}\n    //#endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class LayerCollection : ReadOnlyCollection<Layer> {\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size) : this(g, size, new List<PaintAction>()) {}\n\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size, IList<PaintAction> list) : base(new List<Layer>()) {\n      Context   = new BufferedGraphicsContext();\n      Graphics  = g;\n      Size      = size;\n\n      foreach (var action in list) this.AddLayer(action);\n    }\n\n    /// <summary>TODO</summary>\n    public void AddLayer(PaintAction paintAction) { Items.Add(NewLayer(paintAction)); }\n\n    /// <summary>TODO</summary>\n    public void Render(Graphics g, Point scrollPosition) {\n      for(var i=0; i < this.Count; i++) this[i].Render(g, scrollPosition); \n    }\n\n    /// <summary>TODO</summary>\n    public void Resize (Rectangle rectangle) {\n      Size = rectangle.Size;\n      Context.MaximumBuffer = Size;\n      foreach(var layer in this) {\n        layer.Resize(Context.Allocate(Graphics, rectangle));\n      }\n    }\n\n    BufferedGraphicsContext Context   { get; set; }\n    Graphics                Graphics  { get; set; }\n    Size                    Size      { get; set; }\n\n    /// <summary>TODO</summary>\n    Layer            NewLayer(PaintAction paintAction) {\n      return new Layer(\n        Context.Allocate(Graphics, new Rectangle(Point.Empty,Size)), \n        paintAction\n      );\n    }\n\n    #region IDisposable implementation\n    bool _isDisposed = false;\n\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (Context  != null) Context.Dispose();  Context  = null;\n          if (Graphics != null) Graphics.Dispose(); Graphics = null;\n        }\n        _isDisposed = true;\n      }\n    }\n    #endregion\n  }\n\n}\nnamespace PGNapoleonics.HexgridPanel {\n  using System.Reflection;\n\n  using PaintAction = Action<Graphics>;\n\n  /// <summary>TODO</summary>\n  public sealed class Layer {\n\n    /// <summary>TODO</summary>\n    internal Layer(BufferedGraphics buffer, PaintAction paintAction) {\n      Buffer      = buffer;\n      PaintAction = paintAction;\n\n      Background  = Color.Transparent;\n      IsOn        = true;\n      Resize(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    internal void Resize(BufferedGraphics buffer) {\n      const BindingFlags binding = BindingFlags.NonPublic | BindingFlags.Instance;\n\n      Buffer   = buffer;\n      var info = Buffer.GetType().GetField(\"virtualSize\",binding);\n      Size     = (Size)info.GetValue(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    public Color            Background      { get; private set; }\n    /// <summary>TODO</summary>\n    public BufferedGraphics Buffer          { \n      get { return _buffer; }\n      private set { if (_buffer != null) _buffer.Dispose(); _buffer = value; }\n    } BufferedGraphics _buffer;\n    /// <summary>TODO</summary>\n    public bool             IsOn            { get; set; }\n    /// <summary>TODO</summary>\n    public PaintAction      PaintAction     { get; private set; }\n    /// <summary>TODO</summary>\n    public Size             Size            { get; private set; }\n\n    /// <summary>TODO</summary>\n    public void Refresh() {\n      if (IsOn) {\n        var g     = Buffer.Graphics;\n        var state = g.Save();\n\n        g.Clear(Background);\n\n        PaintAction(g);\n\n        g.Restore(state);\n      }\n    }\n\n#if NET45\n    /// <summary>TODO</summary>\n    public async Task RefreshAsync() { await Task.Run(() => Refresh()); }\n\n    /// <summary>TODO</summary>\n    public async Task RenderAsync(Graphics target, Point scrollPosition) {\n      await Task.Run(() => Render(target,scrollPosition));\n    }\n#endif\n\n    /// <summary>TODO</summary>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public void Render(Graphics target, Point scrollPosition) {\n      if (target != null) {\n        IntPtr targetDC = target.GetHdc();\n \n        try { RenderInternal(new HandleRef(target, targetDC), Buffer, scrollPosition); } \n        finally { target.ReleaseHdcInternal(targetDC);  }\n      }\n    }\n\n    /// <summary>TODO</summary>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n    private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition) {\n      const int  rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n\n      var sourceDC    = buffer.Graphics.GetHdc(); \n      var virtualSize = Size;\n      try { \n        NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                              virtualSize.Width, virtualSize.Height, \n                                  new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n      } \n      finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n    } \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(vector=vs.85).aspx\"></a></remarks>\n\t\t/// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n    [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification=\"Research suggests the Code Analysis message is incorrect.\")]\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n    /// <summary>TODO</summary>\n    [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n    [ResourceExposure(ResourceScope.None)]\n    [return: MarshalAs(UnmanagedType.Bool)]\n    public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n                                     HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n    /// <summary>Message Cracker for HiWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 HiWord(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return ((val32 >> 16) & 0xFFFF);\n    }\n\n    /// <summary>Message Cracker for LoWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 LoWord(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return (val32 & 0xFFFF);\n    }\n  }\n\n    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n  public static partial class ControlExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this ==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this ==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n      \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ScrollBarCommand.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  #pragma warning disable 1570,1591\n  /// <summary>TODO</summary>\n  internal enum ScrollBarCommand {\n      SB_LINEUP           = 0,  //!< TODO\n      SB_LINELEFT         = 0,  //!< TODO\n      SB_LINEDOWN         = 1,  //!< TODO\n      SB_LINERIGHT        = 1,  //!< TODO\n      SB_PAGEUP           = 2,  //!< TODO\n      SB_PAGELEFT         = 2,  //!< TODO\n      SB_PAGEDOWN         = 3,  //!< TODO\n      SB_PAGERIGHT        = 3,  //!< TODO\n      SB_THUMBPOSITION    = 4,  //!< TODO\n      SB_THUMBTRACK       = 5,  //!< TODO\n      SB_TOP              = 6,  //!< TODO\n      SB_LEFT             = 6,  //!< TODO\n      SB_BOTTOM           = 7,  //!< TODO\n      SB_RIGHT            = 7,  //!< TODO\n      SB_ENDSCROLL        = 8   //!< TODO\n  }\n  #pragma warning restore 1570,1591\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Resources;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridPanel.Properties;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>A Last-chance Thread Exception handler.</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public class ThreadExceptionHandler {\n    static ResourceManager StringManager =\n            new ResourceManager(\"en-US\", Assembly.GetExecutingAssembly());\n    static CultureInfo Culture = CultureInfo.CurrentCulture;\n\n    static readonly string NewLine     = Environment.NewLine;\n    static readonly string NewLineX2   = Environment.NewLine + Environment.NewLine;\n    readonly string ErrorTitle  = Application.ProductName + Resources.SevereApplicationError;\n    readonly string FatalTitle  = Application.ProductName + Resources.FatalApplicationError;\n    readonly string NullEventArgs = Resources.NullThreadExceptionArgs;\n    readonly string FatalMessage  = Resources.FatalThreadingError;\n\n    /// <summary>Handles the thread exception.</summary> \n    [SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\")]\n    public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) {\n      try {\n        var senderType = sender==null ? StringManager.GetString(\"NullSender\",Culture) : sender.ToString();\n        if (e == null) {  // This should never happen\n            MessageBox.Show(\n              NullEventArgs + senderType, \n              ErrorTitle, \n              MessageBoxButtons.OK, \n              MessageBoxIcon.Stop,\n              MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);\n            Application.Exit();\n        } else {\n\n          if( e.Exception is NotImplementedException\n          ||  e.Exception is NotSupportedException\n          ||  e.Exception is InvalidOperationException\n          ) {\n             MessageBox.Show(\n                e.Exception.Message + StringManager.GetString(\"From\",Culture) + senderType, \n                ErrorTitle, \n                MessageBoxButtons.OK, \n                MessageBoxIcon.Stop,\n                MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);\n          } else {\n             if (ShowThreadExceptionDialog(e.Exception) == DialogResult.Abort) Application.Exit();\n          }\n          Application.ExitThread();\n        }\n      } catch(Exception) {\n\n        try {\n          MessageBox.Show(FatalMessage, \n            FatalTitle, \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Stop,\n            MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);\n        } finally {\n          Application.Exit();\n        }\n\n      }\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private static DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var result = DialogResult.Abort;\n\n      var errorMessage = \n        \"Unhandled Exception:\" + NewLineX2 +\n        ex.Message             + NewLineX2 +\n        ex.GetType()           + NewLineX2 +\n        \"Stack Trace:\"         + NewLine +\n        ex.StackTrace;\n\n      using (var dialog = new ExceptionDialog(errorMessage)) {\n        dialog.ShowDialog();\n        result = dialog.DialogResult;\n      }\n\n      return result;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/TiltAwarePanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>A Tilt-Aware Focusable Panel</summary>\n  /// ///<remarks>Courtesy of Hans Passant: \n  /// <a>http://stackoverflow.com/questions/3562235/panel-not-getting-focus</a>\n  /// </remarks>\n  public class TiltAwarePanel : Panel {\n    /// <summary>TODO</summary>\n    public TiltAwarePanel() {\n      this.SetStyle(ControlStyles.Selectable, true);\n      this.TabStop = true;\n    }\n\n    #region SelectablePanel implementation\n    /// <inheritdoc/>\n    protected override void OnMouseDown(MouseEventArgs e) {\n      this.Focus();\n      base.OnMouseDown(e);\n    }\n    /// <inheritdoc/>\n    protected override bool IsInputKey(Keys keyData) {\n      if (keyData == Keys.Up || keyData == Keys.Down) return true;\n      if (keyData == Keys.Left || keyData == Keys.Right) return true;\n      return base.IsInputKey(keyData);\n    }\n    /// <inheritdoc/>\n    protected override void OnEnter(EventArgs e) {\n      this.Invalidate();\n      base.OnEnter(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnLeave(EventArgs e) {\n      this.Invalidate();\n      base.OnLeave(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnPaint(e);\n      if (this.Focused) {\n        var rc = this.ClientRectangle;\n        rc.Inflate(-2, -2);\n        ControlPaint.DrawFocusRectangle(e.Graphics, rc);\n      }\n    }\n    #endregion\n\n    #region Mouse Tilt Wheel (MouseHWheel) event implementation\n    /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n    public event EventHandler<MouseEventArgs> MouseHwheel;\n\n    private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n\n    /// <summary>Processes Windows messages.</summary>\n    protected override void WndProc(ref Message m) {\n      if (!IsDisposed && m.HWnd == this.Handle) {\n        switch ((WM)m.Msg) {\n          case WM.MouseHwheel:  OnMouseHwheel(CreateMouseEventArgs(m));\n                                m.Result = (IntPtr)0;\n                                break;\n\n          default:              break;\n        }\n      }\n      base.WndProc(ref m);\n    }\n\n    /// <summary>Raises the MouseHWheel event.</summary>\n    /// <param name=\"e\">A <c>MouseEventArgs</c> that contains the event data. </param>\n    protected virtual void OnMouseHwheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n\n      _wheelHPos += e.Delta;\n      while (_wheelHPos >= MouseWheelStep) {\n        ScrollHorizontal(MouseWheelStep);\n        _wheelHPos -= MouseWheelStep;\n      }\n      while (_wheelHPos <= -MouseWheelStep) {\n        ScrollHorizontal(-MouseWheelStep);\n        _wheelHPos += MouseWheelStep;\n      }\n\n      if (MouseHwheel != null) MouseHwheel.Raise(this, e);\n    }\n\n    /// <summary>TODO</summary>\n    private void ScrollHorizontal(int delta) {\n      AutoScrollPosition = new Point(\n        -AutoScrollPosition.X + delta,\n        -AutoScrollPosition.Y);\n    }\n\n    /// <summary>TODO</summary>\n    private static int MouseWheelStep {\n      get {\n        return SystemInformation.MouseWheelScrollDelta\n             / SystemInformation.MouseWheelScrollLines;\n      }\n    }\n\n    private static MouseEventArgs CreateMouseEventArgs(Message m) {\n      return new MouseEventArgs (\n          (MouseButtons)NativeMethods.LoWord(m.WParam),\n          0,\n          NativeMethods.LoWord(m.LParam),\n          NativeMethods.HiWord(m.LParam),\n          (Int16)NativeMethods.HiWord(m.WParam)\n        );\n    }\n    #endregion\n\n    #region Panel Scroll extensions\n    /// <summary>TODO</summary>\n    public void ScrollVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.Hasflag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n\n    /// <summary>Service routine to execute a Panel scroll.</summary>\n    [Obsolete(\"Use ScrollPanelVertical or ScrollPanelHorizontal instead.\")]\n    public void ScrollPanel(ScrollEventType type, ScrollOrientation orientation, int sign) {\n      if (orientation == ScrollOrientation.VerticalScroll)\n        ScrollVertical(type, sign);\n      else\n        ScrollHorizontal(type, sign);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/TiltAwareScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing WpfInput = System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class TiltAwareScrollableControl : ScrollableControl {\n    /// <summary>TODO</summary>\n    public TiltAwareScrollableControl() {\n      this.SetStyle(ControlStyles.Selectable, true);\n      this.TabStop = true;\n    }\n\n    #region SelectablePanel implementation\n    /// <inheritdoc/>\n    protected override void OnMouseDown(MouseEventArgs e) {\n      this.Focus();\n      base.OnMouseDown(e);\n    }\n    /// <inheritdoc/>\n    protected override bool IsInputKey(Keys keyData) {\n      if (keyData == Keys.Up || keyData == Keys.Down) return true;\n      if (keyData == Keys.Left || keyData == Keys.Right) return true;\n      return base.IsInputKey(keyData);\n    }\n    /// <inheritdoc/>\n    protected override void OnEnter(EventArgs e) {\n      this.Invalidate();\n      base.OnEnter(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnLeave(EventArgs e) {\n      this.Invalidate();\n      base.OnLeave(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnPaint(e);\n      if (this.Focused) {\n        var rc = this.ClientRectangle;\n        rc.Inflate(-2, -2);\n        ControlPaint.DrawFocusRectangle(e.Graphics, rc);\n      }\n    }\n    #endregion\n\n    #region Mouse Tilt Wheel (MouseHwheel) event implementation\n    /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n    public virtual event EventHandler<MouseEventArgs>  MouseHwheel;\n//    public new     event EventHandler<MouseEventArgs>  MouseWheel;\n\n    private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n    private int _wheelVPos = 0;   //!< <summary>Unapplied vertical scroll.</summary>\n\n    /// <summary>Extend Windows Message Loop to receive MouseHwheel messages.</summary>\n    protected override void WndProc(ref Message m) {\n      if (!IsDisposed  &&  m.HWnd == this.Handle) {\n        switch ((WM)m.Msg) {\n          case WM.MouseHwheel: \n            OnMouseHwheel(CreateMouseEventArgs(m));\n            m.Result = (IntPtr)0;\n            break;\n          default: break;\n        }\n      }\n      base.WndProc(ref m);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"e\"></param>\n    protected virtual void OnMouseHwheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      if (!AutoScroll) return;\n\n      RollHorizontal(e.Delta);\n      MouseHwheel.Raise(this, e);\n//      base.OnScroll(new ScrollEventArgs(ScrollEventType.ThumbPosition,AutoScrollPosition.X,ScrollOrientation.HorizontalScroll));\n\n      var eh = e as HandledMouseEventArgs;\n      if (eh != null) eh.Handled = true;\n    }\n\n    ///// <summary>TODO</summary>\n    ///// <param name=\"e\"></param>\n//    protected override void OnMouseWheel(MouseEventArgs e) {\n//      if (e == null) throw new ArgumentNullException(\"e\");\n//      if (!AutoScroll) return;\n\n////      RollVertical( - e.Delta);\n//      MouseWheel.Raise(this, e);\n//      base.OnScroll(new ScrollEventArgs(ScrollEventType.ThumbPosition,AutoScrollPosition.Y,ScrollOrientation.VerticalScroll));\n//    }\n\n    /// <summary>TODO</summary>\n    private static int MouseWheelStep {\n      get {\n        return SystemInformation.MouseWheelScrollDelta\n             / SystemInformation.MouseWheelScrollLines;\n      }\n    }\n\n    /// <summary>TODO</summary>\n    private static MouseEventArgs CreateMouseEventArgs(Message m) {\n      return new MouseEventArgs(\n          (MouseButtons)NativeMethods.LoWord(m.WParam),\n          0,\n          NativeMethods.LoWord(m.LParam),\n          NativeMethods.HiWord(m.LParam),\n          (Int16)NativeMethods.HiWord(m.WParam)\n        );\n    }\n    #endregion\n\n    #region Panel Scroll extensions\n    /// <summary>TODO</summary>\n    public void PageUp()    { RollVertical(-1 * VerticalScroll.LargeChange); }\n    /// <summary>TODO</summary>\n    public void PageDown()  { RollVertical(+1 * VerticalScroll.LargeChange); }\n    /// <summary>TODO</summary>\n    public void PageLeft()  { RollHorizontal(-1 * HorizontalScroll.LargeChange); }\n    /// <summary>TODO</summary>\n    public void PageRight() { RollHorizontal(+1 * HorizontalScroll.LargeChange); }\n    /// <summary>TODO</summary>\n    public void LineUp()    { RollVertical(-1 * MouseWheelStep); }\n    /// <summary>TODO</summary>\n    public void LineDown()  { RollVertical(+1 * MouseWheelStep); }\n    /// <summary>TODO</summary>\n    public void LineLeft()  { RollHorizontal(-1 * MouseWheelStep); }\n    /// <summary>TODO</summary>\n    public void LineRight() { RollHorizontal(+1 * MouseWheelStep); }\n\n    private void RollHorizontal(int delta) {\n      _wheelHPos += delta;\n      while (_wheelHPos >= MouseWheelStep) {\n        HScrollByOffset( + MouseWheelStep);\n        _wheelHPos -= MouseWheelStep;\n      }\n      while (_wheelHPos <= -MouseWheelStep) {\n        HScrollByOffset( - MouseWheelStep);\n        _wheelHPos += MouseWheelStep;\n      }\n    }\n\n    private void RollVertical(int delta) {\n      _wheelVPos += delta;\n      while (_wheelVPos >= MouseWheelStep) {\n        VScrollByOffset( + MouseWheelStep);\n        _wheelVPos -= MouseWheelStep;\n      }\n      while (_wheelVPos <= -MouseWheelStep) {\n        VScrollByOffset( - MouseWheelStep);\n        _wheelVPos += MouseWheelStep;\n      }\n    }\n\n    /// <summary>TODO</summary>\n    private void HScrollByOffset(int delta) {\n      AutoScrollPosition = new Point (-AutoScrollPosition.X + delta, -AutoScrollPosition.Y);\n    }\n\n    /// <summary>TODO</summary>\n    private void VScrollByOffset(int delta) {\n      AutoScrollPosition = new Point (-AutoScrollPosition.X, -AutoScrollPosition.Y + delta);\n    }\n\n    List<Action> ScrollActions { get { return new List<Action> {\n                                        () => PageUp(),   () => PageDown(),\n                                        () => PageLeft(), () => PageRight(),\n                                        () => LineUp(),   () => LineDown(),\n                                        () => LineLeft(), () => LineRight()  };\n      }\n    }\n\n    /// <summary>Service routine to execute a Panel scroll.</summary>\n    [Obsolete(\"Use ScrollPanelVertical or ScrollPanelHorizontal instead.\")]\n    public void ScrollPanel(ScrollEventType type, ScrollOrientation orientation, int sign) {\n      ScrollActions [\n            ( (type.Hasflag(ScrollEventType.SmallDecrement))      ? 4 : 0 )\n          + ( (orientation == ScrollOrientation.HorizontalScroll) ? 2 : 0 )\n          + ( (sign == +1)                                        ? 1 : 0 ) ] ();\n    }\n\n    ///// <summary>TODO</summary>\n    //public void ScrollVertical(ScrollEventType type, int sign) {\n    //  ScrollPanelCommon(type, sign, VerticalScroll);\n    //}\n    ///// <summary>TODO</summary>\n    //public void ScrollHorizontal(ScrollEventType type, int sign) {\n    //  ScrollPanelCommon(type, sign, HorizontalScroll);\n    //}\n\n    ///// <summary>TODO</summary>\n    //private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n    //  if (sign == 0) return;\n    //  Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n    //  AutoScrollPosition = func(AutoScrollPosition,\n    //    type.Hasflag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    //}\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.Transparent;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void Invalidate2() { \n\t\t\tInvalidate2(new Rectangle(this.Location,this.Size));\n\t\t} \n    /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n    /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n    public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"e\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs e) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public static partial class WinFormsExtensions {\n    /// <summary>Reflect to set Double-Buffering on Control.</summary>\n    /// <param name=\"control\">Control to operate on.</param>\n    /// <param name=\"setting\">New value for parameter.</param>\n    public static void MakeDoubleBuffered(this Control control, bool setting)\n    {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      control.GetType()\n             .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n             .SetValue(control, setting, null);\n    }\n\n    /// <summary>Use COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n    public static CreateParams SetCompositedStyle(this Control control, CreateParams parameters) {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      if (parameters==null) throw new ArgumentNullException(\"parameters\");\n      parameters.ExStyle |= (int)WindowStylesEx.Composited;\n      return parameters;\n    }\n  }\n\n  /// <summary>TODO</summary>/>\n  public static partial class PaddingExtensions {\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Point Offset(this Padding @this) { return new Point(@this.Left, @this.Top); }\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Size OffsetSize(this Padding @this) { return new Size(@this.Left, @this.Top); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>\n    /// Windows Messages\n    /// Defined in winuser.h from Windows SDK v6.1\n    /// Documentation pulled from MSDN.\n    /// </summary>\n  public enum WM : int //: uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    Null = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    Create = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    Destroy = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    Move = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    Size = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    Activate = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SetFocus = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KillFocus = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    Enable = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SetRedraw = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SetText = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GetText = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GetTextLength = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    Paint = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    Close = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QueryEndSession = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QueryOpen = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    EndSession = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    Quit = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    EraseBkgnd = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SysColorChange = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    ShowWindow = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WinInitChange = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SettingChange = WM.WinInitChange,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DevModeChange = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ActivateApp = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FontChange = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever neighbour is a change in the system time.\n    /// </summary>\n    TimeChange = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CancelMode = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SetCursor = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MouseActivate = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    ChildActivate = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QueueSync = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GetMinMaxInfo = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PaintIcon = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    IconEraseBkgnd = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NextDlgCtl = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SpoolerStatus = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DrawItem = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MeasureItem = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DeleteItem = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKeyToItem = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CharToItem = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SetFont = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GetFont = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SetHotkey = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GetHotkey = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QueryDragIcon = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    CompareItem = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GetObject = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    Compacting = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete(\"Deprecated - WM_COMMNOTIFY is Obsolete for Win32-Based Applications.\")]\n    CommNotify = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WindowPosChanging = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WindowPosChanged = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete(\"Deprecated - use POWERBROADCAST instead of POWER.\")]\n    Power = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    CopyData = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CancelJournal = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    Notify = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    InputLangChangeRequest = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    InputLangChange = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCard = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    Help = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    UserChanged = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NotifyFormat = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    ContextMenu = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    StyleChanging = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    StyleChanged = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DisplayChange = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GetIcon = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SetIcon = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCreate = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDestroy = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCalcSize = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHitTest = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPaint = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCActivate = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GetDlgCode = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SyncPaint = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMouseMove = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonDown = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonUp = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLbuttonDblClick = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonDown = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonUp = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRbuttonDblClick = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonDown = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonUp = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMbuttonDblClick = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonDown = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonUp = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXbuttonDblClick = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    InputDeviceChange = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    Input = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KeyFirst = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KeyDown = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KeyUp = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    Char = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DeadChar = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SysKeyDown = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SysKeyUp = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SysChar = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SysDeadChar = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UniChar = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KeyLast = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeStartComposition = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeEndComposition = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeComposition = 0x010F,\n    /// <summary>TODO</summary>\n    ImeKeyLast = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    InitDialog = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    Command = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SysCommand = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    Timer = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    Hscroll = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    Vscroll = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    InitMenu = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    InitMenuPopup = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MenuSelect = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MenuChar = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    EnterIdle = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MenuRbuttonUp = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MenuDrag = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MenuGetObject = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UninitMenuPopup = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MenuCommand = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    ChangeUiState = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UpdateUiState = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QueryUiState = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CtlColorMsgbox = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CtlColorEdit = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CtlColorListBox = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CtlColorButton = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CtlColorDlg = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CtlColorScrollBar = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CtlColorStatic = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MouseFirst = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MouseMove = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonDown = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonUp = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LbuttonDblClick = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonDown = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonUp = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RbuttonDblClick = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonDown = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonUp = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MbuttonDblClick = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MouseWheel = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n    /// </summary>\n    XbuttonDown = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XbuttonUp = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XbuttonDblClick = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MouseHwheel = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MouseLast = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    ParentNotify = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    EnterMenuLoop = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    ExitMenuLoop = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NextMenu = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    Sizing = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CaptureChanged = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    Moving = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    PowerBroadcast = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DeviceChange = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MdiCreate = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MdiDestroy = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MdiActivate = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MdiRestore = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MdiNext = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MdiMaximize = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MdiTitle = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MdiCascade = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MdiIconChange = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MdiGetActive = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MdiSetMenu = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    EnterSizeMove = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    ExitSizeMove = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DropFiles = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MdiRefreshMenu = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeSetContext = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeNotify = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    ImeControl = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeCompositionFull = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeSelect = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeChar = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeRequest = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeKeyDown = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    ImeKeyUp = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MouseHover = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MouseLeave = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMouseHover = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMouseLeave = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WtsSessionChange = 0x02B1,\n    /// <summary>TODO</summary>\n    TabletFirst = 0x02c0,\n    /// <summary>TODO</summary>\n    TabletLast = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    Cut = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    Copy = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    Paste = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    Clear = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    Undo = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RenderFormat = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RenderAllFormats = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DestroyClipboard = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DrawClipboard = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PaintClipboard = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VscrollClipboard = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SizeClipboard = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    AskCBFormatName = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    ChangeCBChain = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HscrollClipboard = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QueryNewPalette = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PaletteChanging = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PaletteChanged = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    Hotkey = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    Print = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PrintClient = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    AppCommand = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    ThemeChanged = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    ClipboardUpdate = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCompositionChanged= 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1709:IdentifiersShouldBeCasedCorrectly\", MessageId = \"DWMNC\")]\n    DWMNCRenderingChanged = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMColorizationColorChanged = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWindowMaximizedChange = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n    GetTitleBarInfoEx = 0x033F,\n    /// <summary>TODO</summary>\n    HandheldFirst = 0x0358,\n    /// <summary>TODO</summary>\n    HandheldLast = 0x035F,\n    /// <summary>TODO</summary>\n    AfxFirst = 0x0360,\n    /// <summary>TODO</summary>\n    AfxLast = 0x037F,\n    /// <summary>TODO</summary>\n    PenWinFirst = 0x0380,\n    /// <summary>TODO</summary>\n    PenWinLast = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    App = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    User = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    CplLaunch = User+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    CplLaunched = User+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SysTimer = 0x118\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n [SuppressMessage(\"Microsoft.Design\", \"CA1028:EnumStorageShouldBeInt32\")]\n\t[Flags]public enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLbutton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRbutton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMbutton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXbutton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXbutton2\t= 0x40\n\t}\n\n  /// <summary>TODO</summary>\n\tpublic static class WindowsMouseInput {\n    /// <summary>TODO</summary>\n   [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n   [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n\t\tpublic static System.Drawing.Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new System.Drawing.Point(\n\t\t\t\t\t (int)(short)(lParam.ToInt64() & 0x0000ffff), \n\t\t\t\t\t (int)(short)(lParam.ToInt64() >> 16)\n\t\t\t\t);\n\t\t}\n\n    /// <summary>TODO</summary>\n   [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static Int16 WheelDelta(IntPtr wParam) {\n\t\t\treturn (Int16)(wParam.ToInt64() >> 16);\n\t\t}\n\n    /// <summary>TODO</summary>\n   [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr LParam(Point point) {\n\t\t\tif (point.X<Int16.MinValue || point.X > Int16.MaxValue\n      ||  point.Y<Int16.MinValue || point.Y > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point\",point,\n\t\t\t\t\t\"Must be a valid Point struct.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\n    /// <summary>TODO</summary>\n   [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr WParam (Int16 wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (Int16)mouseKeys;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  [SuppressMessage(\"Microsoft.Design\", \"CA1008:EnumsShouldHaveZeroValue\",Justification=\"Hex-parsing failure\")]\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1714:FlagsEnumsShouldHavePluralNames\")]\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n  [Flags]\n  public enum WindowStylesEx\n  {\n    /// <summary>TODO</summary>\n    None            = 0x00000000,\n    /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n    AcceptFiles     = 0x00000010,\n    /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n    AppWindow       = 0x00040000,\n    /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n    ClientEdge      = 0x00000200,\n    /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n    /// <remarks>\n    /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </remarks>\n    Composited      = 0x02000000,\n    /// <summary>Includes a question mark in the title bar of the window.</summary>\n    /// <remarks>\n    /// When the user clicks the question mark, the cursor changes to a question mark \n    /// with a pointer. If the user then clicks a child window, the child receives a \n    /// WM_HELP message. The child window should pass the message to the parent window \n    /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n    /// The Help application displays a pop-up window that typically contains help for\n    /// the child window.  \n    /// CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n    /// </remarks>\n    ContextHelp     = 0x00000400,\n    /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n    /// <remarks>\n    /// If this style is specified, the dialog manager recurses into children of this \n    /// window when performing navigation operations such as handling the TAB key, \n    /// an arrow key, or a keyboard mnemonic.\n    /// </remarks>\n    ControlParent   = 0x00010000,\n    /// <summary>Creates a window that has a double border.</summary>\n    /// <remarks>\n    /// The window can, optionally, be created with a title bar by specifying the \n    /// WS_CAPTION style in the dwStyle parameter.\n    /// </remarks>\n    DlgModalFrame   = 0x00000001,\n    /// <summary>\n    /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </summary>\n    Layered         = 0x00080000,\n    /// <summary>\n    /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. \n    /// </summary>\n    LayoutRtl       = 0x00400000,\n    /// <summary>\n    /// Creates a window that has generic left-aligned properties. This is the default.\n    /// </summary>\n    Left            = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\n    /// </summary>\n    LeftScrollBar   = 0x00004000,\n    /// <summary>The window text is displayed using left-to-right reading-order properties.</summary>\n    /// <remarks>\n    /// This is the default.\n    /// </remarks>\n    LtrReading      = 0x00000000,\n    /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n    MdiChild        = 0x00000040,\n    /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n    /// <remarks>\n    /// Windows 2000/XP: A top-level window created with this style does not become the \n    /// foreground window when the user clicks it. \n    /// \n    /// The system does not bring this window to the foreground when the user minimizes \n    /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n    /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n    /// default. To force the window to appear on the taskbar, use the APPWINDOW \n    /// style.\n    /// </remarks>\n    NoActivate      = 0x08000000,\n    /// <summary>\n    /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\n    /// </summary>\n    NoInheritLayout = 0x00100000,\n    /// <summary>\n    /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n    /// </summary>\n    NoParentNotify  = 0x00000004,\n    /// <summary>Combines the CLIENTEDGE and WINDOWEDGE styles.</summary>\n    OverlappedWindow = WindowEdge | ClientEdge,\n    /// <summary>Combines the WINDOWEDGE, TOOLWINDOW, and TOPMOST styles.</summary>\n    PaletteWindow   = WindowEdge | ToolWindow | Topmost,\n    /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n    /// <remarks>\n    /// This depends on the window class. This style has an effect only if the \n    /// shell language is Hebrew, Arabic, or another language that supports \n    /// reading-order alignment; otherwise, the style is ignored.\n    /// \n    /// Using the RIGHT style for static or edit controls has the same \n    /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n    /// style with button controls has the same effect as using BS_RIGHT and \n    /// BS_RIGHTBUTTON styles.\n    /// </remarks>\n    Right           = 0x00001000,\n    /// <summary>\n    /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\n    /// </summary>\n    RightScrollBar  = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\n    /// </summary>\n    RtlReading      = 0x00002000,\n    /// <summary>\n    /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\n    /// </summary>\n    StaticEdge      = 0x00020000,\n    /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n    /// <remarks>\n    /// A tool window has a title bar that is shorter than a normal title bar, and the \n    /// window title is drawn using a smaller font. A tool window does not appear in \n    /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n    /// tool window has a system menu, its icon is not displayed on the title bar. \n    /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n    /// </remarks>\n    ToolWindow      = 0x00000080,\n    /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should be placed above all \n    /// non-topmost windows and should stay above them, even when the window is \n    /// deactivated. To add or remove this style, use the SetWindowPos function.\n    /// </remarks>\n    Topmost         = 0x00000008,\n    /// <summary>Specifies that a window should be painted after all siblings.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should not be painted until \n    /// siblings beneath the window (that were created by the same thread) have been \n    /// painted. The window appears transparent because the bits of underlying sibling \n    /// windows have already been painted.\n    /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n    /// </remarks>\n    Transparent     = 0x00000020,\n    /// <summary>Specifies that a window has a border with a raised edge.</summary>\n    WindowEdge      = 0x00000100\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridPanel/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/Common/EmptyBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using HexSize         = System.Drawing.Size;\n  using MapGridHex      = Hex<DrawingContext,StreamGeometry>;\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyBoard : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public EmptyBoard() : base(new HexSize(1,1), new HexSize(26,30), (path,c) => new EmptyGridHex(c)) {\n      FovRadius = 20;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyGridHex : MapGridHex, IHex {\n    /// <summary>TODO</summary>\n    public EmptyGridHex(HexCoords coords) : base(coords,0) {}\n\n    /// <summary>TODO</summary>\n    public override int           HeightTerrain { get { return 0;   } }\n    /// <summary>TODO</summary>\n    public override int           StepCost(Hexside hexsideExit) { return -1; }\n    ///  <inheritdoc/>\n    public override void          Paint(DrawingContext graphics) { ; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/Common/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows;\nusing System.Windows.Input;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  /// <summary></summary>\n  public class HexEventArgs : System.Windows.Forms.MouseEventArgs {\n    /// <summary>TODO</summary>\n    public HexCoords  Coords       { get; private set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    public static  bool    IsAltKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Alt); } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    public static  bool    IsCtlKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control); } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    public static  bool    IsShiftKeyDown    { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Shift); } }\n\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords) \n      : this(coords, new System.Windows.Forms.MouseEventArgs(System.Windows.Forms.MouseButtons.None,0,0,0,0)) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, System.Windows.Forms.Keys modifierKeys) \n      : this(coords, new System.Windows.Forms.MouseEventArgs(System.Windows.Forms.MouseButtons.None,0,0,0,0), modifierKeys) {}\n    ///// <summary>TODO</summary>\n    //public HexEventArgs(HexCoords coords, System.Windows.Forms.MouseEventArgs e) \n    //  : this(coords, e, System.Windows.Forms.Keys.None) {}\n    /// <summary>TODO</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1062:Validate arguments of public methods\", MessageId = \"1\")]\n    public HexEventArgs(HexCoords coords, System.Windows.Forms.MouseEventArgs e, System.Windows.Forms.Keys modifierKeys)\n      : base(e.Button,e.Clicks,e.X,e.Y,e.Delta) {\n      Coords       = coords;\n    }\n\n    public HexEventArgs(HexCoords coords, System.Windows.Forms.MouseEventArgs e) \n      : base(e.Button,e.Clicks,e.X,e.Y,e.Delta) {\n      Coords       = coords;\n      //ModifierKeys = (isShiftKeyDown ? Keys.Shift   : Keys.None)\n      //             | (isCtlKeyDown   ? Keys.Control : Keys.None)\n      //             | (isAltKeyDown   ? Keys.Alt     : Keys.None);\n    }\n  }\n\n  /// <summary></summary>\n  public class HexMouseEventArgs : MouseEventArgs {\n\n    /// <summary>TODO</summary>\n    public HexCoords  GetCoords { \n      get; private set;\n    }\n\n    public HexMouseEventArgs(\n        MouseDevice mouse,\n        int timestamp,\n        MouseButton button\n    ) : base(mouse,timestamp){\n    }\n\n    public HexMouseEventArgs(\n        MouseDevice mouse,\n        int timestamp,\n        MouseButton button,\n        StylusDevice stylusDevice\n    )  : base(mouse,timestamp,stylusDevice) {\n\n    }\n\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/Common/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Globalization;\nusing System.Windows;\nusing System.Windows.Media;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\n#pragma warning disable 1587\n/// <summary>WinForms-specific utilities, including implementation of the subclasses HexgridPanel\n/// and MapDisplay<THex>, utilizing the System.Windows.Forms technology.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using HexSize    = System.Drawing.Size;\n  using HexPoint   = System.Drawing.Point;\n  using HexRectF   = System.Drawing.RectangleF;\n  using MapGridHex = Hex<DrawingContext,StreamGeometry>;\n\n  using Int32ValueEventArgs = ValueChangedEventArgs<Int32>;\n\n  /// <summary>Abstract class representing the basic game board.</summary>\n  /// <typeparam name=\"THex\">Type of the hex for which a game board is desired.</typeparam>\n  public abstract class MapDisplay<THex> : HexBoard<THex,StreamGeometry>, IHexBoard<THex>, IMapDisplayWpf\n    where THex : MapGridHex {\n\n    /// <summary>TODO</summary>\n    public delegate THex InitializeHex(StreamGeometry hexgridPath, HexCoords coords);\n\n    /// <summary>TODO</summary>\n    private static StreamGeometry GetGraphicsPath(HexSize gridSize) {\n      StreamGeometry geometry = new StreamGeometry();\n      geometry.FillRule = FillRule.EvenOdd;\n\n      using (var context = geometry.Open()) {\n        context.BeginFigure(new Point(gridSize.Width*1/3,                0),false,true);\n        context.LineTo     (new Point(gridSize.Width*3/3,                0),true,false);\n        context.LineTo     (new Point(gridSize.Width*4/3,gridSize.Height/2),true,false);\n        context.LineTo     (new Point(gridSize.Width*3/3,gridSize.Height  ),true,false);\n        context.LineTo     (new Point(gridSize.Width*1/3,gridSize.Height  ),true,false);\n        context.LineTo     (new Point(                 0,gridSize.Height/2),true,false);\n      }\n      geometry.Freeze();\n\n      return geometry;\n    }\n\n    #region Constructors\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex) \n    : this(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes)) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex, IFastList<HexCoords> landmarkCoords) \n    : base(sizeHexes, gridSize, landmarkCoords, GetGraphicsPath\n      #if FlatBoardStorage\n        ,() => new FlatBoardStorage<THex>(sizeHexes, coords => initializeHex(GetGraphicsPath(gridSize),coords))\n      #else\n        ,() => new BlockedBoardStorage32x32<THex>(sizeHexes, coords => initializeHex(GetGraphicsPath(gridSize),coords))\n      #endif\n    ) {\n      InitializeProperties();\n    }\n\n    void InitializeProperties() {\n      GoalHex         = \n      HotspotHex      = \n      StartHex        = HexCoords.EmptyUser;\n      ShadeBrushAlpha = 78;\n      ShadeBrushColor = Colors.Black;\n      ShowFov         = true;\n      ShowHexgrid     = true;\n      ShowPath        = true;\n      ShowPathArrow   = true;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Gets or sets the Field-of-View for the current <see cref=\"HotspotHex\"/>, as an <see cref=\"IFov\"/> object.</summary>\n    public virtual  IFov          Fov             {\n      get { return _fov ?? (_fov = this.GetFieldOfView(ShowRangeLine ? StartHex : HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    /// <inheritdoc/>\n    public override int           FovRadius       { set { RangeCutoff = base.FovRadius = value; Fov = null; } }\n    /// <inheritdoc/>\n    public virtual  HexCoords     GoalHex         { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public virtual  HexCoords     HotspotHex      { \n      get { return _hotSpotHex; }\n      set { if (IsOnboard(value)) _hotSpotHex = value; if (!ShowRangeLine) _fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public          int           LandmarkToShow  { get; set; }\n    /// <inheritdoc/>\n    public          string        Name            { get {return \"MapDisplay\";} }\n    /// <inheritdoc/>\n    public          IDirectedPathCollection Path            { \n      get { return _path ?? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])); } \n    } IDirectedPathCollection _path;\n    /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          byte          ShadeBrushAlpha { get; set; }\n    /// <summary>Gets or sets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          Color         ShadeBrushColor { get; set; }\n    /// <summary>Gets or sets whether to display the FIeld-of-View for <see cref=\"HotspotHex\"/>.</summary>\n    public          bool          ShowFov         { get; set; }\n    /// <summary>Gets or sets whether to display the hexgrid.</summary>\n    public          bool          ShowHexgrid     { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowPath        { get; set; }\n    /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n    public          bool          ShowPathArrow   { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowRangeLine   { \n      get { return _showRangeLine; } \n      set { _showRangeLine = value; if (_showRangeLine) Fov = null; }\n    } bool _showRangeLine = false;\n    /// <inheritdoc/>\n    public virtual  HexCoords     StartHex        { \n      get { return _startHex; }\n      set { if (IsOnboard(value)) _startHex = value; _path = null; if (ShowRangeLine) _fov = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(Point point, Size size) {\n      return GetClipInHexes( new HexRectF(point.ToHexPoint(),size.ToHexSize()), MapSizeHexes );\n    }\n\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(HexRectF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintHighlight(DrawingContext graphics) { \n      if (graphics==null) throw new ArgumentNullException(\"dc\");\n      var brushBlack = Brushes.Black;\n\n      graphics.PushTransform(TranslateToHex(StartHex));\n      graphics.DrawGeometry(Brushes.Transparent,new Pen(brushBlack,1),HexgridPath);\n      graphics.Pop();\n\n      //dc.DrawPath(Pens.Red, HexgridPath);\n\n      //if (ShowPath) {\n      //  dc.EndContainer(container); container = dc.BeginContainer();\n      //  PaintPath(dc,Path);\n      //}\n\n      //if (ShowRangeLine) {\n      //  dc.EndContainer(container); container = dc.BeginContainer();\n      //  var target = CentreOfHex(HotspotHex);\n      //  dc.DrawLine(Pens.Red, CentreOfHex(StartHex), target);\n      //  dc.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n      //  dc.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n      //}\n\n      //if (ShowFov) {\n      //  dc.EndContainer(container); container = dc.BeginContainer();\n      //  var clipHexes  = GetClipInHexes(dc.VisibleClipBounds);\n      //  using(var shadeBrush = new SolidBrush(Color.FromArgb(ShadeBrushAlpha, ShadeBrushColor))) {\n      //    PaintForEachHex(dc, clipHexes, coords => {\n      //      if (Fov!=null && ! Fov[coords]) { dc.FillPath(shadeBrush, HexgridPath);  }\n      //    } );\n      //  }\n      //}\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintMap(DrawingContext graphics) { \n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n//      dc.InterpolationMode = InterpolationMode.HighQualityBicubic;\n      var clipHexes = GetClipInHexes(HexPoint.Empty.ToWpfPoint(),MapSizeHexes.ToWpfSize());\n\n      var fontSize   = SystemFonts.MenuFontSize * 0.8F;\n      var brush      = Brushes.Black;\n      var textOffset = new HexPoint(GridSize.Scale(0.50F).ToSize()).ToWpfPoint()\n                     - new Vector(fontSize,fontSize);\n      PaintForEachHex(graphics, clipHexes, coords => {\n        this[coords].Paint(graphics);\n        if (ShowHexgrid) graphics.DrawGeometry(Brushes.Transparent,new Pen(Brushes.Black,1), HexgridPath);\n        if (LandmarkToShow > 0) {\n          graphics.DrawText(new FormattedText(\n              LandmarkDistance(coords,LandmarkToShow-1),\n              CultureInfo.GetCultureInfo(\"en-US\"),\n              FlowDirection.LeftToRight,\n              new Typeface(\"Verdana\"),\n              fontSize,\n              Brushes.Black),\n            textOffset);\n        }\n      } );\n      graphics.Pop();\n    }\n\n    /// <summary>Paint the current shortese path.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be painted.</param>\n    protected virtual  void PaintPath(DrawingContext graphics, IDirectedPathCollection path) {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var pen   = new Pen(Brushes.Black,1.0F);\n      var brush = new SolidColorBrush(Color.FromArgb(78, Colors.PaleGoldenrod.R,Colors.PaleGoldenrod.G,Colors.PaleGoldenrod.B));\n      while (path != null) {\n        var coords = path.PathStep.Hex.Coords;\n        graphics.PushTransform(TranslateToHex(StartHex));\n        graphics.DrawGeometry(brush,pen,HexgridPath);\n\n        if (ShowPathArrow) PaintPathArrow(graphics, path);\n\n        path = path.PathSoFar;\n      }\n    }\n\n    /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>\n    protected virtual  void PaintPathArrow(DrawingContext graphics, IDirectedPathCollection path) {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n      if (path==null) throw new ArgumentNullException(\"path\");\n\n      graphics.PushTransform(new TranslateTransform(CentreOfHexOffset.Width, CentreOfHexOffset.Height));\n      if (path.PathSoFar == null)    PaintPathDestination(graphics);\n      else                           PaintPathArrow(graphics, path.PathStep.HexsideEntry);\n      graphics.Pop();\n    }\n\n    /// <summary>Paint the direction arrow for each hex of the current shortest path.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"hexside\">Type: <see cref=\"Hexside\"/> - \n    /// Direction from this hex in which the next step is made.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathArrow(DrawingContext graphics, Hexside hexside) {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var penBlack = new Pen(Brushes.Black,1.0F);\n      var unit = GridSize.Height/8.0F;\n      graphics.PushTransform(new RotateTransform(60 * (int)hexside));\n      graphics.DrawLine(penBlack, new Point(0,unit*4), new Point(      0,  -unit));\n      graphics.DrawLine(penBlack, new Point(0,unit*4), new Point(-unit*3/2, unit*2));\n      graphics.DrawLine(penBlack, new Point(0,unit*4), new Point( unit*3/2, unit*2));\n      graphics.Pop();\n    }\n\n    /// <summary>Paint the destination indicator for the current shortest path.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathDestination(DrawingContext graphics) {\n      if (graphics==null) throw new ArgumentNullException(\"graphics\");\n\n      var penBlack = new Pen(Brushes.Black,1.0F);\n      var unit = GridSize.Height/8.0F;\n      graphics.DrawLine(penBlack, new Point(-unit*2,-unit*2), new Point(unit*2, unit*2));\n      graphics.DrawLine(penBlack, new Point(-unit*2, unit*2), new Point(unit*2,-unit*2));\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintUnits(DrawingContext graphics) {}\n\n    /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n    /// for each hex on <paramref name=\"dc\"/>.</summary>\n    /// <param name=\"dc\">Graphics object for the canvas being painted.</param>\n    /// <param name=\"clipHexes\">Type: CoordRectangle - \n    /// The rectangular extent of hexes to be painted.</param>\n    /// <param name=\"paintAction\">Type: Action {HexCoords} - \n    /// The paint action to be performed for each hex.</param>\n    void PaintForEachHex(DrawingContext graphics, CoordsRectangle clipHexes, Action<HexCoords> paintAction) {\n      ForEachHex(hex => {\n        if (clipHexes.Left <= hex.Coords.User.X  &&  hex.Coords.User.X <= clipHexes.Right\n        &&  clipHexes.Top  <= hex.Coords.User.Y  &&  hex.Coords.User.Y <= clipHexes.Bottom) {\n          graphics.PushTransform(TranslateToHex(StartHex));\n          paintAction(hex.Coords);\n        }\n      } );\n      return;\n    }\n\n    /// <summary>Returns the translation transform-matrix for the upper-left corner of the specified hex.</summary>\n    /// <param name=\"coords\">Type: HexCoords - \n    /// Coordinates of the hex to be painted next.</param>\n    //void TranslateGraphicsToHex(DrawingContext dc, HexCoords coords) {\n    //  var offset  = UpperLeftOfHex(coords);\n    //  dc.Transform = new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n    //}\n    Transform TranslateToHex(HexCoords coords) {\n      var offset  = UpperLeftOfHex(coords);\n      return new MatrixTransform(new Matrix(1, 0, 0, 1, offset.X, offset.Y));\n    }\n\n    /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n    protected HexPoint UpperLeftOfHex(HexCoords coords) {\n      return new HexPoint(\n        coords.User.X * GridSize.Width,\n        coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n      );\n    }\n\n    /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n    protected HexPoint CentreOfHex(HexCoords coords) {\n      return UpperLeftOfHex(coords) + CentreOfHexOffset;\n    }\n    #endregion\n\n    /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n    /// <param name=\"coords\">Type HexCoords - \n    /// Hex for which to return Landmark distanace.</param>\n    /// <param name=\"landmarkToShow\">Type int - \n    /// Index of the Landmark from which to display distances.</param>\n    protected virtual string LandmarkDistance(HexCoords coords, int landmarkToShow) { \n      if (landmarkToShow < 0  ||  Landmarks.Count <= landmarkToShow) return \"\";\n\n      return string.Format(\"{0,3}\", Landmarks[landmarkToShow].DistanceFrom(coords));\n    }\n\n    /// <summary>TODO</summary>\n    private void Host_FovRadiusChanged(object sender, Int32ValueEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      FovRadius = RangeCutoff = e.Value;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ValueChangedEventArgs<T> : EventArgs {\n    /// <summary>TODO</summary>\n    public ValueChangedEventArgs(T value) : base() { Value = value; }\n    /// <summary>TODO</summary>\n    public T Value { get; private set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/HexgridScrollViewer.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{DAC3749C-6181-4B9C-A1E8-598AF5656F5E}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridScrollViewer</RootNamespace>\n    <AssemblyName>HexgridScrollViewer</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Common\\EmptyBoard.cs\" />\n    <Compile Include=\"Common\\HexEventArgs.cs\" />\n    <Compile Include=\"Common\\MapDisplay.cs\" />\n    <Compile Include=\"HexgridScrollViewer.xaml.cs\">\n      <DependentUpon>HexgridScrollViewer.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridViewModel.cs\" />\n    <Compile Include=\"IMapDisplayWpf.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"TiltAwareScrollViewer.cs\" />\n    <Compile Include=\"ViewModelBase.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"HexgridScrollViewer.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridScrollViewer/HexgridScrollViewer.xaml",
    "content": "﻿<UserControl\n   xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n   xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n   xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n   xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n   xmlns:HexgridScrollViewer=\"clr-namespace:PGNapoleonics.HexgridScrollViewer\" \n   xmlns:local=\"clr-namespace:PGNapoleonics.HexgridPanel\" \n   x:Class=\"PGNapoleonics.HexgridPanel.ScrollViewer\" \n   mc:Ignorable=\"d\" \n   d:DesignHeight=\"300\" Width=\"447\">\n   <UserControl.DataContext>\n      <HexgridScrollViewer:HexgridScrollViewerViewModel/>\n   </UserControl.DataContext>\n   <HexgridScrollViewer:HexgridScrollViewer HorizontalAlignment=\"Left\" Height=\"280\" Margin=\"10,10,0,0\" \n           VerticalAlignment=\"Top\" Width=\"427\" >\n      <HexgridScrollViewer:HexgridScrollViewer.DataContext>\n         <HexgridScrollViewer:HexgridScrollViewerViewModel/>\n      </HexgridScrollViewer:HexgridScrollViewer.DataContext>\n   </HexgridScrollViewer:HexgridScrollViewer>\n</UserControl>\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/HexgridScrollViewer.xaml.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n\n\n  /// <summary>Sub-class implementation of a <b>WPF</b> Scrollable with integrated <see cref=\"TransposableHexgrid\"/> support.</summary>\n  public partial class HexgridScrollViewer : Canvas { //, IHexgridHost {\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    public HexgridScrollViewer() : base() {\n//      InitializeComponent();\n    }\n\n    public event EventHandler<RenderingEventArgs> Render;\n\n    protected override void OnRender(DrawingContext dc) {\n      Render.Raise(this, new RenderingEventArgs(dc));\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"scrollPosition\"></param>\n    public void SetScrollPosition(Point scrollPosition) {\n//      ScrollInfo.SetHorizontalOffset(scrollPosition.X);\n//      ScrollInfo.SetVerticalOffset(scrollPosition.Y);\n    }\n\n//    #region Events\n//    /// <summary>Announces that the mouse is now over a new hex.</summary>\n//    public event EventHandler<HexEventArgs> HotspotHexChange;\n//    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseAltClick;\n//    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseCtlClick;\n//    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseLeftClick;\n//    /// <summary>Announces a mouse right-click. </summary>\n//    public event EventHandler<HexEventArgs> MouseRightClick;\n//    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n//    public event EventHandler<EventArgs>    ScaleChange;\n//    #endregion\n\n//    #region Properties\n//    /// <summary>Mimic WinForms ScrollPosition to simpliify conversion.</summary>\n//    private HexPoint ScrollPosition { \n//      get { return new HexPoint((int)HorizontalOffset,(int)VerticalOffset); } \n//      set { ScrollInfo.SetHorizontalOffset(value.X); ScrollInfo.SetVerticalOffset(value.Y); } \n//    }\n//    /// <summary>Mimic WinForms ClientSize to simpliify conversion.</summary>\n//    private HexSize  ClientSize         { get {return new HexSize((int)ViewportWidth,(int)ViewportHeight);} }\n\n////    /// <summary>TODO</summary>\n//    public HexgridViewModel        DataContext       { get; set; }\n//    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n//    public         Size            GridSizeF         { get { return DataContext.Model.GridSize.Scale(MapScale).ToSize().ToWpfSize(); } }\n//    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n//    public         HexCoords       HotspotHex        { get { return DataContext.HotspotHex; } }\n//    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n//    public static  bool            IsAltKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Alt); } }\n//    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n//    public static  bool            IsCtlKeyDown      { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control); } }\n//    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n//    public static  bool            IsShiftKeyDown    { get { return Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Shift); } }\n//    /// <summary>TODO</summary>\n//    public         bool            IsMapDirty        { \n//      get { return _isMapDirty; }\n//      set { \n//        _isMapDirty = value; \n//        if(_isMapDirty) { IsUnitsDirty = true; } \n//      }\n//    } bool _isMapDirty;\n//    /// <summary>TODO</summary>\n//    public         bool            IsUnitsDirty      { \n//      get { return _isUnitsDirty; }\n//      set { \n//        _isUnitsDirty = value; \n//        if(_isUnitsDirty) { InvalidateVisual(); }\n//      }\n//    } bool _isUnitsDirty;\n//    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n//    public         bool            IsTransposed      { \n//      get { return DataContext.IsTransposed; }\n//      set { DataContext.IsTransposed = value;  SetScrollLimits(DataContext.Model); }\n//    }\n//    /// <inheritdoc/>\n//    public         HexSize         MapSizePixels     { get { return DataContext.Model.MapSizePixels; } } // + MapMargin.Scale(2);} }\n//    /// <summary>Current scaling factor for map display.</summary>\n//    public         float           MapScale          { get { return DataContext.MapScale; } }\n////    /// <summary>MapBoard hosting this panel.</summary>\n////    public         IMapDisplay     Model             { get { return DataContext.Model; } }\n//    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n//    public         HexCoords       PanelCenterHex    { \n////      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ); }\n//      get { return GetHexCoords( this.PointFromScreen(new WpfPoint(ViewportWidth *0.50, ViewportHeight * 0.50)).ToHexPoint()); }\n//    }\n//    /// <summary>TODO</summary>\n//    public WpfInput.ICommand       RefreshCmd        { get; private set; }\n//    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n//    public virtual int     ScaleIndex    { \n//      get { return _scaleIndex; }\n//      set { var newValue = Math.Max(0, Math.Min(ScaleList.Count-1, value));\n//            if( _scaleIndex != newValue) {\n//              _scaleIndex = newValue;\n////              MapScale    = ScaleList[ScaleIndex];\n\n//              OnScaleChange(EventArgs.Empty); \n//            }\n//          } \n//    } int _scaleIndex;\n\n//    /// <summary>Array of supported map scales  as IList {float}.</summary>\n//    public ReadOnlyCollection<float>     ScaleList        { get; private set; }\n//    #endregion\n\n//    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n//    public virtual CoordsRectangle VisibleRectangle  {\n//      get { return GetClipInHexes( ScrollPosition.Scale(-1.0F/MapScale).ToWpfPoint(), \n//                                         ClientSize.Scale( 1.0F/MapScale).ToWpfSize() );\n//      }\n//    }\n\n//    public System.Windows.Media.Color BackColor { get; set; }\n\n//    #region Methods\n//    /// <summary>TODO</summary>\n//    public         void CenterOnHex(HexCoords coords) {\n//      ScrollPosition = ScrollPositionToCenterOnHex(coords);\n////      IsMapDirty = true;\n//      InvalidateScrollInfo();\n//    }\n\n//    /// <summary>TODO</summary>\n//        CoordsRectangle GetClipInHexes(WpfPoint point, WpfSize size) { return DataContext.Model.GetClipInHexes(point, size); }\n//    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n//    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n//    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n//    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n//    public    HexCoords GetHexCoords(HexPoint point) {\n//      return DataContext.Hexgrid.GetHexCoords(point, new HexSize(ScrollPosition));\n//    }\n//    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n//    public virtual void SetMapDirty() { InvalidateVisual(); }\n\n//    /// <summary>TODO</summary>\n//    public         void SetModel(IMapDisplayWpf model) {\n//      SetScrollLimits(DataContext.Model);   \n//      DataContext.SetModel(model);\n//      SetMapDirty();\n//    }\n\n//    /// <summary>TODO</summary>\n//    public         void SetPanelSize() {\n////      if(DesignMode || !IsHandleCreated) return;\n////      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n//      SetScroll(PanelCenterHex);\n//    }\n\n//    /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n//    public virtual void SetScroll(HexCoords newCenterHex) {\n////      if(DesignMode || !IsHandleCreated) return;\n////      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n//      SetScrollLimits(DataContext.Model);\n\n//      CenterOnHex(newCenterHex);\n//    }\n\n//    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n//    public virtual void SetScrollLimits(IMapDisplayWpf model) {\n////      if (model == null  ||  !AutoScroll) return;\n//      //var smallChange              = HexSize.Ceiling(model.GridSize.Scale(MapScale));\n//      //HorizontalScroll.SmallChange = smallChange.Width;\n//      //VerticalScroll.SmallChange   = smallChange.Height;\n\n//      //var largeChange              = HexSize.Round(ClientSize.Scale(0.75F));\n//      //HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n//      //VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n//      //var size                     = DataContext.Hexgrid.GetSize(MapSizePixels,MapScale)\n//      //                             + Margin.Size;\n//      //if (AutoScrollMinSize != size) {\n//      //  AutoScrollMinSize          = size;\n//      //  HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, Margin.Horizontal \n//      //                             + size.Width  - ClientSize.Width));\n//      //  VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, Margin.Vertical \n//      //                             + size.Height - ClientSize.Height));\n//      //  Invalidate();\n//      //}\n//    }\n//    #endregion\n\n//    #region Grid Coordinates\n//    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n//    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n//    /// <returns>Pixel coordinates in Client reference frame.</returns>\n//    public HexPoint HexCenterPoint(HexCoords coordsNewULHex) {\n//      return DataContext.Hexgrid.HexCenterPoint(coordsNewULHex);\n//    }\n//    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n//    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n//    /// <returns>Pixel coordinates in Client reference frame.</returns>\n//    protected HexPoint ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n//      return DataContext.Hexgrid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n//    }\n//    #endregion\n\n//    #region Painting\n//    /// <inheritdoc/>\n////    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n//    /// <inheritdoc/>\n//    //protected override void OnPaint(PaintEventArgs e) {\n//    //  if (e==null) throw new ArgumentNullException(\"e\");\n\n//    //  if(!IsHandleCreated) return;\n//    //  var dc      = e.Graphics;\n//    //  if (DesignMode) { dc.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n//    //  dc.Clip = new Region(e.ClipRectangle);\n//    //  if (IsTransposed) { dc.Transform = TransposeMatrix; }\n\n//    //  var scroll = DataContext.Hexgrid.GetScrollPosition(ScrollPosition);\n//    //  dc.TranslateTransform(scroll.X, scroll.Y);\n//    //  dc.TranslateTransform(Margin.Left,Margin.Top);\n//    //  dc.ScaleTransform(MapScale,MapScale);\n//    //  TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n//    //  var state = dc.Save();\n//    //  RenderMap(dc);\n\n//    //  dc.Restore(state); state = dc.Save();\n//    //  RenderUnits(dc);\n\n//    //  dc.Restore(state); state = dc.Save();\n//    //  RenderHighlight(dc);\n\n//    //  dc.Restore(state);\n//    //}\n//    protected override void OnRender(DrawingContext dc) {\n//      if (dc==null) throw new ArgumentNullException(\"dc\");\n\n////      dc.Clip = new Region(e.ClipRectangle);\n//      if (IsTransposed) { dc.PushTransform(TransposeMatrix); }\n//      OnRenderDetail (dc);\n//      if (IsTransposed) dc.Pop();\n//    }\n//    protected virtual void OnRenderDetail(DrawingContext dc) {\n//      if (dc==null) throw new ArgumentNullException(\"dc\");\n\n//      var scroll = DataContext.Hexgrid.GetScrollPosition(ScrollPosition);\n//      dc.PushTransform(new TranslateTransform(scroll.X, scroll.Y));\n//      dc.PushTransform(new TranslateTransform(Margin.Left,Margin.Top));\n//      dc.PushTransform(new ScaleTransform(MapScale,MapScale));\n////      TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n//      RenderMap(dc);\n//      RenderUnits(dc);\n//      RenderHighlight(dc);\n\n//      dc.Pop();dc.Pop();dc.Pop();\n//    }\n\n//    /// <summary>TODO</summary>\n//    protected virtual void RenderMap(DrawingContext dc) {\n//      if (dc == null) throw new ArgumentNullException(\"dc\");\n\n//      var rectangle = new Rect(new WpfPoint(),new Vector(ActualWidth,ActualHeight));\n//      var brush = new SolidColorBrush(this.BackColor);\n//      dc.DrawRectangle(brush,null, rectangle);\n//      DataContext.Model.PaintMap(dc);\n//    }\n//    /// <summary>TODO</summary>\n//    protected virtual void RenderUnits(DrawingContext dc) {\n//      if (dc == null) throw new ArgumentNullException(\"dc\");\n//      DataContext.Model.PaintUnits(dc);\n//    }\n//    /// <summary>TODO</summary>\n//    protected virtual void RenderHighlight(DrawingContext dc) {\n//      if (dc == null) throw new ArgumentNullException(\"dc\");\n//      DataContext.Model.PaintHighlight(dc);\n//    }\n\n//    /// <summary>TODO</summary>\n//    static protected readonly Transform TransposeMatrix = new MatrixTransform(new Matrix(0F,1F, 1F,0F, 0F,0F));\n//    #endregion\n\n//    private ModifierKeys ModifierKeys(object o) {\n//      return Keyboard.Modifiers;\n//    }\n\n//    #region Mouse event handlers\n//    /// <inheritdoc/>\n//    protected virtual void OnMouseClick(MouseEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      //TraceFlags.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n//      //                                Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n//      var coords    = GetHexCoords(Mouse.GetPosition(this).ToHexPoint());\n//      // TODO - remap this in ViewModel\n//      //var eventArgs = new HexEventArgs(coords, e, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n//      //     if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n//      //else if (e.Button == MouseButtons.Right)    this.OnMouseRightClick(eventArgs);\n//      //else if (IsAltKeyDown  && !IsCtlKeyDown)    this.OnMouseAltClick(eventArgs);\n//      //else if (IsCtlKeyDown)                      this.OnMouseCtlClick(eventArgs);\n//      //else                                        this.OnMouseLeftClick(eventArgs);\n//    }\n//    /// <inheritdoc/>\n//    protected override void OnMouseMove(MouseEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      var coords    = GetHexCoords(Mouse.GetPosition(this).ToHexPoint());\n//      // TODO - remap this in ViewModel\n////      OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n//      base.OnMouseMove(e);\n//    }\n\n//    /// <summary>Raise the MouseAltClick event.</summary>\n//    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick.Raise(this,e); }\n//    /// <summary>Raise the MouseCtlClick event.</summary>\n//    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      DataContext.Model.GoalHex = e.Coords;\n//      MouseCtlClick.Raise(this,e);\n////      Refresh();\n//    }\n//    /// <summary>Raise the MouseLeftClick event.</summary>\n//    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      DataContext.Model.StartHex = e.Coords;\n//      MouseLeftClick.Raise(this,e);\n////      Refresh();\n//    }\n//    /// <summary>Raise the MouseRightClick event.</summary>\n//    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this,e); }\n//   /// <summary>Raise the HotspotHexChange event.</summary>\n//    protected virtual void OnHotspotHexChange(HexEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      DataContext.Model.HotspotHex = e.Coords;\n//      HotspotHexChange.Raise(this,e);\n////      Refresh();\n//    }\n\n//    /// <summary>Raise the ScaleChange event.</summary>\n//    protected virtual void OnScaleChange(EventArgs e) {\n//      SetMapDirty();\n//      OnRenderSizeChanged(new SizeChangedInfo(this,new WpfSize(),true,true));\n//      InvalidateVisual();\n//      ScaleChange.Raise(this, e);\n//    }\n\n//    /// <inheritdoc/>\n//    protected override void OnRenderSizeChanged(SizeChangedInfo info) {\n//      SetScrollLimits(DataContext.Model);\n//      base.OnRenderSizeChanged(info);\n//    }\n//    #endregion\n\n//    #region MouseWheel & Scroll event handlers\n//    ///// <inheritdoc/>\n//    //protected virtual void OnMouseWheel(MouseEventArgs e) {\n//    //  if (e == null) throw new ArgumentNullException(\"e\");\n//    //  TraceFlags.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Name, e.ToString());\n\n//    //  //if (Control.ModifierKeys.HasFlag(Keys.Control)) ScaleIndex += Math.Sign(e.Delta);\n//    //  //else if (IsShiftKeyDown)                        base.OnMouseHWheel(e);\n//    //  //else                                            base.OnMouseWheel(e);\n//    //}\n\n//    /// <summary>TODO</summary>\n//    public void ScrollPanelVertical(bool isPage, int sign) {\n//      ScrollPanelCommon(false, isPage, sign);\n//    }\n//    /// <summary>TODO</summary>\n//    public void ScrollPanelHorizontal(bool isPage, int sign) {\n//      ScrollPanelCommon(true, isPage, sign);\n//    }\n//    /// <summary>TODO</summary>\n//    private void ScrollPanelCommon(bool  isHorizontal, bool isPage, int sign) {\n//      if (sign == 0) return;\n//      switch (sign) {\n//        case -1: if(isPage) if(isHorizontal) PageLeft(); else PageUp(); else if(isHorizontal) LineLeft(); else LineUp(); break;\n//        case +1: if(isPage) if(isHorizontal) PageRight(); else PageDown(); else if(isHorizontal) LineRight(); else LineDown(); break;\n//        default: break;\n//      }\n//    }\n//    #endregion\n\n//    /// <summary>Array of supported map scales  as IList {float}.</summary>\n//    public ReadOnlyCollection<float>     Scales        { get; private set; }\n//    public void SetScales (IList<float> scales) { Scales = new ReadOnlyCollection<float>(scales); }\n  }\n\n  public class RenderingEventArgs : RoutedEventArgs {\n    public RenderingEventArgs(DrawingContext dc) : base() {\n      DrawingContext = dc;\n    }\n    public DrawingContext DrawingContext { get; private set; }\n  }\n}\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using HexPointF = System.Drawing.PointF;\n  using HexSizeF = System.Drawing.SizeF;\n\n  using MapGridHex      = Hex<DrawingContext,StreamGeometry>;\n\n  public class HexgridScrollViewerViewModel : ViewModelBase {\n    public HexgridScrollViewerViewModel() : base(\"HexgridScrollViewer Test (WPF)\") {\n      View.Render += HexgridScrollViewer_Rendering;\n    }\n\n    #region Properties\n    public System.Windows.Media.Color BackColor { get; set; }\n    /// <summary>Mimic WinForms ScrollPosition to simpliify conversion.</summary>\n    private Point ScrollPosition { \n      get { return new Point(0,0); }//View.HorizontalOffset,View.VerticalOffset); } \n      set { View.SetScrollPosition(value); } \n    }\n    /// <summary>MapBoard hosting this panel.</summary>\n    public MapDisplay<MapGridHex> Model    { \n      get { return _model; }\n      set {  if (_model != null) _model.Dispose();  _model = value;  }\n    } MapDisplay<MapGridHex> _model = new EmptyBoard();\n\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public        HexCoords HotspotHex     { get; private set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsAltKeyDown   { get {return Keyboard.Modifiers.HasFlag(ModifierKeys.Alt);} }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsCtlKeyDown   { get {return Keyboard.Modifiers.HasFlag(ModifierKeys.Control);} }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsShiftKeyDown { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Shift); } }\n\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public     bool         IsTransposed  { \n      get { return Model.IsTransposed; }\n      set { Model.IsTransposed = value;  } //SetScrollLimits(Model); }\n    }\n\n    /// <inheritdoc/>\n    public     Size         MapSizePixels { get {return MapSizePixels;} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public     float        MapScale      { \n      get { return Model.MapScale; } \n      private set { Model.MapScale = value; } // SetScrollLimits(Model); } \n    }\n\n    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    public     HexCoords    PanelCenterHex  { \n      get { return GetHexCoords( View.PointFromScreen(new Point(View.Width*0.50, View.Height*0.50)) ); }\n    }\n\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int      ScaleIndex    { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(ScaleList.Count-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue;\n              MapScale    = ScaleList[ScaleIndex];\n\n//              OnScaleChange(EventArgs.Empty); \n            }\n          } \n    } int _scaleIndex;\n\n    /// <summary>Array of supported map scales  as IList {float}.</summary>\n    public IList<float>     ScaleList        { get; private set; }\n\n    private HexgridScrollViewer View { get; set; }\n    #endregion\n  \n    #region Grid Coordinates\n    /// <inheritdoc/>\n    protected IHexgrid    Hexgrid         { get {return Model.Hexgrid;} }\n    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public HexCoords GetHexCoords(Point point) {\n      return Hexgrid.GetHexCoords(new HexPointF((float)point.X,(float)point.Y), \n                                  new HexSizeF((float)ScrollPosition.X,(float)ScrollPosition.Y));\n    }\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(HexCoords coordsNewULHex) {\n      var point = Hexgrid.HexCenterPoint(coordsNewULHex);\n      return new Point(point.X,point.Y);\n    }\n    #endregion\n\n    #region Painting\n    /// <summary>TODO</summary>\n    /// <param name=\"dc\"></param>\n    protected void HexgridScrollViewer_Rendering(object sender, RenderingEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n\n      var dc = e.DrawingContext;\n//      dc.Clip = new Region(e.ClipRectangle);\n      if (IsTransposed) { dc.PushTransform(TransposeMatrix); }\n      OnRenderViewDetail (dc);\n      if (IsTransposed) dc.Pop();\n      View.InvalidateVisual();\n    }\n    /// <summary>TODO</summary>\n    /// <param name=\"dc\"></param>\n    protected virtual void OnRenderViewDetail(DrawingContext dc) {\n      if (dc==null) throw new ArgumentNullException(\"dc\");\n\n      Point scroll; // = Hexgrid.GetScrollPosition(ScrollPosition);\n      if (IsTransposed) scroll = ScrollPosition; \n      else scroll = new Point(ScrollPosition.Y, ScrollPosition.X);\n      dc.PushTransform(new TranslateTransform(scroll.X, scroll.Y));\n      dc.PushTransform(new TranslateTransform(View.Margin.Left,View.Margin.Top));\n      dc.PushTransform(new ScaleTransform(MapScale,MapScale));\n//      TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, dc.VisibleClipBounds);\n\n      RenderMap(dc);\n      RenderUnits(dc);\n      RenderHighlight(dc);\n\n      dc.Pop();dc.Pop();dc.Pop();\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderMap(DrawingContext dc) {\n      if (dc == null) throw new ArgumentNullException(\"dc\");\n\n      var rectangle = new Rect(new Point(),new Vector(View.ActualWidth,View.ActualHeight));\n      var brush = new SolidColorBrush(BackColor);\n      dc.DrawRectangle(brush,null, rectangle);\n      Model.PaintMap(dc);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderUnits(DrawingContext dc) {\n      if (dc == null) throw new ArgumentNullException(\"dc\");\n      Model.PaintUnits(dc);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderHighlight(DrawingContext dc) {\n      if (dc == null) throw new ArgumentNullException(\"dc\");\n      Model.PaintHighlight(dc);\n    }\n\n    static readonly Transform TransposeMatrix = new MatrixTransform(new Matrix(0F,1F, 1F,0F, 0F,0F));\n    #endregion\n  }\n}\n\nnamespace PGNapoleonics.HexgridScrollViewer {\nusing System.Windows.Forms;\n  public partial class TiltAwareScrollViewer : ScrollViewer {\n    /// <summary>TODO</summary>\n    private static int MouseWheelStep {\n      get {\n        return SystemInformation.MouseWheelScrollDelta\n             / SystemInformation.MouseWheelScrollLines;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Windows;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using WpfInput  = System.Windows.Input;\n\n  using HexPoint  = System.Drawing.Point;\n  using HexSize   = System.Drawing.Size;\n  using WpfPoint  = System.Windows.Point;\n  using WpfSize   = System.Windows.Size;\n\n//  /// <summary>TODO</summary>\n//  public class HexgridViewModel : IHexgridHost {\n//    /// <summary>TODO</summary>\n//    public HexgridViewModel(HexgridScrollViewer viewer) {\n//      HotspotHex    = HexCoords.EmptyUser;\n\n//      Viewer        = viewer;\n\n//      Viewer.HotspotHexChange  += HotspotHexChange;\n////      Panel.MouseAltClick     += MouseAltClick;\n////      Panel.MouseCtlClick     += GoalHexChange;\n////      Panel.MouseRightClick   += MouseRightClick;\n////      Panel.ScaleChange       += ScaleChange;\n\n//      Scales        = new List<float>() {1.000F}.AsReadOnly();\n//      SetModel(new EmptyBoard());\n//      Hexgrid       = GetHexgrid();\n//    }\n\n//    HexgridScrollViewer Viewer { get; set; }\n\n//    ///// <summary>Return new ScrollPosition for applied muse-wheel scroll.</summary>\n//    //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n//    //  Func<int,Point> newAutoScroll)\n//    //{\n//    //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n//    //  var steps = (delta+remainder) \n//    //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n//    //  remainder = (delta+remainder) \n//    //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n//    //  return newAutoScroll(scroll.SmallChange * steps);\n//    //}\n//    ///// <summary>TODO</summary>\n//    //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n//    //  return new ScrollEventArgs(\n//    //    ScrollEventType.ThumbTrack,\n//    //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n//    //    isHorizontal ? -newScroll.X : -newScroll.Y,\n//    //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n//    //  );\n//    //}\n\n//    /// <summary>TODO</summary>\n//    public void SetModel(IMapDisplayWpf model) {\n//      Model = model;   \n//    }\n\n//    Hexgrid GetHexgrid() { \n//      var margin          = HexSize.Empty; // Margin.OffsetSize();\n//      return IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale),margin) \n//                          : new Hexgrid(Model.GridSize.Scale(MapScale),margin);     \n//    }\n\n//    #region Properties\n//    ///// <summary>TODO</summary>\n//    //public WpfInput.ICommand RefreshCmd { \n//    //  get { return _refreshCmd; } private set {_refreshCmd = value; } \n//    //} WpfInput.ICommand _refreshCmd;\n\n//    /// <summary>MapBoard hosting this panel.</summary>\n//    public IMapDisplayWpf Model           { get; private set; }\n\n//    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n//    public HexCoords   HotspotHex      { get; set; }\n\n//    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsAltKeyDown   { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Alt); } }\n//    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsCtlKeyDown   { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Control); } }\n//    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n//    protected static  bool  IsShiftKeyDown { get { return Keyboard.Modifiers.HasFlag(ModifierKeys.Shift); } }\n\n//    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n//    public bool        IsTransposed    { \n//      get { return _isTransposed; }\n//      set { _isTransposed = value;  \n//            Hexgrid = GetHexgrid();\n////            if (Viewer.IsHandleCreated) \n//              Viewer.SetScrollLimits(Model);   \n//          }\n//    } bool _isTransposed;\n\n//    /// <inheritdoc/>\n//    public HexSize  MapSizePixels   { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n//    /// <summary>Current scaling factor for map display.</summary>\n//    public float       MapScale      { \n//      get { return Model.MapScale; } \n//      private set { Model.MapScale = value; } \n//    }\n\n//    /// <inheritdoc/>\n//    //public Padding  Margin     { \n//    //  get { return _margin; } \n//    //  set { _margin = value; Hexgrid.Margin = new Size(_margin.Left, _margin.Top); }\n//    //} Padding _margin;\n\n//    /// <summary>TODO</summary>\n//    public    bool   IsMapDirty   { \n//      get { return _isMapDirty; }\n//      set { \n//        _isMapDirty = value; \n//        if(_isMapDirty) { IsUnitsDirty = true; } \n//      }\n//    } bool _isMapDirty;\n//    /// <summary>TODO</summary>\n//    public    bool   IsUnitsDirty { \n//      get { return _isUnitsDirty; }\n//      set { \n//        _isUnitsDirty = value; \n//        if(_isUnitsDirty) { Viewer.InvalidateVisual(); }\n//      }\n//    } bool _isUnitsDirty;\n\n//    /// <summary>Array of supported map scales  as IList {float}.</summary>\n//    public ReadOnlyCollection<float> Scales        { get; private set; }\n//    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n//    public virtual int ScaleIndex    { \n//      get { return _scaleIndex; }\n//      set { var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n//            if( _scaleIndex != newValue) {\n//              _scaleIndex = newValue;\n//              MapScale    = Scales[ScaleIndex];\n//              Hexgrid     = IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale)) \n//                                         : new Hexgrid(Model.GridSize.Scale(MapScale)); \n//              ScaleChange.Raise(this, EventArgs.Empty);\n//            }\n//          } \n//    } int _scaleIndex;\n//    #endregion\n\n//    /// <summary>TODO</summary>\n//    public void SetScales (IList<float> scales) {\n////      if (scales == null) throw new ArgumentNullException(\"scales\");\n//      Scales = new ReadOnlyCollection<float>(scales);\n//    }\n//    #region Events\n\n//    /// <summary>Announces that the mouse is now over a new hex.</summary>\n//    void HotspotHexChange(object sender, HexEventArgs e) {\n//      if (e==null) throw new ArgumentNullException(\"e\");\n//      if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n//    }\n\n////    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n////    public event EventHandler<HexEventArgs> GoalHexChange;\n////    /// <summary>Announces that the Path-Start hex has changed.</summary>\n////    public event EventHandler<HexEventArgs> StartHexChange;\n////    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n////    public event EventHandler<HexEventArgs> MouseAltClick;\n////    /// <summary>Announces a mouse right-click. </summary>\n////    public event EventHandler<HexEventArgs> MouseRightClick;\n//    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n//    public event EventHandler<EventArgs>    ScaleChange;\n//    #endregion\n\n//    #region Grid Coordinates\n//    /// <inheritdoc/>\n//    public Hexgrid    Hexgrid        { get; set; }\n//    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n//    public SizeF      GridSizeF      { get { return Model.GridSize.Scale(MapScale); } }\n\n//    //CoordsRectangle  GetClipInHexes(PointF point, SizeF size) {\n//    //  return Model.GetClipInHexes(point, size);\n//    //}\n\n//    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n//    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n//    /// <returns>Pixel coordinates in Client reference frame.</returns>\n//    public HexPoint  HexCenterPoint(HexCoords coordsNewULHex) {\n//      return Hexgrid.HexCenterPoint(coordsNewULHex);\n//    }\n//    #endregion\n//  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/IMapDisplayWpf.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows;\nusing System.Windows.Media;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using HexRectF  = System.Drawing.RectangleF;\n\n  /// <summary>(Technology-dependent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplayWpf : IMapDisplay {\n\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"point\">Upper-left corner in pixels of the clipping region.</param>\n    /// <param name=\"size\">Width and height of the clipping region in pixels.</param>\n    CoordsRectangle GetClipInHexes(Point point, Size size);\n    /// <summary>Gets the CoordsRectangle description of the clipping region.</summary>\n    /// <param name=\"visibleClipBounds\">Rectangular extent in pixels of the clipping region.</param>\n    CoordsRectangle GetClipInHexes(HexRectF visibleClipBounds);\n\n    /// <summary>Paint the top layer of the display, graphics that changes frequently between refreshes.</summary>\n    /// <param name=\"dc\">Graphics object for the canvas being painted.</param>\n    void  PaintHighlight(DrawingContext graphics);\n\n    /// <summary>Paint the base layer of the display, graphics that changes rarely between refreshes.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>For each visible hex: perform <c>paintAction</c> and then draw its hexgrid outline.</remarks>\n    void  PaintMap(DrawingContext graphics);\n    /// <summary>Paint the intermediate layer of the display, graphics that changes infrequently between refreshes.</summary>\n    /// <param name=\"dc\">Type: Graphics - Object representing the canvas being painted.</param>\n    void  PaintUnits(DrawingContext graphics);\n  }\n}\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  using HexPoint  = System.Drawing.Point;\n  using HexPointF = System.Drawing.PointF;\n  using HexSize   = System.Drawing.Size;\n  using HexSizeF  = System.Drawing.SizeF;\n  using HexRectF  = System.Drawing.RectangleF;\n\n  using WpfPoint  = System.Windows.Point;\n  using WpfSize   = System.Windows.Size;\n\n  public static partial class PointExtensions {\n    public static HexPoint ToHexPoint(this WpfPoint @this) {\n      return new HexPoint((int)@this.X, (int)@this.Y);\n    }\n    public static WpfPoint ToWpfPoint(this HexPoint @this) {\n      return new WpfPoint(@this.X, @this.Y);\n    }\n    public static WpfPoint ToWpfPoint(this HexPointF @this) {\n      return new WpfPoint(@this.X,@this.Y);\n    }\n  }\n\n  public static partial class SizeExtensions {\n    public static HexSize ToHexSize(this WpfSize @this) {\n      return new HexSize((int)@this.Width, (int)@this.Height);\n    }\n    public static WpfSize ToWpfSize(this HexSize @this) {\n      return new WpfSize(@this.Width, @this.Height);\n    }\n    public static WpfSize ToWpfSize(this HexSizeF @this) {\n      return new WpfSize(@this.Width, @this.Height);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridScrollViewer\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridScrollViewer\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4ab4311c-e92f-4ff6-93c5-e08005d414b6\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/TiltAwareScrollViewer.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Automation.Peers;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nusing WpfInput = System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  /// <summary>Interaction logic for HexgridScrollableViewer.xaml</summary>\n  public partial class TiltAwareScrollViewer : ScrollViewer {\n    /// <summary>TODO</summary>\n    public TiltAwareScrollViewer() : base() {\n//      InitializeComponent();\n    }\n\n    #region Mouse Tilt Wheel (MouseHWheel) event implementation\n    /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n    public event EventHandler<MouseEventArgs> MouseHWheel;\n\n    private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n\n    /// <summary>Scrolls horizontally and raises the MouseHWheel event</summary>\n    /// <param name=\"e\"></param>\n    protected virtual void OnMouseHWheel(MouseWheelEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      if (this.CanContentScroll) {\n        ScrollToHorizontalOffset(HorizontalOffset + e.Delta);\n\n        if (MouseHWheel != null) MouseHWheel.Raise(this, e);\n      }\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollViewer/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridScrollViewer {\n  /// <summary>TODO</summary>\n  public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n    /// <summary>TODO</summary>\n    protected ViewModelBase(string displayName) { DisplayName = displayName; }\n\n    /// <summary>TODO</summary>\n    public            string DisplayName                { get; private set; }\n    /// <summary>TODO</summary>\n    protected virtual bool   ThrowOnInvalidPropertyName { get { return true; } }\n\n    /// <summary>Raised when a property on this object has a new value.</summary>\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    /// <summary>Raises this object's PropertyChanged event.</summary>\n    /// <param name=\"propertyName\">The property that has a new value.</param>\n    protected virtual void OnPropertyChanged(string propertyName) {\n      this.VerifyPropertyName(propertyName);\n      this.PropertyChanged.Raise(this, new PropertyChangedEventArgs(propertyName));\n    }\n\n    /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n    [Conditional(\"DEBUG\"), DebuggerStepThrough]\n    public void VerifyPropertyName(string propertyName) {\n      if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n        string msg = \"Invalid property name: \" + propertyName;\n        if (this.ThrowOnInvalidPropertyName)       throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n        Debug.Fail(msg);\n      }\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n        }\n        _isDisposed = true;\n      }\n    }\n    /// <summary>Finalize this instance.</summary>\n    ~ViewModelBase() { Dispose(false); }\n    #endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class CommandViewModel : ViewModelBase { \n    /// <summary>TODO</summary>\n    public CommandViewModel(string displayName, ICommand command) : base(displayName) { \n      if (command == null) throw new ArgumentNullException(\"command\"); \n      this.Command = command; \n    } \n    /// <summary>TODO</summary>\n    public ICommand Command { get; private set; } \n  }\n\n  /// <summary>TODO</summary>\n  public class RelayCommand : ICommand { \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute, Predicate<object> canExecute) { \n      if (execute == null) throw new ArgumentNullException(\"execute\");\n      if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n      _execute    = execute; \n      _canExecute = canExecute;\n    } \n  \n    /// <summary>TODO</summary>\n    [DebuggerStepThrough] \n    public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n    /// <summary>TODO</summary>\n    public event EventHandler CanExecuteChanged { \n      add    { CommandManager.RequerySuggested += value; } \n      remove { CommandManager.RequerySuggested -= value; } \n    }\n  \n    /// <summary>TODO</summary>\n    public void Execute(object parameter) { _execute(parameter); }\n\n    readonly Action<object>    _execute; \n    readonly Predicate<object> _canExecute; \n  }\n\n  ///// <summary>TODO</summary>\n  //public class RelayCommand<T> : ICommand { \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n  //    if (execute == null) throw new ArgumentNullException(\"execute\");\n  //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n  //    _execute    = execute; \n  //    _canExecute = canExecute;\n  //  } \n  \n  //  /// <summary>TODO</summary>\n  //  [DebuggerStepThrough] \n  //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n  //  /// <summary>TODO</summary>\n  //  public event EventHandler CanExecuteChanged { \n  //    add    { CommandManager.RequerySuggested += value; } \n  //    remove { CommandManager.RequerySuggested -= value; } \n  //  }\n  \n  //  /// <summary>TODO</summary>\n  //  public void Execute(T parameter) { _execute(parameter); }\n\n  //  readonly Action<T>    _execute; \n  //  readonly Predicate<object> _canExecute; \n  //}\n\n  /// <summary>TODO</summary>\n  public abstract class WorkspaceViewModel : ViewModelBase {\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel(string displayName) : base (displayName) {\n      _closeCommand = new RelayCommand(param => this.OnRequestClose());\n    }\n\n    /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n    public virtual ICommand CloseCommand { get { return _closeCommand; } } ICommand _closeCommand;\n\n    /// <summary>Raised when this workspace should be removed from the UI.</summary>\n    public event EventHandler RequestClose;\n\n    void OnRequestClose()  { RequestClose.Raise(this,EventArgs.Empty); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/BufferedHexgridScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class BufferedHexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2213:DisposableFieldsShouldBeDisposed\", MessageId = \"_bufferedGraphicsContext\",\n      Justification=\"Not owned by this objcet.\")]\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/BufferedHexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public partial class BufferedHexgridScrollable : HexgridScrollable {\n    /// <summary>TODO</summary>\n    public BufferedHexgridScrollable() {\n      InitializeComponent();\n    }\n    /// <summary>Creates a new instance of HexgridPanel.</summary>\n    public BufferedHexgridScrollable(IContainer container) {\n      if (container==null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public override void SetMapDirty() { \n      if (MapBuffer!=null) PaintBuffer(ScaleRectangle(base.ClientRectangle, MapScale)); \n      base.SetMapDirty();; \n    }\n\n    /// <summary>TODO</summary>\n    protected override void RenderMap(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush,ClientRectangle);\n      g.ScaleTransform(1.0f/MapScale, 1.0f/MapScale);\n      MapBuffer.Render(g, Point.Empty, ClientSize);\n    }\n\n     /// <summary>TODO</summary>\n    static Rectangle ScaleRectangle(Rectangle rectangle, float scale) {\n      return new Rectangle(new Point(new SizeF(rectangle.Location.Scale(scale)).ToSize()), \n                                               rectangle.Size.Scale(scale).ToSize());\n    }\n   #region BufferedGraphics\n    /// <summary>Gets or sets backing buffer for the map underlay.</summary>\n    protected BufferedGraphics MapBuffer { get; private set; }\n    /// <summary>Gets or sets spare buffer for the map underlay.</summary>\n    protected BufferedGraphics MapSpare  { get; private set; }\n\n    /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n    protected virtual void PaintBuffer(Rectangle clipBounds) {\n      if (DataContext.Model==null  ||  MapBuffer==null) return;\n\n      var g = MapBuffer.Graphics;\n      if (g != null) {\n        var state = g.Save();\n\n        g.Clip = new Region(clipBounds);\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n        var scroll = DataContext.Hexgrid.GetScrollPosition(AutoScrollPosition);\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.TranslateTransform(Margin.Left,Margin.Top);\n        g.ScaleTransform(MapScale,MapScale);\n        TraceFlags.PaintDetail.Trace(\"{0}.PaintBuffer - VisibleClipBounds: ({1})\", Name, g.VisibleClipBounds);\n\n        using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, g.VisibleClipBounds);\n        DataContext.Model.PaintMap(g);\n\n        g.Restore(state);\n      }\n    }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      if(Application.OpenForms.Count > 0 \n      && Application.OpenForms[0].WindowState != FormWindowState.Minimized) ResizeBuffer();\n      base.OnResize(e);\n    }\n\n    /// <inheritdoc/>\n    protected override void OnScaleChange(EventArgs e) {\n      ResizeBuffer();\n      base.OnScaleChange(e);\n    }\n\n    BufferedGraphicsContext _bufferedGraphicsContext = new BufferedGraphicsContext();\n\n    /// <inheritdoc/>\n    protected override void OnScroll(ScrollEventArgs se) {\n      if (se==null) throw new ArgumentNullException(\"se\");\n      var clip = (se.ScrollOrientation == ScrollOrientation.HorizontalScroll)\n               ? HorizontalScrollBufferedGraphics(se.NewValue - se.OldValue)\n               : VerticalScrollBufferedGraphics(se.NewValue - se.OldValue);\n\n      if (clip.Size != Size.Empty) PaintBuffer(clip);\n      base.OnScroll(se);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"delta\"></param>\n    /// <returns>Clipping rectangle requiring re-painting.</returns>\n    protected virtual Rectangle HorizontalScrollBufferedGraphics(int delta) {\n      if (delta == 0)    return Rectangle.Empty;\n\n//      Render(MapBuffer, MapSpare.Graphics, new Point(-delta,0));\n      MapBuffer.Render(MapSpare.Graphics, new Point(-delta,0), ClientSize);\n      var temp = MapBuffer; MapBuffer = MapSpare; MapSpare = temp;\n      if (delta < 0) \n        return new Rectangle(0, 0, -delta,ClientSize.Height);\n      else\n        return new Rectangle(ClientSize.Width-delta,0, delta,ClientSize.Height);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"delta\"></param>\n    /// <returns>Clipping rectangle requiring re-painting.</returns>\n    protected virtual Rectangle VerticalScrollBufferedGraphics(int delta) {\n      if (delta == 0)    return Rectangle.Empty;\n\n//      Render(MapBuffer, MapSpare.Graphics, new Point(0,-delta));\n      MapBuffer.Render(MapSpare.Graphics, new Point(0,-delta), ClientSize);\n      var temp = MapBuffer; MapBuffer = MapSpare; MapSpare = temp;\n      if (delta < 0) \n        return new Rectangle(0, 0, ClientSize.Width,-delta);\n      else\n        return new Rectangle(0,ClientSize.Height-delta, ClientSize.Width,delta);\n    }\n\n    /// <summary>TODO</summary>\n    void ResizeBuffer() {\n      var rectangle = new Rectangle(Point.Empty, ClientSize);\n      if (ClientSize != _bufferedGraphicsContext.MaximumBuffer) {\n        _bufferedGraphicsContext.MaximumBuffer = ClientSize;\n\n        if (MapBuffer != null) MapBuffer.Dispose();\n        MapBuffer = _bufferedGraphicsContext.Allocate(this.CreateGraphics(), rectangle);\n\n        if (MapSpare != null) MapSpare.Dispose();\n        MapSpare  = _bufferedGraphicsContext.Allocate(this.CreateGraphics(), rectangle);\n      }\n      PaintBuffer(rectangle);\n    }\n    #endregion\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class BufferedGraphicsExtensions {\n    /// <summary>TODO</summary>\n    /// <param name=\"buffer\"></param>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    /// <param name=\"virtualSize\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public static void Render(this BufferedGraphics buffer, Graphics target, Point scrollPosition, Size virtualSize) {\n      if (target != null) {\n        IntPtr targetDC = target.GetHdc();\n \n        try { RenderInternal(new HandleRef(target, targetDC), buffer, scrollPosition, virtualSize); } \n        finally { target.ReleaseHdcInternal(targetDC);  }\n      }\n    }\n    /// <summary>TODO</summary>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n    private static void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition, Size virtualSize) {\n      const int  rop = GdiRasterOps.SrcCopy;\n\n      var sourceDC    = buffer.Graphics.GetHdc(); \n//      var virtualSize = ClientSize;\n      try { \n        NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                          virtualSize.Width, virtualSize.Height, \n                            new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n      } \n      finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n    } \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/EmptyBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\n\n\nnamespace PGNapoleonics.HexgridPanel {\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyBoard : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public EmptyBoard() : base(new Size(1,1), new Size(26,30), (mb,c) => new EmptyGridHex(mb,c)) {\n      FovRadius = 20;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyGridHex : MapGridHex {\n    /// <summary>TODO</summary>\n    public EmptyGridHex(HexBoard<MapGridHex> board, HexCoords coords) : base(board, coords) {}\n\n    /// <summary>TODO</summary>\n    public override int ElevationASL  { get { return 10 * Elevation; } }\n    /// <summary>TODO</summary>\n    public override int HeightTerrain { get { return ElevationASL;   } }\n    /// <summary>TODO</summary>\n    public override int StepCost(Hexside direction) { return -1; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary></summary>\n  public class HexEventArgs : MouseEventArgs {\n    /// <summary>TODO</summary>\n    public HexCoords  Coords       { get; private set; }\n\n    /// <summary>TODO</summary>\n    public bool     Alt          { get { return ModifierKeys.HasFlag(Keys.Alt);  } }\n    /// <summary>TODO</summary>\n    public bool     Control      { get { return ModifierKeys.HasFlag(Keys.Control); } }\n    /// <summary>TODO</summary>\n    public bool     Shift        { get { return ModifierKeys.HasFlag(Keys.Shift); } }\n\n    /// <summary>TODO</summary>\n    public Keys     ModifierKeys { get; private set; }\n\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0)) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, Keys modifierKeys) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0), modifierKeys) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, MouseEventArgs e) \n      : this(coords, e, Keys.None) {}\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1062:Validate arguments of public methods\", MessageId = \"1\")]\n    public HexEventArgs(HexCoords coords, MouseEventArgs e, Keys modifierKeys)\n      : base(e.Button,e.Clicks,e.X,e.Y,e.Delta) {\n      Coords       = coords;\n      ModifierKeys = modifierKeys;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/HexgridScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class HexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n//        _bufferedGraphicsContext.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/HexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing WpfInput = System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class TiltAwareScrollableControl : ScrollableControl {\n    /// <summary>TODO</summary>\n    public TiltAwareScrollableControl() {\n      this.SetStyle(ControlStyles.Selectable, true);\n      this.TabStop = true;\n    }\n\n    #region SelectablePanel implementation\n    /// <inheritdoc/>\n    protected override void OnMouseDown(MouseEventArgs e) {\n      this.Focus();\n      base.OnMouseDown(e);\n    }\n    /// <inheritdoc/>\n    protected override bool IsInputKey(Keys keyData) {\n      if (keyData == Keys.Up || keyData == Keys.Down) return true;\n      if (keyData == Keys.Left || keyData == Keys.Right) return true;\n      return base.IsInputKey(keyData);\n    }\n    /// <inheritdoc/>\n    protected override void OnEnter(EventArgs e) {\n      this.Invalidate();\n      base.OnEnter(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnLeave(EventArgs e) {\n      this.Invalidate();\n      base.OnLeave(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnPaint(e);\n      if (this.Focused) {\n        var rc = this.ClientRectangle;\n        rc.Inflate(-2, -2);\n        ControlPaint.DrawFocusRectangle(e.Graphics, rc);\n      }\n    }\n    #endregion\n\n    #region Mouse Tilt Wheel (MouseHWheel) event implementation\n    /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n    public event EventHandler<MouseEventArgs> MouseHWheel;\n\n    private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n\n    /// <summary>TODO</summary>\n    protected override void WndProc(ref Message m) {\n      if (!IsDisposed  &&  m.HWnd == this.Handle) {\n        switch ((WM)m.Msg) {\n          case WM.MOUSEHWHEEL: OnMouseHWheel(CreateMouseEventArgs(m));\n            m.Result = (IntPtr)0;\n            break;\n          default: break;\n        }\n      }\n      base.WndProc(ref m);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"e\"></param>\n    protected virtual void OnMouseHWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      if (!AutoScroll) return;\n\n      _wheelHPos += e.Delta;\n      while (_wheelHPos > MouseWheelStep) {\n        ScrollHorizontal(MouseWheelStep);\n        _wheelHPos -= MouseWheelStep;\n      }\n      while (_wheelHPos < -MouseWheelStep) {\n        ScrollHorizontal(-MouseWheelStep);\n        _wheelHPos += MouseWheelStep;\n      }\n\n      if (MouseHWheel != null) MouseHWheel.Raise(this, e);\n    }\n\n    /// <summary>TODO</summary>\n    private void ScrollHorizontal(int delta) {\n      AutoScrollPosition = new Point(\n        -AutoScrollPosition.X + delta,\n        -AutoScrollPosition.Y);\n    }\n\n    /// <summary>TODO</summary>\n    private static int MouseWheelStep {\n      get {\n        return SystemInformation.MouseWheelScrollDelta\n             / SystemInformation.MouseWheelScrollLines;\n      }\n    }\n\n    /// <summary>TODO</summary>\n    private static MouseEventArgs CreateMouseEventArgs(Message m) {\n      return new MouseEventArgs(\n          (MouseButtons)NativeMethods.LOWORD(m.WParam),\n          0,\n          NativeMethods.LOWORD(m.LParam),\n          NativeMethods.HIWORD(m.LParam),\n          (Int16)NativeMethods.HIWORD(m.WParam)\n        );\n    }\n    #endregion\n\n    #region Panel Scroll extensions\n    /// <summary>TODO</summary>\n    public void ScrollVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.HasFlag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n\n    /// <summary>Service routine to execute a Panel scroll.</summary>\n    [Obsolete(\"Use ScrollPanelVertical or ScrollPanelHorizontal instead.\")]\n    public void ScrollPanel(ScrollEventType type, ScrollOrientation orientation, int sign) {\n      if (orientation == ScrollOrientation.VerticalScroll)\n        ScrollVertical(type, sign);\n      else\n        ScrollHorizontal(type, sign);\n    }\n    #endregion\n  }\n\n  /// <summary>Sub-class implementation of a <b>WinForms</b> Panel with integrated <see cref=\"Hexgrid\"/> support.</summary>\n  [DockingAttribute(DockingBehavior.AutoDock)]\n  public partial class HexgridScrollable : TiltAwareScrollableControl, IHexgridHost, ISupportInitialize {\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    protected HexgridScrollable() {\n      InitializeComponent();\n    }\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    public HexgridScrollable(IContainer container) {\n      if (container==null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n      RefreshCmd  = new RelayCommand(o => { if (o != null) { SetMapDirty(); }  Refresh(); } );\n      DataContext = new HexgridViewModel(this);\n      SetScales (new float[] {1.00F});\n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n    }\n    #endregion\n\n    #region Events\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    public event EventHandler<HexEventArgs> HotspotHexChange;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseAltClick;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseCtlClick;\n    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseLeftClick;\n    /// <summary>Announces a mouse right-click. </summary>\n    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public HexgridViewModel        DataContext       { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public         SizeF           GridSizeF         { get { return DataContext.Model.GridSize.Scale(MapScale); } }\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public         HexCoords       HotspotHex        { get { return DataContext.HotspotHex; } }\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsAltKeyDown      { get { return ModifierKeys.HasFlag(Keys.Alt); } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsCtlKeyDown      { get { return ModifierKeys.HasFlag(Keys.Control); } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsShiftKeyDown    { get { return ModifierKeys.HasFlag(Keys.Shift); } }\n    /// <summary>TODO</summary>\n    public         bool            IsMapDirty        { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public         bool            IsUnitsDirty      { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public         bool            IsTransposed      { \n      get { return DataContext.IsTransposed; }\n      set { DataContext.IsTransposed = value;  SetScrollLimits(DataContext.Model); }\n    }\n    /// <inheritdoc/>\n    public         Size            MapSizePixels     { get { return DataContext.Model.MapSizePixels; } } // + MapMargin.Scale(2);} }\n    /// <summary>Current scaling factor for map display.</summary>\n    public         float           MapScale          { get { return DataContext.MapScale; } }\n//    /// <summary>MapBoard hosting this panel.</summary>\n//    public         IMapDisplay     Model             { get { return DataContext.Model; } }\n    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    public         HexCoords       PanelCenterHex    { \n      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ); }\n    }\n    /// <summary>TODO</summary>\n    public WpfInput.ICommand       RefreshCmd        { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int             ScaleIndex        { \n      get { return DataContext.ScaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(DataContext.Scales.Count-1, value));\n            var CenterHex           = PanelCenterHex;\n            DataContext.ScaleIndex  = newValue; \n\n//            SetScrollLimits(DataContext.Model);\n            SetScroll(CenterHex);\n            OnScaleChange(EventArgs.Empty); \n          } \n    }\n    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    public virtual CoordsRectangle VisibleRectangle  {\n      get { return GetClipCells( AutoScrollPosition.Scale(-1.0F/MapScale), \n                                         ClientSize.Scale( 1.0F/MapScale) );\n      }\n    }\n    #endregion\n\n    #region Methods\n    /// <summary>TODO</summary>\n    public         void CenterOnHex(HexCoords coords) {\n      AutoScrollPosition = ScrollPositionToCenterOnHex(coords);\n      IsMapDirty = true;\n      Invalidate();\n    }\n\n    /// <summary>TODO</summary>\n        CoordsRectangle GetClipCells(PointF point, SizeF size) { return DataContext.Model.GetClipCells(point, size); }\n    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public    HexCoords GetHexCoords(Point point) {\n      return DataContext.Hexgrid.GetHexCoords(point, new Size(AutoScrollPosition));\n    }\n\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public virtual void SetMapDirty() { Invalidate(ClientRectangle); }\n\n    /// <summary>TODO</summary>\n    public         void SetModel(IMapDisplay model) {\n      SetScrollLimits(DataContext.Model);   \n      DataContext.SetModel(model);\n      SetMapDirty();\n    }\n\n    /// <summary>TODO</summary>\n    public         void SetPanelSize() {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n      SetScroll(PanelCenterHex);\n    }\n\n    /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n    public virtual void SetScroll(HexCoords newCenterHex) {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n      SetScrollLimits(DataContext.Model);\n\n      CenterOnHex(newCenterHex);\n    }\n\n    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    public virtual void SetScrollLimits(IMapDisplay model) {\n      if (model == null  ||  !AutoScroll) return;\n      var smallChange              = Size.Ceiling(model.GridSize.Scale(MapScale));\n      HorizontalScroll.SmallChange = smallChange.Width;\n      VerticalScroll.SmallChange   = smallChange.Height;\n\n      var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n      HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n      VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n      var size                     = DataContext.Hexgrid.GetSize(MapSizePixels,MapScale)\n                                   + Margin.Size;\n      if (AutoScrollMinSize != size) {\n        AutoScrollMinSize          = size;\n        HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, Margin.Horizontal \n                                   + size.Width  - ClientSize.Width));\n        VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, Margin.Vertical \n                                   + size.Height - ClientSize.Height));\n        Invalidate();\n      }\n    }\n    #endregion\n\n    #region Grid Coordinates\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(HexCoords coordsNewULHex) {\n      return DataContext.Hexgrid.HexCenterPoint(coordsNewULHex);\n    }\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    protected Point ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n      return DataContext.Hexgrid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n    }\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n\n      if(IsHandleCreated) { \n        var g      = e.Graphics;\n        if (DesignMode) { g.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n        g.Clip = new Region(e.ClipRectangle);\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n\n        var scroll = DataContext.Hexgrid.GetScrollPosition(AutoScrollPosition);\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.TranslateTransform(Margin.Left,Margin.Top);\n        g.ScaleTransform(MapScale,MapScale);\n        TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, g.VisibleClipBounds);\n\n        var state = g.Save();\n        RenderMap(g);\n\n        g.Restore(state); state = g.Save();\n        RenderUnits(g);\n\n        g.Restore(state); state = g.Save();\n        RenderHighlight(g);\n\n        g.Restore(state);\n      }\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderMap(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, g.VisibleClipBounds);\n      DataContext.Model.PaintMap(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderUnits(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintUnits(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderHighlight(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintHighlight(g);\n    }\n\n    /// <summary>TODO</summary>\n    static protected readonly Matrix TransposeMatrix = new Matrix(0F,1F, 1F,0F, 0F,0F);\n    #endregion\n\n    /// <summary>TODO</summary>\n    protected override void OnMarginChanged(EventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnMarginChanged(e);\n      DataContext.Margin = Margin;\n    }\n\n    #region Mouse event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseClick(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      TraceFlags.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n                                      Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n      var coords    = GetHexCoords(e.Location);\n      var eventArgs = new HexEventArgs(coords, e, ModifierKeys);\n\n           if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n      else if (e.Button == MouseButtons.Right)    this.OnMouseRightClick(eventArgs);\n      else if (IsAltKeyDown  && !IsCtlKeyDown)    this.OnMouseAltClick(eventArgs);\n      else if (IsCtlKeyDown)                      this.OnMouseCtlClick(eventArgs);\n      else                                        this.OnMouseLeftClick(eventArgs);\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseMove(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n      base.OnMouseMove(e);\n    }\n\n    /// <summary>Raise the MouseAltClick event.</summary>\n    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick.Raise(this,e); }\n    /// <summary>Raise the MouseCtlClick event.</summary>\n    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.GoalHex = e.Coords;\n      MouseCtlClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseLeftClick event.</summary>\n    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.StartHex = e.Coords;\n      MouseLeftClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseRightClick event.</summary>\n    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this,e); }\n   /// <summary>Raise the HotspotHexChange event.</summary>\n    protected virtual void OnHotspotHexChange(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.HotspotHex = e.Coords;\n      HotspotHexChange.Raise(this,e);\n      Refresh();\n    }\n\n    /// <summary>Raise the ScaleChange event.</summary>\n    protected virtual void OnScaleChange(EventArgs e) {\n      SetMapDirty();\n      OnResize(e);\n      Invalidate();\n      ScaleChange.Raise(this, e);\n    }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      SetScrollLimits(DataContext.Model);\n      base.OnResize(e);\n    }\n    #endregion\n\n    #region MouseWheel & Scroll event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      TraceFlags.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Name, e.ToString());\n\n      if (Control.ModifierKeys.HasFlag(Keys.Control)) ScaleIndex += Math.Sign(e.Delta);\n      else if (IsShiftKeyDown)                        base.OnMouseHWheel(e);\n      else                                            base.OnMouseWheel(e);\n    }\n\n    /// <summary>TODO</summary>\n    public void ScrollPanelVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollPanelHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.HasFlag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n    #endregion\n\n    /// <summary>Array of supported map scales  as IList&lt;float&gt;.</summary>\n    public ReadOnlyCollection<float>     Scales        { get; private set; }\n    public void SetScales (IList<float> scales) { Scales = new ReadOnlyCollection<float>(scales); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/HexgridScrollable.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{224E881A-C3E9-42D5-99A9-5D901529E1CE}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridPanel</RootNamespace>\n    <AssemblyName>HexgridScrollable</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Release\\</OutputPath>\n    <DefineConstants>NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>..\\bin\\HexgridPanel\\bin\\Release\\HexgridPanel.XML</DocumentationFile>\n    <NoWarn>1607</NoWarn>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1607,1587</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BufferedHexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"BufferedHexgridScrollable.Designer.cs\">\n      <DependentUpon>BufferedHexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"EmptyBoard.cs\" />\n    <Compile Include=\"HexEventArgs.cs\" />\n    <Compile Include=\"HexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridScrollable.Designer.cs\">\n      <DependentUpon>HexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridViewModel.cs\" />\n    <Compile Include=\"LayeredScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"LayeredScrollable.Designer.cs\">\n      <DependentUpon>LayeredScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapDisplay.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ViewModelBase.cs\" />\n    <Compile Include=\"WinForms\\ExceptionDialog.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.Designer.cs\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\GdiRasterOps.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\ThreadExceptionHandler.cs\" />\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n    <Service Include=\"{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.en-US.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridScrollable/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class HexgridViewModel : IHexgridHost {\n    /// <summary>TODO</summary>\n    public HexgridViewModel(PGNapoleonics.HexgridPanel.HexgridScrollable panel) {\n      HotspotHex    = HexCoords.EmptyUser;\n\n      Panel         = panel;\n\n      Panel.HotspotHexChange  += HotspotHexChange;\n      Panel.MarginChanged     += MarginChanged;\n//      Panel.MouseAltClick     += MouseAltClick;\n//      Panel.MouseCtlClick     += GoalHexChange;\n//      Panel.MouseRightClick   += MouseRightClick;\n//      Panel.ScaleChange       += ScaleChange;\n\n      Scales        = new List<float>() {1.000F}.AsReadOnly();\n      SetModel(new EmptyBoard());\n      Hexgrid       = GetHexgrid();\n    }\n\n    HexgridScrollable Panel { get; set; }\n\n    ///// <summary>Return new AutoScrollPosition for applied muse-wheel scroll.</summary>\n    //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n    //  Func<int,Point> newAutoScroll)\n    //{\n    //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n    //  var steps = (delta+remainder) \n    //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  remainder = (delta+remainder) \n    //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  return newAutoScroll(scroll.SmallChange * steps);\n    //}\n    ///// <summary>TODO</summary>\n    //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n    //  return new ScrollEventArgs(\n    //    ScrollEventType.ThumbTrack,\n    //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n    //    isHorizontal ? -newScroll.X : -newScroll.Y,\n    //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n    //  );\n    //}\n\n    /// <summary>TODO</summary>\n    public void SetModel(IMapDisplay model) {\n      Model = model;   \n    }\n\n    Hexgrid GetHexgrid() { \n      var margin          = Margin.OffsetSize();\n      return IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale),margin) \n                          : new Hexgrid(Model.GridSize.Scale(MapScale),margin);     \n    }\n\n    #region Properties\n    ///// <summary>TODO</summary>\n    //public WpfInput.ICommand RefreshCmd { \n    //  get { return _refreshCmd; } private set {_refreshCmd = value; } \n    //} WpfInput.ICommand _refreshCmd;\n\n    /// <summary>MapBoard hosting this panel.</summary>\n    public IMapDisplay Model           { get; private set; }\n\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public HexCoords   HotspotHex      { get; set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsAltKeyDown   { get { return HexgridScrollable.IsAltKeyDown; } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsCtlKeyDown   { get { return HexgridScrollable.IsCtlKeyDown; } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsShiftKeyDown { get { return HexgridScrollable.IsShiftKeyDown; } }\n\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public bool        IsTransposed    { \n      get { return _isTransposed; }\n      set { _isTransposed = value;  \n            Hexgrid = GetHexgrid();\n            if (Panel.IsHandleCreated) Panel.SetScrollLimits(Model);   \n          }\n    } bool _isTransposed;\n\n    /// <inheritdoc/>\n    public Size        MapSizePixels   { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public float       MapScale      { \n      get { return Model.MapScale; } \n      private set { Model.MapScale = value; } \n    }\n\n    /// <inheritdoc/>\n    public Padding  Margin     { \n      get { return _margin; } \n      set { _margin = value; Hexgrid.Margin = new Size(_margin.Left, _margin.Top); }\n    } Padding _margin;\n\n    /// <summary>TODO</summary>\n    public    bool   IsMapDirty   { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public    bool   IsUnitsDirty { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Panel.Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n\n    /// <summary>Array of supported map scales  as IList&lt;float&gt;.</summary>\n    public ReadOnlyCollection<float> Scales        { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int ScaleIndex    { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue;\n              MapScale    = Scales[ScaleIndex];\n              Hexgrid     = IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale)) \n                                         : new Hexgrid(Model.GridSize.Scale(MapScale)); \n              ScaleChange.Raise(this, EventArgs.Empty);\n            }\n          } \n    } int _scaleIndex;\n    #endregion\n\n    /// <summary>TODO</summary>\n    public void SetScales (IList<float> scales) {\n//      if (scales == null) throw new ArgumentNullException(\"scales\");\n      Scales = new ReadOnlyCollection<float>(scales);\n    }\n    #region Events\n    /// <summary>TODO</summary>\n    void MarginChanged(object sender, EventArgs e) { Margin = Panel.Margin; }\n\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    void HotspotHexChange(object sender, HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n    }\n\n//    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> GoalHexChange;\n//    /// <summary>Announces that the Path-Start hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> StartHexChange;\n//    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseAltClick;\n//    /// <summary>Announces a mouse right-click. </summary>\n//    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Grid Coordinates\n    /// <inheritdoc/>\n    public Hexgrid    Hexgrid        { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public SizeF      GridSizeF      { get { return Model.GridSize.Scale(MapScale); } }\n\n    //CoordsRectangle  GetClipCells(PointF point, SizeF size) {\n    //  return Model.GetClipCells(point, size);\n    //}\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point     HexCenterPoint(HexCoords coordsNewULHex) {\n      return Hexgrid.HexCenterPoint(coordsNewULHex);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/LayeredScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class LayeredScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/LayeredScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using PaintAction = Action<Graphics>;\n\n    /// <summary>TODO</summary>\n  public partial class LayeredScrollable : ScrollableControl, ISupportInitialize { //, IMessageFilter {\n    /// <summary>TODO</summary>\n    public LayeredScrollable() {\n      InitializeComponent();\n    }\n\n    /// <summary>TODO</summary>\n    public LayeredScrollable(IContainer container) {\n      if (container == null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n//\t\t\tApplication.AddMessageFilter(this);\n\n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n\n      Layers = new LayerCollection(this.CreateGraphics(), DisplayRectangle.Size);\n    }\n    #endregion\n\n    /// <summary>TODO</summary>\n    public    LayerCollection   Layers    { get; private set; }\n \n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      Layers.Resize(ClientRectangle);\n      base.OnResize(e);\n    }\n\n    //#region IMessageFilter implementation\n    ///// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    ///// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    ///// that with focus) with adjusted delta.\n    ///// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    ///// Dont forget to add this to constructor:\n    ///// \t\t\tApplication.AddMessageFilter(this);\n    ///// </remarks>\n    ///// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    ///// <returns>Success (true) or failure (false) to OS.</returns>\n    //[System.Security.Permissions.PermissionSetAttribute(\n    //  System.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n    //public bool PreFilterMessage(ref Message m) {\n    //  if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n    //  var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n    //  var ctl\t  = Control.FromHandle(hWnd);\n    //  if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n    //    switch((WM)m.Msg) {\n    //      case WM.MOUSEHWHEEL:\n    //      case WM.MOUSEWHEEL:\n    //        DebugTracing.Trace(TraceFlags.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, ((WM)m.Msg)); \n    //        return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n    //      default: break;\n    //    }\n    //  }\n    //  return false;\n    //}\n    //#endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class LayerCollection : ReadOnlyCollection<Layer> {\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size) : this(g, size, new List<PaintAction>()) {}\n\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size, IList<PaintAction> list) : base(new List<Layer>()) {\n      Context   = new BufferedGraphicsContext();\n      Graphics  = g;\n      Size      = size;\n\n      foreach (var action in list) this.AddLayer(action);\n    }\n\n    /// <summary>TODO</summary>\n    public void AddLayer(PaintAction paintAction) { Items.Add(NewLayer(paintAction)); }\n\n    /// <summary>TODO</summary>\n    public void Render(Graphics g, Point scrollPosition) {\n      for(var i=0; i < this.Count; i++) this[i].Render(g, scrollPosition); \n    }\n\n    /// <summary>TODO</summary>\n    public void Resize (Rectangle rectangle) {\n      Size = rectangle.Size;\n      Context.MaximumBuffer = Size;\n      foreach(var layer in this) {\n        layer.Resize(Context.Allocate(Graphics, rectangle));\n      }\n    }\n\n    BufferedGraphicsContext Context   { get; set; }\n    Graphics                Graphics  { get; set; }\n    Size                    Size      { get; set; }\n\n    /// <summary>TODO</summary>\n    Layer            NewLayer(PaintAction paintAction) {\n      return new Layer(\n        Context.Allocate(Graphics, new Rectangle(Point.Empty,Size)), \n        paintAction\n      );\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (Context  != null) Context.Dispose();  Context  = null;\n          if (Graphics != null) Graphics.Dispose(); Graphics = null;\n        }\n        _isDisposed = true;\n      }\n    }\n\n    /// <summary>Finalize this instance.</summary>\n    ~LayerCollection() { Dispose(false); }\n    #endregion\n  }\n\n}\nnamespace PGNapoleonics.HexgridPanel {\n  using System.Reflection;\n\n  using PaintAction = Action<Graphics>;\n\n  /// <summary>TODO</summary>\n  public sealed class Layer {\n\n    /// <summary>TODO</summary>\n    internal Layer(BufferedGraphics buffer, PaintAction paintAction) {\n      Buffer      = buffer;\n      PaintAction = paintAction;\n\n      Background  = Color.Transparent;\n      IsOn        = true;\n      Resize(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    internal void Resize(BufferedGraphics buffer) {\n      const BindingFlags binding = BindingFlags.NonPublic | BindingFlags.Instance;\n\n      Buffer   = buffer;\n      var info = Buffer.GetType().GetField(\"virtualSize\",binding);\n      Size     = (Size)info.GetValue(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    public Color            Background      { get; private set; }\n    /// <summary>TODO</summary>\n    public BufferedGraphics Buffer          { \n      get { return _buffer; }\n      private set { if (_buffer != null) _buffer.Dispose(); _buffer = value; }\n    } BufferedGraphics _buffer;\n    /// <summary>TODO</summary>\n    public bool             IsOn            { get; set; }\n    /// <summary>TODO</summary>\n    public PaintAction      PaintAction     { get; private set; }\n    /// <summary>TODO</summary>\n    public Size             Size            { get; private set; }\n\n    /// <summary>TODO</summary>\n    public void Refresh() {\n      if (IsOn) {\n        var g     = Buffer.Graphics;\n        var state = g.Save();\n\n        g.Clear(Background);\n\n        PaintAction(g);\n\n        g.Restore(state);\n      }\n    }\n\n#if NET45\n    /// <summary>TODO</summary>\n    public async Task RefreshAsync() { await Task.Run(() => Refresh()); }\n\n    /// <summary>TODO</summary>\n    public async Task RenderAsync(Graphics target, Point scrollPosition) {\n      await Task.Run(() => Render(target,scrollPosition));\n    }\n#endif\n\n    /// <summary>TODO</summary>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public void Render(Graphics target, Point scrollPosition) {\n      if (target != null) {\n        IntPtr targetDC = target.GetHdc();\n \n        try { RenderInternal(new HandleRef(target, targetDC), Buffer, scrollPosition); } \n        finally { target.ReleaseHdcInternal(targetDC);  }\n      }\n    }\n\n    /// <summary>TODO</summary>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n    private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition) {\n      const int  rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n\n      var sourceDC    = buffer.Graphics.GetHdc(); \n      var virtualSize = Size;\n      try { \n        NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                              virtualSize.Width, virtualSize.Height, \n                                  new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n      } \n      finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n    } \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\n#pragma warning disable 1587\n/// <summary>WinForms-specific utilities, including implementation of the subclasses HexgridPanel\n/// and MapDisplay<THex>, utilizing the System.Windows.Forms technology.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridPanel {\n  using Int32ValueEventArgs = ValueChangedEventArgs<Int32>;\n\n  /// <summary>Abstract class representing the basic game board.</summary>\n  /// <typeparam name=\"THex\">Type of the hex for which a game board is desired.</typeparam>\n  public abstract class MapDisplay<THex> : HexBoard<THex>, IBoard<THex>, IMapDisplay\n    where THex : MapGridHex {\n\n    #region Constructors\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<THex>, HexCoords, THex> initializeHex) \n    : this(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes)) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<THex>, HexCoords, THex> initializeHex, \n                         ReadOnlyCollection<HexCoords> landmarkCoords) \n    : base(sizeHexes, gridSize, \n          (map) => new BoardStorage<THex>.FlatBoardStorage(sizeHexes, coords => initializeHex(map,coords)),\n          landmarkCoords\n    ) {\n      InitializeProperties();\n    }\n\n    void InitializeProperties() {\n      GoalHex         = \n      HotspotHex      = \n      StartHex        = HexCoords.EmptyUser;\n      ShadeBrushAlpha = 78;\n      ShadeBrushColor = Color.Black;\n      ShowFov         = true;\n      ShowHexgrid     = true;\n      ShowPath        = true;\n      ShowPathArrow   = true;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Gets or sets the Field-of-View for the current <see cref=\"HotspotHex\"/>, as an <see cref=\"IFov\"/> object.</summary>\n    public virtual  IFov          Fov             {\n//      get { return _fov ?? (_fov = this.GetFieldOfView(HotspotHex)); }\n      get { return _fov ?? (_fov = this.GetFieldOfView(ShowRangeLine ? StartHex : HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    /// <inheritdoc/>\n    public override int           FovRadius       { set { RangeCutoff = base.FovRadius = value; Fov = null; } }\n    /// <inheritdoc/>\n    public virtual  HexCoords     GoalHex         { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public virtual  HexCoords     HotspotHex      { \n      get { return _hotSpotHex; }\n      set { if (IsOnboard(value)) _hotSpotHex = value; if (!ShowRangeLine) _fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public          int           LandmarkToShow  { get; set; }\n    /// <inheritdoc/>\n    public          string        Name            { get {return \"MapDisplay\";} }\n    /// <inheritdoc/>\n    public          IDirectedPath Path            { \n      get { return _path ?? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])); } \n    } IDirectedPath _path;\n    /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          byte          ShadeBrushAlpha { get; set; }\n    /// <summary>Gets or sets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          Color         ShadeBrushColor { get; set; }\n    /// <summary>Gets or sets whether to display the FIeld-of-View for <see cref=\"HotspotHex\"/>.</summary>\n    public          bool          ShowFov         { get; set; }\n    /// <summary>Gets or sets whether to display the hexgrid.</summary>\n    public          bool          ShowHexgrid     { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowPath        { get; set; }\n    /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n    public          bool          ShowPathArrow   { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowRangeLine   { \n      get { return _showRangeLine; } \n      set { _showRangeLine = value; if (_showRangeLine) Fov = null; }\n    } bool _showRangeLine = false;\n    /// <inheritdoc/>\n    public virtual  HexCoords     StartHex        { \n      get { return _startHex; }\n      set { if (IsOnboard(value)) _startHex = value; _path = null; if (ShowRangeLine) _fov = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n    #endregion\n\n    /// <inheritdoc/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2233:OperationsShouldNotOverflow\", MessageId = \"10*elevationLevel\")]\n    public override int   ElevationASL(int elevationLevel) { return 10 * elevationLevel; }\n\n    #region Painting\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(PointF point, SizeF size) {\n      return GetClipInHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintHighlight(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var container = g.BeginContainer(); // Set all transformations relative to current origin!\n      TranslateGraphicsToHex(g, StartHex);\n      g.DrawPath(Pens.Red, HexgridPath);\n\n      if (ShowPath) {\n        g.EndContainer(container); container = g.BeginContainer();\n        PaintPath(g,Path);\n      }\n\n      if (ShowRangeLine) {\n        g.EndContainer(container); container = g.BeginContainer();\n        var target = CentreOfHex(HotspotHex);\n        g.DrawLine(Pens.Red, CentreOfHex(StartHex), target);\n        g.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n        g.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n      }\n\n      if (ShowFov) {\n        g.EndContainer(container); container = g.BeginContainer();\n        var clipHexes  = GetClipInHexes(g.VisibleClipBounds);\n        using(var shadeBrush = new SolidBrush(Color.FromArgb(ShadeBrushAlpha, ShadeBrushColor))) {\n          PaintForEachHex(g, clipHexes, coords => {\n            if (Fov!=null && ! Fov[coords]) { g.FillPath(shadeBrush, HexgridPath);  }\n          } );\n        }\n      }\n      g.EndContainer(container); \n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintMap(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var container = g.BeginContainer(); // Set all transformations relative to current origin!\n      var clipHexes  = GetClipInHexes(g.VisibleClipBounds);\n      g.InterpolationMode = InterpolationMode.HighQualityBicubic;\n      var font       = SystemFonts.MenuFont;\n      var brush      = Brushes.Black;\n      var textOffset = new Point((GridSize.Scale(0.50F)\n                     - new SizeF(font.Size,font.Size).Scale(0.8F)).ToSize());\n      PaintForEachHex(g, clipHexes, coords => {\n        this[coords].Paint(g);\n        if (ShowHexgrid) g.DrawPath(Pens.Black, HexgridPath);\n        if (LandmarkToShow > 0) {\n          g.DrawString(LandmarkDistance(coords,LandmarkToShow-1), font, brush, textOffset);\n        }\n      } );\n      g.EndContainer(container); \n    }\n\n    /// <summary>Paint the current shortese path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be painted.</param>\n    protected virtual  void PaintPath(Graphics g, IDirectedPath path) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        while (path != null) {\n          var coords = path.PathStep.Hex.Coords;\n          TranslateGraphicsToHex(g, coords);\n          g.FillPath(brush, HexgridPath);\n\n          if (ShowPathArrow) PaintPathArrow(g, path);\n\n          path = path.PathSoFar;\n        }\n      }\n    }\n\n    /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>\n    protected virtual  void PaintPathArrow(Graphics g, IDirectedPath path) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n      if (path==null) throw new ArgumentNullException(\"path\");\n\n      g.TranslateTransform(CentreOfHexOffset.Width, CentreOfHexOffset.Height);\n      if (path.PathSoFar == null)    PaintPathDestination(g);\n      else                           PaintPathArrow(g, path.PathStep.HexsideEntry);\n    }\n\n    /// <summary>Paint the direction arrow for each hex of the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"hexside\">Type: <see cref=\"Hexside\"/> - \n    /// Direction from this hex in which the next step is made.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathArrow(Graphics g, Hexside hexside) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var unit = GridSize.Height/8.0F;\n      g.RotateTransform(60 * (int)hexside);\n      g.DrawLine(Pens.Black, 0,unit*4,       0,  -unit);\n      g.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n      g.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n    }\n\n    /// <summary>Paint the destination indicator for the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathDestination(Graphics g) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var unit = GridSize.Height/8.0F;\n      g.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n      g.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintUnits(Graphics g) {}\n\n    /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n    /// for each hex on <paramref name=\"g\"/>.</summary>\n    /// <param name=\"g\">Graphics object for the canvas being painted.</param>\n    /// <param name=\"clipHexes\">Type: CoordRectangle - \n    /// The rectangular extent of hexes to be painted.</param>\n    /// <param name=\"paintAction\">Type: Action&lt;HexCoords&gt; - \n    /// The paint action to be performed for each hex.</param>\n    void PaintForEachHex(Graphics g, CoordsRectangle clipHexes, Action<HexCoords> paintAction) {\n      BoardHexes.ForEach(hex => {\n        if (clipHexes.Left <= hex.Coords.User.X  &&  hex.Coords.User.X <= clipHexes.Right\n        &&  clipHexes.Top  <= hex.Coords.User.Y  &&  hex.Coords.User.Y <= clipHexes.Bottom) {\n          TranslateGraphicsToHex(g, hex.Coords);\n          paintAction(hex.Coords);\n        }\n      } );\n      return;\n    }\n\n    /// <summary>Translates the origin of <paramref name=\"g\"/> to the upper-left corner of the hex with \n    /// coordinates <paramref name=\"coords\"/>.</summary>\n    /// <param name=\"g\">Type: Graphics - The canvas to be painted.</param>\n    /// <param name=\"coords\">Type: HexCoords - \n    /// Coordinates of the hex to be painted next.</param>\n    void TranslateGraphicsToHex(Graphics g, HexCoords coords) {\n      var offset  = UpperLeftOfHex(coords);\n      g.Transform = new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n    }\n\n    /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n    protected Point UpperLeftOfHex(HexCoords coords) {\n      return new Point(\n        coords.User.X * GridSize.Width,\n        coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n      );\n    }\n\n    /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n    protected Point CentreOfHex(HexCoords coords) {\n      return UpperLeftOfHex(coords) + CentreOfHexOffset;\n    }\n    #endregion\n\n    /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n    /// <param name=\"coords\">Type HexCoords - \n    /// Hex for which to return Landmark distanace.</param>\n    /// <param name=\"landmarkToShow\">Type int - \n    /// Index of the Landmark from which to display distances.</param>\n    protected virtual string LandmarkDistance(HexCoords coords, int landmarkToShow) { \n      if (landmarkToShow < 0  ||  Landmarks.Count <= landmarkToShow) return \"\";\n\n      return string.Format(\"{0,3}\", Landmarks[landmarkToShow].HexDistance(coords));\n    }\n\n    /// <summary>TODO</summary>\n    private void Host_FovRadiusChanged(object sender, Int32ValueEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      FovRadius = RangeCutoff = e.Value;\n    }\n\n    #region deprecated\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    [Obsolete(\"Use MapDisplay(Size,Size,Func<HexBoard<THex>, HexCoords, THex>) instead; client should set hex size.\")]\n    protected MapDisplay(Size sizeHexes, Func<HexBoard<THex>, HexCoords, THex> initializeHex) \n      : this(sizeHexes, new Size(27,30), initializeHex) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    [Obsolete(\"Use MapDisplay(Size,Size,Func<HexBoard<THex>, HexCoords, THex>) instead; client should set hex size.\")]\n    protected MapDisplay(Size sizeHexes, Func<HexBoard<THex>, HexCoords, THex> initializeHex, \n                       ReadOnlyCollection<HexCoords> landmarkCoords) \n    : this(sizeHexes, new Size(27,30), initializeHex, landmarkCoords) {}\n\n    /// <inheritdoc/>\n    [Obsolete(\"Use GetClipInHexes(PointF,SizeF) instead.\")]\n    public CoordsRectangle GetClipCells(PointF point, SizeF size) {\n      return GetClipInHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n    /// <inheritdoc/>\n    [Obsolete(\"Use GetClipInHexes(RectangleF) instead.\")]\n    public CoordsRectangle GetClipCells(RectangleF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n    #endregion\n  }\n\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ValueChangedEventArgs<T> : EventArgs {\n    /// <summary>TODO</summary>\n    public ValueChangedEventArgs(T value) : base() { Value = value; }\n    /// <summary>TODO</summary>\n    public T Value { get; private set; }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/MapGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridScrollable {\n  /// <summary>Deprecated; use interface IHex or abstract class MapGridHex instead.</summary>\n//  [Obsolete(\"Use interface IHex or abstract class MapGridHex instead.\")]\n  public interface IMapGridHex : IHex {\n    /// <summary></summary>\n    new HexBoard<MapGridHex> Board      { get; set; }\n  }\n\n  /// <summary>TODO</summary>\n  public abstract class MapGridHex : Hex<IMapGridHex>, IMapGridHex {\n    /// <summary>TODO</summary>\n    protected MapGridHex(HexBoard<MapGridHex> board, HexCoords coords) : base(board, coords) { \n      ((IMapGridHex)this).Board = board;\n    }\n\n    /// <inheritdoc/>\n    new public HexBoard<MapGridHex> Board      { get; set; }\n//    HexBoard<MapGridHex> IMapGridHex.Board      { get; set; }\n\n    /// <summary>TODO</summary>\n    protected  Size                 GridSize   { get { return Board.GridSize; } }\n\n    /// <inheritdoc/>\n    public virtual  void Paint(Graphics g) {;}\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridScrollable\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridScrollable\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"607605fc-a17f-433f-8f02-f967fd996cbd\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "codeplex/HexgridScrollable/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n    /// <summary>TODO</summary>\n    protected ViewModelBase(string displayName) { DisplayName = displayName; }\n\n    /// <summary>TODO</summary>\n    public            string DisplayName                { get; private set; }\n    /// <summary>TODO</summary>\n    protected virtual bool   ThrowOnInvalidPropertyName { get { return true; } }\n\n    /// <summary>Raised when a property on this object has a new value.</summary>\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    /// <summary>Raises this object's PropertyChanged event.</summary>\n    /// <param name=\"propertyName\">The property that has a new value.</param>\n    protected virtual void OnPropertyChanged(string propertyName) {\n      this.VerifyPropertyName(propertyName);\n      this.PropertyChanged.Raise(this, new PropertyChangedEventArgs(propertyName));\n    }\n\n    /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n    [Conditional(\"DEBUG\"), DebuggerStepThrough]\n    public void VerifyPropertyName(string propertyName) {\n      if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n        string msg = \"Invalid property name: \" + propertyName;\n        if (this.ThrowOnInvalidPropertyName)       throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n        Debug.Fail(msg);\n      }\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n        }\n        _isDisposed = true;\n      }\n    }\n    /// <summary>Finalize this instance.</summary>\n    ~ViewModelBase() { Dispose(false); }\n    #endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class CommandViewModel : ViewModelBase { \n    /// <summary>TODO</summary>\n    public CommandViewModel(string displayName, ICommand command) : base(displayName) { \n      if (command == null) throw new ArgumentNullException(\"command\"); \n      this.Command = command; \n    } \n    /// <summary>TODO</summary>\n    public ICommand Command { get; private set; } \n  }\n\n  /// <summary>TODO</summary>\n  public class RelayCommand : ICommand { \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute, Predicate<object> canExecute) { \n      if (execute == null) throw new ArgumentNullException(\"execute\");\n      if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n      _execute    = execute; \n      _canExecute = canExecute;\n    } \n  \n    /// <summary>TODO</summary>\n    [DebuggerStepThrough] \n    public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n    /// <summary>TODO</summary>\n    public event EventHandler CanExecuteChanged { \n      add    { CommandManager.RequerySuggested += value; } \n      remove { CommandManager.RequerySuggested -= value; } \n    }\n  \n    /// <summary>TODO</summary>\n    public void Execute(object parameter) { _execute(parameter); }\n\n    readonly Action<object>    _execute; \n    readonly Predicate<object> _canExecute; \n  }\n\n  ///// <summary>TODO</summary>\n  //public class RelayCommand<T> : ICommand { \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n  //    if (execute == null) throw new ArgumentNullException(\"execute\");\n  //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n  //    _execute    = execute; \n  //    _canExecute = canExecute;\n  //  } \n  \n  //  /// <summary>TODO</summary>\n  //  [DebuggerStepThrough] \n  //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n  //  /// <summary>TODO</summary>\n  //  public event EventHandler CanExecuteChanged { \n  //    add    { CommandManager.RequerySuggested += value; } \n  //    remove { CommandManager.RequerySuggested -= value; } \n  //  }\n  \n  //  /// <summary>TODO</summary>\n  //  public void Execute(T parameter) { _execute(parameter); }\n\n  //  readonly Action<T>    _execute; \n  //  readonly Predicate<object> _canExecute; \n  //}\n\n  /// <summary>TODO</summary>\n  public abstract class WorkspaceViewModel : ViewModelBase {\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel(string displayName) : base (displayName) {\n      _closeCommand = new RelayCommand(param => this.OnRequestClose());\n    }\n\n    /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n    public virtual ICommand CloseCommand { get { return _closeCommand; } } ICommand _closeCommand;\n\n    /// <summary>Raised when this workspace should be removed from the UI.</summary>\n    public event EventHandler RequestClose;\n\n    void OnRequestClose()  { RequestClose.Raise(this,EventArgs.Empty); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/GdiRasterOps.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  internal static partial class GdiRasterOps {\n    public const int SrcCopy                 = 0x00CC0020; /* dest = source                   */ \n    public const int SrcPaint                = 0x00EE0086; /* dest = source OR dest           */\n    public const int SrcAnd                  = 0x008800C6; /* dest = source AND dest          */\n    public const int SrcInvert               = 0x00660046; /* dest = source XOR dest          */\n    public const int SrcErase                = 0x00440328; /* dest = source AND (NOT dest )   */ \n    public const int NotSrcCopy              = 0x00330008; /* dest = (NOT source)             */\n    public const int NotSrcErase             = 0x001100A6; /* dest = (NOT src) AND (NOT dest) */ \n    public const int MergeCopy               = 0x00C000CA; /* dest = (source AND pattern)     */ \n    public const int MergePaint              = 0x00BB0226; /* dest = (NOT source) OR dest     */\n    public const int PatCopy                 = 0x00F00021; /* dest = pattern                  */ \n    public const int PatPaint                = 0x00FB0A09; /* dest = DPSnoo                   */\n    public const int PatInvert               = 0x005A0049; /* dest = pattern XOR dest         */\n    public const int DstInvert               = 0x00550009; /* dest = (NOT dest)               */\n    public const int Blackness               = 0x00000042; /* dest = BLACK                    */ \n    public const int Whiteness               = 0x00FF0062; /* dest = WHITE                    */\n//    public const int CaptureBlt              = 0x40000000; /* Include layered windows */ \n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridScrollable.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n\t\t/// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \n      \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification=\"Research suggests the Code Analysis message is incorrect.\")\n    ,System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n       \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n    /// <summary>TODO</summary>\n    [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n    [ResourceExposure(ResourceScope.None)] \n    public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n                                     HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n    /// <summary>Message Cracker for HiWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 HIWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return ((val32 >> 16) & 0xFFFF);\n    }\n\n    /// <summary>Message Cracker for LoWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 LOWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return (val32 & 0xFFFF);\n    }\n  }\n\n    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n  public static partial class ControlExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n      \n    }\n  }\n\n  /// <summary>Extension methods for System.Windows.Forms.Form.</summary>\n  public static partial class FormExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1011:ConsiderPassingBaseTypesAsParameters\")]\n    public static void UIThread(this Form @this, Action action) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1011:ConsiderPassingBaseTypesAsParameters\")]\n    public static void UIThread(this Form @this, Action<object[]> action, params object[] args) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ScrollBarCommand.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  #pragma warning disable 1570,1591\n  /// <summary>TODO</summary>\n  internal enum ScrollBarCommand {\n      SB_LINEUP           = 0,  //!< TODO\n      SB_LINELEFT         = 0,  //!< TODO\n      SB_LINEDOWN         = 1,  //!< TODO\n      SB_LINERIGHT        = 1,  //!< TODO\n      SB_PAGEUP           = 2,  //!< TODO\n      SB_PAGELEFT         = 2,  //!< TODO\n      SB_PAGEDOWN         = 3,  //!< TODO\n      SB_PAGERIGHT        = 3,  //!< TODO\n      SB_THUMBPOSITION    = 4,  //!< TODO\n      SB_THUMBTRACK       = 5,  //!< TODO\n      SB_TOP              = 6,  //!< TODO\n      SB_LEFT             = 6,  //!< TODO\n      SB_BOTTOM           = 7,  //!< TODO\n      SB_RIGHT            = 7,  //!< TODO\n      SB_ENDSCROLL        = 8   //!< TODO\n  }\n  #pragma warning restore 1570,1591\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>A Last-chance THread Exception handler.</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public class ThreadExceptionHandler {\n    /// <summary>Handles the thread exception.</summary> \n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1031:DoNotCatchGeneralExceptionTypes\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1303:Do not pass literals as localized parameters\", \n      MessageId = \"System.Windows.Forms.MessageBox.Show(System.String,System.String,\"\n                + \"System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1804:RemoveUnusedLocals\", MessageId = \"result\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1300:SpecifyMessageBoxOptions\")]\n    public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) {\n      if (sender==null) throw new ArgumentNullException(\"sender\");\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if(e.Exception is NotImplementedException \n      || e.Exception is NotSupportedException\n      || e.Exception is InvalidOperationException\n      ) {\n          MessageBox.Show(e.Exception.Message, \n            \"Application Error\", \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Information);\n      } else {\n        try {\n          var result = ShowThreadExceptionDialog(e.Exception);\n          Application.ExitThread();\n        }\n        catch {  // Fatal error, terminate program\n          try {\n            MessageBox.Show(\"Fatal Error in Unhandled Exception Handler.\", \n              \"Fatal Application Error\", \n              MessageBoxButtons.OK, \n              MessageBoxIcon.Stop);\n          }\n          finally { Application.Exit(); }\n        }\n      }\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private static DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var errorMessage= \n        \"Unhandled Exception:\" + Environment.NewLine + Environment.NewLine +\n        ex.Message + Environment.NewLine + Environment.NewLine +\n        ex.GetType() + Environment.NewLine + Environment.NewLine +\n        \"Stack Trace:\" + Environment.NewLine +\n        ex.StackTrace;\n\n      var dialog = new ExceptionDialog(errorMessage);\n      try {\n        dialog.Show();\n      } finally { if (dialog!=null) dialog.Dispose(); }\n      return DialogResult.Abort;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.TRANSPARENT;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void Invalidate2() { \n\t\t\tInvalidate2(new Rectangle(this.Location,this.Size));\n\t\t} \n    /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n    /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1300:SpecifyMessageBoxOptions\")]\n    public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\ttry {\n\t\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t\t} catch (InvalidOperationException e) { \n\t\t\t\t\tMessageBox.Show(\"Why is \" + e.Message + \"\\n occurring in\\n\" +\n\t\t\t\t\t\t\"TransparentPanel.Invalidate2(Rectangle r).\");\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"pevent\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs pevent) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public static partial class WinFormsExtensions {\n    /// <summary>Reflect to set Double-Buffering on Control.</summary>\n    /// <param name=\"control\">Control to operate on.</param>\n    /// <param name=\"setting\">New value for parameter.</param>\n    public static void MakeDoubleBuffered(this Control control, bool setting)\n    {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      control.GetType()\n             .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n             .SetValue(control, setting, null);\n    }\n\n    /// <summary>Use COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n    public static CreateParams SetCompositedStyle(this Control control, CreateParams parameters) {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      if (parameters==null) throw new ArgumentNullException(\"parameters\");\n      parameters.ExStyle |= (int)WindowStylesEx.COMPOSITED;\n      return parameters;\n    }\n  }\n\n  /// <summary>TODO</summary>/>\n  public static partial class PaddingExtensions {\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Point Offset(this Padding @this) { return new Point(@this.Left, @this.Top); }\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Size OffsetSize(this Padding @this) { return new Size(@this.Left, @this.Top); }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>\n    /// Windows Messages\n    /// Defined in winuser.h from Windows SDK v6.1\n    /// Documentation pulled from MSDN.\n    /// </summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1034:NestedTypesShouldNotBeVisible\")]\n  public enum WM : int //: uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    NULL = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    CREATE = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    DESTROY = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    MOVE = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    SIZE = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    ACTIVATE = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SETFOCUS = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KILLFOCUS = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    ENABLE = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SETREDRAW = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SETTEXT = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GETTEXT = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GETTEXTLENGTH = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    PAINT = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    CLOSE = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QUERYENDSESSION = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QUERYOPEN = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    ENDSESSION = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    QUIT = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    ERASEBKGND = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SYSCOLORCHANGE = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    SHOWWINDOW = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WININICHANGE = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SETTINGCHANGE = WM.WININICHANGE,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DEVMODECHANGE = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ACTIVATEAPP = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FONTCHANGE = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever there is a change in the system time.\n    /// </summary>\n    TIMECHANGE = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CANCELMODE = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SETCURSOR = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MOUSEACTIVATE = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    CHILDACTIVATE = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QUEUESYNC = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GETMINMAXINFO = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PAINTICON = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    ICONERASEBKGND = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NEXTDLGCTL = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SPOOLERSTATUS = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DRAWITEM = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MEASUREITEM = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DELETEITEM = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKEYTOITEM = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CHARTOITEM = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SETFONT = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GETFONT = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SETHOTKEY = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GETHOTKEY = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QUERYDRAGICON = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    COMPAREITEM = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GETOBJECT = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    COMPACTING = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete]\n    COMMNOTIFY = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGING = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGED = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete]\n    POWER = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    COPYDATA = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CANCELJOURNAL = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    NOTIFY = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    INPUTLANGCHANGEREQUEST = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    INPUTLANGCHANGE = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCARD = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    HELP = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    USERCHANGED = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NOTIFYFORMAT = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    CONTEXTMENU = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    STYLECHANGING = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    STYLECHANGED = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DISPLAYCHANGE = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GETICON = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SETICON = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCREATE = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDESTROY = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCALCSIZE = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHITTEST = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPAINT = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCACTIVATE = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GETDLGCODE = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SYNCPAINT = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMOUSEMOVE = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDOWN = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONUP = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDBLCLK = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDOWN = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONUP = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDBLCLK = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDOWN = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONUP = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDBLCLK = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDOWN = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONUP = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDBLCLK = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    INPUT_DEVICE_CHANGE = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    INPUT = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYFIRST = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KEYDOWN = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KEYUP = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    CHAR = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DEADCHAR = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYDOWN = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYUP = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SYSCHAR = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SYSDEADCHAR = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UNICHAR = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYLAST = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_STARTCOMPOSITION = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_ENDCOMPOSITION = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITION = 0x010F,\n    /// <summary>TODO</summary>\n    IME_KEYLAST = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    INITDIALOG = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    COMMAND = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SYSCOMMAND = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    TIMER = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    HSCROLL = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    VSCROLL = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    INITMENU = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    INITMENUPOPUP = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MENUSELECT = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MENUCHAR = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    ENTERIDLE = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MENURBUTTONUP = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MENUDRAG = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MENUGETOBJECT = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UNINITMENUPOPUP = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MENUCOMMAND = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    CHANGEUISTATE = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UPDATEUISTATE = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QUERYUISTATE = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CTLCOLORMSGBOX = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CTLCOLOREDIT = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CTLCOLORLISTBOX = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CTLCOLORBTN = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CTLCOLORDLG = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CTLCOLORSCROLLBAR = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CTLCOLORSTATIC = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MOUSEFIRST = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MOUSEMOVE = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDOWN = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONUP = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDBLCLK = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDOWN = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONUP = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDBLCLK = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDOWN = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONUP = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDBLCLK = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEWHEEL = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n    /// </summary>\n    XBUTTONDOWN = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONUP = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONDBLCLK = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEHWHEEL = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MOUSELAST = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    PARENTNOTIFY = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    ENTERMENULOOP = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    EXITMENULOOP = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NEXTMENU = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    SIZING = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CAPTURECHANGED = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    MOVING = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    POWERBROADCAST = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DEVICECHANGE = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MDICREATE = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MDIDESTROY = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MDIACTIVATE = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MDIRESTORE = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MDINEXT = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MDIMAXIMIZE = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MDITILE = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MDICASCADE = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MDIICONARRANGE = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MDIGETACTIVE = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MDISETMENU = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    ENTERSIZEMOVE = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    EXITSIZEMOVE = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DROPFILES = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MDIREFRESHMENU = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SETCONTEXT = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_NOTIFY = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    IME_CONTROL = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITIONFULL = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SELECT = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_CHAR = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_REQUEST = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYDOWN = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYUP = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSEHOVER = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSELEAVE = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSEHOVER = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSELEAVE = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WTSSESSION_CHANGE = 0x02B1,\n    /// <summary>TODO</summary>\n    TABLET_FIRST = 0x02c0,\n    /// <summary>TODO</summary>\n    TABLET_LAST = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    CUT = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    COPY = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    PASTE = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    CLEAR = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    UNDO = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERFORMAT = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERALLFORMATS = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DESTROYCLIPBOARD = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DRAWCLIPBOARD = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PAINTCLIPBOARD = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VSCROLLCLIPBOARD = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SIZECLIPBOARD = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    ASKCBFORMATNAME = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    CHANGECBCHAIN = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HSCROLLCLIPBOARD = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QUERYNEWPALETTE = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PALETTEISCHANGING = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PALETTECHANGED = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    HOTKEY = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINT = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINTCLIENT = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    APPCOMMAND = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    THEMECHANGED = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    CLIPBOARDUPDATE = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCOMPOSITIONCHANGED = 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    DWMNCRENDERINGCHANGED = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMCOLORIZATIONCOLORCHANGED = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWINDOWMAXIMIZEDCHANGE = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    GETTITLEBARINFOEX = 0x033F,\n    /// <summary>TODO</summary>\n    HANDHELDFIRST = 0x0358,\n    /// <summary>TODO</summary>\n    HANDHELDLAST = 0x035F,\n    /// <summary>TODO</summary>\n    AFXFIRST = 0x0360,\n    /// <summary>TODO</summary>\n    AFXLAST = 0x037F,\n    /// <summary>TODO</summary>\n    PENWINFIRST = 0x0380,\n    /// <summary>TODO</summary>\n    PENWINLAST = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    APP = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    USER = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1707:IdentifiersShouldNotContainUnderscores\")]\n    CPL_LAUNCH = USER+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1707:IdentifiersShouldNotContainUnderscores\")]\n    CPL_LAUNCHED = USER+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SYSTIMER = 0x118\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n    \"CA1028:EnumStorageShouldBeInt32\")]\n\t[Flags]public enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLButton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRButton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMButton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXButton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXButton2\t= 0x40\n\t}\n\n  /// <summary>TODO</summary>\n\tpublic static class WindowsMouseInput {\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static System.Drawing.Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new System.Drawing.Point(\n\t\t\t\t\t (int)(short)(lParam.ToInt64() & 0x0000ffff), \n\t\t\t\t\t (int)(short)(lParam.ToInt64() >> 16)\n\t\t\t\t);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static Int16 WheelDelta(IntPtr wParam) {\n\t\t\treturn (Int16)(wParam.ToInt64() >> 16);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr LParam(Point point) {\n\t\t\tif (point.X<Int16.MinValue || point.X > Int16.MaxValue\n      ||  point.Y<Int16.MinValue || point.Y > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point\",point,\n\t\t\t\t\t\"Must be a valid Point struct.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1702:CompoundWordsShouldBeCasedCorrectly\", MessageId = \"WParam\")]\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"Param\")]\n    public static IntPtr WParam (Int16 wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (Int16)mouseKeys;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n    \"CA1008:EnumsShouldHaveZeroValue\"), \n  System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n    \"CA1714:FlagsEnumsShouldHavePluralNames\"), \n  System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n    \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n  [Flags]internal enum WindowStylesEx\n  {\n    /// <summary>TODO</summary>\n    NONE = 0x00000000,\n    /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n    ACCEPTFILES = 0x00000010,\n    /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n    APPWINDOW = 0x00040000,\n    /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n    CLIENTEDGE = 0x00000200,\n    /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n    /// <remarks>\n    /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </remarks>\n    COMPOSITED = 0x02000000,\n    /// <summary>Includes a question mark in the title bar of the window.</summary>\n    /// <remarks>\n    /// When the user clicks the question mark, the cursor changes to a question mark \n    /// with a pointer. If the user then clicks a child window, the child receives a \n    /// WM_HELP message. The child window should pass the message to the parent window \n    /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n    /// The Help application displays a pop-up window that typically contains help for\n    /// the child window.  \n    /// CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n    /// </remarks>\n    CONTEXTHELP = 0x00000400,\n    /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n    /// <remarks>\n    /// If this style is specified, the dialog manager recurses into children of this \n    /// window when performing navigation operations such as handling the TAB key, \n    /// an arrow key, or a keyboard mnemonic.\n    /// </remarks>\n    CONTROLPARENT = 0x00010000,\n    /// <summary>Creates a window that has a double border.</summary>\n    /// <remarks>\n    /// The window can, optionally, be created with a title bar by specifying the \n    /// WS_CAPTION style in the dwStyle parameter.\n    /// </remarks>\n    DLGMODALFRAME = 0x00000001,\n    /// <summary>\n    /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </summary>\n    LAYERED = 0x00080000,\n    /// <summary>\n    /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. \n    /// </summary>\n    LAYOUTRTL = 0x00400000,\n    /// <summary>\n    /// Creates a window that has generic left-aligned properties. This is the default.\n    /// </summary>\n    LEFT = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\n    /// </summary>\n    LEFTSCROLLBAR = 0x00004000,\n    /// <summary>The window text is displayed using left-to-right reading-order properties.</summary>\n    /// <remarks>\n    /// This is the default.\n    /// </remarks>\n    LTRREADING = 0x00000000,\n    /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n    MDICHILD = 0x00000040,\n    /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n    /// <remarks>\n    /// Windows 2000/XP: A top-level window created with this style does not become the \n    /// foreground window when the user clicks it. \n    /// \n    /// The system does not bring this window to the foreground when the user minimizes \n    /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n    /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n    /// default. To force the window to appear on the taskbar, use the APPWINDOW \n    /// style.\n    /// </remarks>\n    NOACTIVATE = 0x08000000,\n    /// <summary>\n    /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\n    /// </summary>\n    NOINHERITLAYOUT = 0x00100000,\n    /// <summary>\n    /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n    /// </summary>\n    NOPARENTNOTIFY = 0x00000004,\n    /// <summary>Combines the CLIENTEDGE and WINDOWEDGE styles.</summary>\n    OVERLAPPEDWINDOW = WINDOWEDGE | CLIENTEDGE,\n    /// <summary>Combines the WINDOWEDGE, TOOLWINDOW, and TOPMOST styles.</summary>\n    PALETTEWINDOW = WINDOWEDGE | TOOLWINDOW | TOPMOST,\n    /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n    /// <remarks>\n    /// This depends on the window class. This style has an effect only if the \n    /// shell language is Hebrew, Arabic, or another language that supports \n    /// reading-order alignment; otherwise, the style is ignored.\n    /// \n    /// Using the RIGHT style for static or edit controls has the same \n    /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n    /// style with button controls has the same effect as using BS_RIGHT and \n    /// BS_RIGHTBUTTON styles.\n    /// </remarks>\n    RIGHT = 0x00001000,\n    /// <summary>\n    /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\n    /// </summary>\n    RIGHTSCROLLBAR = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\n    /// </summary>\n    RTLREADING = 0x00002000,\n    /// <summary>\n    /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\n    /// </summary>\n    STATICEDGE = 0x00020000,\n    /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n    /// <remarks>\n    /// A tool window has a title bar that is shorter than a normal title bar, and the \n    /// window title is drawn using a smaller font. A tool window does not appear in \n    /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n    /// tool window has a system menu, its icon is not displayed on the title bar. \n    /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n    /// </remarks>\n    TOOLWINDOW = 0x00000080,\n    /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should be placed above all \n    /// non-topmost windows and should stay above them, even when the window is \n    /// deactivated. To add or remove this style, use the SetWindowPos function.\n    /// </remarks>\n    TOPMOST = 0x00000008,\n    /// <summary>Specifies that a window should be painted after all siblings.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should not be painted until \n    /// siblings beneath the window (that were created by the same thread) have been \n    /// painted. The window appears transparent because the bits of underlying sibling \n    /// windows have already been painted.\n    /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n    /// </remarks>\n    TRANSPARENT = 0x00000020,\n    /// <summary>Specifies that a window has a border with a raised edge.</summary>\n    WINDOWEDGE = 0x00000100\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollable/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/App.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n   <startup>\n      <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5.2\"/>\n   </startup>\n</configuration>\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleBufferedHexgridScrollable.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2014 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridScrollableExample {\n  partial class ExampleBufferedHexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExampleBufferedHexgridScrollable));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n      this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n      this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n      this._hexgridPanel = new PGNapoleonics.HexgridPanel.BufferedHexgridScrollable();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      this.toolStrip2.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).BeginInit();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this._hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Margin = new System.Windows.Forms.Padding(0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(143, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(86, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.buttonRangeLine,\n            this.buttonFieldOfView,\n            this.buttonPathArrow,\n            this.comboBoxMapSelection,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug,\n            this.toolStripSeparator3,\n            this.menuItemHelp});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(767, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.AutoSize = false;\n      this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // buttonRangeLine\n      // \n      this.buttonRangeLine.AutoSize = false;\n      this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonRangeLine.CheckOnClick = true;\n      this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n      this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonRangeLine.Name = \"buttonRangeLine\";\n      this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n      this.buttonRangeLine.Text = \"Range Line\";\n      this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n      this.buttonRangeLine.CheckedChanged += new System.EventHandler(this.buttonRangeLine_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.AutoSize = false;\n      this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // buttonPathArrow\n      // \n      this.buttonPathArrow.AutoSize = false;\n      this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonPathArrow.Checked = true;\n      this.buttonPathArrow.CheckOnClick = true;\n      this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n      this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonPathArrow.Name = \"buttonPathArrow\";\n      this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n      this.buttonPathArrow.Text = \"Path Arrow\";\n      this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n      this.buttonPathArrow.CheckedChanged += new System.EventHandler(this.buttonPathArrow_Click);\n      // \n      // comboBoxMapSelection\n      // \n      this.comboBoxMapSelection.AutoSize = false;\n      this.comboBoxMapSelection.CausesValidation = false;\n      this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n      this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n      this.comboBoxMapSelection.Text = \"Map:\";\n      this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n      this.comboBoxMapSelection.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapSelection_SelectionChanged);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n      this.lblLandmark.Text = \"Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.AutoSize = false;\n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n      this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemHelp\n      // \n      this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n      this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n      this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemHelp.Name = \"menuItemHelp\";\n      this.menuItemHelp.ShowDropDownArrow = false;\n      this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n      this.menuItemHelp.Text = \"&Help\";\n      this.menuItemHelp.Visible = false;\n      // \n      // menuItemHelpContents\n      // \n      this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n      this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n      this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpContents.Text = \"&Contents\";\n      this.menuItemHelpContents.Click += new System.EventHandler(this.menuItemHelpContents_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n      // \n      // menuItemHelpAbout\n      // \n      this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n      this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n      // \n      // _hexgridPanel\n      // \n      this._hexgridPanel.AutoScroll = true;\n      this._hexgridPanel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this._hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this._hexgridPanel.IsMapDirty = false;\n      this._hexgridPanel.IsTransposed = false;\n      this._hexgridPanel.IsUnitsDirty = false;\n      this._hexgridPanel.Location = new System.Drawing.Point(5, 5);\n      this._hexgridPanel.Margin = new System.Windows.Forms.Padding(0);\n      this._hexgridPanel.Name = \"_hexgridPanel\";\n      this._hexgridPanel.ScaleIndex = 0;\n      this._hexgridPanel.Size = new System.Drawing.Size(756, 356);\n      this._hexgridPanel.TabIndex = 0;\n      this._hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this._hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this._hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this._hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // ExampleBufferedHexgridScrollable\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"ExampleBufferedHexgridScrollable\";\n      this.Text = \"BufferedHexgrid Scrollablel Example (WinForms)\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).EndInit();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexgridPanel.BufferedHexgridScrollable _hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripButton buttonPathArrow;\n    private System.Windows.Forms.ToolStripButton buttonRangeLine;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n  }\n}"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleBufferedHexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridExampleCommon;\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridScrollableExample {\n  using MapGridHex      = Hex<Graphics,System.Drawing.Drawing2D.GraphicsPath>;\n\n  internal sealed partial class ExampleBufferedHexgridScrollable : Form, IMessageFilter {\n    private bool           _isPanelResizeSuppressed = false;\n    private MapDisplay<MapGridHex> _mapBoard;\n\n    public ExampleBufferedHexgridScrollable() {\n      InitializeComponent();\n      Application.AddMessageFilter(this);\n\n      //ComponentResourceManager resources = new ComponentResourceManager(typeof(HexgridScrollableExample));\n      //this._hexgridPanel.SetScaleList ( (IList<float>)(resources.GetObject(\"_hexgridPanel.Scales\")) );\n      this._hexgridPanel.SetScaleList ( new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly() );\n\n      this._hexgridPanel.ScaleChange += new EventHandler<EventArgs>((o,e) => OnResizeEnd(e));\n\n      LoadTraceMenu(menuItemDebug,this.menuItemDebugTracing_Click);\n\n      comboBoxMapSelection.Items.AddRange(\n         Map.MapList.Select(item => item.MapName).ToArray()\n      );\n      comboBoxMapSelection.SelectedIndex = 0;\n\n//      helpProvider1.SetShowHelp(this,true);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler);\n\n    [System.Diagnostics.Conditional(\"TRACE\")]\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler) {\n      foreach(var item in Enum.GetValues(typeof(Traces))) {\n        var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n        menuItemDebug.DropDownItems.Add(menuItem);\n        menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n        menuItem.Size         = new System.Drawing.Size(143, 22);\n        menuItem.Text         = item.ToString();\n        menuItem.CheckOnClick = true;\n        menuItem.Click       += handler;\n      }\n    }\n\n    private void LoadLandmarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      _mapBoard.Landmarks.ForEach(landmark =>\n        menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords))\n      );\n      menuItemLandmarks.SelectedIndexChanged += new EventHandler(menuItemLandmarks_SelectedIndexChanged);\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    #region Event handlers\n    private void HexGridExampleForm_Load(object sender, EventArgs e) {\n      _hexgridPanel.SetScaleList (new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly());\n      _hexgridPanel.ScaleIndex = _hexgridPanel.Scales\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      var padding = this.toolStripContainer1.ContentPanel.Padding;\n      Size = _hexgridPanel.MapSizePixels  + new Size(21,93)\n           + new Size(padding.Left+padding.Right, padding.Top+padding.Bottom);\n    }\n\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      _isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! _isPanelResizeSuppressed) _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      _isPanelResizeSuppressed = false;\n      _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n\n    private void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = _mapBoard.HotspotHex;\n      statusLabel.Text = string.Format(CultureInfo.InvariantCulture,\n        PGNapoleonics.HexgridScrollableExample.Properties.Resources.StatusLabelText,\n        hotHex, hotHex, hotHex,\n        _mapBoard.StartHex - hotHex, (_mapBoard.Path==null ? 0 : _mapBoard.Path.TotalCost))\n        \n        + string.Format(CultureInfo.InvariantCulture,\n        \"  Elevation: Ground={0}; Observer={1}; Target={2}\", \n        _mapBoard.ElevationGroundASL(hotHex), \n        _mapBoard.ElevationObserverASL(hotHex), \n        _mapBoard.ElevationTargetASL(hotHex)\n        );\n    }\n\n    private void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      _mapBoard.FovRadius   =\n      _mapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    private void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex;\n      _hexgridPanel.SetMapDirty();\n      Update();\n    }\n\n    private void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (Traces)Enum.Parse(typeof(Traces),name);\n      if( item.Checked)   DebugTracing.EnabledTraces |=  flag;\n      else                DebugTracing.EnabledTraces &= ~flag;\n    }\n\n    private void menuItemHelpContents_Click(object sender, EventArgs e) {\n//      helpProvider1.SetShowHelp(this,true);\n    }\n\n    private void comboBoxMapSelection_SelectionChanged(object sender, EventArgs e) {\n      SetMapBoard(ParseMapName(((ToolStripItem)sender).Text));\n    }\n    private static MapDisplay<MapGridHex> ParseMapName(string mapName) {\n     return Map.MapList.First(item => item.MapName == mapName).MapBoard;\n   }\n\n    private void SetMapBoard(MapDisplay<MapGridHex> mapBoard) {\n      _hexgridPanel.SetModel( _mapBoard = mapBoard);\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      _mapBoard.ShowFov       = buttonFieldOfView.Checked;\n      _mapBoard.FovRadius     =\n      _mapBoard.RangeCutoff   = Int32.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n      LoadLandmarkMenu();\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*_mapBoard.MapSizeHexes.Height-1, 2));\n   \n      _hexgridPanel.Focus();\n   }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      _mapBoard.ShowFov = buttonFieldOfView.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonPathArrow_Click(object sender, EventArgs e) {\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonRangeLine_Click(object sender, EventArgs e) {\n      _mapBoard.ShowRangeLine = buttonRangeLine.Checked;\n      _hexgridPanel.SetMapDirty();\n      _mapBoard.StartHex = _mapBoard.StartHex; // Indirect, but it works.\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonTransposeMap_Click(object sender, EventArgs e) {\n      _hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      _mapBoard.GoalHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      _mapBoard.StartHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      _mapBoard.HotspotHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    #endregion\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n    /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    /// <returns>Success (true) or failure (false) to OS.</returns>\n    [System.Security.Permissions.PermissionSetAttribute(\n      System.Security.Permissions.SecurityAction.Demand, Name = \"FullTrust\")]\n    public bool PreFilterMessage(ref Message m) {\n      if ((WM)m.Msg != WM.MouseHwheel && (WM)m.Msg != WM.MouseWheel) return false;\n\n      var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n      var ctl = Control.FromChildHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch ((WM)m.Msg) {\n          case WM.MouseHwheel:\n          case WM.MouseWheel:\n            DebugTracing.Trace(Traces.ScrollEvents, true, \" - {0}.WM.{1}: \", Name, ((WM)m.Msg));\n            return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n          default: break;\n        }\n      }\n      return false;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleBufferedHexgridScrollable.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridPanel.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2014 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridScrollableExample {\n#pragma warning disable 0618 // Obsolete usage of HexgridPanel expected\n  partial class ExampleHexgridPanelExample {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExampleHexgridPanelExample));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n      this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n      this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n      this._hexgridPanel = new PGNapoleonics.HexgridPanel.HexgridPanel();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      this.toolStrip2.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).BeginInit();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this._hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Margin = new System.Windows.Forms.Padding(0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(143, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(86, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.buttonRangeLine,\n            this.buttonFieldOfView,\n            this.buttonPathArrow,\n            this.comboBoxMapSelection,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug,\n            this.toolStripSeparator3,\n            this.menuItemHelp});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(767, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.AutoSize = false;\n      this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // buttonRangeLine\n      // \n      this.buttonRangeLine.AutoSize = false;\n      this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonRangeLine.CheckOnClick = true;\n      this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n      this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonRangeLine.Name = \"buttonRangeLine\";\n      this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n      this.buttonRangeLine.Text = \"Range Line\";\n      this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n      this.buttonRangeLine.CheckedChanged += new System.EventHandler(this.buttonRangeLine_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.AutoSize = false;\n      this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // buttonPathArrow\n      // \n      this.buttonPathArrow.AutoSize = false;\n      this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonPathArrow.Checked = true;\n      this.buttonPathArrow.CheckOnClick = true;\n      this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n      this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonPathArrow.Name = \"buttonPathArrow\";\n      this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n      this.buttonPathArrow.Text = \"Path Arrow\";\n      this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n      this.buttonPathArrow.CheckedChanged += new System.EventHandler(this.buttonPathArrow_Click);\n      // \n      // comboBoxMapSelection\n      // \n      this.comboBoxMapSelection.AutoSize = false;\n      this.comboBoxMapSelection.CausesValidation = false;\n      this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n      this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n      this.comboBoxMapSelection.Text = \"Map:\";\n      this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n      this.comboBoxMapSelection.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapSelection_SelectionChanged);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n      this.lblLandmark.Text = \"Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.AutoSize = false;\n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n      this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemHelp\n      // \n      this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n      this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n      this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemHelp.Name = \"menuItemHelp\";\n      this.menuItemHelp.ShowDropDownArrow = false;\n      this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n      this.menuItemHelp.Text = \"&Help\";\n      this.menuItemHelp.Visible = false;\n      // \n      // menuItemHelpContents\n      // \n      this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n      this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n      this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpContents.Text = \"&Contents\";\n      this.menuItemHelpContents.Click += new System.EventHandler(this.menuItemHelpContents_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n      // \n      // menuItemHelpAbout\n      // \n      this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n      this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n      // \n      // _hexgridPanel\n      // \n      this._hexgridPanel.AutoScroll = true;\n      this._hexgridPanel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this._hexgridPanel.AutoSize = true;\n      this._hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this._hexgridPanel.IsTransposed = false;\n      this._hexgridPanel.Location = new System.Drawing.Point(5, 5);\n      this._hexgridPanel.Margin = new System.Windows.Forms.Padding(0);\n      this._hexgridPanel.Name = \"_hexgridPanel\";\n      this._hexgridPanel.ScaleIndex = 0;\n      this._hexgridPanel.Size = new System.Drawing.Size(756, 356);\n      this._hexgridPanel.TabIndex = 0;\n      this._hexgridPanel.TabStop = true;\n      this._hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this._hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this._hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this._hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // HexgridPanelExample\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"HexgridPanelExample\";\n      this.Text = \"Hexgrid Panel Example (WinForms)\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.ContentPanel.PerformLayout();\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).EndInit();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexgridPanel.HexgridPanel _hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripButton buttonPathArrow;\n    private System.Windows.Forms.ToolStripButton buttonRangeLine;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n  }\n#pragma warning restore 0618\n}"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridExampleCommon;\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridScrollableExample {\n  using MapGridHex      = Hex<Graphics,GraphicsPath>;\n\n  internal sealed partial class ExampleHexgridPanelExample : Form, IMessageFilter {\n    private bool            _isPanelResizeSuppressed = false;\n    private MapDisplay<MapGridHex> _mapBoard;\n\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"resources\")]\n    public ExampleHexgridPanelExample() {\n      InitializeComponent();\n      Application.AddMessageFilter(this);\n\n      //ComponentResourceManager resources = new ComponentResourceManager(typeof(ExampleHexgridPanelExample));\n      this._hexgridPanel.SetScaleList ( new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly() );\n\n      this._hexgridPanel.ScaleChange += new EventHandler<EventArgs>((o,e) => OnResizeEnd(e));\n\n      LoadTraceMenu(menuItemDebug,this.menuItemDebugTracing_Click);\n\n      comboBoxMapSelection.Items.AddRange(\n         Map.MapList.Select(item => item.MapName).ToArray()\n      );\n      comboBoxMapSelection.SelectedIndex = 0;\n\n//      helpProvider1.SetShowHelp(this,true);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler);\n\n    [System.Diagnostics.Conditional(\"TRACE\")]\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler) {\n      foreach(var item in Enum.GetValues(typeof(Traces))) {\n        var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n        menuItemDebug.DropDownItems.Add(menuItem);\n        menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n        menuItem.Size         = new System.Drawing.Size(143, 22);\n        menuItem.Text         = item.ToString();\n        menuItem.CheckOnClick = true;\n        menuItem.Click       += handler;\n      }\n    }\n\n    private void LoadLandmarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      _mapBoard.Landmarks.ForEach(landmark =>\n        menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords))\n      );\n      menuItemLandmarks.SelectedIndexChanged += new EventHandler(menuItemLandmarks_SelectedIndexChanged);\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    #region Event handlers\n    private void HexGridExampleForm_Load(object sender, EventArgs e) {\n      _hexgridPanel.SetScaleList (new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F});\n      _hexgridPanel.ScaleIndex = _hexgridPanel.ScaleList\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      var padding = this.toolStripContainer1.ContentPanel.Padding;\n      Size = _hexgridPanel.MapSizePixels  + new Size(21,93)\n           + new Size(padding.Left+padding.Right, padding.Top+padding.Bottom);\n    }\n\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      _isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! _isPanelResizeSuppressed) _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      _isPanelResizeSuppressed = false;\n      _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n\n    private void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = _mapBoard.HotspotHex;\n      statusLabel.Text = string.Format(CultureInfo.InvariantCulture,\n        PGNapoleonics.HexgridScrollableExample.Properties.Resources.StatusLabelText,\n        hotHex, hotHex, hotHex,\n        _mapBoard.StartHex - hotHex, (_mapBoard.Path==null ? 0 : _mapBoard.Path.TotalCost));\n    }\n\n    private void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      _mapBoard.FovRadius   =\n      _mapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    private void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex;\n      _hexgridPanel.SetMapDirty();\n      Update();\n    }\n\n    private void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (Traces)Enum.Parse(typeof(Traces),name);\n      if( item.Checked)   DebugTracing.EnabledTraces |=  flag;\n      else                DebugTracing.EnabledTraces &= ~flag;\n    }\n\n    private void menuItemHelpContents_Click(object sender, EventArgs e) {\n//      helpProvider1.SetShowHelp(this,true);\n    }\n\n    private void comboBoxMapSelection_SelectionChanged(object sender, EventArgs e) {\n      SetMapBoard(ParseMapName(((ToolStripItem)sender).Text));\n    }\n    private static MapDisplay<MapGridHex> ParseMapName(string mapName) {\n     return Map.MapList.First(item => item.MapName == mapName).MapBoard;\n   }\n\n    private void SetMapBoard(MapDisplay<MapGridHex> mapBoard) {\n      _hexgridPanel.Model     = (_mapBoard = mapBoard);\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      _mapBoard.ShowFov       = buttonFieldOfView.Checked;\n      _mapBoard.FovRadius     =\n      _mapBoard.RangeCutoff   = Int32.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n      LoadLandmarkMenu();\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*_mapBoard.MapSizeHexes.Height-1, 2));\n   \n      _hexgridPanel.Focus();\n   }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      _mapBoard.ShowFov = buttonFieldOfView.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonPathArrow_Click(object sender, EventArgs e) {\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonRangeLine_Click(object sender, EventArgs e) {\n      _mapBoard.ShowRangeLine = buttonRangeLine.Checked;\n      _hexgridPanel.SetMapDirty();\n      _mapBoard.StartHex = _mapBoard.StartHex; // Indirect, but it works.\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonTransposeMap_Click(object sender, EventArgs e) {\n      _hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      _mapBoard.GoalHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      _mapBoard.StartHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      _mapBoard.HotspotHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    #endregion\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n    /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    /// <returns>Success (true) or failure (false) to OS.</returns>\n    [System.Security.Permissions.PermissionSetAttribute(\n      System.Security.Permissions.SecurityAction.Demand, Name = \"FullTrust\")]\n    public bool PreFilterMessage(ref Message m) {\n      if ((WM)m.Msg != WM.MouseHwheel && (WM)m.Msg != WM.MouseWheel) return false;\n\n      var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n      var ctl = Control.FromChildHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch ((WM)m.Msg) {\n          case WM.MouseHwheel:\n          case WM.MouseWheel:\n            DebugTracing.Trace(Traces.ScrollEvents, true, \" - {0}.WM.{1}: \", Name, ((WM)m.Msg));\n            return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n          default: break;\n        }\n      }\n      return false;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridPanel.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridScrollable.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2014 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PGNapoleonics.HexgridScrollableExample {\n  partial class ExampleHexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExampleHexgridScrollable));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n      this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n      this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n      this._hexgridPanel = new PGNapoleonics.HexgridPanel.HexgridScrollable();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      this.toolStrip2.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).BeginInit();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this._hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Margin = new System.Windows.Forms.Padding(0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(143, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(86, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.buttonRangeLine,\n            this.buttonFieldOfView,\n            this.buttonPathArrow,\n            this.comboBoxMapSelection,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug,\n            this.toolStripSeparator3,\n            this.menuItemHelp});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(767, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.AutoSize = false;\n      this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // buttonRangeLine\n      // \n      this.buttonRangeLine.AutoSize = false;\n      this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonRangeLine.CheckOnClick = true;\n      this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n      this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonRangeLine.Name = \"buttonRangeLine\";\n      this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n      this.buttonRangeLine.Text = \"Range Line\";\n      this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n      this.buttonRangeLine.CheckedChanged += new System.EventHandler(this.buttonRangeLine_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.AutoSize = false;\n      this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // buttonPathArrow\n      // \n      this.buttonPathArrow.AutoSize = false;\n      this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonPathArrow.Checked = true;\n      this.buttonPathArrow.CheckOnClick = true;\n      this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n      this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonPathArrow.Name = \"buttonPathArrow\";\n      this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n      this.buttonPathArrow.Text = \"Path Arrow\";\n      this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n      this.buttonPathArrow.CheckedChanged += new System.EventHandler(this.buttonPathArrow_Click);\n      // \n      // comboBoxMapSelection\n      // \n      this.comboBoxMapSelection.AutoSize = false;\n      this.comboBoxMapSelection.CausesValidation = false;\n      this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n      this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n      this.comboBoxMapSelection.Text = \"Map:\";\n      this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n      this.comboBoxMapSelection.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapSelection_SelectionChanged);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n      this.lblLandmark.Text = \"Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.AutoSize = false;\n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n      this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemHelp\n      // \n      this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n      this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n      this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemHelp.Name = \"menuItemHelp\";\n      this.menuItemHelp.ShowDropDownArrow = false;\n      this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n      this.menuItemHelp.Text = \"&Help\";\n      this.menuItemHelp.Visible = false;\n      // \n      // menuItemHelpContents\n      // \n      this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n      this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n      this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpContents.Text = \"&Contents\";\n      this.menuItemHelpContents.Click += new System.EventHandler(this.menuItemHelpContents_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n      // \n      // menuItemHelpAbout\n      // \n      this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n      this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n      // \n      // _hexgridPanel\n      // \n      this._hexgridPanel.AutoScroll = true;\n      this._hexgridPanel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this._hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this._hexgridPanel.IsMapDirty = false;\n      this._hexgridPanel.IsTransposed = false;\n      this._hexgridPanel.IsUnitsDirty = false;\n      this._hexgridPanel.Location = new System.Drawing.Point(5, 5);\n      this._hexgridPanel.Margin = new System.Windows.Forms.Padding(0);\n      this._hexgridPanel.Name = \"_hexgridPanel\";\n      this._hexgridPanel.ScaleIndex = 0;\n      this._hexgridPanel.Size = new System.Drawing.Size(756, 356);\n      this._hexgridPanel.TabIndex = 0;\n      this._hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this._hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this._hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this._hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // ExampleHexgridScrollable\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"ExampleHexgridScrollable\";\n      this.Text = \"Hexgrid Scrollablel Example (WinForms)\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      ((System.ComponentModel.ISupportInitialize)(this._hexgridPanel)).EndInit();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexgridPanel.HexgridScrollable _hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripButton buttonPathArrow;\n    private System.Windows.Forms.ToolStripButton buttonRangeLine;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n  }\n}"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridExampleCommon;\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridScrollableExample {\n  using MapGridDisplay = MapDisplay<Hex<Graphics, GraphicsPath>>;\n\n  internal sealed partial class ExampleHexgridScrollable : Form, IMessageFilter {\n    private bool           _isPanelResizeSuppressed = false;\n    private MapGridDisplay _mapBoard;\n\n    public ExampleHexgridScrollable() {\n      InitializeComponent();\n      Application.AddMessageFilter(this);\n\n      //ComponentResourceManager resources = new ComponentResourceManager(typeof(HexgridScrollableExample));\n      //this._hexgridPanel.SetScaleList ( (IList<float>)(resources.GetObject(\"_hexgridPanel.Scales\")) );\n      this._hexgridPanel.SetScaleList ( new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly() );\n\n      this._hexgridPanel.ScaleChange += new EventHandler<EventArgs>((o,e) => OnResizeEnd(e));\n\n      LoadTraceMenu(menuItemDebug,this.menuItemDebugTracing_Click);\n\n      comboBoxMapSelection.Items.AddRange(\n         Map.MapList.Select(item => item.MapName).ToArray()\n      );\n      comboBoxMapSelection.SelectedIndex = 0;\n\n//      helpProvider1.SetShowHelp(this,true);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler);\n\n    [System.Diagnostics.Conditional(\"TRACE\")]\n    static partial void LoadTraceMenu(ToolStripDropDownButton menuItemDebug, EventHandler handler) {\n      foreach(var item in Enum.GetValues(typeof(Traces))) {\n        var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n        menuItemDebug.DropDownItems.Add(menuItem);\n        menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n        menuItem.Size         = new System.Drawing.Size(143, 22);\n        menuItem.Text         = item.ToString();\n        menuItem.CheckOnClick = true;\n        menuItem.Click       += handler;\n      }\n    }\n\n    private void LoadLandmarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      //foreach(var landmark in _mapBoard.Landmarks) {\n      //  menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords));\n      //}\n      _mapBoard.Landmarks.ForEach(landmark =>\n        menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords))\n      );\n      menuItemLandmarks.SelectedIndexChanged += new EventHandler(menuItemLandmarks_SelectedIndexChanged);\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    #region Event handlers\n    private void HexGridExampleForm_Load(object sender, EventArgs e) {\n      _hexgridPanel.SetScaleList (new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly());\n      _hexgridPanel.ScaleIndex = _hexgridPanel.Scales\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      var padding = this.toolStripContainer1.ContentPanel.Padding;\n      Size = _hexgridPanel.MapSizePixels  + new Size(21,93)\n           + new Size(padding.Left+padding.Right, padding.Top+padding.Bottom);\n    }\n\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      _isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! _isPanelResizeSuppressed) _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      _isPanelResizeSuppressed = false;\n      _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n\n    private void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = _mapBoard.HotspotHex;\n      statusLabel.Text = string.Format(CultureInfo.InvariantCulture,\n        PGNapoleonics.HexgridScrollableExample.Properties.Resources.StatusLabelText,\n        hotHex, hotHex, hotHex,\n        _mapBoard.StartHex - hotHex, (_mapBoard.Path==null ? 0 : _mapBoard.Path.TotalCost));\n    }\n\n    private void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      _mapBoard.FovRadius   =\n      _mapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    private void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex;\n      _hexgridPanel.SetMapDirty();\n      Update();\n    }\n\n    private void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (Traces)Enum.Parse(typeof(Traces),name);\n      if( item.Checked)   DebugTracing.EnabledTraces |=  flag;\n      else                DebugTracing.EnabledTraces &= ~flag;\n    }\n\n    private void menuItemHelpContents_Click(object sender, EventArgs e) {\n//      helpProvider1.SetShowHelp(this,true);\n    }\n\n    private void comboBoxMapSelection_SelectionChanged(object sender, EventArgs e) {\n      SetMapBoard(ParseMapName(((ToolStripItem)sender).Text));\n    }\n    private static MapGridDisplay ParseMapName(string mapName) {\n     return Map.MapList.First(item => item.MapName == mapName).MapBoard;\n   }\n\n    private void SetMapBoard(MapGridDisplay mapBoard) {\n      _hexgridPanel.SetModel( _mapBoard = mapBoard);\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      _mapBoard.ShowFov       = buttonFieldOfView.Checked;\n      _mapBoard.FovRadius     =\n      _mapBoard.RangeCutoff   = Int32.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n      LoadLandmarkMenu();\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*_mapBoard.MapSizeHexes.Height-1, 2));\n   \n      _hexgridPanel.Focus();\n   }\n\n    private void buttonFieldOfView_Click(object sender, EventArgs e) {\n      _mapBoard.ShowFov = buttonFieldOfView.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonPathArrow_Click(object sender, EventArgs e) {\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonRangeLine_Click(object sender, EventArgs e) {\n      _mapBoard.ShowRangeLine = buttonRangeLine.Checked;\n      _hexgridPanel.SetMapDirty();\n      _mapBoard.StartHex = _mapBoard.StartHex; // Indirect, but it works.\n      this._hexgridPanel.Refresh();\n    }\n    private void buttonTransposeMap_Click(object sender, EventArgs e) {\n      _hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    private void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      _mapBoard.GoalHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      _mapBoard.StartHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    private void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      _mapBoard.HotspotHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    #endregion\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n    /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    /// <returns>Success (true) or failure (false) to OS.</returns>\n    [System.Security.Permissions.PermissionSetAttribute(\n      System.Security.Permissions.SecurityAction.Demand, Name = \"FullTrust\")]\n    public bool PreFilterMessage(ref Message m) {\n      if ((WM)m.Msg != WM.MouseHwheel && (WM)m.Msg != WM.MouseWheel) return false;\n\n      var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n      var ctl = Control.FromChildHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch ((WM)m.Msg) {\n          case WM.MouseHwheel:\n          case WM.MouseWheel:\n            DebugTracing.Trace(Traces.ScrollEvents, true, \" - {0}.WM.{1}: \", Name, ((WM)m.Msg));\n            return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n          default: break;\n        }\n      }\n      return false;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/ExampleHexGridScrollable.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast Path-Finding is used instead of Stable Path-Finding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terrain.\n</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/HexgridScrollableExample.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{45429A16-9A82-41C2-9E2D-70D88B4D6D6B}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridScrollableExample</RootNamespace>\n    <AssemblyName>HexgridScrollableExample</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>CODE_ANALYSIS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1587,1607</NoWarn>\n    <DocumentationFile>bin\\Release\\HexGridScrollableExample.XML</DocumentationFile>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>PGNapoleonics.HexgridScrollableExample.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>true</Prefer32Bit>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>CODE_ANALYSIS</DefineConstants>\n    <DocumentationFile>\n    </DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1587,1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1607,1587</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"ExampleBufferedHexgridScrollable.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"ExampleBufferedHexgridScrollable.Designer.cs\">\n      <DependentUpon>ExampleBufferedHexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"ExampleHexGridPanel.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"ExampleHexGridPanel.Designer.cs\">\n      <DependentUpon>ExampleHexGridPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"ExampleHexGridScrollable.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"ExampleHexGridScrollable.Designer.cs\">\n      <DependentUpon>ExampleHexGridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MDIParent1.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"MDIParent1.Designer.cs\">\n      <DependentUpon>MDIParent1.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"ExampleBufferedHexgridScrollable.resx\">\n      <DependentUpon>ExampleBufferedHexgridScrollable.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"ExampleHexGridPanel.resx\">\n      <DependentUpon>ExampleHexGridPanel.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"ExampleHexGridScrollable.resx\">\n      <DependentUpon>ExampleHexGridScrollable.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"MDIParent1.resx\">\n      <DependentUpon>MDIParent1.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/MDIParent1.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridScrollableExample {\n  partial class MdiParent {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MdiParent));\n      this.menuStrip = new System.Windows.Forms.MenuStrip();\n      this.fileMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.printSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();\n      this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.editMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();\n      this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\n      this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.viewMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.statusBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.windowsMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.newWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.tileVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.tileHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.arrangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.helpMenu = new System.Windows.Forms.ToolStripMenuItem();\n      this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\n      this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStrip = new System.Windows.Forms.ToolStrip();\n      this.newToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.openToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.printToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();\n      this.statusStrip = new System.Windows.Forms.StatusStrip();\n      this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();\n      this.toolTip = new System.Windows.Forms.ToolTip(this.components);\n      this.menuStrip.SuspendLayout();\n      this.toolStrip.SuspendLayout();\n      this.statusStrip.SuspendLayout();\n      this.SuspendLayout();\n      // \n      // menuStrip\n      // \n      this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.fileMenu,\n            this.editMenu,\n            this.viewMenu,\n            this.toolsMenu,\n            this.windowsMenu,\n            this.helpMenu});\n      this.menuStrip.Location = new System.Drawing.Point(0, 0);\n      this.menuStrip.MdiWindowListItem = this.windowsMenu;\n      this.menuStrip.Name = \"menuStrip\";\n      this.menuStrip.Size = new System.Drawing.Size(632, 24);\n      this.menuStrip.TabIndex = 0;\n      this.menuStrip.Text = \"MenuStrip\";\n      // \n      // fileMenu\n      // \n      this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripMenuItem,\n            this.openToolStripMenuItem,\n            this.toolStripSeparator3,\n            this.saveToolStripMenuItem,\n            this.saveAsToolStripMenuItem,\n            this.toolStripSeparator4,\n            this.printToolStripMenuItem,\n            this.printPreviewToolStripMenuItem,\n            this.printSetupToolStripMenuItem,\n            this.toolStripSeparator5,\n            this.exitToolStripMenuItem});\n      this.fileMenu.ImageTransparentColor = System.Drawing.SystemColors.ActiveBorder;\n      this.fileMenu.Name = \"fileMenu\";\n      this.fileMenu.Size = new System.Drawing.Size(37, 20);\n      this.fileMenu.Text = \"&File\";\n      // \n      // newToolStripMenuItem\n      // \n      this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripMenuItem.Image\")));\n      this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.newToolStripMenuItem.Name = \"newToolStripMenuItem\";\n      this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));\n      this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.newToolStripMenuItem.Text = \"&New\";\n      this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n      // \n      // openToolStripMenuItem\n      // \n      this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripMenuItem.Image\")));\n      this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.openToolStripMenuItem.Name = \"openToolStripMenuItem\";\n      this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\n      this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.openToolStripMenuItem.Text = \"&Open\";\n      this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile);\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(143, 6);\n      // \n      // saveToolStripMenuItem\n      // \n      this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripMenuItem.Image\")));\n      this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.saveToolStripMenuItem.Name = \"saveToolStripMenuItem\";\n      this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));\n      this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.saveToolStripMenuItem.Text = \"&Save\";\n      // \n      // saveAsToolStripMenuItem\n      // \n      this.saveAsToolStripMenuItem.Name = \"saveAsToolStripMenuItem\";\n      this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.saveAsToolStripMenuItem.Text = \"Save &As\";\n      this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(143, 6);\n      // \n      // printToolStripMenuItem\n      // \n      this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripMenuItem.Image\")));\n      this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.printToolStripMenuItem.Name = \"printToolStripMenuItem\";\n      this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));\n      this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.printToolStripMenuItem.Text = \"&Print\";\n      // \n      // printPreviewToolStripMenuItem\n      // \n      this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripMenuItem.Image\")));\n      this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.printPreviewToolStripMenuItem.Name = \"printPreviewToolStripMenuItem\";\n      this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.printPreviewToolStripMenuItem.Text = \"Print Pre&view\";\n      // \n      // printSetupToolStripMenuItem\n      // \n      this.printSetupToolStripMenuItem.Name = \"printSetupToolStripMenuItem\";\n      this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.printSetupToolStripMenuItem.Text = \"Print Setup\";\n      // \n      // toolStripSeparator5\n      // \n      this.toolStripSeparator5.Name = \"toolStripSeparator5\";\n      this.toolStripSeparator5.Size = new System.Drawing.Size(143, 6);\n      // \n      // exitToolStripMenuItem\n      // \n      this.exitToolStripMenuItem.Name = \"exitToolStripMenuItem\";\n      this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22);\n      this.exitToolStripMenuItem.Text = \"E&xit\";\n      this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click);\n      // \n      // editMenu\n      // \n      this.editMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.undoToolStripMenuItem,\n            this.redoToolStripMenuItem,\n            this.toolStripSeparator6,\n            this.cutToolStripMenuItem,\n            this.copyToolStripMenuItem,\n            this.pasteToolStripMenuItem,\n            this.toolStripSeparator7,\n            this.selectAllToolStripMenuItem});\n      this.editMenu.Name = \"editMenu\";\n      this.editMenu.Size = new System.Drawing.Size(39, 20);\n      this.editMenu.Text = \"&Edit\";\n      // \n      // undoToolStripMenuItem\n      // \n      this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"undoToolStripMenuItem.Image\")));\n      this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.undoToolStripMenuItem.Name = \"undoToolStripMenuItem\";\n      this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));\n      this.undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.undoToolStripMenuItem.Text = \"&Undo\";\n      // \n      // redoToolStripMenuItem\n      // \n      this.redoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"redoToolStripMenuItem.Image\")));\n      this.redoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.redoToolStripMenuItem.Name = \"redoToolStripMenuItem\";\n      this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));\n      this.redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.redoToolStripMenuItem.Text = \"&Redo\";\n      // \n      // toolStripSeparator6\n      // \n      this.toolStripSeparator6.Name = \"toolStripSeparator6\";\n      this.toolStripSeparator6.Size = new System.Drawing.Size(161, 6);\n      // \n      // cutToolStripMenuItem\n      // \n      this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"cutToolStripMenuItem.Image\")));\n      this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.cutToolStripMenuItem.Name = \"cutToolStripMenuItem\";\n      this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));\n      this.cutToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.cutToolStripMenuItem.Text = \"Cu&t\";\n      this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click);\n      // \n      // copyToolStripMenuItem\n      // \n      this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"copyToolStripMenuItem.Image\")));\n      this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.copyToolStripMenuItem.Name = \"copyToolStripMenuItem\";\n      this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));\n      this.copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.copyToolStripMenuItem.Text = \"&Copy\";\n      this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click);\n      // \n      // pasteToolStripMenuItem\n      // \n      this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"pasteToolStripMenuItem.Image\")));\n      this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.pasteToolStripMenuItem.Name = \"pasteToolStripMenuItem\";\n      this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));\n      this.pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.pasteToolStripMenuItem.Text = \"&Paste\";\n      this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click);\n      // \n      // toolStripSeparator7\n      // \n      this.toolStripSeparator7.Name = \"toolStripSeparator7\";\n      this.toolStripSeparator7.Size = new System.Drawing.Size(161, 6);\n      // \n      // selectAllToolStripMenuItem\n      // \n      this.selectAllToolStripMenuItem.Name = \"selectAllToolStripMenuItem\";\n      this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));\n      this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22);\n      this.selectAllToolStripMenuItem.Text = \"Select &All\";\n      // \n      // viewMenu\n      // \n      this.viewMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolBarToolStripMenuItem,\n            this.statusBarToolStripMenuItem});\n      this.viewMenu.Name = \"viewMenu\";\n      this.viewMenu.Size = new System.Drawing.Size(44, 20);\n      this.viewMenu.Text = \"&View\";\n      // \n      // toolBarToolStripMenuItem\n      // \n      this.toolBarToolStripMenuItem.Checked = true;\n      this.toolBarToolStripMenuItem.CheckOnClick = true;\n      this.toolBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.toolBarToolStripMenuItem.Name = \"toolBarToolStripMenuItem\";\n      this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(126, 22);\n      this.toolBarToolStripMenuItem.Text = \"&Toolbar\";\n      this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click);\n      // \n      // statusBarToolStripMenuItem\n      // \n      this.statusBarToolStripMenuItem.Checked = true;\n      this.statusBarToolStripMenuItem.CheckOnClick = true;\n      this.statusBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.statusBarToolStripMenuItem.Name = \"statusBarToolStripMenuItem\";\n      this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(126, 22);\n      this.statusBarToolStripMenuItem.Text = \"&Status Bar\";\n      this.statusBarToolStripMenuItem.Click += new System.EventHandler(this.StatusBarToolStripMenuItem_Click);\n      // \n      // toolsMenu\n      // \n      this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.optionsToolStripMenuItem});\n      this.toolsMenu.Name = \"toolsMenu\";\n      this.toolsMenu.Size = new System.Drawing.Size(48, 20);\n      this.toolsMenu.Text = \"&Tools\";\n      // \n      // optionsToolStripMenuItem\n      // \n      this.optionsToolStripMenuItem.Name = \"optionsToolStripMenuItem\";\n      this.optionsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);\n      this.optionsToolStripMenuItem.Text = \"&Options\";\n      // \n      // windowsMenu\n      // \n      this.windowsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newWindowToolStripMenuItem,\n            this.cascadeToolStripMenuItem,\n            this.tileVerticalToolStripMenuItem,\n            this.tileHorizontalToolStripMenuItem,\n            this.closeAllToolStripMenuItem,\n            this.arrangeIconsToolStripMenuItem});\n      this.windowsMenu.Name = \"windowsMenu\";\n      this.windowsMenu.Size = new System.Drawing.Size(68, 20);\n      this.windowsMenu.Text = \"&Windows\";\n      // \n      // newWindowToolStripMenuItem\n      // \n      this.newWindowToolStripMenuItem.Name = \"newWindowToolStripMenuItem\";\n      this.newWindowToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.newWindowToolStripMenuItem.Text = \"&New Window\";\n      this.newWindowToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);\n      // \n      // cascadeToolStripMenuItem\n      // \n      this.cascadeToolStripMenuItem.Name = \"cascadeToolStripMenuItem\";\n      this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.cascadeToolStripMenuItem.Text = \"&Cascade\";\n      this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.CascadeToolStripMenuItem_Click);\n      // \n      // tileVerticalToolStripMenuItem\n      // \n      this.tileVerticalToolStripMenuItem.Name = \"tileVerticalToolStripMenuItem\";\n      this.tileVerticalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.tileVerticalToolStripMenuItem.Text = \"Tile &Vertical\";\n      this.tileVerticalToolStripMenuItem.Click += new System.EventHandler(this.TileVerticalToolStripMenuItem_Click);\n      // \n      // tileHorizontalToolStripMenuItem\n      // \n      this.tileHorizontalToolStripMenuItem.Name = \"tileHorizontalToolStripMenuItem\";\n      this.tileHorizontalToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.tileHorizontalToolStripMenuItem.Text = \"Tile &Horizontal\";\n      this.tileHorizontalToolStripMenuItem.Click += new System.EventHandler(this.TileHorizontalToolStripMenuItem_Click);\n      // \n      // closeAllToolStripMenuItem\n      // \n      this.closeAllToolStripMenuItem.Name = \"closeAllToolStripMenuItem\";\n      this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.closeAllToolStripMenuItem.Text = \"C&lose All\";\n      this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.CloseAllToolStripMenuItem_Click);\n      // \n      // arrangeIconsToolStripMenuItem\n      // \n      this.arrangeIconsToolStripMenuItem.Name = \"arrangeIconsToolStripMenuItem\";\n      this.arrangeIconsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);\n      this.arrangeIconsToolStripMenuItem.Text = \"&Arrange Icons\";\n      this.arrangeIconsToolStripMenuItem.Click += new System.EventHandler(this.ArrangeIconsToolStripMenuItem_Click);\n      // \n      // helpMenu\n      // \n      this.helpMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.contentsToolStripMenuItem,\n            this.indexToolStripMenuItem,\n            this.searchToolStripMenuItem,\n            this.toolStripSeparator8,\n            this.aboutToolStripMenuItem});\n      this.helpMenu.Name = \"helpMenu\";\n      this.helpMenu.Size = new System.Drawing.Size(44, 20);\n      this.helpMenu.Text = \"&Help\";\n      // \n      // contentsToolStripMenuItem\n      // \n      this.contentsToolStripMenuItem.Name = \"contentsToolStripMenuItem\";\n      this.contentsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1)));\n      this.contentsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n      this.contentsToolStripMenuItem.Text = \"&Contents\";\n      // \n      // indexToolStripMenuItem\n      // \n      this.indexToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"indexToolStripMenuItem.Image\")));\n      this.indexToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.indexToolStripMenuItem.Name = \"indexToolStripMenuItem\";\n      this.indexToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n      this.indexToolStripMenuItem.Text = \"&Index\";\n      // \n      // searchToolStripMenuItem\n      // \n      this.searchToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject(\"searchToolStripMenuItem.Image\")));\n      this.searchToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;\n      this.searchToolStripMenuItem.Name = \"searchToolStripMenuItem\";\n      this.searchToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n      this.searchToolStripMenuItem.Text = \"&Search\";\n      // \n      // toolStripSeparator8\n      // \n      this.toolStripSeparator8.Name = \"toolStripSeparator8\";\n      this.toolStripSeparator8.Size = new System.Drawing.Size(165, 6);\n      // \n      // aboutToolStripMenuItem\n      // \n      this.aboutToolStripMenuItem.Name = \"aboutToolStripMenuItem\";\n      this.aboutToolStripMenuItem.Size = new System.Drawing.Size(168, 22);\n      this.aboutToolStripMenuItem.Text = \"&About ... ...\";\n      // \n      // toolStrip\n      // \n      this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.newToolStripButton,\n            this.openToolStripButton,\n            this.saveToolStripButton,\n            this.toolStripSeparator1,\n            this.printToolStripButton,\n            this.printPreviewToolStripButton,\n            this.toolStripSeparator2,\n            this.helpToolStripButton});\n      this.toolStrip.Location = new System.Drawing.Point(0, 24);\n      this.toolStrip.Name = \"toolStrip\";\n      this.toolStrip.Size = new System.Drawing.Size(632, 25);\n      this.toolStrip.TabIndex = 1;\n      this.toolStrip.Text = \"ToolStrip\";\n      // \n      // newToolStripButton\n      // \n      this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"newToolStripButton.Image\")));\n      this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.newToolStripButton.Name = \"newToolStripButton\";\n      this.newToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.newToolStripButton.Text = \"New\";\n      this.newToolStripButton.Click += new System.EventHandler(this.ShowNewForm);\n      // \n      // openToolStripButton\n      // \n      this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"openToolStripButton.Image\")));\n      this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.openToolStripButton.Name = \"openToolStripButton\";\n      this.openToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.openToolStripButton.Text = \"Open\";\n      this.openToolStripButton.Click += new System.EventHandler(this.OpenFile);\n      // \n      // saveToolStripButton\n      // \n      this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"saveToolStripButton.Image\")));\n      this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.saveToolStripButton.Name = \"saveToolStripButton\";\n      this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.saveToolStripButton.Text = \"Save\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // printToolStripButton\n      // \n      this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.printToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printToolStripButton.Image\")));\n      this.printToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.printToolStripButton.Name = \"printToolStripButton\";\n      this.printToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.printToolStripButton.Text = \"Print\";\n      // \n      // printPreviewToolStripButton\n      // \n      this.printPreviewToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.printPreviewToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"printPreviewToolStripButton.Image\")));\n      this.printPreviewToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.printPreviewToolStripButton.Name = \"printPreviewToolStripButton\";\n      this.printPreviewToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.printPreviewToolStripButton.Text = \"Print Preview\";\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // helpToolStripButton\n      // \n      this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;\n      this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject(\"helpToolStripButton.Image\")));\n      this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;\n      this.helpToolStripButton.Name = \"helpToolStripButton\";\n      this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);\n      this.helpToolStripButton.Text = \"Help\";\n      // \n      // statusStrip\n      // \n      this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripStatusLabel});\n      this.statusStrip.Location = new System.Drawing.Point(0, 431);\n      this.statusStrip.Name = \"statusStrip\";\n      this.statusStrip.Size = new System.Drawing.Size(632, 22);\n      this.statusStrip.TabIndex = 2;\n      this.statusStrip.Text = \"StatusStrip\";\n      // \n      // toolStripStatusLabel\n      // \n      this.toolStripStatusLabel.Name = \"toolStripStatusLabel\";\n      this.toolStripStatusLabel.Size = new System.Drawing.Size(39, 17);\n      this.toolStripStatusLabel.Text = \"Status\";\n      // \n      // MdiParent\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(632, 453);\n      this.Controls.Add(this.statusStrip);\n      this.Controls.Add(this.toolStrip);\n      this.Controls.Add(this.menuStrip);\n      this.IsMdiContainer = true;\n      this.MainMenuStrip = this.menuStrip;\n      this.Name = \"MdiParent\";\n      this.Text = \"MDIParent1\";\n      this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MdiParent_FormClosing);\n      this.menuStrip.ResumeLayout(false);\n      this.menuStrip.PerformLayout();\n      this.toolStrip.ResumeLayout(false);\n      this.toolStrip.PerformLayout();\n      this.statusStrip.ResumeLayout(false);\n      this.statusStrip.PerformLayout();\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n    #endregion\n\n\n    private System.Windows.Forms.MenuStrip menuStrip;\n    private System.Windows.Forms.ToolStrip toolStrip;\n    private System.Windows.Forms.StatusStrip statusStrip;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;\n    private System.Windows.Forms.ToolStripMenuItem printSetupToolStripMenuItem;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;\n    private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;\n    private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem tileHorizontalToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem fileMenu;\n    private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem editMenu;\n    private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem viewMenu;\n    private System.Windows.Forms.ToolStripMenuItem toolBarToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem statusBarToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem toolsMenu;\n    private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem windowsMenu;\n    private System.Windows.Forms.ToolStripMenuItem newWindowToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem cascadeToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem tileVerticalToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem closeAllToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem arrangeIconsToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem helpMenu;\n    private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;\n    private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;\n    private System.Windows.Forms.ToolStripButton newToolStripButton;\n    private System.Windows.Forms.ToolStripButton openToolStripButton;\n    private System.Windows.Forms.ToolStripButton saveToolStripButton;\n    private System.Windows.Forms.ToolStripButton printToolStripButton;\n    private System.Windows.Forms.ToolStripButton printPreviewToolStripButton;\n    private System.Windows.Forms.ToolStripButton helpToolStripButton;\n    private System.Windows.Forms.ToolTip toolTip;\n  }\n}\n\n\n\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/MDIParent1.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reflection;\nusing System.Resources;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexgridExampleCommon;\n\nnamespace PGNapoleonics.HexgridScrollableExample {\n  /// <summary>TODO</summary>\n  public partial class MdiParent : Form {\n    private int childFormNumber = 0;\n\n//    static CultureInfo Culture = CultureInfo.CurrentCulture;\n    //static ResourceManager StringManager =\n    //        new ResourceManager(\"en-US\", Assembly.GetExecutingAssembly());\n    private static string FileExtensionMask = PGNapoleonics.HexgridScrollableExample.Properties.Resources.FileExtensionMask;\n\n    /// <summary>TODO</summary>\n    public MdiParent() {\n      InitializeComponent();\n\n      CreateDefaultChildren();\n    }\n\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void CreateDefaultChildren() {\n      ShowDefaultChildren (new ExampleHexgridPanelExample());\n      ShowDefaultChildren (new ExampleBufferedHexgridScrollable());\n      ShowDefaultChildren (new ExampleHexgridScrollable());\n    }\n\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void ShowDefaultChildren(Form child) {\n      child.MdiParent = this;\n      child.WindowState = FormWindowState.Maximized;\n      components.Add(child);\n      child.Show();\n    }\n\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void ShowNewForm(object sender, EventArgs e) {\n      var child = new Form();\n      child.MdiParent = this;\n      child.Text = \"Window \" + childFormNumber++;\n      components.Add(child);\n      child.Show();\n    }\n\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n    private void OpenFile(object sender, EventArgs e) {\n      using(var openFileDialog = new OpenFileDialog()) {\n        openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n        openFileDialog.Filter = FileExtensionMask;\n        if (openFileDialog.ShowDialog(this) == DialogResult.OK) {\n          string FileName = openFileDialog.FileName;\n        }\n      }\n    }\n\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1804:RemoveUnusedLocals\", MessageId = \"FileName\")]\n    private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) {\n      using(var saveFileDialog = new SaveFileDialog()) {\n        saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n        saveFileDialog.Filter = FileExtensionMask;\n        if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {\n          string FileName = saveFileDialog.FileName;\n        }\n      }\n    }\n\n    private void ExitToolsStripMenuItem_Click(object sender, EventArgs e) {\n      this.Close();\n    }\n\n    private void CutToolStripMenuItem_Click(object sender, EventArgs e) {\n    }\n\n    private void CopyToolStripMenuItem_Click(object sender, EventArgs e) {\n    }\n\n    private void PasteToolStripMenuItem_Click(object sender, EventArgs e) {\n    }\n\n    private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e) {\n      toolStrip.Visible = toolBarToolStripMenuItem.Checked;\n    }\n\n    private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e) {\n      statusStrip.Visible = statusBarToolStripMenuItem.Checked;\n    }\n\n    private void CascadeToolStripMenuItem_Click(object sender, EventArgs e) {\n      LayoutMdi(MdiLayout.Cascade);\n    }\n\n    private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e) {\n      LayoutMdi(MdiLayout.TileVertical);\n    }\n\n    private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e) {\n      LayoutMdi(MdiLayout.TileHorizontal);\n    }\n\n    private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e) {\n      LayoutMdi(MdiLayout.ArrangeIcons);\n    }\n\n    private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) {\n      foreach (Form childForm in MdiChildren) {\n        childForm.Close();\n      }\n    }\n\n    private void MdiParent_FormClosing(object sender, FormClosingEventArgs e) {\n      foreach (var child in this.MdiChildren) { child.Hide(); if (child!=null) child.Close(); }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/MDIParent1.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"menuStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"newToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"undoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGmSURBVDhPvZHdS5MBFMb3p3TX6E7c1BTHUIc2xUbEqGUz\n        LaV5s6ViRvhuul0M9lFshFjmjV/bKLVajRAid6N3KYg3FkHDiWvNmXt3++udDiMd4nthD5ybc57nx+Ec\n        xbkqGM0TfCcysSgyuyQSlioSFymOT5d/QaRQnjmR4VAO+1SOlx8PASUhnkiKmZXDQSH05E2erkCGBtsK\n        NV0xKu9EaRz8xlisBKDQGJ7aYeKziD0k8vRtHrN3G51tGc39RdS3X9Fgfc/l9lmM7gzTkq8Y/au+sW16\n        nu/zYDzHTe8e1XejVHUsSOHwgdkwFKPsxiS6h5s4pnMnAZ3+JM0jaW759hkYT6NsDqBqCx0ZL2gFND1x\n        dANfcYRLAK45t6jo+86VkdTBJh3eHwiTv/4FWOLohSTOUoC6wQTa3g2qLcuo2j9QZnqNsuXZkbHCPE+t\n        ZQmD6ye20cRJwHEdv/RFfUBaf5Pu4C4+6b3F9tlVde8T191ZjMIXeWGzfxetdZWrriytj9a5ZHghD9D0\n        OCGFf9PUv0a5KSJ/dZP01vr+DdRtc/LD/0EKxR+XdBDBXAMPDQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"redoToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGVSURBVDhPzZHdK0NhHMf3p7jBknbBNpqbc+FtttrUrBim\n        LEJeRo0lzMsK2S6M5D3vJjXFJinhZu64WolQu9FaXjrnuf56nrOl5kTIhW99L56e7/dzfuf3yP5MO+cE\n        /jOCLeqlY4KJgADnioDk9ddiZebFI4KBdQGD2wLcOwJ6VimEOhn7XKw8e0hQ4nxAXt0BNLYQuNYwbD4e\n        9gUB9sUEZPOCgOuMSIEbpwTm0SeoLcsobAtAVbMrWm3dRz2FNM7yaKGQJZoraAqL0yarCbk2BBR13yKz\n        bALGvkPxUlXjR65lC9nGeVSMvYqTNM/xUFqD0glcfga4Q4bWizSu/z2grN6GXDcJx0IcFg8P3VAcioo1\n        KWCYAnQDjzTsSwFMBQmY2Ze1QzGou+4h109LAR0zUZS748ip3E0BsIVp6D8rrSEoTOtiOb14XArw7BE0\n        +J5R5Lihe5hMCUgW9pnM/Zcwjb4g33byvcJHZdFtG3ojMIy8gGu/Qq33+ecgBtE7r2F08yjtjf5uEiad\n        K4Yq+mzJ47+WTPYGxTcHtykTmrAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"cutToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGhSURBVDhPYyAG/AcCKJMwWLlp///ZyzbBNYA033nw9H91\n        6xTiDJk8d83/nmmL/1e1zgRr+Pb9x//Vm/b8T8mpIt4Vk2av/D95zmqQ5f+fvXjzPy2/5r+YEB8J3ti4\n        73/X5IX/T5y5+P/gsXP/w+KzSTNg4aod/7unLPrfO23h//LGvv8+QdHEawaBzokL/5c09P1Pzqv7Hxqb\n        +d/NO4g0A0AgIa/lf1hC4f+QtLb//gktxBsQ3fHuf0Tn6/8hzQ/+e5ed+u9Tfva/X9Xl/z6lp/+7Ze/E\n        b1BE+6v/kT3v/gc33PlvHT3vv2lQ33+3vH3//auv/ncFaraKmY/fgLD25//D2p7+d0zbANZsGtT737vk\n        1H//yqv/nTI2/TcJ7sdvQGjLo/9Bjff+O6Vu+m8c0A02IABou2/F2f8WEdP+aztk4TcguOnef/+yS//t\n        ktf8N/SBBJx3yfH/dkmr/mvaJP+XkdfEb4Bf5cX/9kmrgbZ3/Vc3CwcnHvuUNf+1rBP+q5tH/Df2b8dv\n        gHPGlv9mIZP+a1jF/jf0qsGvmDqAgQEAkYXpGFtqYpEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"copyToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHgSURBVDhPvZHdS1pxGMfPn7IKieq63Y/RKw0aFF1ssEEv\n        dOVFXXUVFQ3Wlg4H2dSo7A21jnUiKiPFylwttMy9GXMNNgUrzinLrGN98zxaVgu7GOwLn5vf+X0/D8/v\n        MP8cbuEbJFiblzDMuDDAfcQbLYfklfSRyrejn3CirnUID0tr7peYrd5kLZHY2Tm6hudgcXjxrEF5v8Qw\n        66aixQew64DHL+C9fhrskgDTAg+jnUffLA/V+B7xojNwUzjAOUkg5eQ0BuEgikAoTILbaR/ZQX6tg0jW\n        GUZnstPHXscpFDMCWtg/aOz3Y3h+l86vp0ETArciIK9qgiCBOr6vtPdRRMQOH8F2YB9f/LvQTQWp1MHG\n        CM/WPl4qgsitmkROxSiyywcTAmnf46h4NVmu86Fe/RnvjNskuIxwKGLr9zEcmwfQsGuQPelJCYRwFF9/\n        huD+HoDT8wu2Tz/Q2pv4vc0jYcjVQTx/68PTtg1Cw65CVtqdEuSXVP9Fo2qDBGJ8vRAvYtN/BKtLgHlx\n        Dx9GncgqUqUe8q7UtK+Q4PrkS7pNy8gsUKQXVDbZETk5g27cBa15DZqxVZosldWGJWQ8fp1eUCS3xF/b\n        SGSX6yEr0yKruAuZhcp4uQMPHr1KL/hPYZgL78LfVeQiZg4AAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"pasteToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJXSURBVDhPtZJdSFNhHMYPdGE3RR/UVVcF0U0UEVQXGYWt\n        sNlikdii5SK2SckmS9tGas0cunRzadoW+THUprMSpUnREBqOvmdsRh8SOSPXsnY2N+eyeDrn3UaujCDo\n        gYcD73mf3/+Dl/ovcvZr4bihQW+LCrL8fUgez6+edgPmuqX2CIL+DkT8V+EbqUGJmANDpQKXdWoYK4uJ\n        k9GE2FCMtiEe6kYs2AlLkwLRyTaUSHh4MaTE2VNcKEWb4Xcew6R9NWTC/b8D2HA8ZEWj9ijcrhrQ7+sx\n        MaLGW9dx9Jl5kAgy0VG6Ck8NFAoO/zJSd1ttAkBfh65UiHJFHtSFuThTwIdCzINcxIVUkIU62RoCyMvO\n        TAd0NuswQ3dhJmBCdLwKgeeF8LYtJ/a0LoO7aREeGTNImHXWto3pAItJi+lAC6bHKhB9eRKRZwdB9y+G\n        vtWOKlMvzl3qglJngVxjhkRlhLCoOh3Q3KDBlM+IyIgYU4+5CN/fhI+3VpBwSvHZbwiGYhibCCJXeh45\n        +eqfELO+DPSrCoQfchAeXI/QwEr4WilSmVXzTSexyeqAZ9RPwneHvNjDFyUgDdUqfB4+jZBjHejbSxGw\n        ZWD0GkXa/jr7HV/CTOUPQXje+OEafodsgRwcJrxr7wFkbt8Bqu5CMQIPpEx4CT71LMR4+wJ4GynImJnZ\n        tlMdXGE6qLcMoG/QS76st25YC+pieRF5IKktpyxmFja38j3XaxK23XHDan+SDtCXnWBeGA8i/m7k7NxC\n        frDbZmdOVZvPBPAnHWK2zV74m5PX/1UU9QOTNfjZ1V1+MwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"indexToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"searchToolStripMenuItem.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALGSURBVDhPldL/T01xHMfx/hczs8VmmC/zg1i7oa6pOXVL\n        Jbrqlm5fbrluSqV7uynpdq/qtoh7C9Ei3eu0fBnKl6yFmSRkWF93VUZ2Q/Z0P2OuxmZe2/ntvB/nfD7v\n        V8Dvya2UEY+hwk2+VcZY28n+Cheph86jKWzm52t/T15VBwdtMs6ubq6+7EMe7sA5VESGnIRkOklirhN1\n        XuPfkQMWGZNDprX/Mg8+PGFgdpScthIsL/JJuaRkg7mcGFMP0YYGEvQn5iN68bs2N3W9VjrGHdyc6qVv\n        pp8Br4eWERdJdjMK+1PW2NpYW6NGyqxkR1atHxFAsVPG/rCcmiE9jrc2nMNmah87ST3TgqZukpiK1yw9\n        G8Hi06GsN6YTlVblB7LL2qlzv8EkW9h7fyuZvWHoHAZymnzHOn4Rk7UBQ3kl8dYUAqsVBJaFE6Ep9wMZ\n        5jbqr8xSWF+P8qyCLXI06lor1Y0urnXdZszzjrfjHpoutBOXp2VBSQjKRJMf0Bpbsbq9HGjyEG9QE1q/\n        G11TMZ03uhD5Ogcfvd8YnZrD1nCeddoINscX+IG9h1rIrHmF9vhnNNYhwnO1vnUeYWTC82t4/P1XBke+\n        4Op+RkRcLMHRBj+QUnSO1NJbJB77RIJlimjjHfaXmhiemPwxPD3nG/5Mz6CXutYetkmRBEk6PyAaJkqy\n        q+QBqsPjKIp6kYw62jtvMDbt+/LoF+4993K5b4Y0fQFh0k6K87P9gIhoWJzeSdTBOyzNNrNMF0uyLosT\n        zW7augewX+ghbV8BkartNFtiabenU2XKmY+IhqnSq9mUYSVYnYpSY0ZKLkTasYtwSUVM5DZsuo2MnVLw\n        7W4CjqNZfyKiYaIkYs9iVeK2xYWJM8cog0kOW8GjgpUM24OYdEWyL2nrfOBfEUBS6HKu61ezJ2QJqtBV\n        /weICGTdskWErF3oGw4I+A4LpgTtu1iCBgAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"toolStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>125, 17</value>\n  </metadata>\n  <data name=\"newToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPrZDJasJQGIXzUvoO9TX0jcQuSulCLUUECwot\n        KtrSAbQWRDTg0CLBCY1xqmkcYo7c8ItJYy9Z+MHhLu453+IXzkbypY6/SeRriKXLiKaKZqh6Gjb4j+v4\n        M7y+AF9y/yRS3UkomkbmvcaXxLMVqjsJhh/N8SE0sXP38El1J1t9Z0oOIprYiSQLVLdjGAZUbYOhopoC\n        z4X/tOAm8UoTO+uNjslcgzSY8wVXsTxNjug7Awt1jb68RFOa8AWXtxmaHdFWW8jTX7R7M1RbMl/APq2w\n        w81+VugMF6i3FZTEgXuB9XBfnSkqjRHeyl33AuvhxO8xitU+ch+SOwF7eeEK2Keb0OQcCMIe3/X1lqrb\n        NIsAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"openToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJYSURBVDhPvZFbSBNQHIf30ENPFmlRCEWWhD0MA0Oqh5Ck\n        m6KUZoWRJpS3LhiKbVPbvE53c+pKh7lN19RptTIMK4RCkQgtdZSYmgVFpZgZKnn7GptokkEP0R9+L+ec\n        7zs/zhH8l8kpMSPTWriSbyJPZ0WiNDK/9XcTnawjLF7lhC6IKsh0yFKyDUQllyCoN2tYLo218j/ekiAp\n        JTxRRWh8oUvQ22VkcrTOmR8jFqaHDFhNKmzm7GUlYQlqQuO0BMcWI6irVDMxUr0Env1UyrQ9ieqKfKrK\n        cjGUZKIvzOC6UkyxPHWptMaoYOKLcQGec8D0isEeu2x+E9wsl/P9o34BbqpXOPPAWkCDRc6dqlyshiws\n        ehkm3VVuaNMoU4vRKUQuWZU+l7F3Rc7aAy1SbNVqZgdkMJi9NG8da/0S6EmGV4l01kZwKSYEgUGXxbe+\n        fHiv5G6NiraHStehX6u/jIL2cGZag5h8FMCbSiHnTx9wCcq1Ur6+ljHYmo7NomSuXwrdcS6wM8YBnmCm\n        LYTJ5v2MNe5huH4HsnhvTgZ6uN6iVJ3OcJeIW2YFHU8dTXqSHIKz0HGKuWdHmHpyiPGmvYzY/Phc40N7\n        zmoig7zw2+bmEugKxHQ3Z3DbXAB9GfDCUff5MaZaghl/HMBogz9DViEfjFuxK92Rxm7Bd7vn4k8U5aVS\n        Z8rHfi+Bdo1gIW3KFTTLV3I/cxW1aWsxpHpy7fImIg9vxt9346JAk52CRnqOPFE0kovHnQ9zJiKQowd3\n        sW+3kJ1Cb3y8PNm4wYN1a9xY7z5f/d+MQPATMS7uX9kMtOAAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"saveToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPrZLdS9NRGMd//0L33QRddFtTYzgXq8GvXENZ\n        Ngwrwl5+kWZpukwTFSvTqPkG2QqXTlqtJuGkIl/AFCkRZSpZmrmiJQ41xSaCwdfznP3yuIouogeem8P5\n        fM55XqT/Es+fhUHpa11Ci3cRD93zaGoM4a5jGnW1X2C/FcD18kmUloyjsOAt8nJHcP6cHyouSQR2dQK1\n        NSv4WyyvrMKU2oVDqU95qrgkeZ8scEFlxTf16u9BcGh+GbssL6DRKLAe9AiB+8EcF5SWfFWvR8dP+GNw\n        ATFmHwouTeGApVkInA0zXHDR9kFFRGyEhydC2CZ7kZM9huQkpxDU3w5yQdbZERWLxK9wnz+IzQY3FGUA\n        ZrNDCGqqP3OBcmpARf8Md/Z/wqb4Rhw+8gqJiXVCcKNyCh3tYKMEjh1/A+vRXt5tahjVTN+mlyNwN1Ks\n        LyHLdiG4UjaBNh/YDgDNrh9s7t9Rfm2WN5UaRjVnZvjX4f3JrTAaK4TgcuEYPI+A+85VtjhhmNKyo9KS\n        bkPamaIInMTgfR4YDGVCYMsbZTBQXRXmLxNE5zE6GYPvZzA6OQsl9yr2mFo4rNvtgl5fJAS0lo47WP82\n        CQg+nX8T7wJzCEwv4kKxHbEGF4ObEJtwD7r4fCHIzBhidS9xeKvRgy07ZDxu64GvvQ8d3f3ofT2IvWYr\n        NPoGxDF4u7YeWm1OtODkiR6+nrRhtCQ0ZxoVdZsaRjXTq5QE74zLEoJ/D0laA2xoOmtG+TV7AAAAAElF\n        TkSuQmCC\n</value>\n  </data>\n  <data name=\"printToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPrZL7T1JxAMVZP/b/tLa2Wm21mail1YZlRjid\n        k6JhTApClhGmktrDWlKjK3OBDrLAMWJaY9MZZJbo0umWQIEFXRPQMB6ne788HFpbW322s93d3fM598X5\n        7xjtUxh0vId5dOaPMY14kL18O6zgrcePrWz8TMIbWMGgbQIlZy6DW31pu4Qts0ml0gjRETjdH0iGHC4Y\n        LONwz/hQJVITQbZSiN7qxsfPdHYzA7u8Go1jdnEZJruLLP92XWsaB5sks+4LhgvWbc5puDxeVDaocOSs\n        HBrtM9zps21KFJ1PSHnENZ9fzS0HwzHML4XRa3CglC+Dsqsfj0xjKGVEpNzUpof6/hAoyxs8MDqhf/4a\n        tyk7rt4yQtyiBb+xA+U1ChSfluLkuevo1lkhUWlRnHuMm49fIBKLk+WtJJIprMcT5E6+0uv49CUKeTuF\n        OmkXcweyjEB1zwzLq3d46nCDMr/E3b5hqHsGIGvXQdTcA8HFDvAaWnBUIEfRKQnOM+cqhdew/7goI1B2\n        D8AfCGU3C4msbcAbXMVOcEh2UBzwxW0oqZZi1+GajKC504DpuSUw7ywPe/wtmsCcfw1jszQpW7OCY7UK\n        7KsQbgqUGgqaXhN8oTjoWBqB72ksLqcwsfADw5NR9DtXSDGXQzwxKecF9ZJWyG7oMDrpJ9/2b1IgYJGo\n        HqKiTokywRVwmd+0qKoJB3mNOHDiAvaWC7GnrB67ubX5YkH53+BwfgHgHTGbZU7qDAAAAABJRU5ErkJg\n        gg==\n</value>\n  </data>\n  <data name=\"printPreviewToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPrZDdS1NhAIf3z4RXXkRqEd5IoCaKROWc6YVN\n        XMQkMFToZjcpQaatoVuiq+UkTTrFWR/OyuWmNaGoYDLtIkHUKfOjSJxuc0/7OHObx4+bHvjxvhe/33MO\n        r+K/IDpn2B9hzMOQ/RtW21Q8UvVgYoPD6B3+SF5J3dGSF45pqS6ny2pndNJztGT43Q+pLsfw5G18nIw0\n        yeTpmy9SPUUouMX45DjGRxZu39NzR99Ffpn6YEG/6JZmCba3txBHRnjvnMDnX2V+2Y9VEFFrm6jR3pJL\n        zIJLmiZwTLiwO5zxeygMfwO7LK2HMZifoarVyAU9Q2PxcpJus4XFFf/eePl3iNnFIDbXDJXV1XJB98Co\n        NE3QaexhYWUtMd4IR8c7uGcDPHzu5mJFhVwQe+l0BNGGaHfg24h+eSnI558BXn/dpKFFR2VVFfrWpkxJ\n        uiASifBrbo67nQb6Bl/x0uXFJLhpaNahVF1m8H4NoulGpiRdsBMMs/4ngMfr5YHRiOa6lqt19VxRXsBw\n        8xy+x0XsfqrF0tGYkiQFsfOwtLa1c60sh++6XBZMBazZlDRrylOC3PPqY1NYcglN6Sk+tJyhvjgbVelp\n        +YMeR+wv8k9mUXz2RHSsUPwDd10kHqNu+GEAAAAASUVORK5CYII=\n</value>\n  </data>\n  <data name=\"helpToolStripButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKWSURBVDhPjZJbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb\n        b2aIFop5GXPeyrmp8zLNec01HbmpqJvabjbndHl3JTmGbk7zroUXKD79N5XMFPzCjwMHPp9zzu/8ROdF\n        3eChpGSc7OxBsrIcHG1fLCE4VBMT69TVz6J5P4NUekHRMexyrVOumsBqW+OjOUC/eR5tiwdJtvN80Wm4\n        q3sZh+MnA9YdbNYt+vvW0esXaWqeFm409K/oNNzRGcRi3qKnZ5X2jmXaBLBVN09T4xwqlQe5fIycvKFD\n        wWlYbwiEQYMhSIt2gcZGLzU1s5SXT6NQjJKfP8KLZDMJz42caNhmGNa2zKPTLaB556O+bo6W9gCy1k1i\n        S/eJke0gqQkgL58k/pkRffvgoUDbOoVc4aauwcvb6q9UlnlQlkyh1gVJ0kKVFT4vCOWHevsvHuf5aTN7\n        mPP7EIklNrS6SSRSO7LiYWRFo7wpdFPb7CVRA7phWFzaJqPAxL0n6vBqcO1yJ9FNodKF6GWKEd9yAJNl\n        jLT0PsRiW/jPc5tWUFkI5xgeGfOH19J6J1LNEnHxJkQZWRqKlb0sbQeZXxXeV2JBmmvnYcEGhrFDQSih\n        W4QEtx5UUtE8StPAARHXKxC9LhoSTu4XyojZMcXGwXeszi9EiwPoTwh2fuyH4ZQcE3MrQi8se1yJzP87\n        B5IcO+mZfRSX2fAGF1B1LyLv3D3CwSmcLq9x4RXgKaGZyaUeomPU/09keqaZV4Koy/KNu8njdLkP2PsN\n        xk9+om4XM7MIFV1rXL6pJE9pOXukM8UWUtN6aWib4UasCXGtD61jj2brLkmKGS5FKUhI/cDAaOBswXFU\n        1W6KlE7inrYTcS2Xq5EZ3H9UhUxlY2gyKMAi0R+3BHAuvd7mVQAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <metadata name=\"statusStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>223, 17</value>\n  </metadata>\n  <metadata name=\"toolTip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>332, 17</value>\n  </metadata>\n  <metadata name=\"$this.TrayHeight\" type=\"System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>51</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridScrollable.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(vector=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n   [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", \n      MessageId = \"0\", Justification=\"Research suggests the Code Analysis message is incorrect.\")] \n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.WinForms;\n\n#pragma warning disable 1587\n/// <summary>Example usage of <see cref=\"HexUtilities\"/> with <see cref=\"HexUtilities.HexgridPanel\"/> \n/// in a simple <see cref=\"WinForms\"/> application.</summary>\n#pragma warning restore 1587\n[assembly:CLSCompliant(true)]\nnamespace PGNapoleonics.HexgridScrollableExample {\n  static class Program {\n    volatile static int i = 0;\n\n    /// <summary>The main entry point for the application.</summary>\n    [STAThread]\n    static void Main()      {\n      Application.EnableVisualStyles();\n      Application.SetCompatibleTextRenderingDefault(false);\n      Application.ThreadException += \n        new ThreadExceptionEventHandler(\n          (new ThreadExceptionHandler()).ApplicationThreadException);\n      switch (i) {\n        default:\n        case 0:  Application.Run(new MdiParent()); break;\n        case 1:  Application.Run(new ExampleHexgridPanelExample()); break;\n        case 2:  Application.Run(new ExampleHexgridScrollable()); break;\n        case 3:  Application.Run(new ExampleBufferedHexgridScrollable()); break;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\nusing System.Resources;\n\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridScrollableExample\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridScrollableExample\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4a8c8786-a6f8-4d6e-829a-9fea0edb6a23\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n\n[assembly: NeutralResourcesLanguageAttribute(\"en-US\")]\n\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridScrollableExample.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexgridScrollableExample.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Text Files (*.txt)|*.txt|All Files (*.*)|*.*.\n        /// </summary>\n        internal static string FileExtensionMask {\n            get {\n                return ResourceManager.GetString(\"FileExtensionMask\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to &quot;Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}&quot;.\n        /// </summary>\n        internal static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"FileExtensionMask\" xml:space=\"preserve\">\n    <value>Text Files (*.txt)|*.txt|All Files (*.*)|*.*</value>\n  </data>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>\"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\"</value>\n  </data>\n</root>"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexgridScrollableExample.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "codeplex/HexgridScrollableExample/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "codeplex/Utilities/DebugTracing.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;     // For StructLayout, DllImport\n\nnamespace PG_Napoleonics.Utilities {\n  [StructLayout(LayoutKind.Sequential)]\n  public sealed class _SystemTime {\n    public ushort year;\n    public ushort month;\n    public ushort weekday;\n    public ushort day;\n    public ushort hour;\n    public ushort minute;\n    public ushort second;\n    public ushort millisecond;\n\n    public override string ToString() {\n      return string.Format(\"{0,2}:{1,2}:{2,2}.{3,3}\", \n        this.hour, this.minute, this.second, this.millisecond);\n    }\n  }\n  [Flags]\n  public enum TraceFlag  {\n     None           = 0x0000\n    ,Painting       = 0x0001\n    ,FieldOfView    = 0x0002\n    ,Mouse          = 0x0004\n    ,MouseMove      = 0x0008\n    ,MainForm       = 0x0010\n    ,FindPath       = 0x0020\n    ,Docking        = 0x0040\n    ,MenuEvents     = 0x0080\n    ,KeyEvents      = 0x0100\n    ,Sizing         = 0x0200\n    ,ScrollEvents   = 0x0400\n    ,ToolTipEvents  = 0x0800\n    ,Caching        = 0x1000\n    ,Initialization = 0x2000\n    ,Solo          = Int32.MinValue // 0x40000000\n  }\n\n  public sealed partial class DebugTracing {\n    [DllImport(\"Kernel32.dll\")]\n    private static extern void GetSystemTime([In,Out] _SystemTime st);\n\n    public static TraceFlag EnabledFags { get; set; }\n\n    public static string GetTimeString() {\n      var st = new _SystemTime();\n      GetSystemTime(st); \n      return st.ToString();\n    }\n\n  #if DEBUG\n      public static void Trace(TraceFlag flags, string format, params object[] args) {\n        Trace(flags, false, string.Format(format,args));\n      }\n      public static void Trace(TraceFlag flags, bool newline, string format, params object[] args) {\n        Trace(flags, newline, string.Format(format,args));\n      }\n      public static void Trace(TraceFlag flags, bool newline, string description) {\n        if (EnabledFags.HasFlag(flags)) {\n          if(newline) Debug.WriteLine(\"\");\n          Debug.WriteLine(description);\n        }\n      }\n\n      public static void LogTime(TraceFlag flags, string format, params object[] args) {\n        LogTime(flags, false, string.Format(format,args));\n      }\n      public static void LogTime(TraceFlag flags, bool newline, string format, params object[] args) {\n        LogTime(flags, newline, string.Format(format,args));\n      }\n      public static void LogTime(TraceFlag flags, string description) {\n        LogTime(flags, false, description);\n      }\n      public static void LogTime(TraceFlag flags, bool newline, string description) {\n        if (EnabledFags.HasFlag(flags)) {\n          if(newline) Debug.WriteLine(\"\");\n          Debug.Write(\"{0} - \", GetTimeString());\n          Trace(flags, false, description);\n        }\n      }\n    #else\n      public static void Trace(TraceFlag flags, string format, params object[] args) {}\n      public static void Trace(TraceFlag flags, bool newline, string format, params object[] args) {}\n      public static void Trace(TraceFlag flags, bool newline, string description) {}\n\n      public static void LogTime(TraceFlag flags, string format, params object[] args) {}\n      public static void LogTime(TraceFlag flags, bool newline, string format, params object[] args) {}\n      public static void LogTime(TraceFlag flags, string description) {}\n      public static void LogTime(TraceFlag flags, bool newline, string description) {}\n    #endif\n  }\n\n  public static partial class Extensions {\n    #if DEBUG\n      public static void Trace(this TraceFlag @this, string format, params object[] args) {\n        DebugTracing.Trace(@this,format,args);\n      }\n      public static void Trace(this TraceFlag @this, bool newline, string format, params object[] args) {\n        DebugTracing.Trace(@this,newline,format,args);\n      }\n      public static void Trace(this TraceFlag @this, bool newline, string description) {\n        DebugTracing.Trace(@this,newline,description);\n      }\n\n      public static void LogTime(this TraceFlag @this, string format, params object[] args) {\n        DebugTracing.LogTime(@this,format,args);\n      }\n      public static void LogTime(this TraceFlag @this, bool newline, string format, params object[] args) {\n        DebugTracing.LogTime(@this,newline,format,args);\n      }\n      public static void LogTime(this TraceFlag @this, string description) {\n        DebugTracing.LogTime(@this,description);\n      }\n      public static void LogTime(this TraceFlag @this, bool newline, string description) {\n        DebugTracing.LogTime(@this,newline,description);\n      }\n    #else\n      public static void Trace(this TraceFlag @this, string format, params object[] args) {}\n      public static void Trace(this TraceFlag @this, bool newline, string format, params object[] args) {}\n      public static void Trace(this TraceFlag @this, bool newline, string description) {}\n\n      public static void LogTime(this TraceFlag @this, string format, params object[] args) {}\n      public static void LogTime(this TraceFlag @this, bool newline, string format, params object[] args) {}\n      public static void LogTime(this TraceFlag @this, string description) {}\n      public static void LogTime(this TraceFlag @this, bool newline, string description) {}\n    #endif\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/DictPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  public interface IPriorityQueue<TPriority,TValue> \n    where TPriority : struct, IComparable<TPriority>, IEquatable<TPriority>\n  {\n    bool IsEmpty { get; }\n\n    void                           Enqueue(TPriority priority, TValue value);\n    TValue                         Dequeue();\n    KeyValuePair<TPriority,TValue> Peek();\n  }\n\n  /// <summary>Stable (insertion-order preserving for equal-priority elements) PriorityQueue implementation.</summary>\n  /// <remarks>Eric Lippert's C# implementation of PrioirtyQueue for use by the A* algorithm.</remarks>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/08/path-finding-using-a-in-c-3-0-part-three.aspx</cref>\n  /// <typeparam name=\"TPriority\">Type of the queue-item prioirty.</typeparam>\n  /// <typeparam name=\"TValue\">Type of the queue-item value.</typeparam>\n  public sealed class DictPriorityQueue<TPriority,TValue> : IPriorityQueue<TPriority,TValue>\n    where TPriority : struct, IComparable<TPriority>, IEquatable<TPriority> \n  {\n    IDictionary<TPriority,Queue<TValue>> list = new SortedDictionary<TPriority,Queue<TValue>>();\n\n    public bool IsEmpty { get { return !list.Any(); } }\n\n    public void Enqueue(TPriority priority, TValue value) {\n      Queue<TValue> queue;\n      if( ! list.TryGetValue(priority, out queue) ) {\n        queue = new Queue<TValue>();\n        list.Add(priority, queue);\n      }\n      queue.Enqueue(value);\n    }\n\n    public TValue Dequeue() {\n      var pair = list.First();\n      var v    = pair.Value.Dequeue();\n      if( pair.Value.Count == 0)  list.Remove(pair.Key);\n\n      return v;\n    }\n\n    public KeyValuePair<TPriority,TValue> Peek() { \n      var peek = list.First();\n      return new KeyValuePair<TPriority,TValue>(peek.Key, peek.Value.Peek()); \n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/FastList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  /// <summary>Joe Duffy's Simple Fast List enumerator.</summary>\n  /// <seealso cref=\"http://www.bluebytesoftware.com/blog/2008/09/21/TheCostOfEnumeratingInNET.aspx\"/>\n  public class FastList<T> : IEnumerable<T>, IFastEnumerable<T>, IForEachable<T>, IForEachable2<T>{\n    private T[] m_array;\n\n    public FastList(T[] array) { m_array = array; }\n\n    IEnumerator<T> IEnumerable<T>.GetEnumerator(){\n      return new ClassicEnumerable<T>(m_array);\n    }\n    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator(){\n      return new ClassicEnumerable<T>(m_array);\n    }\n    IFastEnumerator<T> IFastEnumerable<T>.GetEnumerator() {\n      return new FastEnumerable<T>(m_array);\n    }\n    void IForEachable<T>.ForEach(Action<T> action) {\n      T[] a = m_array;\n      for (int i = 0, c = a.Length; i < c; i++)    action(a[i]);\n    }\n    void IForEachable2<T>.ForEach(Functor<T> functor) {\n      T[] a = m_array;\n      for (int i = 0, c = a.Length; i < c; i++)    functor.Invoke(a[i]);\n    }\n\n    public T this[int index] { get { return m_array[index]; } }\n  }\n\n  /// <remarks>\n  /// The idea behind IFastEnumerable<T> (and specifically IFastEnumerator<T>) is to return\n  /// the current element during the call to MoveNext itself.  This cuts the number of\n  /// interface method calls necessary to enumerate a list in half.  The impact to performance\n  /// isn’t huge, but it was enough to cut our overhead from about 3X to 2.3X.  Every little\n  /// bit counts.\n  /// </remarks>\n  /// <typeparam name=\"T\"></typeparam>\n  public interface IFastEnumerable<T> {\n    IFastEnumerator<T> GetEnumerator();\n  }\n  public interface IFastEnumerator<T>{\n    bool MoveNext(ref T elem);\n  }\n\n  /// <summary>Delegated ForEach.</summary>\n  /// <remarks>\n  /// The IForEachable<T> interface is a push model in the sense that the caller provides a\n  /// delegate and the ForEach method is responsible for invoking it once per element in the\n  /// collection.  ForEach doesn’t return until this is done.  In addition to having far\n  /// fewer method calls to enumerate a collection, there isn’t a single interface method call.\n  /// Delegate dispatch is also much faster than interface method dispatch.  The result is\n  /// nearly twice as fast as the classic IEnumerator<T> pattern (when /o+ isn’t defined).  \n  /// Now we’re really getting somewhere!\n  /// </remarks>\n  /// <typeparam name=\"T\"></typeparam>\n  public interface IForEachable<T>{\n    void ForEach(Action<T> action);\n  }\n\n  /// <summary>Replaces delegate calls with virtual method calls.</summary>\n  /// <remarks>\n  /// Somebody calling it will pass an instance of the Functor<T> class with the Invoke \n  /// method overridden.  The implementation of ForEach then looks quite a bit like \n  /// IForEachable<T>’s, just with virtual method calls in place of delegate calls:\n  /// </remarks>\n  public interface IForEachable2<T> {\n    void ForEach(Functor<T> functor);\n  }\n\n  public abstract class Functor<T>{\n    public abstract void Invoke(T t);\n  }\n\n  /// <summary>Implements IEnumerable<T> in the standard way:</summary>\n  public class ClassicEnumerable<T> : IEnumerator<T>{\n    private T[] m_a;\n    private int m_index = -1;\n    internal ClassicEnumerable(T[] a) { m_a = a; }\n\n    public bool MoveNext() { return ++m_index < m_a.Length; }\n    public T Current { get { return m_a[m_index]; } }\n    object System.Collections.IEnumerator.Current { get { return Current; } }\n    public void Reset() { m_index = -1; }\n    public void Dispose() { }\n  }\n\n  public class FastEnumerable<T> : IFastEnumerator<T>{\n    private T[] m_a;\n    private int m_index = -1;\n    internal FastEnumerable(T[] a) { m_a = a; } \n\n    public bool MoveNext(ref T elem) {\n      T[] a = m_a;\n      int i;\n      if ((i = ++m_index) >= a.Length)     return false;\n      elem = a[i];\n      return true;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HeapPriorityQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  /// <summary>Fast (but unstable) implementation of PriorityQueue.</summary>\n  /// <typeparam name=\"TPriority\"></typeparam>\n  /// <typeparam name=\"TValue\"></typeparam>\n  public sealed class HeapPriorityQueue<TPriority,TValue> : IPriorityQueue<TPriority,TValue>\n    where TPriority : struct, IComparable<TPriority>, IEquatable<TPriority>\n  {\n    IHeap<KeyValuePair<TPriority,TValue>> heap = new MinListHeap<KeyValuePair<TPriority,TValue>>();\n\n    public bool IsEmpty { get { return heap.IsEmpty; } }\n\n    public void Enqueue(TPriority priority, TValue value) {\n      heap.Add(new KeyValuePair<TPriority,TValue>(priority, value));\n    }\n\n    public TValue Dequeue() { return heap.ExtractFirst().Value; }\n\n    public KeyValuePair<TPriority,TValue> Peek() { return heap.Peek(); }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/Coords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public enum CoordsType { Canon, User, Custom }\n\n  public abstract partial class Coords : ICoordsCanon, ICoordsUser, ICoordsCustom,\n    IEquatable<Coords>, IEqualityComparer<Coords> {\n    #region Constructors\n    protected Coords(CoordsType coordsType, IntVector2D vector) {\n      switch(coordsType) {\n        default:\n        case CoordsType.Canon:   _vectorCanon  = vector;  isUserNull   = isCustomNull = true;  break;\n        case CoordsType.User:    _vectorUser   = vector;  isCustomNull = isCanonNull  = true;  break;\n        case CoordsType.Custom:  _vectorCustom = vector;  isCanonNull  = isUserNull   = true;  break;\n      }\n    }\n    #endregion\n\n    /// <inheritDoc/>\n    /// <remarks>Prefers Custom over User over Canon in choosing which values to present.</remarks>\n    public override string ToString() {\n      return ! isCustomNull ? string.Format(\"Custom: {0}\", VectorCustom)\n                            : string.Format(\"User: {0}\",   VectorUser);\n    }\n\n    #region Value Equality\n    bool IEquatable<Coords>.Equals(Coords rhs) { return this == rhs; }\n    public override bool Equals(object rhs) { return (rhs is Coords) && this == (Coords)rhs; }\n    public static bool operator == (Coords lhs, Coords rhs) { return lhs.VectorCanon.Equals(rhs.VectorCanon); }\n    public static bool operator != (Coords lhs, Coords rhs) { return ! (lhs == rhs); }\n    public override int GetHashCode() { return VectorUser.GetHashCode(); }\n\n    bool IEqualityComparer<Coords>.Equals(Coords lhs, Coords rhs) { return lhs == rhs; }\n    int  IEqualityComparer<Coords>.GetHashCode(Coords coords) { return coords.GetHashCode(); }\n    #endregion\n\n    #region Conversions\n    protected static IntMatrix2D MatrixUserToCanon;\n    protected IntVector2D VectorCanon {\n      get { return !isCanonNull ? _vectorCanon : VectorUser * MatrixUserToCanon; }\n      set { _vectorCanon = value;  isUserNull = isCustomNull = true; }\n    } IntVector2D _vectorCanon;\n    bool isCanonNull;\n\n    protected static IntMatrix2D MatrixCanonToUser;\n    protected IntVector2D VectorUser {\n      get { return !isUserNull  ? _vectorUser \n                 : !isCanonNull ? VectorCanon  * MatrixCanonToUser\n                                : VectorCustom * MatrixCustomToUser; }\n      set { _vectorUser  = value;  isCustomNull = isCanonNull = true; }\n    } IntVector2D _vectorUser;\n    bool isUserNull;\n\n    protected static IntMatrix2D MatrixCustomToUser;\n    protected static IntMatrix2D MatrixUserToCustom;\n    protected IntVector2D VectorCustom {\n      get { return !isCustomNull ? _vectorCustom : VectorUser * MatrixUserToCustom; }\n      set { _vectorCustom  = value;  isCanonNull = isUserNull = true; }\n    } IntVector2D _vectorCustom;\n    bool isCustomNull;\n    #endregion\n\n    protected abstract IEnumerable<NeighbourCoords> GetNeighbours(Hexside hexsides);\n    protected abstract int Range(ICoordsCanon coords);\n    protected abstract ICoordsCanon StepOut(IntVector2D vector);\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/HexCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public sealed partial class HexCoords : Coords {\n    static HexCoords() {\n      MatrixUserToCanon  = new IntMatrix2D(2, 1,  0,2,  0,0,  2);\n      MatrixCanonToUser  = new IntMatrix2D(2,-1,  0,2,  0,1,  2);\n      MatrixCustomToUser = new IntMatrix2D(2, 0,  0,2,  0,0,  2); // default to identity transformation, and\n      MatrixUserToCustom = new IntMatrix2D(2, 0,  0,2,  0,0,  2); // its inverse, also the identity transformation\n    }\n\n    static readonly ICoordsCanon _EmptyCanon = HexCoords.NewCanonCoords(0,0);\n    static readonly ICoordsUser  _EmptyUser  = HexCoords.NewUserCoords(0,0);\n    public static ICoordsCanon EmptyCanon { get { return _EmptyCanon; } }\n    public static ICoordsUser  EmptyUser  { get { return _EmptyUser; } }\n\n    #region Constructors\n    public static ICoordsCanon  NewCanonCoords (IntVector2D vector){ return new HexCoords(CoordsType.Canon, vector); }\n    public static ICoordsUser   NewUserCoords  (IntVector2D vector){ return new HexCoords(CoordsType.User,vector); }\n    public static ICoordsCustom NewCustomCoords(IntVector2D vector){ return new HexCoords(CoordsType.Custom,vector); }\n    public static ICoordsCanon  NewCanonCoords (int x, int y) { return new HexCoords(CoordsType.Canon, x,y); }\n    public static ICoordsUser   NewUserCoords  (int x, int y) { return new HexCoords(CoordsType.User,x,y); }\n    public static ICoordsUser   NewCustomCoords(int x, int y) { return new HexCoords(CoordsType.Custom,x,y); }\n\n    HexCoords(CoordsType coordsType, IntVector2D vector) : base(coordsType, vector) {}\n    HexCoords(CoordsType coordsType, int x, int y) : base(coordsType, new IntVector2D(x,y)) {}\n    #endregion\n\n    #region protected overrides\n    protected override IEnumerable<NeighbourCoords> GetNeighbours(Hexside hexsides) {\n      ICoordsCanon coords = this;\n      foreach (Hexside hexside in Enum.GetValues(typeof(Hexside)))\n        if (hexside != Hexside.None  &&  hexsides.HasFlag(hexside)) \n          yield return new NeighbourCoords(hexside, coords.StepOut(hexside));\n    }\n\n    protected override int Range(ICoordsCanon coords) {\n      var deltaX = coords.X - VectorCanon.X;\n      var deltaY = coords.Y - VectorCanon.Y;\n      return (Math.Abs(deltaX) + Math.Abs(deltaY) + Math.Abs(deltaX-deltaY)) / 2;\n    }\n\n    protected override ICoordsCanon StepOut(IntVector2D vector) { \n      return NewCanonCoords(VectorCanon + vector); \n    }\n    #endregion\n  } \n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  /// <summary></summary>\n  public class HexEventArgs : MouseEventArgs {\n    public ICoordsUser  Coords       { get; private set; }\n\n    public bool         Alt          { get { return ModifierKeys.HasFlag(Keys.Alt);  } }\n    public bool         Control      { get { return ModifierKeys.HasFlag(Keys.Control); } }\n    public bool         Shift        { get { return ModifierKeys.HasFlag(Keys.Shift); } }\n\n    public Keys         ModifierKeys { get; private set; }\n\n    public HexEventArgs(ICoordsUser coords) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0)) {}\n    public HexEventArgs(ICoordsUser coords, Keys modifierKeys) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0), modifierKeys) {}\n    public HexEventArgs(ICoordsUser coords, MouseEventArgs e) \n      : this(coords, e, Keys.None) {}\n    public HexEventArgs(ICoordsUser coords, MouseEventArgs e, Keys modifierKeys)\n      : base(e.Button,e.Clicks,e.X,e.Y,e.Delta) {\n      Coords       = coords;\n      ModifierKeys = modifierKeys;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/HexGridPanel.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"$this.TrayLargeIcon\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>False</value>\n  </metadata>\n</root>"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/HexgridPanel.Designer.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public partial class HexgridPanel {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n        if (_mapBuffer!=null) _mapBuffer.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      this.SuspendLayout();\n      // \n      // HexgridPanel\n      // \n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/HexgridPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Drawing.Imaging;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\n\nusing PG_Napoleonics.Utilities.HexUtilities;\nusing PG_Napoleonics.Utilities.WinForms;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface IMapDisplay {\n    Size   GridSize      { get; }\n    Size   MapSizePixels { get; }\n    string Name          { get; }   // only used in DebugTracing calls\n\n    UserCoordsRectangle GetClipCells(PointF point, SizeF size);\n    UserCoordsRectangle GetClipCells(RectangleF visibleClipBounds);\n\n    void  PaintHighlight(Graphics g);\n    void  PaintMap(Graphics g);\n    void  PaintUnits(Graphics g);\n  }\n\n  public partial class HexgridPanel : Panel, ISupportInitialize {\n    public HexgridPanel() {\n      InitializeComponent();\n    }\n    public HexgridPanel(IContainer container) {\n      container.Add(this);\n\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    public virtual void BeginInit() { \n      MapMargin = new System.Drawing.Size(5,5);\n      Scales    = new float[] {0.707F, 1.000F, 1.414F};\n    }\n    public virtual void EndInit() { \n      this.MakeDoubleBuffered(true);\n    }\n    #endregion\n\n    public event EventHandler<HexEventArgs> MouseAltClick;\n    public event EventHandler<HexEventArgs> MouseCtlClick;\n    public event EventHandler<HexEventArgs> MouseLeftClick;\n    public event EventHandler<HexEventArgs> MouseRightClick;\n    public event EventHandler<HexEventArgs> HotSpotHexChange;\n    public event EventHandler<EventArgs>    ScaleChange;\n\n    /// <summary>MapBoard hosting this panel.</summary>\n    public IMapDisplay Host          {\n      get { return _host; }\n      set { _host = value; MapBuffer = null; }\n    } IMapDisplay _host;\n\n    public ICoordsUser HotSpotHex    { get; private set; }\n\n    public bool        IsTransposed  { \n      get { return _isTransposed; }\n      set { _isTransposed = value; if (IsHandleCreated) SetScroll(); }\n    } bool _isTransposed;\n\n    /// <summary>Margin of map in pixels.</summary>\n    public Size        MapMargin     { get; private set; }\n\n    /// <summary>Size of map in pixels.</summary>\n    public Size        MapSizePixels { get {return Host.MapSizePixels + MapMargin.Scale(2);} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public float       MapScale      { get { return DesignMode ? 1 : Scales[ScaleIndex]; } }\n\n    /// <summary>Returns <code>ICoordsUser</code> of the hex closest to the center of the current viewport.</summary>\n    public ICoordsUser PanelCenterHex { \n      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ).User; }\n    }\n\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int ScaleIndex    { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(Scales.Length-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue; \n              OnScaleChange(EventArgs.Empty); \n            }\n      } \n    } int _scaleIndex;\n\n    /// <summary>Array of supported map scales (float).</summary>\n    public float[]     Scales        { \n      get {return _scales;}\n      set {_scales = value; if (_scaleIndex!=0) ScaleIndex = _scaleIndex;}\n    } float[] _scales;\n\n    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    public UserCoordsRectangle     VisibleRectangle {\n      get { return Host.GetClipCells( AutoScrollPosition.Scale(-1.0F/MapScale), \n                                      ClientSize.Scale(1.0F/MapScale) );\n      }\n    }\n\n    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    public virtual void SetScroll() {\n      var smallChange              = Size.Ceiling(Host.GridSize.Scale(MapScale));\n      HorizontalScroll.SmallChange = smallChange.Width;\n      VerticalScroll.SmallChange   = smallChange.Height;\n\n      var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n      HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n      VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n      var size                     = TransposeSize(Size.Ceiling(MapSizePixels.Scale(MapScale)));\n      if (AutoScrollMinSize != size) {\n        AutoScrollMinSize          = size;\n        HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, size.Width  - ClientSize.Width));\n        VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, size.Height - ClientSize.Height));\n        Invalidate();\n      }\n    }\n\n    #region Grid Coordinates\n    /// <summary>Scaled <code>Size</code> of each hexagon in grid, being the 'full-width' and 'full-height'.</summary>\n    SizeF GridSize { get { return Host.GridSize.Scale(MapScale); } }\n\n    /// Mathemagically (left as exercise for the reader) our 'picking' matrices are these, assuming: \n    ///  - origin at upper-left corner of hex (0,0);\n    ///  - 'straight' hex-axis vertically down; and\n    ///  - 'oblique'  hex-axis up-and-to-right (at 120 degrees from 'straight').\n    private Matrix matrixX { \n      get { return new Matrix((3.0F/2.0F)/GridSize.Width,  (3.0F/2.0F)/GridSize.Width,\n                                     1.0F/GridSize.Height,       -1.0F/GridSize.Height,  -0.5F,-0.5F); } \n    }\n    private Matrix matrixY { \n      get { return new Matrix(       0.0F,                 (3.0F/2.0F)/GridSize.Width,\n                                    2.0F/GridSize.Height,         1.0F/GridSize.Height,  -0.5F,-0.5F); } \n    }\n\n    /// <summary>Canonical coordinates for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Canonical coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public ICoordsCanon GetHexCoords(Point point) {\n      return GetHexCoords(point, new Size(AutoScrollPosition));\n    }\n    /// <summary>Canonical coordinates for a selected hex for a given AutoScroll position.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n    /// <returns>Canonical coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    protected ICoordsCanon GetHexCoords(Point point, Size autoScroll) {\n      if( Host == null ) return HexCoords.EmptyCanon;\n\n      autoScroll = TransposeSize(autoScroll);\n\n      // Adjust for origin not as assumed by GetCoordinate().\n      var grid    = new Size((int)(GridSize.Width*2F/3F), (int)GridSize.Height);\n      var margin  = new Size((int)(MapMargin.Width *MapScale), \n                             (int)(MapMargin.Height*MapScale));\n      point      -= autoScroll + margin + grid;\n\n      return HexCoords.NewCanonCoords( GetCoordinate(matrixX, point), \n                                    GetCoordinate(matrixY, point) );\n    }\n\n    /// <summary>Calculates a (canonical X or Y) grid-coordinate for a point, from the supplied 'picking' matrix.</summary>\n    /// <param name=\"matrix\">The 'picking' matrix</param>\n    /// <param name=\"point\">The screen point identifying the hex to be 'picked'.</param>\n    /// <returns>A (canonical X or Y) grid coordinate of the 'picked' hex.</returns>\n\t  private static int GetCoordinate (Matrix matrix, Point point){\n      var pts = new Point[] {point};\n      matrix.TransformPoints(pts);\n\t\t  return (int) Math.Floor( (pts[0].X + pts[0].Y + 2F) / 3F );\n\t  }\n\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\">ICoordsUser for the hex to be centered in viewport.</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    protected Point ScrollPositionToCenterOnHex(ICoordsUser coordsNewCenterHex) {\n      return HexCenterPoint(HexCoords.NewUserCoords(\n                coordsNewCenterHex.Vector - ( new IntVector2D(VisibleRectangle.Size.Vector) / 2 )\n      ));\n    }\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\">User (ie rectangular) hex-coordinates for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(ICoordsUser coordsNewULHex) {\n      if (coordsNewULHex == null) return new Point();\n      var offset = new Size((int)(GridSize.Width*2F/3F), (int)GridSize.Height);\n      var margin = Size.Round( MapMargin.Scale(MapScale) );\n      return TransposePoint(HexOrigin(GridSize,coordsNewULHex) + margin + offset);\n    }\n    Point HexOrigin(SizeF gridSize, ICoordsUser coords) {\n      return new Point(\n        (int)(GridSize.Width  * coords.X),\n        (int)(GridSize.Height * coords.Y   + GridSize.Height/2 * (coords.X+1)%2)\n      );\n    }\n    #endregion\n\n    #region Painting\n    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n    protected override void OnPaint(PaintEventArgs e) {\n      base.OnPaint(e);\n      if(IsHandleCreated)    PaintPanel(e.Graphics);\n    }\n    protected virtual void PaintPanel(Graphics g) {\n      var scroll = TransposePoint(AutoScrollPosition);\n      if (DesignMode) { g.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n      g.Clear(Color.White);\n      g.DrawRectangle(Pens.Black, ClientRectangle);\n\n      if (IsTransposed) { g.Transform = new Matrix(0F,1F, 1F,0F, 0F,0F); }\n      g.TranslateTransform(scroll.X, scroll.Y);\n      g.ScaleTransform(MapScale,MapScale);\n\n      var state = g.Save();\n      g.DrawImageUnscaled(MapBuffer, Point.Empty);\n\n      g.Restore(state); state = g.Save();\n      g.TranslateTransform(MapMargin.Width, MapMargin.Height);\n      Host.PaintUnits(g);\n\n      g.Restore(state); state = g.Save();\n      g.TranslateTransform(MapMargin.Width, MapMargin.Height);\n      Host.PaintHighlight(g);\n    }\n    #endregion\n\n    #region Double-Buffering\n    Bitmap MapBuffer     { \n      get { return _mapBuffer ?? ( _mapBuffer = PaintBuffer()); } \n      set { if (_mapBuffer!=null) _mapBuffer.Dispose(); _mapBuffer = value; }\n    } Bitmap _mapBuffer;\n    Bitmap PaintBuffer() {\n      var size   = MapSizePixels;\n      var buffer = new Bitmap(size.Width,size.Height, PixelFormat.Format32bppPArgb);\n      using(var g = Graphics.FromImage(buffer)) {\n        g.Clear(Color.White);\n        g.TranslateTransform(MapMargin.Width, MapMargin.Height);\n        Host.PaintMap(g);\n      }\n      return buffer;\n    }\n    #endregion\n\n    protected         bool        IsAltKeyDown   { get {return ModifierKeys.HasFlag(Keys.Alt);} }\n    protected         bool        IsCtlKeyDown   { get {return ModifierKeys.HasFlag(Keys.Control);} }\n    protected         bool        IsShiftKeyDown { get {return ModifierKeys.HasFlag(Keys.Shift);} }\n\n    Point TransposePoint(Point point) { return IsTransposed ? new Point(point.Y,point.X) : point; }\n    Size  TransposeSize(Size  size)   { return IsTransposed ? new Size (size.Height, size.Width) : size; }\n\n    protected override void OnMouseClick(MouseEventArgs e) {\n      TraceFlag.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n                                      Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n      var eventArgs = new HexEventArgs( GetHexCoords(TransposePoint(e.Location)).User, e, ModifierKeys);\n\n           if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n      else if (e.Button == MouseButtons.Right)    OnMouseRightClick(eventArgs);\n      else if (IsAltKeyDown  && !IsCtlKeyDown)    OnMouseAltClick(eventArgs);\n      else if (IsCtlKeyDown)                      OnMouseCtlClick(eventArgs);\n      else                                        OnMouseLeftClick(eventArgs);\n    }\n    protected override void OnMouseMove(MouseEventArgs e) {\n      var newHex = GetHexCoords(TransposePoint(e.Location)).User;\n      if ( ! newHex.Equals(HotSpotHex))\n        OnHotSpotHexChange(new HexEventArgs(newHex));\n      HotSpotHex = newHex;\n\n      base.OnMouseMove(e);\n    }\n    protected override void OnMouseWheel(MouseEventArgs e) {\n      TraceFlag.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Host.Name, e.ToString()); \n      if( Control.ModifierKeys.HasFlag(Keys.Control)) {\n        ScaleIndex += Math.Sign(e.Delta);  \n      } else {\n        var orientation = IsShiftKeyDown ? ScrollOrientation.HorizontalScroll\n                                         : ScrollOrientation.VerticalScroll;\n        WheelPanel(orientation, -e.Delta);\n      }\n      Invalidate();\n    }\n\n    protected virtual void OnMouseAltClick(HexEventArgs e) {\n      var handler = MouseAltClick;\n      if( handler != null ) handler(this, e);\n    }\n    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n      var handler = MouseCtlClick;\n      if( handler != null ) handler(this, e);\n    }\n    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n      var handler = MouseLeftClick;\n      if( handler != null ) handler(this, e);\n    }\n    protected virtual void OnMouseRightClick(HexEventArgs e) {\n      var handler = MouseRightClick;\n      if( handler != null ) handler(this, e);\n    }\n    protected virtual void OnHotSpotHexChange(HexEventArgs e) {\n      var handler = HotSpotHexChange;\n      if( handler != null ) handler(this, e);\n    }\n    protected virtual void OnScaleChange(EventArgs e) {\n      var handler = ScaleChange;\n      if( handler != null ) handler(this, e);\n    }\n\n    int mouseWheelHorizontalRemainder = 0;\n    int mouseWheelVerticalRemainder   = 0;\n    void WheelPanel(ScrollOrientation orientation, int delta) {\n      if( orientation == ScrollOrientation.VerticalScroll )\n        mouseWheelVerticalRemainder   = WheelPanelDetail(orientation, VerticalScroll,  delta,\n            (p,amount) => new Point(-p.X, -p.Y + amount), mouseWheelVerticalRemainder);\n      else\n        mouseWheelHorizontalRemainder = WheelPanelDetail(orientation, HorizontalScroll,delta,\n            (p,amount) => new Point(-p.X + amount, -p.Y), mouseWheelHorizontalRemainder);\n    }\n    int WheelPanelDetail(ScrollOrientation orientation, ScrollProperties scroll, int delta,\n      Func<Point,int,Point> newAutoScroll, int remainder) {\n      const int mouseWheelDelta = 120;\n\n      var scrollLines = SystemInformation.MouseWheelScrollLines;\n      var steps       = Math.Sign(delta) * ( (Math.Abs(delta+remainder) * scrollLines) / mouseWheelDelta );\n      remainder       = Math.Sign(delta) * ( (Math.Abs(delta+remainder) * scrollLines) % mouseWheelDelta );\n\n      if (steps != 0) {\n        var oldValue = scroll.Value;\n        AutoScrollPosition = newAutoScroll(AutoScrollPosition, scroll.SmallChange * steps);\n        OnScroll( new ScrollEventArgs(ScrollEventType.ThumbPosition, oldValue, scroll.Value, orientation) );\n      }\n      return remainder;\n    }\n    public void ScrollPanel(ScrollEventType type, ScrollOrientation orientation, int sign) {\n      if( sign != 0 ) {\n        ScrollProperties          scroll;\n        Func<Point,int,int,Point> func;\n        if( orientation == ScrollOrientation.VerticalScroll ) {\n          scroll = VerticalScroll;\n          func   = (p,sgn,stp) => new Point(-p.X, -p.Y + stp * sgn);\n        } else {\n          scroll = HorizontalScroll;\n          func   = (p,sgn,stp) => new Point(-p.X + stp * sgn, -p.Y);\n        }\n\n        var step = type.HasFlag(ScrollEventType.LargeIncrement) || type.HasFlag(ScrollEventType.LargeDecrement)\n                 ? scroll.LargeChange\n                 : scroll.SmallChange;\n        var oldValue = scroll.Value;\n        AutoScrollPosition = func(AutoScrollPosition, sign, step);\n        OnScroll( new ScrollEventArgs(type, oldValue, scroll.Value, orientation) );\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/IBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface IBoard<TGridHex> : INavigableBoard where TGridHex : class, IGridHex {\n    /// <summary>The rectangular extent of the board's hexagonal grid.</summary>\n    Size     SizeHexes                 { get; }\n    TGridHex this[ICoordsUser coords]  { get; }\n    TGridHex this[ICoordsCanon coords] { get; }\n\n    bool IsPassable(ICoordsUser coords);\n  }\n\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ICoordsCanon.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface ICoordsCanon {\n    int             X         { get; }\n    int             Y         { get; }\n    IntVector2D     Vector    { get; set; }\n    ICoordsCustom   Custom    { get; }\n    ICoordsUser     User      { get; }\n    string          ToString();\n    int             Range(ICoordsCanon coords);\n    IEnumerable<NeighbourCoords> GetNeighbours(Hexside hexsides);\n\n    ICoordsCanon StepOut(IntVector2D vector);\n    ICoordsCanon StepOut(Hexside hexside);\n  }\n\n  public partial class Coords {\n    int             ICoordsCanon.X          { get { return VectorCanon.X; } }\n    int             ICoordsCanon.Y          { get { return VectorCanon.Y; } }\n    IntVector2D     ICoordsCanon.Vector     { get { return VectorCanon;   }\n                                              set { VectorCanon=value;    } }\n    ICoordsUser     ICoordsCanon.User       { get { return this; } }\n    ICoordsCustom   ICoordsCanon.Custom     { get { return this; } }\n    string          ICoordsCanon.ToString() { return VectorCanon.ToString(); }\n\n    IEnumerable<NeighbourCoords> ICoordsCanon.GetNeighbours(Hexside hexsides) { \n      return GetNeighbours(hexsides); \n    }\n    int ICoordsCanon.Range(ICoordsCanon coords) { return Range(coords); }\n\n    ICoordsCanon ICoordsCanon.StepOut(IntVector2D vector) { return StepOut(vector); }\n    ICoordsCanon ICoordsCanon.StepOut(Hexside hexside) { \n      switch(hexside) {\n        case Hexside.NorthWest:   return StepOut(new IntVector2D(-1,-1));\n        case Hexside.North:       return StepOut(new IntVector2D( 0,-1));\n        case Hexside.NorthEast:   return StepOut(new IntVector2D( 1, 0));\n        case Hexside.SouthEast:   return StepOut(new IntVector2D( 1, 1));\n        case Hexside.South:       return StepOut(new IntVector2D( 0, 1));\n        case Hexside.SouthWest:   return StepOut(new IntVector2D(-1, 0));\n        default:                  throw new ArgumentOutOfRangeException();\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ICoordsCustom.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface ICoordsCustom {\n    int            X         { get; }\n    int            Y         { get; }\n    IntVector2D    Vector    { get; set; }\n    ICoordsCanon   Canon     { get; }\n    string         ToString();\n    int            Range(ICoordsCustom coords);\n    IEnumerable<NeighbourCoords> GetNeighbours(Hexside hexsides);\n  }\n\n  public partial class Coords {\n    int           ICoordsCustom.X          { get { return VectorCustom.X; } }\n    int           ICoordsCustom.Y          { get { return VectorCustom.Y; } }\n    IntVector2D   ICoordsCustom.Vector     { get { return VectorCustom;   }\n                                             set { VectorCustom=value;    } }\n    ICoordsCanon  ICoordsCustom.Canon      { get { return this;           } } \n    string        ICoordsCustom.ToString() { return VectorCustom.ToString(); }\n\n    IEnumerable<NeighbourCoords> ICoordsCustom.GetNeighbours(Hexside hexsides) { \n      return GetNeighbours(hexsides); \n    }\n    int ICoordsCustom.Range(ICoordsCustom coords) { return Range(coords.Canon); }\n\n    public static void SetCustomMatrices(IntMatrix2D userToCustom, IntMatrix2D customToUser) {\n      MatrixUserToCustom = userToCustom;\n      MatrixCustomToUser = customToUser;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ICoordsUser.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface ICoordsUser {\n    int             X         { get; }\n    int             Y         { get; }\n    IntVector2D     Vector    { get; set; }\n    ICoordsCanon    Canon     { get; }\n    string          ToString();\n    int             Range(ICoordsUser coords);\n    IEnumerable<NeighbourCoords> GetNeighbours(Hexside hexsides);\n  }\n\n  public partial class Coords {\n    int           ICoordsUser.X          { get { return VectorUser.X; } }\n    int           ICoordsUser.Y          { get { return VectorUser.Y; } }\n    IntVector2D   ICoordsUser.Vector     { get { return VectorUser;   }\n                                           set { VectorUser=value;    } }\n    ICoordsCanon  ICoordsUser.Canon      { get { return this;         } } \n    string        ICoordsUser.ToString() { return VectorUser.ToString(); }\n\n    IEnumerable<NeighbourCoords> ICoordsUser.GetNeighbours(Hexside hexsides) { \n      return GetNeighbours(hexsides); \n    }\n    int ICoordsUser.Range(ICoordsUser coords) { return Range(coords.Canon); }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/IGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface IGridHex {\n    ICoordsUser      Coords         { get; }\n    int              Elevation      { get; }\n    int              ElevationASL   { get; }\n    int              HeightObserver { get; }\n    int              HeightTarget   { get; }\n    int              HeightTerrain  { get; }\n    IBoard<IGridHex> Board          { get; }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/IntMatrix2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  /// <summary>Row-major order representation of an immutable integer matrix.</summary>\n  /// <remarks> Represents Points as row vectors and planes as column vectors.\n  /// This representation is standard for computer graphics, though opposite \n  /// to standard mathematical (and physics) representation, and treats \n  /// row vectors as contravariant and column vectors as covariant.</remarks>\n  public struct IntMatrix2D : IEquatable<IntMatrix2D> {\n    static IntMatrix2D TransposeMatrix = new IntMatrix2D(0,1, 1,0);\n    public static IntMatrix2D Transpose(IntMatrix2D matrix) {\n      return matrix * TransposeMatrix;\n    }\n\n    public int M11 { get; private set; }\n    public int M12 { get; private set; }\n    public int M21 { get; private set; }\n    public int M22 { get; private set; }\n    public int M31 { get; private set; }\n    public int M32 { get; private set; }\n    public int M33 { get; private set; }\n    public static IntMatrix2D Identity { get { return _identity; } }\n    static IntMatrix2D _identity = new IntMatrix2D(1,0,0,1,0,0);\n\n    #region Constructors\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector v.</summary>\n    /// <param name=\"v\">the translation vector</param>\n    public IntMatrix2D(IntVector2D v)  : this(1,0, 0,1, v.X,v.Y, 1) {}\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation (dx,dy).</summary>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int dx, int dy)  : this(1,0, 0,1, dx,dy,1) {}\n    /// <summary> Initialies a new <code>IntMatrix2D</code> with a rotation.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22) : this(m11,m12, m21,m22, 0,0, 1) {}\n    /// <summary>Copy Constructor for a new <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m\">Source IntegerMatrix</param>\n    public IntMatrix2D(IntMatrix2D m) : this(m.M11,m.M21, m.M12,m.M22, m.M31,m.M32, m.M33) { }\n    /// <summary>Initializes a new fully-specificed <code>IntMatrix2D</code> .</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy) : this(m11,m12,m21,m22,dx,dy,1) {}\n    /// <summary>Initializes a new fully-specificed non-normed <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    /// <param name=\"norm\">Normalization component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy, int norm) : this() {\n      M11 = m11;  M12 = m12;\n      M21 = m21;  M22 = m22;\n      M31 = dx;   M32 = dy;   M33 = norm;\n    }\n    #endregion\n\n    #region operators\n    /// <summary>(Contravariant) Vector application.</summary>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <returns>New IntVector2D resulting from application of this matrix to vector v.</returns>\n    public static IntVector2D operator * (IntVector2D v, IntMatrix2D m) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M21 + m.M31,   v.X * m.M12 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>Matrix multiplication.</summary>\n    /// <param name=\"m1\">Prepended transformation.</param>\n    /// <param name=\"m2\">Appended transformation.</param>\n    /// <returns></returns>\n    public static IntMatrix2D operator * (IntMatrix2D m1, IntMatrix2D m2) {\n      return new IntMatrix2D (\n        m1.M11*m2.M11 + m1.M12*m2.M21,           m1.M11*m2.M12 + m1.M12*m2.M22,\n        m1.M21*m2.M11 + m1.M22*m2.M21,           m1.M21*m2.M12 + m1.M22*m2.M22,\n        m1.M31*m2.M11 + m1.M32*m2.M21 + m2.M31,  m1.M31*m2.M12 + m1.M32*m2.M22 + m2.M32,  m1.M33 * m2.M33\n      );\n    }\n    #endregion\n\n    /// <summary>Vector Rotation (only).</summary>\n    /// <param name=\"v\">IntVector2D to be rotated.</param>\n    /// <returns>New IntVector2D resulting from rotaion (only) of vector v by this matrix \n    /// (ignoring any translation components of this matrix).</returns>\n    public IntVector2D Rotate(IntVector2D v) {\n      return new IntVector2D (v.X * M11 + v.Y * M12, v.X * M21 + v.Y * M22, v.W * M33).Normalize();\n    }\n\n    #region Value Equality\n    public override bool Equals(object obj) { \n      return (obj is IntMatrix2D) && this.Equals((IntMatrix2D)obj); \n    }\n    bool IEquatable<IntMatrix2D>.Equals(IntMatrix2D rhs)              { return this == rhs; }\n    public static bool operator != (IntMatrix2D lhs, IntMatrix2D rhs) { return ! (lhs == rhs); }\n    public static bool operator == (IntMatrix2D lhs, IntMatrix2D rhs) {\n      return lhs.M11== rhs.M11 && lhs.M12 == rhs.M12\n          && lhs.M21== rhs.M21 && lhs.M22 == rhs.M22\n          && lhs.M31== rhs.M31 && lhs.M32 == rhs.M32 && lhs.M33 == rhs.M33;\n    }\n    public override int GetHashCode() { return M11 ^ M12 ^ M21 ^ M22 ^ M31 ^ M32 ^ M33; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return string.Format(\"(({0},{1]),({2},{3}),({4],{5}),{6})\",M11,M12,M21,M22,M31,M32,M33);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/IntVector2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  /// <summary>Representation of an immutable integer 2D vector.</summary>\n  public struct IntVector2D : IEquatable<IntVector2D> {\n    public static readonly IntVector2D Empty = new IntVector2D(Point.Empty);\n\n    public int X { get; private set; }\n    public int Y { get; private set; }\n    public int W { get; private set; }\n\n    public IntVector2D(Point p)             : this(p.X, p.Y, 1) {}\n    public IntVector2D(Size s)              : this(s.Width, s.Height, 1) {}\n    public IntVector2D(IntVector2D v)       : this(v.X, v.Y, 1) {}\n    public IntVector2D(int x, int y)        : this(x, y, 1) {}\n    public IntVector2D(int x, int y, int w) : this() {\n      X = x;\n      Y = y;\n      W = w;\n    }\n\n    public IntVector2D Normalize() {\n      switch (W) {\n        case 1:   return this;\n        case 2:   return new IntVector2D(X >> 1, Y >> 1);\n        case 4:   return new IntVector2D(X >> 2, Y >> 2);\n        case 3:                                \n        default:  var x = (X >= 0) ? X : X - W;\n                  var y = (Y >= 0) ? Y : Y - W;\n                  return new IntVector2D(x/W, y/W);\n      }\n    }\n\n    #region Scalar operators\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (int s, IntVector2D v) { return v * s; }\n    public static IntVector2D operator * (IntVector2D v, int s) {\n      return new IntVector2D(v.X*s, v.Y*s);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, int i) {\n      return new IntVector2D(v.X/i, v.Y/i);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, float s) {\n      return new IntVector2D((int)Math.Floor(v.X/(float)s), (int)Math.Floor(v.Y/(float)s));\n    }\n    #endregion\n\n    #region Vector operators\n    /// <summary>Scalar (Inner, or Dot) Product of two <code>IntVector2D</code> as an Int32.</summary>\n   public static int operator * (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.X + v1.Y*v2.Y;\n    }\n    /// <summary>Z component of the 'Vector'- or Cross-Product of two <code>IntVector2D</code>s</summary>\n    /// <returns>A pseudo-scalar (it reverses sign on exchange of its arguments).</returns>\n    public static int operator ^ (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.Y - v1.Y*v2.X;\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n   public static IntVector2D operator + (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X+v2.X, v1.Y+v2.Y);\n    }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D operator - (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X-v2.X, v1.Y-v2.Y);\n    }\n    #endregion\n\n    #region Coords-vector operators\n    public static ICoordsCanon operator + (ICoordsCanon coords, IntVector2D vector) {\n      return HexCoords.NewCanonCoords(coords.Vector.X + vector.X, coords.Vector.Y + vector.Y);\n    }\n    public static ICoordsUser operator + (ICoordsUser coords, IntVector2D vector) {\n      return HexCoords.NewCanonCoords(coords.Vector.X + vector.X, coords.Vector.Y + vector.Y).User;\n    }\n    #endregion\n\n    #region Casts\n    public static implicit operator IntVector2D (Point p) { return new IntVector2D(p);  }\n    public static implicit operator IntVector2D (Size s)  { return new IntVector2D(s);  }\n    public static implicit operator Point (IntVector2D v) { return new Point(v.X, v.Y); }\n    public static implicit operator Size (IntVector2D v)  { return new Size(v.X, v.Y);  }\n    #endregion\n\n    #region Value Equality\n    public override bool Equals(object obj)              { \n      return (obj is IntVector2D) && this == (IntVector2D)obj; }\n    bool IEquatable<IntVector2D>.Equals(IntVector2D rhs) { return this == rhs; }\n    public static bool operator != (IntVector2D lhs, IntVector2D rhs) { return ! (lhs == rhs); }\n    public static bool operator == (IntVector2D lhs, IntVector2D rhs) {\n      return (lhs.X == rhs.X) && (lhs.Y == rhs.Y) && (lhs.W == rhs.W);\n    }\n    public override int GetHashCode() { return (X<<16) ^ Y ^ W; }\n    #endregion\n\n    public override string ToString() { return string.Format(\"({0,3},{1,3})\",X,Y); }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/NeighbourCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  [Flags] public enum Hexside {\n    None      = 0x00,\n    North     = 0x01,\n    NorthEast = 0x02,\n    SouthEast = 0x04,\n    South     = 0x08,\n    SouthWest = 0x10,\n    NorthWest = 0x20\n  }\n\n  public struct NeighbourCoords : IEquatable<NeighbourCoords> {\n    public Hexside      Direction { get; private set; }\n    public ICoordsCanon Coords    { get; private set; }\n\n    public NeighbourCoords(Hexside direction, ICoordsCanon coords) : this() {\n      Direction = direction; Coords = coords;\n    }\n    public override string ToString() { \n      return string.Format(\"Neighbour: {0} at {1}\", Coords.User,Direction);\n    }\n\n    #region Value Equality - on Coords field only\n    public override bool Equals(object obj) { \n      return (obj is NeighbourCoords) && this == (NeighbourCoords)obj;\n    }\n    bool IEquatable<NeighbourCoords>.Equals(NeighbourCoords obj)              { return this == obj; }\n    public static bool operator != (NeighbourCoords lhs, NeighbourCoords rhs) { return ! (lhs == rhs); }\n    public static bool operator == (NeighbourCoords lhs, NeighbourCoords rhs) {\n      return lhs.Direction == rhs.Direction  &&  lhs.Coords == rhs.Coords;\n    }\n    public override int GetHashCode() { return Coords.User.GetHashCode(); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/NeighbourHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface INeighbourHex {\n    IGridHex  Hex        { get; }\n    Hexside   Direction  { get; }\n    int       SequenceNo { get; }\n  }\n  public struct NeighbourHex : INeighbourHex, IEquatable<NeighbourHex> {\n    public IGridHex  Hex        { get; private set; }\n    public Hexside   Direction  { get; private set; }\n    public int       SequenceNo { get; private set; }\n    public NeighbourHex(IGridHex hex, Hexside direction) : this(hex,direction,0) {}\n    public NeighbourHex(IGridHex hex, Hexside direction, int seqNo) : this() {\n      Hex        = hex;\n      Direction  = direction;\n      SequenceNo = seqNo;\n    }\n\n    public override string ToString() { \n      return string.Format(\"NeighbourHex: {0} at {1}\",Hex.Coords,Direction);\n    }\n\n    public static IEnumerable<NeighbourHex> GetNeighbours(IGridHex hex) {\n      return hex.Coords.GetNeighbours(~Hexside.None)\n                .Select((nn,seq)=>new NeighbourHex(hex.Board[nn.Coords.User], nn.Direction, seq))\n                .Where(n=>n.Hex!=null)\n                .Select(nh=>nh);\n    }\n\n    #region Value Equality - on Hex field only\n    public override bool Equals(object obj)                               {\n      return (obj is NeighbourHex)  &&  this == (NeighbourHex)obj; \n    }\n    bool IEquatable<NeighbourHex>.Equals(NeighbourHex rhs)                { return this == rhs; }\n    public static bool operator != (NeighbourHex @this, NeighbourHex rhs) { return ! (@this == rhs); }\n    public static bool operator == (NeighbourHex @this, NeighbourHex rhs) { return @this.Hex == rhs.Hex; }\n    public override int GetHashCode()                                     { return Hex.Coords.GetHashCode(); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/Path.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface IPath<TNode> : IEnumerable<ICoordsCanon> where TNode:ICoordsCanon {\n    Hexside      LastDirection { get; }\n    ICoordsCanon LastStep      { get; }\n    IPath<TNode> PreviousSteps { get; }\n    int          Count         { get; }\n    uint         TotalCost     { get; }\n    uint         TotalSteps    { get; }\n  }\n\n  /// <summary>Eric Lippert's implementation for use in A*, modified for a hex-grid.</summary>\n  /// <remarks>An implementation of 'path' using an immutable stack.</remarks>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx</cref>\n  /// <typeparam name=\"TNode\">The type of a path-'node'.</typeparam>\n  public sealed class Path<TNode> : IPath<TNode> where TNode : ICoordsCanon\n  {\n    public Hexside      LastDirection { get; private set; }\n    public ICoordsCanon LastStep      { get; private set; }\n    public IPath<TNode> PreviousSteps { get{ return _previousSteps;} } Path<TNode> _previousSteps;\n    public int          Count         { get; private set; }\n    public uint         TotalCost     { get; private set; }\n    public uint         TotalSteps    { get; private set; }\n\n    public Path<TNode> AddStep(TNode step, uint stepCost, Hexside direction) {\n      return new Path<TNode>(this, step, direction, TotalCost + stepCost);\n    }\n\n    public Path(TNode start) : this(null, start, Hexside.None, 0) { }\n    private Path(Path<TNode> previousSteps, TNode thisStep, Hexside direction, uint totalCost)\n    : this(previousSteps, thisStep, direction, totalCost, 0) { }\n    private Path(Path<TNode> previousSteps, TNode thisStep, Hexside direction, uint totalCost, int count) {\n      _previousSteps = previousSteps;\n      LastDirection  = direction;\n      LastStep       = thisStep;\n      Count          = count;\n      TotalCost      = totalCost;\n      TotalSteps     = previousSteps==null ? 0 : previousSteps.TotalSteps+1;\n    }\n\n    public IEnumerator<ICoordsCanon> GetEnumerator() {\n      for (var p = (IPath<TNode>)this; p != null; p = p.PreviousSteps) {\n        yield return p.LastStep;\n        var step = p.LastStep;\n        for (var i=0; i<p.Count; i++) {\n          step = step.StepOut(p.LastDirection);\n          yield return step;\n        }\n      }\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n\n    public override string ToString() {\n      return string.Format(\"Hex: {0} with TotalCost={1,3} (as {2}/{3})\",\n        LastStep.User, TotalCost, TotalCost>>16, TotalCost &0xFFFF);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/Path2.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface IPath2 : IEnumerable<ICoordsUser>\n  { \n    Hexside       LastDirection { get; }\n    ICoordsUser   LastStep      { get; }\n    IPath2        PreviousSteps { get; }\n    int           Count         { get; }\n    uint          TotalCost     { get; }\n    uint          TotalSteps    { get; }\n  }\n\n  /// <summary>Eric Lippert's implementation for use in A*, modified for a hex-grid.</summary>\n  /// <remarks>An implementation of 'path' using an immutable stack.</remarks>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx</cref>\n  /// <typeparam name=\"TNode\">The type of a path-'node'.</typeparam>\n  public sealed class Path2 : IPath2\n  {\n    public Hexside      LastDirection { get; private set; }\n    public ICoordsUser  LastStep      { get; private set; }\n    public IPath2       PreviousSteps { get{ return _previousSteps;} } Path2 _previousSteps;\n    public int          Count         { get; private set; }\n    public uint         TotalCost     { get; private set; }\n    public uint         TotalSteps    { get; private set; }\n\n    public Path2 AddStep(ICoordsUser step, uint stepCost, Hexside direction) {\n      return new Path2(this, step, direction, TotalCost + stepCost);\n    }\n\n    public Path2(ICoordsUser start) : this(null, start, Hexside.None, 0) { }\n    private Path2(Path2 previousSteps, ICoordsUser thisStep, Hexside direction, uint totalCost)\n    : this(previousSteps, thisStep, direction, totalCost, 0) { }\n    private Path2(Path2 previousSteps, ICoordsUser thisStep, Hexside direction, uint totalCost, int count) {\n      _previousSteps = previousSteps;\n      LastDirection  = direction;\n      LastStep       = thisStep;\n      Count          = count;\n      TotalCost      = totalCost;\n      TotalSteps     = previousSteps==null ? 0 : previousSteps.TotalSteps+1;\n    }\n\n    public IEnumerator<ICoordsUser> GetEnumerator() {\n      for (var p = (IPath2)this; p != null; p = p.PreviousSteps) {\n        yield return p.LastStep;\n        var step = p.LastStep;\n        for (var i=0; i<p.Count; i++) {\n          step = step.Canon.StepOut(p.LastDirection).User;\n          yield return step;\n        }\n      }\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n\n    public override string ToString() {\n      return string.Format(\"Hex: {0} with TotalCost={1,3} (as {2}/{3})\",\n        LastStep, TotalCost, TotalCost>>16, TotalCost &0xFFFF);\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/PathFInder2.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public interface INavigableBoard {\n    int   StepCost(ICoordsCanon coords, Hexside hexside);\n    int   Heuristic(int range);\n    bool  IsOnBoard(ICoordsUser coords);\n  }\n\n  /// <summary>(Adapted) C# implementation of A* path-finding algorithm by Eric Lippert.</summary>\n  /// <remarks><quote>\n  /// A nice property of the A* algorithm is that it finds the optimal path in a reasonable \n  /// amount of time provided that:\n  ///   • the estimating function never overestimates the distance to the goal. \n  ///     (Think about what happens if the estimating function sometimes overestimates the distance;\n  ///     if the optimal path is one of the ones overestimated then it will possibly not make it to \n  ///     the front of the priority queue before a nonoptimal solution is found.)\n  ///   • calling the estimating function does not take very long.\n  /// One way to ensure that the estimating function never overestimates the distance is to always \n  /// estimate zero. If you do so then this becomes Dijkstra's algorithm. However, the better your \n  /// estimating function can get without going over (this really should have been called the \n  /// \"The Price Is Right\" algorithm...) the faster this will identify the truly optimal path.\n  ///\n  /// Unfortunately, the space complexity of this algorithm can be really quite high on complicated \n  /// graphs. There are more complex versions of this algorithm which can deal with the space complexity.\n  /// </quote>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/10/path-finding-using-a-in-c-3-0-part-four.aspx</cref>\n  /// \n  /// Adapted to hex-grids, and to weight the most direct path favourably for better (visual) \n  /// behaviour on a hexgrid.\n  /// </remarks>\n  /// <param name=\"start\"></param>\n  /// <param name=\"goal\"></param>\n  /// <param name=\"board\"></param>\n  /// <returns></returns>\n  public static class PathFinder2 {\n    public static int RangeCutoff { get; set; }\n    static PathFinder2() { RangeCutoff = 80; }  // TODO: Set this to FOVRange perhaps?\n\n    public static IPath2 FindPath(\n      ICoordsUser     start,\n      ICoordsUser     goal,\n      INavigableBoard board\n    ) {\n      return FindPath(start, goal, board.StepCost, board.Heuristic, board.IsOnBoard);\n    }\n\n    public static IPath2 FindPath(\n      ICoordsUser     start,\n      ICoordsUser     goal,\n      Func<ICoordsCanon, Hexside, int> stepCost,\n      Func<int,int>                    heuristic,\n      Func<ICoordsUser,bool>           isOnBoard\n    ) {\n      var vectorGoal = goal.Canon.Vector - start.Canon.Vector;\n      var closed     = new HashSet<ICoordsUser>();\n      var queue      = goal.Range(start) > RangeCutoff\n          ? (IPriorityQueue<uint, Path2>) new HeapPriorityQueue<uint, Path2>()\n          : (IPriorityQueue<uint, Path2>) new DictPriorityQueue<uint, Path2>();\n      #if DEBUG\n        TraceFlag.FindPath.Trace(true, \"Find path from {0} to {1}; vectorGoal = {0}\", \n                                      start.Canon, goal.Canon, vectorGoal);\n      #endif\n\n      queue.Enqueue (0, new Path2(start));\n\n      while (! queue.IsEmpty) {\n        var oldPref = queue.Peek().Key & 0xFFFF; \n        var path = queue.Dequeue();\n        if( closed.Contains(path.LastStep) ) continue;\n\n        #if DEBUG\n          var previous = (path.PreviousSteps) == null ? HexCoords.EmptyUser : path.PreviousSteps.LastStep;\n          TraceFlag.FindPath.Trace(\"Dequeue Path at {0} from {3} w/ cost={1,4}:{2,3}.\", \n            path.LastStep, path.TotalCost, oldPref, previous);\n        #endif\n        if(path.LastStep!=null  &&  path.LastStep.Equals(goal)) return path;\n\n        closed.Add(path.LastStep);\n\n        foreach (var neighbour in path.LastStep.GetNeighbours(~Hexside.None)) {\n          if (isOnBoard(neighbour.Coords.User)) {\n            var cost = stepCost(path.LastStep.Canon, neighbour.Direction);\n            if (cost > 0) {\n              var preference = (ushort)Math.Abs(vectorGoal ^ (goal.Canon.Vector - neighbour.Coords.Vector));\n              var newPath    = path.AddStep(neighbour.Coords.User, (ushort)cost, neighbour.Direction); \n              var estimate   = ( (uint)heuristic(goal.Range(neighbour.Coords.User))\n                             +   (uint)newPath.TotalCost ) << 16;\n              queue.Enqueue(estimate + preference, newPath);\n              #if DEBUG\n                TraceFlag.FindPath.Trace(\"   Enqueue {0}: {1,4}:{2,3}\",\n                        neighbour.Coords, estimate>>16, preference);\n              #endif\n            }\n          }\n        }\n      }\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/PathFinder.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public static class PathFinder {\n    public static int RangeCutoff { get; set; }\n    static PathFinder() { RangeCutoff = 80; }  // TODO: Set this to FOVRange perhaps?\n\n    /// <summary>(Adapted) C# implementation of A* path-finding algorithm by Eric Lippert.</summary>\n    /// <remarks><quote>\n    /// A nice property of the A* algorithm is that it finds the optimal path in a reasonable \n    /// amount of time provided that:\n    ///   • the estimating function never overestimates the distance to the goal. \n    ///     (Think about what happens if the estimating function sometimes overestimates the distance;\n    ///     if the optimal path is one of the ones overestimated then it will possibly not make it to \n    ///     the front of the priority queue before a nonoptimal solution is found.)\n    ///   • calling the estimating function does not take very long.\n    /// One way to ensure that the estimating function never overestimates the distance is to always \n    /// estimate zero. If you do so then this becomes Dijkstra's algorithm. However, the better your \n    /// estimating function can get without going over (this really should have been called the \n    /// \"The Price Is Right\" algorithm...) the faster this will identify the truly optimal path.\n    ///\n    /// Unfortunately, the space complexity of this algorithm can be really quite high on complicated \n    /// graphs. There are more complex versions of this algorithm which can deal with the space complexity.\n    /// </quote>\n    /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/10/path-finding-using-a-in-c-3-0-part-four.aspx</cref>\n    /// \n    /// Adapted to hex-grids, and to weight the most direct path favourably for better (visual) \n    /// behaviour on a hexgrid.\n    /// </remarks>\n    /// <param name=\"start\"></param>\n    /// <param name=\"goal\"></param>\n    /// <param name=\"stepCost\"></param>\n    /// <param name=\"range\"></param>\n    /// <param name=\"isOnBoard\"></param>\n    /// <returns></returns>\n    [System.Obsolete(\"Use FindPath(ICoordsCanon start,ICoordsCanon goal,INavigableBoard board) instead.\")]\n    public static IPath<ICoordsCanon> FindPath( \n      ICoordsCanon start, \n      ICoordsCanon goal,\n      Func<ICoordsCanon,Hexside,int> stepCost,\n      Func<ICoordsCanon,int>         range,\n      Func<ICoordsCanon,bool>        isOnBoard\n    ) {\n      var vectorGoal = goal.Vector - start.Vector;\n      var closed     = new HashSet<ICoordsUser>();\n      var queue      = goal.Range(start) > RangeCutoff\n          ? (IPriorityQueue<uint, Path<ICoordsCanon>>) new HeapPriorityQueue<uint, Path<ICoordsCanon>>()\n          : (IPriorityQueue<uint, Path<ICoordsCanon>>) new DictPriorityQueue<uint, Path<ICoordsCanon>>();\n      #if DEBUG\n        TraceFlag.FindPath.Trace(true, \"Find path from {0} to {1}; vectorGoal = {0}\", \n                                      start.User, goal.User, vectorGoal);\n      #endif\n\n      queue.Enqueue (0, new Path<ICoordsCanon>(start));\n\n      while (! queue.IsEmpty) {\n        var oldPref = queue.Peek().Key & 0xFFFF; \n        var path = queue.Dequeue();\n        if( closed.Contains(path.LastStep.User) ) continue;\n\n        #if DEBUG\n          var previous = (path.PreviousSteps) == null ? HexCoords.EmptyCanon : path.PreviousSteps.LastStep;\n          TraceFlag.FindPath.Trace(\"Dequeue Path at {0} from {3} w/ cost={1,4}:{2,3}.\", \n            path.LastStep, path.TotalCost, oldPref, previous);\n        #endif\n        if(path.LastStep!=null  &&  path.LastStep.Equals(goal)) return path;\n\n        closed.Add(path.LastStep.User);\n\n        foreach (var neighbour in path.LastStep.GetNeighbours(~Hexside.None)) {\n          if (isOnBoard(neighbour.Coords)) {\n            var cost = stepCost(path.LastStep, neighbour.Direction);\n            if (cost > 0) {\n              var preference = (ushort)Math.Abs(vectorGoal ^ (goal.Vector - neighbour.Coords.Vector));\n              var newPath    = path.AddStep(neighbour.Coords.User.Canon, (ushort)cost, neighbour.Direction); \n              var estimate   = ((uint)range(neighbour.Coords.User.Canon) + (uint)newPath.TotalCost) << 16;\n              queue.Enqueue(estimate + preference, newPath);\n              #if DEBUG\n                TraceFlag.FindPath.Trace(\"   Enqueue {0}: {1,4}:{2,3}\",\n                        neighbour.Coords, estimate>>16, preference);\n              #endif\n            }\n          }\n        }\n      }\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/FieldOfView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\nusing PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  public enum FovTargetMode {\n    EqualHeights,\n    TargetHeightEqualZero,\n    TargetHeightEqualActual\n  }\n  public interface IFieldOfView {\n    bool this[ICoordsUser coords] { get; }\n  }\n  public class FieldOfView : IFieldOfView {\n    public static IFieldOfView GetFieldOfView(IBoard<IGridHex> board, ICoordsUser origin, int range) {\n      return GetFieldOfView(board, origin, range, FovTargetMode.EqualHeights);\n    }\n    public static IFieldOfView GetFieldOfView(IBoard<IGridHex> board, ICoordsUser origin, int range, \n      FovTargetMode targetMode) {\n      DebugTracing.LogTime(TraceFlag.FieldOfView,\"FieldOfView - begin\");\n      var fov = new FieldOfView(board);\n      if (board.IsPassable(origin)) {\n        Func<ICoordsCanon,int> target;\n        int                    observer;\n        switch (targetMode) {\n          case FovTargetMode.EqualHeights: \n            observer = board[origin].ElevationASL + 1;\n            target   = canon => board[canon.User].ElevationASL + 1;\n            break;\n          case FovTargetMode.TargetHeightEqualZero:\n            observer = board[origin].HeightObserver;\n            target   = canon => board[canon.User].ElevationASL;\n            break;\n          default:\n          case FovTargetMode.TargetHeightEqualActual:\n            observer = board[origin].HeightObserver;\n            target   = canon => board[canon.User].HeightTarget;\n            break;\n        }\n        ShadowCasting.ComputeFieldOfView(\n          origin.Canon, \n          range, \n          observer,\n          canon=>board.IsOnBoard(canon.User),\n          target,\n          canon=>board[canon.User].HeightTerrain,\n          canon=>fov[canon.User] = true\n        );\n      }\n      DebugTracing.LogTime(TraceFlag.FieldOfView,\"FieldOfView - end\");\n      return fov;\n    }\n\n    public FieldOfView(IBoard<IGridHex> board) {\n      Board      = board;\n      FovBacking = new bool[board.SizeHexes.Width, board.SizeHexes.Height];\n    }\n\n    public bool this[ICoordsUser coords] { \n      get { return Board.IsOnBoard(coords) && FovBacking[coords.X, coords.Y]; } \n      set { if (Board.IsOnBoard(coords)) { FovBacking[coords.X,coords.Y] = value; } }\n    } bool[,] FovBacking;\n\n    IBoard<IGridHex>       Board;\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/FovCone.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#undef TraceFoV\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  internal struct FovCone : IEquatable<FovCone> {\n    public IntVector2D  VectorTop    { get; private set; }\n    public IntVector2D  VectorBottom { get; private set; }\n    public int          Range        { get; private set; }\n    public RiseRun      RiseRun      { get; private set; }\n\n    public FovCone(int range, IntVector2D top, IntVector2D bottom, RiseRun riseRun) : this() {\n      this.Range        = range;\n      this.VectorTop    = top;\n      this.VectorBottom = bottom;\n      this.RiseRun      = riseRun;\n    }\n    public override string ToString() {\n      return string.Format(\"Y={0}, TopVector={1}, BottomVector={2}, RiseRun={3}\",\n                                  Range, VectorTop, VectorBottom, RiseRun);\n    }\n\n    #region Value Equality\n    bool IEquatable<FovCone>.Equals(FovCone obj) { return this == obj; }\n    public override bool Equals(object obj) { \n      return (obj is FovCone) && this == (FovCone)obj;\n    }\n    public static bool operator != (FovCone @this, FovCone obj) { return ! ( @this == obj); }\n    public static bool operator == (FovCone @this, FovCone obj) {\n      return @this.Range        == obj.Range  \n         &&  @this.RiseRun      == obj.RiseRun\n         &&  @this.VectorTop    == obj.VectorTop \n         &&  @this.VectorBottom == obj.VectorBottom;\n    }\n    public override int GetHashCode() {\n      return VectorTop.GetHashCode() ^ Range.GetHashCode() \n           ^ RiseRun.GetHashCode()   ^ VectorBottom.GetHashCode();\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/FovQueue.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  internal class FovQueue {\n    public FovQueue() : this(0) {}\n    public FovQueue(int capacity) {\n      Queue            = new Queue<FovCone>(capacity);\n      IsCacheOccuppied = false;\n    }\n\n    Queue<FovCone> Queue;\n    bool           IsCacheOccuppied;\n    FovCone        Cache;\n\n    public int Count { get { return Queue.Count + (IsCacheOccuppied ? 1 : 0); } }\n\n    public FovCone Dequeue() {\n      if (Queue.Count>0)    { return Queue.Dequeue(); }\n      if (IsCacheOccuppied) { IsCacheOccuppied = false; return Cache; }\n      throw new InvalidOperationException(\"Queue empty.\");\n    }\n\n    public void Enqueue(FovCone cone) {\n      if (!IsCacheOccuppied) {\n        Cache            = cone;\n        IsCacheOccuppied = true;\n      } else if (Cache.Range == cone.Range && Cache.RiseRun == cone.RiseRun) {\n        Cache = new FovCone(Cache.Range, Cache.VectorTop, cone.VectorBottom, cone.RiseRun);\n      } else {\n        Queue.Enqueue(Cache);\n        Cache = cone;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/RiseRun.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#undef TraceFoV\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  #pragma warning disable 0660,0661 // operator == or != w/o overriding object.equals(object o)\n  internal struct RiseRun : IEquatable<RiseRun>, IComparable<RiseRun> {\n    static RiseRun Max(RiseRun lhs, RiseRun rhs) { return lhs >  rhs  ? lhs : rhs; }\n    static RiseRun Min(RiseRun lhs, RiseRun rhs) { return lhs <= rhs  ? lhs : rhs; }\n\n    public int Rise;    // in units of elevation: meters.\n    public int Run;     // in units of distance:  hexes.\n    public RiseRun(int rise, int run) : this() {\n      this.Rise = rise;\n      this.Run  = run;\n    }\n\n    #region Operators and Interface implementations: IEquatable<RiseRun>, IComparable<RiseRun>\n    public static bool operator <  (RiseRun lhs, RiseRun rhs) {\n      return (lhs.Rise * rhs.Run) < (lhs.Run * rhs.Rise);\n    }\n    public static bool operator <= (RiseRun lhs, RiseRun rhs) { return ! (lhs > rhs); }\n    public static bool operator >  (RiseRun lhs, RiseRun rhs) {\n      return (lhs.Rise * rhs.Run) > (lhs.Run * rhs.Rise);\n    }\n    public static bool operator >= (RiseRun lhs, RiseRun rhs) { return ! (lhs < rhs); }\n    public static bool operator == (RiseRun lhs, RiseRun rhs) { return lhs.Equals(rhs); }\n    public static bool operator != (RiseRun lhs, RiseRun rhs) { return ! (lhs == rhs); }\n    public bool Equals(RiseRun rhs) { return (this.Rise * rhs.Run) == (this.Run * rhs.Rise); }\n    public int CompareTo(RiseRun rhs) { \n      return (this == rhs) ?  0\n           : (this  < rhs) ? -1 \n                           : +1;\n    }\n    public override int GetHashCode() { return Rise ^ Run; }\n    #endregion\n    public override string ToString() { return string.Format(\"Rise={0}; Run={1}\", Rise, Run); }\n  }\n  #pragma warning restore 0660,0661\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/ShadowCastingFov.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#undef TraceFoV\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  /// <summary>Credit: Eric Lippert</summary>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2011/12/29/shadowcasting-in-c-part-six.aspx</cref>\n  public static partial class ShadowCasting {\n    public static int MaximumBoardElevation { get; set; }\n\n    /// <summary></summary>\n    /// <remarks>\n    /// Takes a circle in the form of a center point and radius, and a function\n    /// that can tell whether a given cell is opaque. Calls the setFoV action on\n    /// every cell that is both within the radius and visible from the center. \n    /// </remarks>\n    /// <param name=\"observerCoords\">Cordinates of observer;s hex.</param>\n    /// <param name=\"radius\">Maximum radius for Field-of-View.</param>\n    /// <param name=\"observerHeight\">Height (ASL) of the observer's eyes.</param>\n    /// <param name=\"isOnBoard\">Is this hex on the baoard.</param>\n    /// <param name=\"targetHeight\">Returns ground level (ASL) of supplied hex.</param>\n    /// <param name=\"terrainHeight\">Returns height (ASL) of terrain in supplied hex.</param>\n    /// <param name=\"setFoV\">Sets a hex as visible in the Field-of-View.</param>\n    public static void ComputeFieldOfView(\n      ICoordsCanon            observerCoords, \n      int                     radius, \n      int                     observerHeight,\n      Func<ICoordsCanon,bool> isOnBoard,\n      Func<ICoordsCanon,int>  targetHeight, \n      Func<ICoordsCanon,int>  terrainHeight,\n      Action<ICoordsCanon>    setFoV\n    ) {\n      #if TraceFOV\n        TraceFlag.FieldOfView.Trace(true, \" - Coords = \" + observerCoords.User.ToString());\n      #endif\n      var matrixOrigin = new IntMatrix2D(observerCoords.Vector);\n\n      setFoV(observerCoords);    // Always visible to self!\n      #if TraceFoV\n        for (int dodecant = 3; dodecant < 4; dodecant++) {\n          TraceFlag.FieldOfView.Trace(true,\" - Dodecant: {0}\", dodecant);\n      #else\n        Parallel.For (0, matrices.Count, dodecant => {\n      #endif\n          var matrix = matrices[dodecant] * matrixOrigin;\n          ComputeFieldOfViewInDodecantZero(\n            radius,\n            observerHeight,\n            TranslateDodecant(matrix, isOnBoard),\n            TranslateDodecant(matrix, targetHeight),\n            TranslateDodecant(matrix, terrainHeight),\n            TranslateDodecant(matrix, setFoV));\n        }\n      #if !TraceFoV\n        );\n      #endif\n    }\n\n    private static void ComputeFieldOfViewInDodecantZero(\n      int                     radius,\n      int                     observerHeight,\n      Func<ICoordsCanon,bool> isOnBoard,\n      Func<ICoordsCanon, int> targetHeight,\n      Func<ICoordsCanon, int> terrainHeight,\n      Action<ICoordsCanon>    setFieldOfView)\n    {\n      #if TraceFOV\n        radius = 16;\n        DebugTracing.EnabledFags |= TraceFlag.FieldOfView;\n      #endif\n\n      var currentCoords = HexCoords.NewCanonCoords(0,1);\n      if ( ! isOnBoard(currentCoords) ) return;\n\n      if (radius > 0) setFieldOfView(currentCoords);\n\n      var queue   = new FovQueue();\n      var current = new FovCone( 2, \n                                 new IntVector2D(1,2), \n                                 new IntVector2D(0,1), \n                                 new RiseRun(terrainHeight(currentCoords) - observerHeight, 1) );\n      while (current.Range <= radius) {\n        current = ComputeFoVForRange(\n          observerHeight,\n          current,\n          isOnBoard,\n          targetHeight,\n          terrainHeight,\n          setFieldOfView,\n          queue);\n      }\n    }\n\n    // This method has two main purposes: (1) it marks points inside the\n    // portion that are within the radius as in the field of view, and \n    // (2) it computes which portions of the following column are in the \n    // field of view, and puts them on a work queue for later processing. \n    //\n    // A more sophisticated algorithm would say that a cell is visible if there is \n    // *any* straight line segment that passes through *any* portion of the origin cell\n    // and any portion of the target cell, passing through only transparent cells\n    // along the way. This is the \"Permissive Field Of View\" algorithm, and it\n    // is much harder to implement.\n    //\n    // Search for transitions from opaque to transparent or\n    // transparent to opaque and use those to determine what\n    // portions of the *next* column are visible from the origin.\n    private static FovCone ComputeFoVForRange(\n      int                     observerHeight,\n      FovCone                 cone,\n      Func<ICoordsCanon,bool> isOnBoard,\n      Func<ICoordsCanon, int> targetHeight,\n      Func<ICoordsCanon, int> terrainHeight,\n      Action<ICoordsCanon>    setFieldOfView,\n      FovQueue             queue)\n    {\n      Action<FovCone> enqueue = queue.Enqueue;\n\n      var range         = cone.Range;\n      var topVector     = cone.VectorTop;\n      var topRiseRun    = cone.RiseRun;\n      var bottomVector  = cone.VectorBottom;\n\n      // track the overlap-cone between adjacent hexes as we move down.\n      var overlapVector = cone.VectorTop;\n      var hexX          = XFromVector(range, topVector, true);\n      #if TraceFOV\n        TraceFlag.FieldOfView.Trace(false, \"DQ:   ({0}) from {1}\", cone, hexX);\n      #endif\n\n      do {\n        while (overlapVector.GT(bottomVector)) {\n          var coordsCurrent   = HexCoords.NewCanonCoords(hexX,range);\n          var hexVectorBottom = VectorHexBottom(coordsCurrent);\n          if (isOnBoard(coordsCurrent)) { \n            #region Set current hex parameters\n            var hexVectorTop  = VectorHexTop(coordsCurrent);\n            var hexElevation  = targetHeight(coordsCurrent);\n            var hexHeight     = terrainHeight(coordsCurrent);\n            var hexRiseRun    = new RiseRun(hexHeight-observerHeight, range);\n            #endregion\n\n            #region Check visibility of current hex\n            var riseRun = new RiseRun(hexElevation-observerHeight, GetRange(coordsCurrent));\n            if ( riseRun >= cone.RiseRun  \n            && bottomVector.LE(coordsCurrent.Vector) && coordsCurrent.Vector.LE(topVector)  \n            ) {\n              setFieldOfView(coordsCurrent);\n              #if TraceFOV\n                TraceFlag.FieldOfView.Trace(false,\"    Set visible: {0} / {1}; {2} >= {3}\", \n                    MapCoordsDodecant(coordsCurrent), coordsCurrent.ToString(), riseRun, cone.RiseRun);\n              #endif\n            }\n            #endregion\n\n            #region Check hex transition\n            if (hexRiseRun > topRiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, hexVectorTop, topRiseRun, 0);\n              topRiseRun = hexRiseRun;\n            } else if (hexRiseRun > cone.RiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 1);\n              topRiseRun = hexRiseRun;\n            } else if (hexRiseRun < cone.RiseRun) {\n              topVector  = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 2);\n              topRiseRun = cone.RiseRun;\n            }\n            #endregion\n          }\n\n          overlapVector = VectorMax(hexVectorBottom, bottomVector); \n          if (hexVectorBottom.GT(bottomVector))      -- hexX;\n        }\n\n        #region Dequeue next cone\n        if (queue.Count == 0) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 3);\n          cone        = queue.Dequeue();\n          break;\n        } else {\n          cone        = queue.Dequeue();\n          if(cone.Range != range) {\n            topVector = LogAndEnqueue(enqueue, range, topVector, bottomVector, topRiseRun, 4);\n            break;\n          }\n          #if TraceFOV\n            TraceFlag.FieldOfView.Trace(false, \"DQ:   ({0}) from {1}\", cone, hexX);\n          #endif\n        }\n        #endregion\n\n        #region Check cone transition\n        if (cone.RiseRun > topRiseRun) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, cone.VectorTop, topRiseRun, 5);\n          topRiseRun  = cone.RiseRun;\n        } else if (cone.RiseRun < topRiseRun) {\n          topVector   = LogAndEnqueue(enqueue, range, topVector, overlapVector, topRiseRun, 6);\n          topRiseRun  = cone.RiseRun;  // TODO Why is this commented out?\n        }\n        #endregion\n\n        overlapVector = topVector;\n        bottomVector  = cone.VectorBottom;\n      } while(true);\n\n      // Pick-up any cone portion at bottom of range still unprocessed\n      if (topVector.GT(bottomVector))\n        LogAndEnqueue(enqueue, range, topVector, bottomVector, cone.RiseRun, 7);\n\n      return cone;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/ShadowCastingFov_DodecantHelpers.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#undef TraceFoV\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  public static partial class ShadowCasting {\n    /// <summary>Build dodecant matrices from sextant matrices and reflection about theta=30.</summary>\n    static ShadowCasting() {\n      var matrixRotate  = new IntMatrix2D( 0,-1, 1,1);\n      var matrixReflect = new IntMatrix2D(-1, 0, 1,1);\n      matrices = new List<IntMatrix2D>(12);\n      matrices.Add(IntMatrix2D.Identity);\n      matrices.Add(matrixReflect);\n      for (int i=2; i<12; i+=2) {\n        matrices.Add(matrixRotate  * matrices[i-2]);\n        matrices.Add(matrixReflect * matrices[i]);\n      }\n    }\n    #if TraceFoV\n    static void TestMatrices() {\n        var vector_0_1 = new IntVector2D(0,1);\n        var vector_1_2 = new IntVector2D(1,2);\n        for(var dodecant=0; dodecant < matrices.Count; dodecant++) {\n            TraceFlag.FieldOfView.Trace(true,\n              \"Dodecant #{0,2} canons:  (0,1) to {1}; (1,2) to {2}\", dodecant, \n                  (vector_0_1 * matrices[dodecant]).ToString(), \n                  (vector_1_2 * matrices[dodecant]).ToString());\n        }\n      }\n    #endif\n\n    //         Sextant map\n    //                    X-axis\n    //         \\     |     /\n    //           \\ 3 | 2 /\n    //             \\ | / \n    //          4    +    1     \n    //             / | \\\n    //           / 5 | 0 \\  \n    //         /     |     \\\n    //             Y-axis\n    private static List<IntMatrix2D> matrices;\n    private static Action<ICoordsCanon> TranslateDodecant(IntMatrix2D matrix, Action<ICoordsCanon> action) {\n      return (v) => action(HexCoords.NewCanonCoords(v.Vector*matrix));\n    }\n    private static Func<ICoordsCanon,T> TranslateDodecant<T>(IntMatrix2D matrix, Func<ICoordsCanon,T> func) {\n      return (v) => func(HexCoords.NewCanonCoords(v.Vector*matrix));\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/ShadowCastingFov/ShadowCastingFov_Utilities.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n#undef TraceFoV\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nusing PG_Napoleonics.Utilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities.ShadowCastingFov {\n  public static partial class ShadowCasting {\n    static IntVector2D LogAndEnqueue(Action<FovCone> enqueue, int range, IntVector2D top, \n            IntVector2D bottom, RiseRun riseRun, int code\n    ) {\n      if( top.GT(bottom)) {\n        var cone = new FovCone(range+1, top, bottom, riseRun);\n        #if TraceFOV\n          TraceFlag.FieldOfView.Trace(false, \"  EQ: ({0}) code: {1}\",cone,code);\n        #endif\n        enqueue(cone);\n        return bottom;\n      } else {\n        return top;\n      }\n    }\n\n    private static int GetRange(ICoordsCanon coords) { return HexCoords.EmptyCanon.Range(coords); }\n\n    static int XFromVector(int y, IntVector2D v, bool isTop) {\n      if (isTop) {\n        return (-2 * v.Y + v.X * (3 * y + 1) + (3 * v.Y) - 1) / (3 * v.Y);\n      } else { \n        return (+2 * v.Y + v.X * (3 * y - 1)) / (3 * v.Y);\n      }\n    }\n    /// <summary>IntVector2D for top corner of cell Canon(x,y).</summary>\n    /// <remarks>\n    /// In first dodecant; The top corner for hex (x,y) is determined \n    /// (from close visual inspection) as:\n    ///       (x,y) + 1/3 * (2,1)\n    /// which reduces to:\n    ///       (x + 2/3, y + 1/3) == 1/3 * (3x + 2, 3y + 1)\n    /// </remarks>\n    static IntMatrix2D matrixHexTop = new IntMatrix2D(3,0,  0,3, 2,1);\n    static IntVector2D VectorHexTop(ICoordsCanon hex) { return hex.Vector * matrixHexTop; }\n    /// <summary>IntVector2D for bottom corner of cell Canon(x,y).</summary>\n    /// <remarks>\n    /// In first dodecant; The bottom corner for hex (x,y) is determined \n    /// (from close visual inspection) as:\n    ///       (x,y) + 1/3 * (-2,-1)\n    /// which reduces to:\n    ///       (x - 2/3, y - 1/3) == 1/3 * (3x - 2, 3y - 1)\n    /// </remarks>\n    static IntMatrix2D matrixHexBottom = new IntMatrix2D(3,0,  0,3, -2,-1);\n    static IntVector2D VectorHexBottom(ICoordsCanon hex)  { return hex.Vector * matrixHexBottom;  }\n\n    // These are here (instead of IntVector2D.cs) because they are \"upside-down\" for regular use.\n    static IntVector2D VectorMax(IntVector2D lhs, IntVector2D rhs) {\n      return lhs.GT(rhs) ? lhs : rhs; \n    }\n    static IntVector2D VectorMin(IntVector2D lhs, IntVector2D rhs) {\n      return lhs.LE(rhs) ? lhs : rhs;\n    }\n    private static bool GT(this IntVector2D lhs, IntVector2D rhs) {\n      return lhs.X*rhs.Y > lhs.Y*rhs.X; \n    }\n    private static bool LE(this IntVector2D lhs, IntVector2D rhs) { return ! lhs.GT(rhs); }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/HexUtilities/UserCoordsRectangle.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nusing PG_Napoleonics.Utilities;\nusing PG_Napoleonics.Utilities.HexUtilities;\n\nnamespace PG_Napoleonics.Utilities.HexUtilities {\n  /// <summary>Stores a rectangular board region as four User Coordinate integers.</summary>\n  public struct UserCoordsRectangle : IEquatable<UserCoordsRectangle>, IEqualityComparer<UserCoordsRectangle> {\n    public UserCoordsRectangle(ICoordsUser location, ICoordsUser size) \n      : this(new Rectangle(location.Vector, size.Vector)) {}\n    public UserCoordsRectangle(int x, int y, int width, int height) \n      : this(new Rectangle(x,y,width,height)) {}\n    public UserCoordsRectangle(Rectangle rectangle) : this() {\n      Rectangle = rectangle;\n    }\n\n    public int         Bottom   { get { return Rectangle.Bottom; } }\n    public int         Height   { get { return Rectangle.Height; } }\n    public bool        IsEmpty  { get { return Rectangle.IsEmpty; } }\n    public int         Left     { get { return Rectangle.Left; } }\n    public ICoordsUser Location { get { return HexCoords.NewUserCoords(Rectangle.Location); } }\n    public int         Right    { get { return Rectangle.Right; } }\n    public ICoordsUser Size     { get { return HexCoords.NewUserCoords(Rectangle.Size); } }\n    public int         Top      { get { return Rectangle.Top; } }\n    public int         Width    { get { return Rectangle.Width; } }\n    public int         X        { get { return Rectangle.X; } }\n    public int         Y        { get { return Rectangle.Y; } }\n\n    public Rectangle   Rectangle  { get; private set; }\n    public ICoordsUser UpperLeft  { get { return HexCoords.NewUserCoords(Left,Top); } }\n    public ICoordsUser UpperRight { get { return HexCoords.NewUserCoords(Right,Top); } }\n    public ICoordsUser LowerLeft  { get { return HexCoords.NewUserCoords(Left,Bottom); } }\n    public ICoordsUser LowerRight { get { return HexCoords.NewUserCoords(Right,Bottom); } }\n\n    #region Value Equality\n    bool IEquatable<UserCoordsRectangle>.Equals(UserCoordsRectangle rhs) { return this == rhs; }\n    public override bool Equals(object rhs) { return (rhs is UserCoordsRectangle) && this == (UserCoordsRectangle)rhs; }\n    public static bool operator == (UserCoordsRectangle lhs, UserCoordsRectangle rhs) { \n      return lhs.Rectangle == rhs.Rectangle; \n    }\n    public static bool operator != (UserCoordsRectangle lhs, UserCoordsRectangle rhs) { return ! (lhs == rhs); }\n    public override int GetHashCode() { return Rectangle.GetHashCode(); }\n\n    bool IEqualityComparer<UserCoordsRectangle>.Equals(UserCoordsRectangle lhs, UserCoordsRectangle rhs) { return lhs == rhs; }\n    int  IEqualityComparer<UserCoordsRectangle>.GetHashCode(UserCoordsRectangle coords) { return Rectangle.GetHashCode(); }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/IHeap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Collections.Generic;\n\nnamespace PG_Napoleonics.Utilities {\n  public struct KeyValuePair<TKey,TValue> : IComparable<KeyValuePair<TKey,TValue>>\n    where TKey : IComparable<TKey>\n  {\n    public TKey   Key;\n    public TValue Value;\n\n    public KeyValuePair(TKey key, TValue value) {\n      Key   = key;\n      Value = value;\n    }\n    int IComparable<KeyValuePair<TKey,TValue>>.CompareTo(KeyValuePair<TKey,TValue> rhs) { \n      return this.Key.CompareTo(rhs.Key); \n    }\n  }\n\n  public interface IHeap<T> where T : struct, IComparable<T> {\n    /// <summary>Returns the number of elements in the heap.</summary>\n    int Count    { get; }\n    /// <summary>Return whether the heap is empty.</summary>\n    bool IsEmpty { get; }\n\n    /// <summary>Add an element <c>item</c> to the heap.</summary>\n    void Add(T item);\n    /// <summary>???</summary>\n    void BuildHead();\n    /// <summary>Delete all elements from the heap.</summary>\n    void Clear();\n    /// <summary>Return top element, removing it from the heap.</summary>\n    T    ExtractFirst();\n    /// <summary>Return top element, leaving it on the heap.</summary>\n    T    Peek();\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/ImmutableStack.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  /// <summary>Eric Lippert's implementation for use in A*.</summary>\n  /// <remarks>An implementation of immutable stack for use in A* as a 'Path to here'..</remarks>\n  /// <cref>http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx</cref>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ImmutableStack<T> : IEnumerable<T> {\n\n    public T                 TopItem      { get; protected set; }\n    public ImmutableStack<T> Remainder    { get; protected set; }\n    public ImmutableStack<T> Push(T step) { return new ImmutableStack<T>(step, this); }\n\n    public ImmutableStack(T start) : this(start, null) {}\n    protected ImmutableStack(T topItem, ImmutableStack<T> remainder) {\n      TopItem   = topItem;\n      Remainder = remainder;\n    }\n\n    public IEnumerator<T> GetEnumerator() {\n      for (ImmutableStack<T> p = this; p != null; p = p.Remainder)  yield return p.TopItem;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/MinListHeap.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace PG_Napoleonics.Utilities {\n  /// <summary>\n  /// MinHeap from ZeraldotNet (http://zeraldotnet.codeplex.com/)\n  /// Modified by Roy Triesscheijn (http://royalexander.wordpress.com)    \n  /// -Moved method variables to class variables\n  /// -Added English Exceptions and comments (instead of Chinese)    \n  /// Adapted by PIeter Geerkens:\n  /// </summary>    \n  public sealed class MinListHeap<T> : IHeap<T> where T : struct, IComparable<T> {  \n    /// <summary>Construct a new heap with default capacity of 16.</summary>\n    public MinListHeap() : this(16) { }\n    /// <summary>Construct a new heap with the specified capacity.</summary>\n    public MinListHeap(int capacity) {\n      list = new List<T>(capacity);\n    }\n\n    /// <inheritdoc/>\n    public int Count        { get { return list.Count; } }\n\n    /// <inheritdoc/>\n    public bool IsEmpty     { get { return list.Count==0; } }\n\n    /// <inheritdoc/>\n    public void BuildHead() {\n      for (var position = (Count-1) >> 1;  position >= 0;  position--) { MinHeapify(position); }\n    }\n\n    /// <inheritdoc/>\n    public void Clear()     { list.Clear(); }\n\n    /// <inheritdoc/>\n    public void Add(T item) {            \n      list.Add(item);\n      int position        = Count-1;\n      int parent_position = (position-1) >> 1;\n\n      while (position > 0  &&  list[parent_position].CompareTo(list[position]) > 0) {\n        ListSwap(position, parent_position);\n        position          = parent_position;\n        parent_position   = (position-1) >> 1;\n      }\n    }\n\n    /// <inheritdoc/>\n    public T ExtractFirst() {\n      var item = list[0];            \n      list[0]  = list.Last();\n      list.RemoveAt(Count-1);\n      MinHeapify(0);\n      return item;\n    }\n\n    /// <inheritdoc/>\n    public T Peek()         { return list[0]; }\n\n    #region private internals\n    List<T> list;\n\n    void MinHeapify(int position) {\n      do {\n        var left        = (position << 1) + 1;\n        var minPosition = (left < Count  &&  list[left].CompareTo(list[position]) < 0)\n                        ? left\n                        : position;\n\n        var right       = left + 1;\n        if (right < Count  &&  list[right].CompareTo(list[minPosition]) < 0) {\n          minPosition   = right;\n        }\n\n        if (minPosition == position) return;\n\n        ListSwap(position, minPosition);\n        position        = minPosition;\n      } while (true);\n    }\n\n    void ListSwap(int lhs, int rhs) { var heap = list[lhs];   list[lhs] = list[rhs];   list[rhs] = heap; }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/PointExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  public static class PointExtensions {\n    #region Point scaling functions\n    public static Point Scale(this Point @this, int scale) { \n      return @this.Scale(scale,scale);\n    }\n    public static Point Scale(this Point @this, int scaleX, int scaleY) {\n      return new Point(@this.X * scaleX, @this.Y * scaleY);\n    }\n    public static PointF Scale(this Point @this, float scale) {\n      return @this.Scale(scale,scale);\n    }\n    public static PointF Scale(this Point @this, float scaleX, float scaleY) {\n      return new PointF(@this.X,@this.Y).Scale(scaleX,scaleY);\n    }\n    public static PointF Scale(this PointF @this, float scale) { \n      return @this.Scale(scale,scale);\n    }\n    public static PointF Scale(this PointF @this, float scaleX, float scaleY) {\n      return new PointF(@this.X * scaleX, @this.Y * scaleY);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Utilities\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"Utilities\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"59925f4a-6821-4d5a-9c7c-bd25fa573308\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"4.1.*\")]\n[assembly: AssemblyFileVersion(\"4.1.*\")]\n"
  },
  {
    "path": "codeplex/Utilities/SizeExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace PG_Napoleonics.Utilities {\n  public static class SizeExtensions {\n    #region Size scaling functions\n    public static Size Scale(this Size @this, int scale) { \n      return @this.Scale(scale,scale);\n    }\n    public static Size Scale(this Size @this, int scaleX, int scaleY) {\n      return new Size(@this.Width * scaleX, @this.Height * scaleY);\n    }\n    public static SizeF Scale(this Size @this, float scale) {\n      return @this.Scale(scale,scale);\n    }\n    public static SizeF Scale(this Size @this, float scaleX, float scaleY) {\n      return new SizeF(@this).Scale(scaleX,scaleY);\n    }\n    public static SizeF Scale(this SizeF @this, float scale) { \n      return @this.Scale(scale,scale);\n    }\n    public static SizeF Scale(this SizeF @this, float scaleX, float scaleY) {\n      return new SizeF(@this.Width * scaleX, @this.Height * scaleY);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/Utilities.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{F8F3C076-404D-4B41-83CA-9E233393B139}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PG_Napoleonics.Utilities</RootNamespace>\n    <AssemblyName>Utilities</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\Utilities\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\Utilities\\bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>\n    </DocumentationFile>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\Utilities\\bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>..\\bin\\Utilities\\bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x64'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\Utilities\\bin\\x64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x64'\">\n    <OutputPath>..\\bin\\Utilities\\bin\\x64\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"FastList.cs\" />\n    <Compile Include=\"HeapPriorityQueue.cs\" />\n    <Compile Include=\"HexUtilities\\HexEventArgs.cs\" />\n    <Compile Include=\"HexUtilities\\Coords.cs\" />\n    <Compile Include=\"HexUtilities\\IGridHex.cs\" />\n    <Compile Include=\"HexUtilities\\Path2.cs\" />\n    <Compile Include=\"HexUtilities\\PathFInder2.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\FieldOfView.cs\" />\n    <Compile Include=\"IHeap.cs\" />\n    <Compile Include=\"HexUtilities\\UserCoordsRectangle.cs\" />\n    <Compile Include=\"MinListHeap.cs\" />\n    <Compile Include=\"PointExtensions.cs\" />\n    <Compile Include=\"HexUtilities\\ICoordsCustom.cs\" />\n    <Compile Include=\"HexUtilities\\HexgridPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexUtilities\\HexgridPanel.Designer.cs\">\n      <DependentUpon>HexgridPanel.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexUtilities\\IBoard.cs\" />\n    <Compile Include=\"HexUtilities\\HexCoords.cs\" />\n    <Compile Include=\"HexUtilities\\PathFinder.cs\" />\n    <Compile Include=\"HexUtilities\\NeighbourCoords.cs\" />\n    <Compile Include=\"HexUtilities\\ICoordsCanon.cs\" />\n    <Compile Include=\"HexUtilities\\NeighbourHex.cs\" />\n    <Compile Include=\"HexUtilities\\IntMatrix2D.cs\" />\n    <Compile Include=\"HexUtilities\\IntVector2D.cs\" />\n    <Compile Include=\"HexUtilities\\ICoordsUser.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\FovCone.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\FovQueue.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\RiseRun.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\ShadowCastingFov.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\ShadowCastingFov_DodecantHelpers.cs\" />\n    <Compile Include=\"HexUtilities\\ShadowCastingFov\\ShadowCastingFov_Utilities.cs\" />\n    <Compile Include=\"ImmutableStack.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"SizeExtensions.cs\" />\n    <Compile Include=\"WinForms\\Extensions.cs\" />\n    <Compile Include=\"HexUtilities\\Path.cs\" />\n    <Compile Include=\"DictPriorityQueue.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"DebugTracing.cs\" />\n    <Compile Include=\"WinForms\\ThreadExceptionHandler.cs\" />\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"Utils.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"HexUtilities\\HexGridPanel.resx\">\n      <DependentUpon>HexgridPanel.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Documentation\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "codeplex/Utilities/Utils.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace PG_Napoleonics.Utilities {\n  public static class Utils{\n    #region Enum Parsing utilities\n    public static IEnumerable<TEnum> EnumGetValues<TEnum>() {\n      return (IEnumerable<TEnum>)(Enum.GetValues(typeof(TEnum)));\n    }\n\n    public static T ParseEnum<T>(string value, bool checkConstants = true) {\n      T enumValue;\n      if (!TryParseEnum<T>(value, out enumValue) && checkConstants) \n                  ThrowInvalidDataException(typeof(T), enumValue);\n      return enumValue;\n    }\n    public static bool TryParseEnum<T>(string value, out T enumValue) {\n      enumValue = (T)Enum.Parse(typeof(T),value);\n      return  (Enum.IsDefined(typeof(T),enumValue));\n    }\n    public static T EnumParse<T>(char c, string lookup) {\n      var index = lookup.IndexOf(c);\n      if (index == -1) ThrowInvalidDataException(typeof(T), c);\n      return (T) Enum.ToObject(typeof(T), index);\n    }\n    #endregion\n\n    #region ErrorThrowers\n    public static void ThrowInvalidDataException(Type type, object data) {\n      throw new InvalidDataException(string.Format(\"{0}: Invalid: '{1}'\", type.Name, data));\n    }\n    public static void ThrowInvalidDataException(string parseType, int lineNo, object section, \n      string error, Exception ex, object data) {\n      throw new InvalidDataException(\n              string.Format(\"{0}: {3}\\n  for section {2} on line # {1}:\\n   {4}\",  \n                  parseType, lineNo, section, error, data), ex);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/Extensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace System.Windows.Forms {\n  public static partial class Extensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action);\n      } else {\n        action.Invoke();\n      }\n    }\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action,args);\n      } else {\n        action.Invoke(args);\n      }\n    }\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Form @this, Action action) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action);\n      } else {\n        action.Invoke();\n      }\n    }\n    public static void UIThread(this Form @this, Action<object[]> action, params object[] args) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action,args);\n      } else {\n        action.Invoke(args);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Windows.Forms;\n\nnamespace System.Threading {\n  public class ThreadExceptionHandler {\n    ///<summary>Handles the thread exception.</summary> \n    public void Application_ThreadException(object sender, ThreadExceptionEventArgs e) {\n      if(e.Exception is NotImplementedException || e.Exception is NotSupportedException) {\n          MessageBox.Show(e.Exception.Message, \n            \"Application Error\", \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Information);\n      } else {\n        try {\n          var result = ShowThreadExceptionDialog(e.Exception);\n          Application.ExitThread();\n        }\n        catch {  // Fatal error, terminate program\n          try {\n            MessageBox.Show(\"Fatal Error in Unhandled Exception Handler.\", \n              \"Application Error\", \n              MessageBoxButtons.OK, \n              MessageBoxIcon.Stop);\n          }\n          finally { Application.Exit(); }\n        }\n      }\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var errorMessage= \n        \"Unhandled Exception:\\n\\n\" +\n        ex.Message + \"\\n\\n\" + \n        ex.GetType() + \n        \"\\n\\nStack Trace:\\n\" + \n        ex.StackTrace;\n\n      return MessageBox.Show(errorMessage, \n        \"Application Error\", \n        MessageBoxButtons.OK, //.AbortRetryIgnore, \n        MessageBoxIcon.Stop);\n    }\n  }\n\n  public static partial class Extensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action);\n      } else {\n        action.Invoke();\n      }\n    }\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action,args);\n      } else {\n        action.Invoke(args);\n      }\n    }\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Form @this, Action action) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action);\n      } else {\n        action.Invoke();\n      }\n    }\n    public static void UIThread(this Form @this, Action<object[]> action, params object[] args) {\n      if (@this.InvokeRequired) {\n        @this.BeginInvoke(action,args);\n      } else {\n        action.Invoke(args);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace System.Windows.Forms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a WS_EX_TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.WS_EX_TRANSPARENT;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void InvalidateEx() { \n\t\t\tInvalidateEx(new Rectangle(this.Location,this.Size));\n\t\t} \n\t\t///<summary><inheritdoc cref=\"InvalidateEx()\" /></summary>\n\t\t/// <param name=\"r\"><c>Rectangle</c> to be invalidated.</param>\n\t\tpublic virtual void InvalidateEx(Rectangle r) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\ttry {\n\t\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), r,true); \n\t\t\t\t} catch (InvalidOperationException e) { \n\t\t\t\t\tMessageBox.Show(\"Why is \" + e.Message + \"\\n occurring in\\n\" +\n\t\t\t\t\t\t\"TransparentPanel.InvalidateEx(Rectangle r).\");\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"pevent\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs pevent) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace PG_Napoleonics.Utilities.WinForms {\n  public static partial class WinFormsExtensions {\n    /// <summary>Reflect to set Double-Buffering on Control.</summary>\n    /// <param name=\"control\">Control to operate on.</param>\n    /// <param name=\"setting\">New value for parameter.</param>\n    public static void MakeDoubleBuffered(this Control control, bool setting)\n    {\n      control.GetType()\n             .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n             .SetValue(control, setting, null);\n    }\n    /// <summary>Use WS_EX_COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n    public static CreateParams SetCompositedStyle(this Control control, CreateParams cp) {\n      cp.ExStyle |= (int)WindowStylesEx.WS_EX_COMPOSITED;\n      return cp;\n    }\n  }\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Windows.Forms {\n/// <summary>\n  /// Windows Messages\n  /// Defined in winuser.h from Windows SDK v6.1\n  /// Documentation pulled from MSDN.\n  /// </summary>\n  public enum WM : uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    NULL = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    CREATE = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    DESTROY = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    MOVE = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    SIZE = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    ACTIVATE = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SETFOCUS = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KILLFOCUS = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    ENABLE = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SETREDRAW = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SETTEXT = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GETTEXT = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GETTEXTLENGTH = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    PAINT = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    CLOSE = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QUERYENDSESSION = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QUERYOPEN = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    ENDSESSION = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    QUIT = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    ERASEBKGND = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SYSCOLORCHANGE = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    SHOWWINDOW = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WININICHANGE = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SETTINGCHANGE = WM.WININICHANGE,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DEVMODECHANGE = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ACTIVATEAPP = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FONTCHANGE = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever there is a change in the system time.\n    /// </summary>\n    TIMECHANGE = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CANCELMODE = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SETCURSOR = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MOUSEACTIVATE = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    CHILDACTIVATE = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QUEUESYNC = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GETMINMAXINFO = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PAINTICON = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    ICONERASEBKGND = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NEXTDLGCTL = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SPOOLERSTATUS = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DRAWITEM = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MEASUREITEM = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DELETEITEM = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKEYTOITEM = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CHARTOITEM = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SETFONT = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GETFONT = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SETHOTKEY = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GETHOTKEY = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QUERYDRAGICON = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    COMPAREITEM = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GETOBJECT = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    COMPACTING = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete]\n    COMMNOTIFY = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGING = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGED = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete]\n    POWER = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    COPYDATA = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CANCELJOURNAL = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    NOTIFY = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    INPUTLANGCHANGEREQUEST = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    INPUTLANGCHANGE = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCARD = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    HELP = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    USERCHANGED = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NOTIFYFORMAT = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    CONTEXTMENU = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    STYLECHANGING = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    STYLECHANGED = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DISPLAYCHANGE = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GETICON = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SETICON = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCREATE = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDESTROY = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCALCSIZE = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHITTEST = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPAINT = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCACTIVATE = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GETDLGCODE = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SYNCPAINT = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMOUSEMOVE = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDOWN = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONUP = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDBLCLK = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDOWN = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONUP = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDBLCLK = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDOWN = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONUP = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDBLCLK = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDOWN = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONUP = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDBLCLK = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    INPUT_DEVICE_CHANGE = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    INPUT = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYFIRST = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KEYDOWN = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KEYUP = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    CHAR = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DEADCHAR = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYDOWN = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYUP = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SYSCHAR = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SYSDEADCHAR = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UNICHAR = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYLAST = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_STARTCOMPOSITION = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_ENDCOMPOSITION = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITION = 0x010F,\n    IME_KEYLAST = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    INITDIALOG = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    COMMAND = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SYSCOMMAND = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    TIMER = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    HSCROLL = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    VSCROLL = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    INITMENU = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    INITMENUPOPUP = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MENUSELECT = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MENUCHAR = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    ENTERIDLE = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MENURBUTTONUP = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MENUDRAG = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MENUGETOBJECT = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UNINITMENUPOPUP = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MENUCOMMAND = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    CHANGEUISTATE = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UPDATEUISTATE = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QUERYUISTATE = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CTLCOLORMSGBOX = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CTLCOLOREDIT = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CTLCOLORLISTBOX = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CTLCOLORBTN = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CTLCOLORDLG = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CTLCOLORSCROLLBAR = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CTLCOLORSTATIC = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MOUSEFIRST = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MOUSEMOVE = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDOWN = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONUP = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDBLCLK = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDOWN = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONUP = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDBLCLK = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDOWN = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONUP = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDBLCLK = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEWHEEL = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n   /// </summary>\n    XBUTTONDOWN = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONUP = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONDBLCLK = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEHWHEEL = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MOUSELAST = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    PARENTNOTIFY = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    ENTERMENULOOP = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    EXITMENULOOP = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NEXTMENU = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    SIZING = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CAPTURECHANGED = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    MOVING = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    POWERBROADCAST = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DEVICECHANGE = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MDICREATE = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MDIDESTROY = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MDIACTIVATE = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MDIRESTORE = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MDINEXT = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MDIMAXIMIZE = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MDITILE = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MDICASCADE = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MDIICONARRANGE = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MDIGETACTIVE = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MDISETMENU = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    ENTERSIZEMOVE = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    EXITSIZEMOVE = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DROPFILES = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MDIREFRESHMENU = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SETCONTEXT = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_NOTIFY = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    IME_CONTROL = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITIONFULL = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SELECT = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_CHAR = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_REQUEST = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYDOWN = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYUP = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSEHOVER = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSELEAVE = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSEHOVER = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSELEAVE = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WTSSESSION_CHANGE = 0x02B1,\n    TABLET_FIRST = 0x02c0,\n    TABLET_LAST = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    CUT = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    COPY = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    PASTE = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    CLEAR = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    UNDO = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERFORMAT = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERALLFORMATS = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DESTROYCLIPBOARD = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DRAWCLIPBOARD = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PAINTCLIPBOARD = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VSCROLLCLIPBOARD = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SIZECLIPBOARD = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    ASKCBFORMATNAME = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    CHANGECBCHAIN = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HSCROLLCLIPBOARD = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QUERYNEWPALETTE = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PALETTEISCHANGING = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PALETTECHANGED = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    HOTKEY = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINT = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINTCLIENT = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    APPCOMMAND = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    THEMECHANGED = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    CLIPBOARDUPDATE = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCOMPOSITIONCHANGED = 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    DWMNCRENDERINGCHANGED = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMCOLORIZATIONCOLORCHANGED = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWINDOWMAXIMIZEDCHANGE = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    GETTITLEBARINFOEX = 0x033F,\n    HANDHELDFIRST = 0x0358,\n    HANDHELDLAST = 0x035F,\n    AFXFIRST = 0x0360,\n    AFXLAST = 0x037F,\n    PENWINFIRST = 0x0380,\n    PENWINLAST = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    APP = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    USER = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    CPL_LAUNCH = USER+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    CPL_LAUNCHED = USER+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SYSTIMER = 0x118\n\t}\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Windows.Forms {\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n\t[Flags]\n\tpublic enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLButton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRButton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMButton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXButton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXButton2\t= 0x40\n\t}\n\tpublic static class WindowsMouseInput {\n\t\tpublic static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\t\tpublic static Int16 WheelDelta(IntPtr wParam) {\n\t\t\treturn (Int16)(wParam.ToInt64() >> 16);\n\t\t}\n\t\tpublic static IntPtr WParam (Int16 wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (Int16)mouseKeys;\n\t\t}\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static System.Drawing.Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new System.Drawing.Point(\n\t\t\t\t\t (int)(short)(lParam.ToInt64() & 0x0000ffff), \n\t\t\t\t\t (int)(short)(lParam.ToInt64() >> 16)\n\t\t\t\t);\n\t\t}\n\t\tpublic static IntPtr LParam(Point point) {\n\t\t\tif (point.X<Int16.MinValue || point.X > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point.X\",point.X,\n\t\t\t\t\t\"Must be a valid Int16 value.\");\n\t\t\tif (point.Y<Int16.MinValue || point.Y > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point.Y\",point.Y,\n\t\t\t\t\t\"Must be a valid Int16 value.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "codeplex/Utilities/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Windows.Forms {\n   [Flags]     \n   public enum WindowStylesEx : uint \n   {\n      /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n      WS_EX_ACCEPTFILES = 0x00000010,\n      /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n      WS_EX_APPWINDOW = 0x00040000,\n      /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n      WS_EX_CLIENTEDGE = 0x00000200,\n      /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n      /// <remarks>\n      /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n      /// </remarks>\n      WS_EX_COMPOSITED = 0x02000000,\n      /// <summary>Includes a question mark in the title bar of the window.</summary>\n      /// <remarks>\n      /// When the user clicks the question mark, the cursor changes to a question mark \n      /// with a pointer. If the user then clicks a child window, the child receives a \n      /// WM_HELP message. The child window should pass the message to the parent window \n      /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n      /// The Help application displays a pop-up window that typically contains help for\n      /// the child window.  \n      /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n      /// </remarks>\n      WS_EX_CONTEXTHELP = 0x00000400,\n      /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n      /// <remarks>\n      /// If this style is specified, the dialog manager recurses into children of this \n      /// window when performing navigation operations such as handling the TAB key, \n      /// an arrow key, or a keyboard mnemonic.\n      /// </remarks>\n      WS_EX_CONTROLPARENT = 0x00010000,\n      /// <summary>Creates a window that has a double border.</summary>\n      /// <remarks>\n      /// The window can, optionally, be created with a title bar by specifying the \n      /// WS_CAPTION style in the dwStyle parameter.\n      /// </remarks>\n      WS_EX_DLGMODALFRAME = 0x00000001,\n      /// <summary>\n      /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n      /// </summary>\n      WS_EX_LAYERED = 0x00080000,\n      /// <summary>\n      /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. \n      /// </summary>\n      WS_EX_LAYOUTRTL = 0x00400000,\n      /// <summary>\n      /// Creates a window that has generic left-aligned properties. This is the default.\n      /// </summary>\n      WS_EX_LEFT = 0x00000000,\n      /// <summary>\n      /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\n      /// </summary>\n      WS_EX_LEFTSCROLLBAR = 0x00004000,\n      /// <summary>The window text is displayed using left-to-right reading-order properties.</summary>\n      /// <remarks>\n      /// This is the default.\n      /// </remarks>\n      WS_EX_LTRREADING = 0x00000000,\n      /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n      WS_EX_MDICHILD = 0x00000040,\n      /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n      /// <remarks>\n      /// Windows 2000/XP: A top-level window created with this style does not become the \n      /// foreground window when the user clicks it. \n      /// \n      /// The system does not bring this window to the foreground when the user minimizes \n      /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n      /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n      /// default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW \n      /// style.\n      /// </remarks>\n      WS_EX_NOACTIVATE = 0x08000000,\n      /// <summary>\n      /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\n      /// </summary>\n      WS_EX_NOINHERITLAYOUT = 0x00100000,\n      /// <summary>\n      /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n      /// </summary>\n      WS_EX_NOPARENTNOTIFY = 0x00000004,\n      /// <summary>Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.</summary>\n      WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      /// <summary>Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.</summary>\n      WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST,\n      /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n      /// <remarks>\n      /// This depends on the window class. This style has an effect only if the \n      /// shell language is Hebrew, Arabic, or another language that supports \n      /// reading-order alignment; otherwise, the style is ignored.\n      /// \n      /// Using the WS_EX_RIGHT style for static or edit controls has the same \n      /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n      /// style with button controls has the same effect as using BS_RIGHT and \n      /// BS_RIGHTBUTTON styles.\n      /// </remarks>\n      WS_EX_RIGHT = 0x00001000,\n      /// <summary>\n      /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\n      /// </summary>\n      WS_EX_RIGHTSCROLLBAR = 0x00000000,\n      /// <summary>\n      /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\n      /// </summary>\n      WS_EX_RTLREADING = 0x00002000,\n      /// <summary>\n      /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\n      /// </summary>\n      WS_EX_STATICEDGE = 0x00020000,\n      /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n      /// <remarks>\n      /// A tool window has a title bar that is shorter than a normal title bar, and the \n      /// window title is drawn using a smaller font. A tool window does not appear in \n      /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n      /// tool window has a system menu, its icon is not displayed on the title bar. \n      /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n      /// </remarks>\n      WS_EX_TOOLWINDOW = 0x00000080,\n      /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n      /// <remarks>\n      /// Specifies that a window created with this style should be placed above all \n      /// non-topmost windows and should stay above them, even when the window is \n      /// deactivated. To add or remove this style, use the SetWindowPos function.\n      /// </remarks>\n      WS_EX_TOPMOST = 0x00000008,\n      /// <summary>Specifies that a window should be painted after all siblings.</summary>\n      /// <remarks>\n      /// Specifies that a window created with this style should not be painted until \n      /// siblings beneath the window (that were created by the same thread) have been \n      /// painted. The window appears transparent because the bits of underlying sibling \n      /// windows have already been painted.\n      /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n      /// </remarks>\n      WS_EX_TRANSPARENT = 0x00000020,\n      /// <summary>Specifies that a window has a border with a raised edge.</summary>\n      WS_EX_WINDOWEDGE = 0x00000100\n   }\n}\n"
  },
  {
    "path": "codeplex/Utilities/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "documentation.yml",
    "content": "# Documentation files and directories are excluded from language\n# statistics.\n#\n# Lines in this file are Regexps that are matched against the file\n# pathname.\n#\n# Please add additional test coverage to\n# `test/test_blob.rb#test_documentation` if you make any changes.\n\n## Documentation directories ##\n\n- ^[Dd]ocs?/\n- (^|/)[Dd]ocumentation/\n- (^|/)[Gg]roovydoc/\n- (^|/)[Jj]avadoc/\n- ^[Mm]an/\n- ^[Ee]xamples/\n- ^[Dd]emos?/\n- (^|/)inst/doc/\n- */html/\n\n## Documentation files ##\n\n- docs.zip\n- (^|/)CHANGE(S|LOG)?(\\.|$)\n- (^|/)CONTRIBUTING(\\.|$)\n- (^|/)COPYING(\\.|$)\n- (^|/)INSTALL(\\.|$)\n- (^|/)LICEN[CS]E(\\.|$)\n- (^|/)[Ll]icen[cs]e(\\.|$)\n- (^|/)README(\\.|$)\n- (^|/)[Rr]eadme(\\.|$)\n\n# Samples folders\n- ^[Ss]amples?/\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/HexGridExampleWinForms.Designer.cs",
    "content": "﻿#region License - Copyright (C) 2012-2013 Pieter Geerkens, all rights reserved.\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n//\n// Use of this software is permitted only as described in the attached file: license.txt.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nnamespace HexgridExampleWinForms {\n  partial class HexgridExampleWinForms {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    [System.CodeDom.Compiler.GeneratedCode(\"\",\"\")]\n    private void InitializeComponent() {\n      this.components = new System.ComponentModel.Container();\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexgridExampleWinForms));\n      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();\n      this.toolStrip1 = new System.Windows.Forms.ToolStrip();\n      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();\n      this.statusLabel = new System.Windows.Forms.ToolStripLabel();\n      this._hexgridPanel = new PGNapoleonics.HexgridPanel.HexgridPanel(this.components);\n      this.toolStrip2 = new System.Windows.Forms.ToolStrip();\n      this.buttonTransposeMap = new System.Windows.Forms.ToolStripButton();\n      this.buttonRangeLine = new System.Windows.Forms.ToolStripButton();\n      this.buttonFieldOfView = new System.Windows.Forms.ToolStripButton();\n      this.buttonPathArrow = new System.Windows.Forms.ToolStripButton();\n      this.comboBoxMapSelection = new System.Windows.Forms.ToolStripComboBox();\n      this.lblPathCutover = new System.Windows.Forms.ToolStripLabel();\n      this.txtPathCutover = new System.Windows.Forms.ToolStripTextBox();\n      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\n      this.lblLandmark = new System.Windows.Forms.ToolStripLabel();\n      this.menuItemLandmarks = new System.Windows.Forms.ToolStripComboBox();\n      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemDebug = new System.Windows.Forms.ToolStripDropDownButton();\n      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelp = new System.Windows.Forms.ToolStripDropDownButton();\n      this.menuItemHelpContents = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\n      this.menuItemHelpAbout = new System.Windows.Forms.ToolStripMenuItem();\n      this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.ContentPanel.SuspendLayout();\n      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();\n      this.toolStripContainer1.SuspendLayout();\n      this.toolStrip1.SuspendLayout();\n      this.toolStrip2.SuspendLayout();\n      this.SuspendLayout();\n      // \n      // toolStripContainer1\n      // \n      // \n      // toolStripContainer1.BottomToolStripPanel\n      // \n      this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.toolStrip1);\n      // \n      // toolStripContainer1.ContentPanel\n      // \n      this.toolStripContainer1.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;\n      this.toolStripContainer1.ContentPanel.Controls.Add(this._hexgridPanel);\n      this.toolStripContainer1.ContentPanel.Padding = new System.Windows.Forms.Padding(5);\n      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(770, 370);\n      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);\n      this.toolStripContainer1.Margin = new System.Windows.Forms.Padding(0);\n      this.toolStripContainer1.Name = \"toolStripContainer1\";\n      this.toolStripContainer1.Size = new System.Drawing.Size(770, 420);\n      this.toolStripContainer1.TabIndex = 0;\n      this.toolStripContainer1.Text = \"toolStripContainer1\";\n      // \n      // toolStripContainer1.TopToolStripPanel\n      // \n      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip2);\n      // \n      // toolStrip1\n      // \n      this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.toolStripLabel1,\n            this.statusLabel});\n      this.toolStrip1.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip1.Name = \"toolStrip1\";\n      this.toolStrip1.Size = new System.Drawing.Size(143, 25);\n      this.toolStrip1.TabIndex = 0;\n      // \n      // toolStripLabel1\n      // \n      this.toolStripLabel1.Name = \"toolStripLabel1\";\n      this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);\n      this.toolStripLabel1.Text = \"Status: \";\n      // \n      // statusLabel\n      // \n      this.statusLabel.Name = \"statusLabel\";\n      this.statusLabel.Size = new System.Drawing.Size(86, 22);\n      this.statusLabel.Text = \"toolStripLabel2\";\n      this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n      // \n      // _hexgridPanel\n      // \n      this._hexgridPanel.AutoScroll = true;\n      this._hexgridPanel.AutoScrollMinSize = new System.Drawing.Size(34, 45);\n      this._hexgridPanel.AutoSize = true;\n      this._hexgridPanel.Dock = System.Windows.Forms.DockStyle.Fill;\n      this._hexgridPanel.IsTransposed = false;\n      this._hexgridPanel.Location = new System.Drawing.Point(5, 5);\n      this._hexgridPanel.Margin = new System.Windows.Forms.Padding(0);\n      this._hexgridPanel.Name = \"_hexgridPanel\";\n      this._hexgridPanel.ScaleIndex = 0;\n      this._hexgridPanel.Scales = ((System.Collections.ObjectModel.ReadOnlyCollection<float>)(resources.GetObject(\"_hexgridPanel.Scales\")));\n      this._hexgridPanel.Size = new System.Drawing.Size(756, 356);\n      this._hexgridPanel.TabIndex = 0;\n      this._hexgridPanel.TabStop = true;\n      this._hexgridPanel.HotspotHexChange += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_HotSpotHexChange);\n      this._hexgridPanel.MouseCtlClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_GoalHexChange);\n      this._hexgridPanel.MouseLeftClick += new System.EventHandler<PGNapoleonics.HexgridPanel.HexEventArgs>(this.PanelBoard_StartHexChange);\n      this._hexgridPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.hexgridPanel_MouseMove);\n      // \n      // toolStrip2\n      // \n      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;\n      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.buttonTransposeMap,\n            this.buttonRangeLine,\n            this.buttonFieldOfView,\n            this.buttonPathArrow,\n            this.comboBoxMapSelection,\n            this.lblPathCutover,\n            this.txtPathCutover,\n            this.toolStripSeparator2,\n            this.lblLandmark,\n            this.menuItemLandmarks,\n            this.toolStripSeparator1,\n            this.menuItemDebug,\n            this.toolStripSeparator3,\n            this.menuItemHelp});\n      this.toolStrip2.Location = new System.Drawing.Point(3, 0);\n      this.toolStrip2.Name = \"toolStrip2\";\n      this.toolStrip2.Size = new System.Drawing.Size(767, 25);\n      this.toolStrip2.TabIndex = 0;\n      // \n      // buttonTransposeMap\n      // \n      this.buttonTransposeMap.AutoSize = false;\n      this.buttonTransposeMap.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonTransposeMap.CheckOnClick = true;\n      this.buttonTransposeMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonTransposeMap.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonTransposeMap.Image\")));\n      this.buttonTransposeMap.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonTransposeMap.Name = \"buttonTransposeMap\";\n      this.buttonTransposeMap.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonTransposeMap.Size = new System.Drawing.Size(75, 22);\n      this.buttonTransposeMap.Text = \"Transpose\";\n      this.buttonTransposeMap.ToolTipText = \"Toggles transposition of the current map.\";\n      this.buttonTransposeMap.Click += new System.EventHandler(this.buttonTransposeMap_Click);\n      // \n      // buttonRangeLine\n      // \n      this.buttonRangeLine.AutoSize = false;\n      this.buttonRangeLine.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonRangeLine.CheckOnClick = true;\n      this.buttonRangeLine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonRangeLine.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonRangeLine.Image\")));\n      this.buttonRangeLine.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonRangeLine.Name = \"buttonRangeLine\";\n      this.buttonRangeLine.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonRangeLine.Size = new System.Drawing.Size(75, 22);\n      this.buttonRangeLine.Text = \"Range Line\";\n      this.buttonRangeLine.ToolTipText = \"Toggles (a) display of Range Line; and (b) Field-of-View source between Start-Hex\" +\n    \" and Hotspot-Hex.\";\n      this.buttonRangeLine.CheckedChanged += new System.EventHandler(this.buttonRangeLine_Click);\n      // \n      // buttonFieldOfView\n      // \n      this.buttonFieldOfView.AutoSize = false;\n      this.buttonFieldOfView.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonFieldOfView.Checked = true;\n      this.buttonFieldOfView.CheckOnClick = true;\n      this.buttonFieldOfView.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonFieldOfView.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonFieldOfView.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonFieldOfView.Image\")));\n      this.buttonFieldOfView.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonFieldOfView.Name = \"buttonFieldOfView\";\n      this.buttonFieldOfView.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonFieldOfView.Size = new System.Drawing.Size(75, 22);\n      this.buttonFieldOfView.Text = \"FOV\";\n      this.buttonFieldOfView.ToolTipText = \"Toggles display of current Field-of-View\";\n      this.buttonFieldOfView.Click += new System.EventHandler(this.buttonFieldOfView_Click);\n      // \n      // buttonPathArrow\n      // \n      this.buttonPathArrow.AutoSize = false;\n      this.buttonPathArrow.BackColor = System.Drawing.SystemColors.ControlLight;\n      this.buttonPathArrow.Checked = true;\n      this.buttonPathArrow.CheckOnClick = true;\n      this.buttonPathArrow.CheckState = System.Windows.Forms.CheckState.Checked;\n      this.buttonPathArrow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.buttonPathArrow.Image = ((System.Drawing.Image)(resources.GetObject(\"buttonPathArrow.Image\")));\n      this.buttonPathArrow.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.buttonPathArrow.Name = \"buttonPathArrow\";\n      this.buttonPathArrow.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);\n      this.buttonPathArrow.Size = new System.Drawing.Size(75, 22);\n      this.buttonPathArrow.Text = \"Path Arrow\";\n      this.buttonPathArrow.ToolTipText = \"Toggle display of Path Arrow.\";\n      this.buttonPathArrow.CheckedChanged += new System.EventHandler(this.buttonPathArrow_Click);\n      // \n      // comboBoxMapSelection\n      // \n      this.comboBoxMapSelection.AutoSize = false;\n      this.comboBoxMapSelection.CausesValidation = false;\n      this.comboBoxMapSelection.Name = \"comboBoxMapSelection\";\n      this.comboBoxMapSelection.Size = new System.Drawing.Size(90, 23);\n      this.comboBoxMapSelection.Text = \"Map:\";\n      this.comboBoxMapSelection.ToolTipText = \"Selects map to display.\";\n      this.comboBoxMapSelection.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapSelection_SelectionChanged);\n      // \n      // lblPathCutover\n      // \n      this.lblPathCutover.Name = \"lblPathCutover\";\n      this.lblPathCutover.Size = new System.Drawing.Size(79, 22);\n      this.lblPathCutover.Text = \"Path Cutover:\";\n      this.lblPathCutover.ToolTipText = resources.GetString(\"lblPathCutover.ToolTipText\");\n      // \n      // txtPathCutover\n      // \n      this.txtPathCutover.Name = \"txtPathCutover\";\n      this.txtPathCutover.Size = new System.Drawing.Size(40, 25);\n      this.txtPathCutover.Tag = 20;\n      this.txtPathCutover.Text = \"20\";\n      this.txtPathCutover.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n      this.txtPathCutover.ToolTipText = resources.GetString(\"txtPathCutover.ToolTipText\");\n      this.txtPathCutover.TextChanged += new System.EventHandler(this.txtPathCutover_TextChanged);\n      // \n      // toolStripSeparator2\n      // \n      this.toolStripSeparator2.Name = \"toolStripSeparator2\";\n      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);\n      // \n      // lblLandmark\n      // \n      this.lblLandmark.Name = \"lblLandmark\";\n      this.lblLandmark.Size = new System.Drawing.Size(63, 22);\n      this.lblLandmark.Text = \"Landmark:\";\n      this.lblLandmark.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // menuItemLandmarks\n      // \n      this.menuItemLandmarks.AutoSize = false;\n      this.menuItemLandmarks.Items.AddRange(new object[] {\n            \"None\"});\n      this.menuItemLandmarks.Name = \"menuItemLandmarks\";\n      this.menuItemLandmarks.Size = new System.Drawing.Size(50, 23);\n      this.menuItemLandmarks.ToolTipText = \"Landmark from which shortest-paths distances are to be displayed.\";\n      // \n      // toolStripSeparator1\n      // \n      this.toolStripSeparator1.Name = \"toolStripSeparator1\";\n      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemDebug\n      // \n      this.menuItemDebug.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemDebug.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemDebug.Name = \"menuItemDebug\";\n      this.menuItemDebug.Size = new System.Drawing.Size(87, 22);\n      this.menuItemDebug.Text = \"&Debug Trace\";\n      this.menuItemDebug.ToolTipText = \"Build with DEBUG to enable this feature.\";\n      // \n      // toolStripSeparator3\n      // \n      this.toolStripSeparator3.Name = \"toolStripSeparator3\";\n      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);\n      // \n      // menuItemHelp\n      // \n      this.menuItemHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\n      this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\n            this.menuItemHelpContents,\n            this.toolStripSeparator4,\n            this.menuItemHelpAbout});\n      this.menuItemHelp.Image = ((System.Drawing.Image)(resources.GetObject(\"menuItemHelp.Image\")));\n      this.menuItemHelp.ImageTransparentColor = System.Drawing.Color.Magenta;\n      this.menuItemHelp.Name = \"menuItemHelp\";\n      this.menuItemHelp.ShowDropDownArrow = false;\n      this.menuItemHelp.Size = new System.Drawing.Size(36, 19);\n      this.menuItemHelp.Text = \"&Help\";\n      this.menuItemHelp.Visible = false;\n      // \n      // menuItemHelpContents\n      // \n      this.menuItemHelpContents.Name = \"menuItemHelpContents\";\n      this.menuItemHelpContents.ShortcutKeys = System.Windows.Forms.Keys.F1;\n      this.menuItemHelpContents.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpContents.Text = \"&Contents\";\n      this.menuItemHelpContents.Click += new System.EventHandler(this.menuItemHelpContents_Click);\n      // \n      // toolStripSeparator4\n      // \n      this.toolStripSeparator4.Name = \"toolStripSeparator4\";\n      this.toolStripSeparator4.Size = new System.Drawing.Size(187, 6);\n      // \n      // menuItemHelpAbout\n      // \n      this.menuItemHelpAbout.Name = \"menuItemHelpAbout\";\n      this.menuItemHelpAbout.Size = new System.Drawing.Size(190, 22);\n      this.menuItemHelpAbout.Text = \"&ABout HexgridUtilities\";\n      // \n      // HexgridExampleWinForms\n      // \n      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.ClientSize = new System.Drawing.Size(770, 420);\n      this.Controls.Add(this.toolStripContainer1);\n      this.Name = \"HexgridExampleWinForms\";\n      this.Text = \"HexgridExampleWinForms\";\n      this.Load += new System.EventHandler(this.HexGridExampleForm_Load);\n      this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.BottomToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ContentPanel.ResumeLayout(false);\n      this.toolStripContainer1.ContentPanel.PerformLayout();\n      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);\n      this.toolStripContainer1.TopToolStripPanel.PerformLayout();\n      this.toolStripContainer1.ResumeLayout(false);\n      this.toolStripContainer1.PerformLayout();\n      this.toolStrip1.ResumeLayout(false);\n      this.toolStrip1.PerformLayout();\n      this.toolStrip2.ResumeLayout(false);\n      this.toolStrip2.PerformLayout();\n      this.ResumeLayout(false);\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.ToolStripContainer toolStripContainer1;\n    private System.Windows.Forms.ToolStrip toolStrip1;\n    private System.Windows.Forms.ToolStripLabel toolStripLabel1;\n    private PGNapoleonics.HexgridPanel.HexgridPanel _hexgridPanel;\n    private System.Windows.Forms.ToolStrip toolStrip2;\n    private System.Windows.Forms.ToolStripButton buttonTransposeMap;\n    private System.Windows.Forms.ToolStripLabel statusLabel;\n    private System.Windows.Forms.ToolStripComboBox comboBoxMapSelection;\n    private System.Windows.Forms.ToolStripButton buttonFieldOfView;\n    private System.Windows.Forms.ToolStripLabel lblPathCutover;\n    private System.Windows.Forms.ToolStripTextBox txtPathCutover;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemDebug;\n    private System.Windows.Forms.ToolStripComboBox menuItemLandmarks;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\n    private System.Windows.Forms.ToolStripLabel lblLandmark;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\n    private System.Windows.Forms.ToolStripButton buttonPathArrow;\n    private System.Windows.Forms.ToolStripButton buttonRangeLine;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;\n    private System.Windows.Forms.ToolStripDropDownButton menuItemHelp;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpContents;\n    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\n    private System.Windows.Forms.ToolStripMenuItem menuItemHelpAbout;\n  }\n}"
  },
  {
    "path": "old/HexGridExample2 - Copy/HexGridExampleWinForms.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexgridPanel;\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing HexgridExampleCommon;\n\nnamespace HexgridExampleWinForms {\n  using MapGridDisplay = PGNapoleonics.HexgridPanel.MapDisplay<MapGridHex>;\n\n  internal sealed partial class HexgridExampleWinForms : Form, IMessageFilter {\n    private MapGridDisplay _mapBoard { get; set; }\n\n    public HexgridExampleWinForms() {\n      InitializeComponent();\n      Application.AddMessageFilter(this);\n\n      this._hexgridPanel.ScaleChange += new EventHandler<EventArgs>((o,e) => OnResizeEnd(e));\n\n      LoadTraceMenu();\n\n      comboBoxMapSelection.Items.AddRange(\n         Map.MapList.Select(item => item.MapName).ToArray()\n      );\n      comboBoxMapSelection.SelectedIndex = 0;\n\n//      helpProvider1.SetShowHelp(this,true);\n    }\n    protected override CreateParams CreateParams { \n\t\t\tget { return this.SetCompositedStyle(base.CreateParams); }\n\t\t}\n\n    partial void LoadTraceMenu();\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n    [System.Diagnostics.Conditional(\"TRACE\")]\n    partial void LoadTraceMenu() {\n      foreach(var item in Enum.GetValues(typeof(TraceFlags))) {\n        var menuItem = new System.Windows.Forms.ToolStripMenuItem();\n        menuItemDebug.DropDownItems.Add(menuItem);\n        menuItem.Name         = \"menuItemDebugTracing\" + item.ToString();\n        menuItem.Size         = new System.Drawing.Size(143, 22);\n        menuItem.Text         = item.ToString();\n        menuItem.CheckOnClick = true;\n        menuItem.Click       += new System.EventHandler(this.menuItemDebugTracing_Click);\n      }\n    }\n\n    void LoadLandmarkMenu() {\n      menuItemLandmarks.Items.Clear();\n      menuItemLandmarks.Items.Add(\"None\");\n      foreach(var landmark in _mapBoard.Landmarks) {\n        menuItemLandmarks.Items.Add(string.Format(CultureInfo.InvariantCulture, \"{0}\", landmark.Coords));\n      }\n      menuItemLandmarks.SelectedIndexChanged += new EventHandler(menuItemLandmarks_SelectedIndexChanged);\n      menuItemLandmarks.SelectedIndex = 0; \n    }\n\n    #region Event handlers\n    void HexGridExampleForm_Load(object sender, EventArgs e) {\n      _hexgridPanel.Scales = new List<float>() {0.707F,  0.841F, 1.000F, 1.189F, 1.414F}.AsReadOnly();\n      _hexgridPanel.ScaleIndex = _hexgridPanel.Scales\n                              .Select((f,i) => new {value=f, index=i})\n                              .Where(s => s.value==1.0F)\n                              .Select(s => s.index).FirstOrDefault(); \n      var padding = this.toolStripContainer1.ContentPanel.Padding;\n      Size = _hexgridPanel.MapSizePixels  + new Size(21,93)\n           + new Size(padding.Left+padding.Right, padding.Top+padding.Bottom);\n    }\n\n    bool isPanelResizeSuppressed = false;\n    protected override void OnResizeBegin(EventArgs e) {\n      base.OnResizeBegin(e);\n      isPanelResizeSuppressed = true;\n    }\n    protected override void OnResize(EventArgs e) {\n      base.OnResize(e);\n      if (IsHandleCreated && ! isPanelResizeSuppressed) _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n    protected override void OnResizeEnd(EventArgs e) {\n      base.OnResizeEnd(e);\n      isPanelResizeSuppressed = false;\n      _hexgridPanel.SetScrollLimits(_mapBoard);\n    }\n\n    void hexgridPanel_MouseMove(object sender, MouseEventArgs e) {\n      var hotHex       = _mapBoard.HotspotHex;\n      statusLabel.Text = string.Format(CultureInfo.InvariantCulture,\n        // \"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\",\n        PGNapoleonics.HexGridExample2.Properties.Resources.StatusLabelText,\n        hotHex, hotHex, hotHex,\n        _mapBoard.StartHex - hotHex, (_mapBoard.Path==null ? 0 : _mapBoard.Path.TotalCost));\n    }\n\n    void txtPathCutover_TextChanged(object sender, EventArgs e) {\n      int value;\n      if (Int32.TryParse(txtPathCutover.Text, out value)) {\n        txtPathCutover.Tag = value;\n      } else {\n        txtPathCutover.Text = txtPathCutover.Tag.ToString();\n        value = (int)txtPathCutover.Tag;\n      }\n      _mapBoard.FovRadius   =\n      _mapBoard.RangeCutoff = value;\n      Refresh();\n    }\n\n    void menuItemLandmarks_SelectedIndexChanged(object sender, EventArgs e) {\n      _mapBoard.LandmarkToShow = menuItemLandmarks.SelectedIndex;\n      _hexgridPanel.SetMapDirty();\n      Update();\n    }\n\n    void menuItemDebugTracing_Click(object sender, EventArgs e) {\n      var item = (ToolStripMenuItem)sender;\n      item.CheckState = item.Checked ? CheckState.Checked : CheckState.Unchecked;\n      var name = item.Name.Replace(\"menuItemDebugTracing\",\"\");\n      var flag = (TraceFlags)Enum.Parse(typeof(TraceFlags),name);\n      if( item.Checked)   DebugTracing.EnabledFlags |=  flag;\n      else                DebugTracing.EnabledFlags &= ~flag;\n    }\n\n    void menuItemHelpContents_Click(object sender, EventArgs e) {\n//      helpProvider1.SetShowHelp(this,true);\n    }\n\n   void comboBoxMapSelection_SelectionChanged(object sender, EventArgs e) {\n      SetMapBoard(ParseMapName(((ToolStripItem)sender).Text));\n    }\n   private MapGridDisplay ParseMapName(string mapName) {\n     return Map.MapList.First(item => item.MapName == mapName).MapBoard;\n   }\n\n    void SetMapBoard(MapGridDisplay mapBoard) {\n      _hexgridPanel.SetModel( _mapBoard = mapBoard);\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      _mapBoard.ShowFov       = buttonFieldOfView.Checked;\n      _mapBoard.FovRadius     =\n      _mapBoard.RangeCutoff   = Int32.Parse(txtPathCutover.Tag.ToString(),CultureInfo.InvariantCulture);\n      LoadLandmarkMenu();\n\n      CustomCoords.SetMatrices(new IntMatrix2D(2,0, 0,-2, 0,2*_mapBoard.MapSizeHexes.Height-1, 2));\n   \n      _hexgridPanel.Focus();\n   }\n\n    void buttonFieldOfView_Click(object sender, EventArgs e) {\n      _mapBoard.ShowFov = buttonFieldOfView.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    void buttonPathArrow_Click(object sender, EventArgs e) {\n      _mapBoard.ShowPathArrow = buttonPathArrow.Checked;\n      this._hexgridPanel.Refresh();\n    }\n    void buttonRangeLine_Click(object sender, EventArgs e) {\n      _mapBoard.ShowRangeLine = buttonRangeLine.Checked;\n      _hexgridPanel.SetMapDirty();\n      _mapBoard.StartHex = _mapBoard.StartHex; // Indirect, but it works.\n      this._hexgridPanel.Refresh();\n    }\n    void buttonTransposeMap_Click(object sender, EventArgs e) {\n      _hexgridPanel.IsTransposed = buttonTransposeMap.Checked;\n    }\n\n    void PanelBoard_GoalHexChange(object sender, HexEventArgs e) {\n      _mapBoard.GoalHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    void PanelBoard_StartHexChange(object sender, HexEventArgs e) {\n      _mapBoard.StartHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) {\n      _mapBoard.HotspotHex = e.Coords;\n      this._hexgridPanel.Refresh();\n    }\n    #endregion\n\n    #region IMessageFilter implementation\n    /// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    /// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    /// that with focus) with adjusted delta.\n    /// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    /// Dont forget to add this to constructor:\n    /// \t\t\tApplication.AddMessageFilter(this);\n    ///</remarks>\n    /// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    /// <returns>Success (true) or failure (false) to OS.</returns>\n    [System.Security.Permissions.PermissionSetAttribute(\n      System.Security.Permissions.SecurityAction.Demand, Name = \"FullTrust\")]\n    public bool PreFilterMessage(ref Message m) {\n      if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n\n      var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n      var ctl = Control.FromChildHandle(hWnd);\n      if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n        switch ((WM)m.Msg) {\n          case WM.MOUSEHWHEEL:\n          case WM.MOUSEWHEEL:\n            DebugTracing.Trace(TraceFlags.ScrollEvents, true, \" - {0}.WM.{1}: \", Name, ((WM)m.Msg));\n            return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n          default: break;\n        }\n      }\n      return false;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/HexGridExampleWinForms.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <data name=\"_hexgridPanel.Scales\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n    <value>\n        AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u\n        ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u\n        PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB\n        AAAAQlN5c3RlbS5Db2xsZWN0aW9ucy5PYmplY3RNb2RlbC5SZWFkT25seUNvbGxlY3Rpb25gMVtbU3lz\n        dGVtLlNpbmdsZQEAAAAEbGlzdAQwU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0\n        ZW0uU2luZ2xlAgAAAAIAAAAJAwAAAAUDAAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3Rg\n        MVtbU3lzdGVtLlNpbmdsZQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACwgIAgAAAAkEAAAAAQAA\n        AAEAAAAPBAAAAAQAAAALAACAPwAAAAAAAAAAAAAAAAs=\n</value>\n  </data>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>122, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"buttonTransposeMap.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonRangeLine.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonFieldOfView.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"buttonPathArrow.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"lblPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.\n</value>\n  </data>\n  <data name=\"txtPathCutover.ToolTipText\" xml:space=\"preserve\">\n    <value>Range beyond which Fast PathFinding is used instead of Stable PathFinding. \nBy way of illustration using the Terrain Map:\n1) With Path Cutover set to 20 hexes (the default;\n2) Left-click a Start-Hex along the left side of the board;\n3) Right-click a Goal-Hex just inside the (tan-coloured) Trail; then\n4) Right-click a Goal-Hex just over the (tan-coloured) Trail.\n\nNote how the \"directness\" of the path is influenced. The \n\"unstable\" path-finder is significantly faster at long range, \nbut generates meandering (still optimal) paths over \nclear terriain.</value>\n  </data>\n  <data name=\"menuItemHelp.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG\n        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9\n        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw\n        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc\n        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9\n        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32\n        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo\n        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+\n        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D\n        TgDQASA1MVpwzwAAAABJRU5ErkJggg==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "old/HexGridExample2 - Copy/HexgridExampleWinForms.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{BEA36FDA-557C-4FDA-94A2-48A21A0C31FC}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexGridExample2</RootNamespace>\n    <AssemblyName>HexGridExample2</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <TargetFrameworkProfile>\n    </TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <NoWarn>1607</NoWarn>\n    <Prefer32Bit>true</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'\">\n    <OutputPath>..\\bin\\HexGridExample2\\bin\\Release\\</OutputPath>\n    <DefineConstants>CODE_ANALYSIS</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>1607</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <Prefer32Bit>false</Prefer32Bit>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <DocumentationFile>..\\bin\\HexGridExample2\\bin\\Release\\HexGridExample2.XML</DocumentationFile>\n    <CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>HexgridExampleWinForms.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>\n    <DocumentationFile>..\\bin\\HexGridExample2\\bin\\Release\\HexGridExample2.XML</DocumentationFile>\n    <Optimize>true</Optimize>\n    <NoWarn>1607,1587</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexGridExampleWinForms.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"HexGridExampleWinForms.Designer.cs\">\n      <DependentUpon>HexGridExampleWinForms.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"HexGridExampleWinForms.resx\">\n      <DependentUpon>HexGridExampleWinForms.cs</DependentUpon>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.config\" />\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.4.5\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 4.5</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexGridExampleCommon\\HexgridExampleCommon.csproj\">\n      <Project>{4e4ec92b-2bf5-4342-a069-3a6bb76b7fca}</Project>\n      <Name>HexgridExampleCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "old/HexGridExample2 - Copy/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n    /// <param name=\"pt\">(Sign-extended) screen coordinates as a Point structure.</param>\n    /// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \n      \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification=\"Research suggests the Code Analysis message is incorrect.\")] \n     [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n       \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    internal static extern IntPtr WindowFromPoint(System.Drawing.Point pt);\n\n    /// <summary>P/Invoke declaration for user32.dll.SendMessage</summary>\n    /// <param name=\"hWnd\">Window handle</param>\n    /// <param name=\"msg\">Windows message</param>\n    /// <param name=\"wParam\">WParam</param>\n    /// <param name=\"lParam\">LParam</param>\n    /// <returns></returns>\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n    internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n\n    /// <summary>Message Cracker for HiWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n    internal static Int32 HIWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return ((val32 >> 16) & 0xFFFF);\n    }\n\n    /// <summary>Message Cracker for LoWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n    internal static Int32 LOWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return (val32 & 0xFFFF);\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/Program.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.WinForms;\n\n#pragma warning disable 1587\n/// <summary>Example usage of <see cref=\"HexUtilities\"/> with <see cref=\"HexUtilities.HexgridPanel\"/> \n/// in a simple <see cref=\"WinForms\"/> application.</summary>\n#pragma warning restore 1587\nnamespace HexgridExampleWinForms {\n  static class Program {\n    /// <summary>The main entry point for the application.</summary>\n    [STAThread]\n    static void Main()      {\n      Application.EnableVisualStyles();\n      Application.SetCompatibleTextRenderingDefault(false);\n      Application.ThreadException += \n        new ThreadExceptionEventHandler(\n          (new ThreadExceptionHandler()).ApplicationThreadException);\n\n      Application.Run(new HexgridExampleWinForms());\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.InteropServices;\n\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinForms\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinForms\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"e0be8677-676e-4d95-bf9d-c39273565a46\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.*\")]\n[assembly: AssemblyFileVersion(\"6.4\")]\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18052\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PGNapoleonics.HexGridExample2.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PGNapoleonics.HexGridExample2.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to &quot;Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}&quot;.\n        /// </summary>\n        internal static string StatusLabelText {\n            get {\n                return ResourceManager.GetString(\"StatusLabelText\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"StatusLabelText\" xml:space=\"preserve\">\n    <value>\"Hotspot Hex: {0:gi3} / {1:uI4} / {2:c5}; {3:r6}; Path Length = {4}\"</value>\n  </data>\n</root>"
  },
  {
    "path": "old/HexGridExample2 - Copy/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18047\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HexgridExampleWinForms {\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/app.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\"/></startup></configuration>\n"
  },
  {
    "path": "old/HexGridExample2 - Copy/index.xhtml",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.4\"/>\n<title>Hexgrid Utilities: Main Page</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(initResizable);\n  $(window).load(resizeHeight);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">Hexgrid Utilities\n   &#160;<span id=\"projectnumber\">V 6.3</span>\n   </div>\n   <div id=\"projectbrief\">Hexgrid utilities for Board Game Implementations</div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.4 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li class=\"current\"><a href=\"index.xhtml\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"namespaces.xhtml\"><span>Packages</span></a></li>\n      <li><a href=\"annotated.xhtml\"><span>Classes</span></a></li>\n      <li><a href=\"files.xhtml\"><span>Files</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n  <div id=\"nav-tree\">\n    <div id=\"nav-tree-contents\">\n      <div id=\"nav-sync\" class=\"sync\"></div>\n    </div>\n  </div>\n  <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n       class=\"ui-resizable-handle\">\n  </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('index.xhtml','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Classes</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Namespaces</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Files</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(8)\"><span class=\"SelectionMark\">&#160;</span>Properties</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(9)\"><span class=\"SelectionMark\">&#160;</span>Events</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">Hexgrid Utilities Documentation</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n</div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n  <ul>\n    <li class=\"footer\">Generated on Sun Jul 28 2013 22:52:44 for Hexgrid Utilities by\n    <a href=\"http://www.doxygen.org/index.html\">\n    <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.4 </li>\n  </ul>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "old/HexGridExample2-branch/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Linq;\nusing System.Text;\n\nusing PGNapoleonics;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.PathFinding;\n\nnamespace PGNapoleonics.HexGridExample2 {\n  internal abstract class MapDisplay : HexBoard<MapGridHex>, IMapDisplay, IBoard<IHex>, INavigableBoard {\n\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n    protected MapDisplay(Size sizeHexes, Func<IBoard<MapGridHex>, HexCoords, MapGridHex> initializeHex) \n      : base(sizeHexes, new Size(27,30), (map) => \n          new BoardStorage<MapGridHex>.FlatBoardStorage(sizeHexes, coords => initializeHex(map,coords))\n    ) {\n      StartHex   = GoalHex = HotspotHex = HexCoords.EmptyUser;\n    }\n\n    public virtual  IFov      Fov            {\n      get { return _fov ?? (_fov = this.GetFov(HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    public virtual  HexCoords GoalHex        { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    public virtual  HexCoords HotspotHex     { \n      get { return _hotSpotHex; }\n      set { _hotSpotHex = value; Fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    public          IDirectedPath Path       { \n      get { return _path ?? ( IsPassable(StartHex) && IsPassable(GoalHex) \n                          ? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])) : null); } \n    } IDirectedPath _path;\n    public virtual  HexCoords StartHex       { \n      get { return _startHex; } // ?? (_startHex = HexCoords.EmptyUser); } \n      set { if (IsOnboard(value)) _startHex = value; _path = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n\n    public          int       LandmarkToShow { get; set; }\n    public          Size      MapMargin      { get; set; }\n    public          string    Name           { get {return \"MapDisplay\";} }\n    public          bool      ShowFov        { get; set; }\n\n    IHex IFovBoard<IHex>.this[HexCoords coords] { get { return BoardHexes[coords]; } }\n\n    public CoordsRectangle GetClipCells(PointF point, SizeF size) {\n      return GetClipHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n    public CoordsRectangle GetClipCells(RectangleF visibleClipBounds) {\n      return GetClipHexes(visibleClipBounds, MapSizeHexes);\n    }\n    public virtual  void PaintHighlight(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var state = g.Save();\n      g.TranslateTransform(\n        MapMargin.Width  + StartHex.User.X * GridSize.Width,\n        MapMargin.Height + StartHex.User.Y * GridSize.Height + (StartHex.User.X+1)%2 * GridSize.Height/2\n      );\n      g.DrawPath(Pens.Red, HexgridPath);\n\n#if PathFwd\n      g.Restore(state); state = g.Save();\n      PaintPath(g,Path);\n#else\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        var path = Path;\n        while (path != null) {\n          g.Restore(state); state = g.Save();\n\n          var coords = path.StepCoords;\n          g.TranslateTransform(\n            MapMargin.Width  + coords.User.X * GridSize.Width,\n            MapMargin.Height + coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n          );\n          g.FillPath(brush, HexgridPath);\n\n          path = path.PathSoFar;\n        }\n      }\n#endif\n\n      g.Restore(state); state = g.Save();\n      var clipCells = GetClipCells(g.VisibleClipBounds);\n      var location  = new Point(GridSize.Width*2/3, GridSize.Height/2);\n\n      g.TranslateTransform(MapMargin.Width + clipCells.Right*GridSize.Width, MapMargin.Height);\n\n      var textOffset = new Point(GridSize.Width/2 - 6, GridSize.Height/2 - 6);\n      var font       = SystemFonts.MenuFont;\n      using(var shadeBrush = new SolidBrush(Color.FromArgb(78,Color.Black))) {\n        for (int x=clipCells.Right; x-->clipCells.Left; ) {\n          g.TranslateTransform(-GridSize.Width, 0);\n          var container = g.BeginContainer();\n          g.TranslateTransform(0,  clipCells.Top*GridSize.Height + (x+1)%2 * (GridSize.Height)/2);\n          for (int y=clipCells.Top; y<clipCells.Bottom; y++) {\n            var coords = HexCoords.NewUserCoords(x,y);\n            if (ShowFov && Fov!=null && ! Fov[coords]) { g.FillPath(shadeBrush, HexgridPath);  }\n\n            g.DrawString(HexText(x,y,LandmarkToShow), font, Brushes.Black, textOffset);\n\n            g.TranslateTransform(0,GridSize.Height);\n          }\n          g.EndContainer(container);\n        }\n      }\n    }\n\n#if PathFwd\n    void PaintPath(Graphics g, IDirectedPath Path) {\n      var state = g.Save();\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        var path = Path;\n        while (path != null) {\n          g.Restore(state); state = g.Save();\n          var coords = path.PathStep.Hex.Coords;\n          g.TranslateTransform(\n            MapMargin.Width  + coords.User.X * GridSize.Width,\n            MapMargin.Height + coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n          );\n          g.FillPath(brush, HexgridPath);\n\n          PaintPathArrow(g, path);\n          path = path.PathSoFar;\n        }\n      }\n    }\n\n    void PaintPathArrow(Graphics g, IDirectedPath path) {\n      g.TranslateTransform(GridSize.Width * 2/3, GridSize.Height/2);\n      var unit = GridSize.Height/8.0F;\n      if (path.PathSoFar == null) {\n        g.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n        g.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n      } else {\n        g.RotateTransform(60 * (int)path.PathStep.HexsideEntry);\n        g.DrawLine(Pens.Black, 0,unit*4,       0,-unit);\n        g.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n        g.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n      }\n    }\n#endif\n\n    public abstract void PaintMap(Graphics g);\n    public abstract void PaintUnits(Graphics g);\n\n    CoordsRectangle  GetClipHexes(RectangleF visibleClipBounds, Size boardSizeHexes) {\n      var left    = Math.Max((int)visibleClipBounds.Left  /GridSize.Width  - 1, 0);\n      var top     = Math.Max((int)visibleClipBounds.Top   /GridSize.Height - 1, 0);\n      var right   = Math.Min((int)visibleClipBounds.Right /GridSize.Width  + 1, boardSizeHexes.Width);\n      var bottom  = Math.Min((int)visibleClipBounds.Bottom/GridSize.Height + 1, boardSizeHexes.Height); \n      return new CoordsRectangle (left, top, right-left, bottom-top);\n    }\n    \n    public string HexText(HexCoords coords, int landmarkToShow) { \n      var value = (0 <= landmarkToShow && landmarkToShow < Landmarks.Count)\n        ? Landmarks[landmarkToShow].HexDistance(coords) : -1;\n      return value==-1 ? \"\" : string.Format(\"{0,3}\", value);\n    }\n    public string HexText(int x, int y, int landmarkToShow)     { \n      return HexText(HexCoords.NewUserCoords(x,y),landmarkToShow); \n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/DebugTracing.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>enumerationof known debugging trace flags.</summary>\n  [Flags]public enum Traces  {\n    /// <summary>TODO</summary>\n    None            = 0x00000,\n    /// <summary>TODO</summary>\n    Caching         = 0x00001,\n    /// <summary>TODO</summary>\n    FieldOfView     = 0x00002,\n    /// <summary>TODO</summary>\n    Mouse           = 0x00004,\n    /// <summary>TODO</summary>\n    MouseMove       = 0x00008,\n    /// <summary>TODO</summary>\n    MainForm        = 0x00010,\n    /// <summary>TODO</summary>\n    Initialization  = 0x00020,\n    /// <summary>TODO</summary>\n    Docking         = 0x00040,\n    /// <summary>TODO</summary>\n    MenuEvents      = 0x00080,\n    /// <summary>TODO</summary>\n    KeyEvents       = 0x00100,\n    /// <summary>TODO</summary>\n    Sizing          = 0x00200,\n    /// <summary>TODO</summary>\n    ScrollEvents    = 0x00400,\n    /// <summary>TODO</summary>\n    ToolTipEvents   = 0x00800,\n    /// <summary>TODO</summary>\n    Paint           = 0x01000,\n    /// <summary>TODO</summary>\n    PaintMap        = 0x02000,\n    /// <summary>TODO</summary>\n    PaintDetail     = 0x04000,\n    /// <summary>TODO</summary>\n    FindPathEnqueue = 0x08000,\n    /// <summary>TODO</summary>\n    FindPathDequeue = 0x10000,\n    /// <summary>TODO</summary>\n    FindPathDetail  = 0x20000,\n    /// <summary>TODO</summary>\n    FindPathShortcut= 0x40000\n  }\n\n  internal static partial class NativeMethods {\n    [StructLayout(LayoutKind.Sequential)]\n    internal sealed class SystemTime {\n      public ushort year;\n      public ushort month;\n      public ushort weekday;\n      public ushort day;\n      public ushort hour;\n      public ushort minute;\n      public ushort second;\n      public ushort millisecond;\n\n      public override string ToString() {\n        return string.Format(CultureInfo.InvariantCulture,\"{0,2}:{1,2}:{2,2}.{3,3}\", \n          this.hour, this.minute, this.second, this.millisecond);\n      }\n    }\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"Kernel32.dll\")]\n    internal static extern void GetSystemTime([In,Out] SystemTime st);\n  }\n\n  /// <summary>TODO</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public static partial class DebugTracing {\n    /// <summary>TODO</summary>\n    public static Traces EnabledTraces { get; set; }\n\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, string format, params object[] args) {\n      Trace(traces, false, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void Trace(Traces traces, bool newLine, string format, params object[] args) {\n      Trace(traces, newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n#if ! TRACE\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n#endif\n    public static void Trace(Traces traces, bool newLine, string description) {\n      TraceDetail(traces, newLine, description);\n    }\n\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string format, params object[] args) {\n      LogTime(traces, false, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, bool newLine, string format, params object[] args) {\n      LogTime(traces, newLine, string.Format(CultureInfo.CurrentCulture,format,args));\n    }\n    /// <summary>TODO</summary>\n    public static void LogTime(Traces traces, string description) {\n      LogTime(traces, false, description);\n    }\n    /// <summary>TODO</summary>\n#if ! TRACE\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"traces\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n    [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n#endif\n    public static void LogTime(Traces traces, bool newLine, string description) {\n      LogTimeDetail(traces, newLine, description);\n    }\n\n    static partial void TraceDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void TraceDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        System.Diagnostics.Trace.WriteLine(description);\n      }\n    }\n\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description);\n    [Conditional(\"TRACE\")]\n    static partial void LogTimeDetail(Traces traces, bool newLine, string description) {\n      if (EnabledTraces.HasFlag(traces)) {\n        if(newLine) System.Diagnostics.Trace.WriteLine(\"\");\n        var st = new NativeMethods.SystemTime();\n        NativeMethods.GetSystemTime(st);\n\n        System.Diagnostics.Trace.Write(\"{0} - \", st.ToString());\n        Trace(traces, false, description);\n      }\n    }\n  }\n\n    /// <summary>TODO</summary>\n  public static partial class Extensions {\n    #if TRACE\n      public static void Trace(this Traces @this, string format, params object[] args) {\n        DebugTracing.Trace(@this,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.Trace(@this,newLine,format,args);\n      }\n      public static void Trace(this Traces @this, bool newLine, string description) {\n        DebugTracing.Trace(@this,newLine,description);\n      }\n\n      public static void LogTime(this Traces @this, string format, params object[] args) {\n        DebugTracing.LogTime(@this,format,args);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {\n        DebugTracing.LogTime(@this,newLine,format,args);\n      }\n      public static void LogTime(this Traces @this, string description) {\n        DebugTracing.LogTime(@this,description);\n      }\n      public static void LogTime(this Traces @this, bool newLine, string description) {\n        DebugTracing.LogTime(@this,newLine,description);\n      }\n    #else\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void Trace(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void Trace(this Traces @this, bool newLine, string description) {}\n\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      public static void LogTime(this Traces @this, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"args\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"format\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newline\")]\n      public static void LogTime(this Traces @this, bool newLine, string format, params object[] args) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      public static void LogTime(this Traces @this, string description) {}\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"newLine\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"this\")]\n      [SuppressMessage(\"Microsoft.Usage\", \"CA1801:ReviewUnusedParameters\", MessageId = \"description\")]\n      public static void LogTime(this Traces @this, bool newLine, string description) {}\n    #endif\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/EnumExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.Reflection;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n    /// <summary>Type-safe extension methods for parsing Enums.</summary>\n    public static partial class EnumExtensions{\n      #region Enum Parsing utilities\n      /// <summary>Typesafe wrapper for <c>Enum.GetValues(typeof(TEnum).</c></summary>\n      public static IList<TEnum> EnumGetValues<TEnum>() {\n        return new List<TEnum>((TEnum[])(Enum.GetValues(typeof(TEnum)))).AsReadOnly();\n      }\n\n      /// <summary>TODO</summary>\n      [SuppressMessage(\"Microsoft.Design\", \"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n      [Obsolete(\"Less useful or convenient than originally thought - just use Enum.GetNames({TEnum}).\")]\n      public static IList<string> EnumGetNames<TEnum>() where TEnum : struct {\n        return new List<string>((string[])(Enum.GetNames(typeof(TEnum)))).AsReadOnly();\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value) where TEnum : struct {\n        return ParseEnum<TEnum>(value,true,false);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static TEnum ParseEnum<TEnum>(string value, bool checkConstants, bool ignoreCase) where TEnum : struct {\n        TEnum enumValue;\n        if (!TryParseEnum<TEnum>(value, ignoreCase, out enumValue) && checkConstants) \n              throw new ArgumentOutOfRangeException(\"value\",value,\"Enum type: \" + typeof(TEnum).Name);\n\n        return enumValue;\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static bool TryParseEnum<TEnum>(string value, out TEnum enumValue) where TEnum : struct {\n        return Enum.TryParse<TEnum>(value, out enumValue)  \n           &&  Enum.IsDefined(typeof(TEnum),enumValue);\n      }\n      /// <summary>Typesafe wrapper for <c>Enum.TryParseEnum()</c> that automatically checks \n      /// constants for membership in the <c>enum</c>.</summary>\n      public static bool TryParseEnum<TEnum>(string value, bool ignoreCase, out TEnum enumValue) where TEnum : struct {\n        return Enum.TryParse<TEnum>(value, ignoreCase, out enumValue)  \n           &&  Enum.IsDefined(typeof(TEnum),enumValue);\n      }\n\n      /// <summary>Typesafe wrapper for <c>Enum.ToObject()</c>.</summary>\n      /// <typeparam name=\"TEnum\"></typeparam>\n      public static TEnum EnumParse<TEnum>(char c, string lookup) {\n        if (lookup==null) throw new ArgumentNullException(\"lookup\");\n        var index = lookup.IndexOf(c);\n        if (index == -1) throw new ArgumentOutOfRangeException(\"c\",c,\"Enum Type: \" + typeof(TEnum).Name);\n\n        return (TEnum) Enum.ToObject(typeof(TEnum), index);\n      }\n      #endregion\n    }\n}\n#region Deprecated code\nnamespace PGNapoleonics.HexUtilities.Common {\nusing System.IO;\n  public static partial class EnumExtensions{\n    #region InvalidDataException Throwers\n    /// <summary>Deprecated</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(MemberInfo type, object data) {\n      if (type == null) \n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"Unknown: Invalid: '{0}'\", data));\n      else\n        throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture,\n            \"{1}: Invalid: '{0}'\", data, type.Name));\n    }\n    ///  <summary>Deprecated:</summary>\n    /// <deprecated/>\n    [Obsolete(\"InvalidDataException is an IOException; subclass and throw a more appropriate error instead.\")]\n    public static void ThrowInvalidDataException(string parseType, int lineNo, \n      object section, string error, Exception ex, object data) {\n      throw new InvalidDataException(\n          string.Format(CultureInfo.InvariantCulture,\n            \"{0}: {3}\\n  for section {2} on line # {1}:\\n   {4}\",  \n              parseType, lineNo, section, error, data), ex);\n    }\n    #endregion\n  }\n}\n#endregion"
  },
  {
    "path": "old/HexInterfaces/Common/Extensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class EventHandlerExtensions {\n    /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler<T> @this, object sender, T e) \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this PropertyChangedEventHandler @this, object sender, T e)  \n      where T : PropertyChangedEventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n \n      /// <summary>Raises an event in a standard (mostly thread-safe) manner.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\", \n      Justification=\"Not an event, just an event raiser.\")]\n    public static void Raise<T>(this EventHandler @this, object sender, T e)  \n      where T : EventArgs {\n      var handler = @this;\n      if( handler != null ) handler(sender, e);\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/FastList.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing System.Diagnostics;\nusing System.Diagnostics.CodeAnalysis;\n\n#pragma warning disable 1587\n/// <summary>Joe Duffy's Simple (Fast) List enumerator.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common {\n\n  #region Default implementations\n  /// <inheritdoc/>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  public sealed class FastList<TItem> : AbstractFastList<TItem> {\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    public FastList(TItem[] array) : base(array) { }\n  }\n\n  /// <inheritdoc/>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  public sealed class FastListDisposable<TItem> : AbstractFastList<TItem>, IDisposable \n    where TItem : IDisposable {\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    public FastListDisposable(TItem[] array) : base(array)  { }\n\n    #region IDisposable implementation with Finalizer\n    private bool _isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    private void Dispose(bool disposing) {\n      if (! _isDisposed  &&  disposing) {\n        ForEach ( item => item.Dispose() );\n        _array = null;\n      }\n      _isDisposed = true;\n    }\n    #endregion\n  }\n  #endregion\n\n\n  /// <summary>Adapted implementation of Joe Duffy's Simple (Fast) List enumerator.</summary>\n  /// <remarks>\n  /// <a href=\"http://www.bluebytesoftware.com/blog/2008/09/21/TheCostOfEnumeratingInNET.aspx\">\n  /// The Cost of Enumeration in DotNet</a>\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The Type of the Item to be stored and iterated over.</typeparam>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\",\n    Justification=\"The suffix has an unambiguous meaning in the application domain.\")]\n  [DebuggerDisplay(\"Count={Count}\")]\n  private abstract class AbstractFastList<TItem> : IFastList<TItem> {\n    ///// <summary>Returns a new instance from <paramref name=\"array\"/>.</summary>\n    //[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n    //[SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\")]\n    //public static IFastList<TItem> NewDisposableFastList(TItem[] array) {\n    //  AbstractFastList<TItem>.FastListDisposable tempFastList = null;\n    //  AbstractFastList<TItem>.FastListDisposable fastList     = null;\n    //  try {\n    //    tempFastList = new FastListDisposable(array);\n    //    fastList     = tempFastList;\n    //    tempFastList = null;\n    //  } finally { if (tempFastList != null) tempFastList.Dispose(); }\n\n    //  return fastList;\n    //}\n\n    /// <summary>TODO</summary>\n    internal TItem[] _array;\n\n    /// <summary>Constructs a new instance from <paramref name=\"array\"/>.</summary>\n    protected AbstractFastList(TItem[] array) { _array = array; }\n\n    /// <inheritdoc/>>\n    public IEnumerator<TItem>                     GetEnumerator(){\n      return new ClassicEnumerable<TItem>(_array);\n    }\n    IEnumerator                       IEnumerable.GetEnumerator() {return this.GetEnumerator();}\n    IFastEnumerator<TItem> IFastEnumerable<TItem>.GetEnumerator(){\n      return new FastEnumerable<TItem>(_array);\n    }\n\n    /// <summary>IForEachable{TItem} implementation.</summary>\n    public void  ForEach(Action<TItem> action) {\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    action(a[i]);\n    }\n\n    /// <summary>IForEachable2{TItem} implementation</summary>\n    public void  ForEach(FastIteratorFunctor<TItem> functor) {\n      if (functor==null) throw new ArgumentNullException(\"functor\");\n\n      TItem[] a = _array;\n      for (int i = 0; i < a.Length; i++)    functor.Invoke(a[i]);\n    }\n\n    /// <inheritdoc/>\n    public int   Count               { get {return _array.Length;} }\n    /// <inheritdoc/>\n    public TItem this[int index]     { get { return _array[index]; } }\n    /// <inheritdoc/>\n    public int   IndexOf(TItem item) { return Array.IndexOf(_array, item); }\n  }\n\n  /// <summary>Optimized ForEach.</summary>\n  /// <remarks>\n  /// The idea behind IFastEnumerable{TItem} (and specifically IFastEnumerator{TItem}) is to return\n  /// the current element during the call to MoveNext itself.  This cuts the number of\n  /// interface method calls necessary to enumerate a list in half.  The impact to performance\n  /// isn’t huge, but it was enough to cut our overhead from about 3X to 2.3X.  Every little\n  /// bit counts.\n  /// </remarks>\n  /// <typeparam name=\"TItem\"></typeparam>\n  public interface IFastEnumerable<TItem> {\n    /// <summary>Returns the items of a list in order.</summary>\n    IFastEnumerator<TItem> GetEnumerator();\n  }\n\n  /// <summary>Returns the items of a list in order.</summary>\n  public interface IFastEnumerator<T>{\n    /// <summary>Return the next item in the enumeration.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1045:DoNotPassTypesByReference\", MessageId = \"0#\")]\n    bool MoveNext(ref T item);\n  }\n\n  /// <summary>Delegated ForEach - <c>action</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// The IForEachable{T} interface is a push model: the caller provides a delegate and the \n  /// ForEach method is responsible for invoking it once per element in the collection.\n  /// ForEach doesn’t return until this is done.  In addition to having far fewer method\n  /// calls to enumerate a collection, neighbour isn’t a single interface method call.\n  /// Delegate dispatch is also much faster than interface method dispatch.  The result is\n  /// nearly twice as fast as the classic IEnumerator{T} pattern (when /o+ isn’t defined).  \n  /// Now we’re really getting somewhere!\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable<TItem>{\n    /// <summary>Perform the supplied <paramref name=\"action\"/> for every item in the enumeration.</summary>\n    void ForEach(Action<TItem> action);\n  }\n\n  /// <summary>Functored ForEach - <c>functor</c> describes the work to be performed on each iteration.</summary>\n  /// <remarks>\n  /// Clients will pass an instance of the Functor{T} class with the Invoke method\n  /// overridden.  The implementation of ForEach then looks quite a bit like \n  /// IForEachable{T}’s, just with virtual method calls in place of delegate calls:\n  /// </remarks>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  public interface IForEachable2<TItem> {\n    /// <summary>Perform the action specified by <paramref name=\"functor\"/> for every item in the enumeration.</summary>\n    void ForEach(FastIteratorFunctor<TItem> functor);\n  }\n\n  /// <summary>TODO</summary>\n  [SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n  public interface IFastList<TItem> : IEnumerable<TItem>,\n    IFastEnumerable<TItem>, IForEachable<TItem>, IForEachable2<TItem> {\n    /// <summary>Gets the item at location <paramref name=\"index\"/>.</summary>\n    TItem this[int index] { get; }\n\n    /// <summary>Returns the current size of the list.</summary>\n    int Count { get; }\n\n    /// <summary>Returns the index of the specified item in the internal array storage.</summary>\n    /// <param name=\"item\"></param>\n    int IndexOf(TItem item);\n  }\n\n  /// <summary>Abstract base class for a <c>FastList</c> functor.</summary>\n  /// <typeparam name=\"TItem\">The type of object being iterated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public abstract class FastIteratorFunctor<TItem>{\n    /// <summary>Perform the action associated with this functor on <paramref name=\"item\"/>.</summary>\n    public abstract void Invoke(TItem item);\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>standard</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class ClassicEnumerable<TItem> : IEnumerator<TItem> {\n    internal ClassicEnumerable(TItem[] a) { _a = a; }\n\n    private TItem[] _a;\n    private int     _index = -1;  ///< Index of the currently-enumerated element.\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool   MoveNext() { return ++_index < _a.Length; }\n\n    /// <summary>Return the current item in the enumeration</summary>\n    public TItem       Current  { get { return _a[_index]; } }\n    object IEnumerator.Current  { get { return Current; } }\n\n    /// <summary>Reset the enumerator to the start of the enumeration.</summary>\n    public void Reset() { _index = -1; }\n\n    #region IDisposable implementation with Finalizer\n    private bool _isDisposed = false;  //!<True if already Disposed.\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Utility routine to do the hard-lifting for Dispose().</summary>\n    private void Dispose(bool disposing) {\n      if (! _isDisposed  &&  disposing  &&  typeof(TItem).GetInterfaces().Contains(typeof(IDisposable))) {\n        foreach(var i in _a) ((IDisposable)i).Dispose();\n      }\n      _isDisposed = true;\n    }\n    #endregion\n  }\n\n  /// <summary>Implements IEnumerable{TItem} in the <i><b>fast</b></i> way:</summary>\n  /// <typeparam name=\"TItem\">Type of the objects being enumerated.</typeparam>\n  [DebuggerDisplay(\"Count={Count}\")]\n  public sealed class FastEnumerable<TItem> : IFastEnumerator<TItem> {\n    /// <summary>Construct a new instance from array <c>a</c>.</summary>\n    /// <param name=\"a\">The array of type <c>TItem</c> to make enumerable.</param>\n    internal FastEnumerable(TItem[] a) { _array = a; } \n\n    private TItem[] _array;\n    private int     _index = -1;\n\n    /// <summary>Return the next item in the enumeration.</summary>\n    public bool MoveNext(ref TItem item) {\n      var a = _array;\n      int i;\n      if ((i = ++_index) >= a.Length)     return false;\n      item = a[i];\n      return true;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public static class ArrayExtensions {\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this T[] @this) {\n      return new FastList<T>(@this);\n    }\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this IList<T> @this) {\n      return new FastList<T>(@this.ToArray());\n    }\n    /// <summary>TODO</summary>\n    /// <typeparam name=\"T\"></typeparam>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static FastList<T> ToFastList<T>(this IEnumerable<T> @this) {\n      return new FastList<T>(@this.ToArray());\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/ImmutableStack.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Eric Lippert's implementation for use in A*.</summary>\n  /// <remarks>An implementation of immutable stack for use in A* as a 'Path to here'..</remarks>\n  /// <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx\">Path Finding Using A* Part THree</a>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ImmutableStackCollection<T> : IEnumerable<T> {\n\n    /// <summary>Gets the top item on the stack.</summary>\n    public T                 TopItem      { get; private set; }\n    /// <summary>Gets the remainder of the stack.</summary>\n    public ImmutableStackCollection<T> Remainder    { get; private set; }\n    /// <summary>Returns a new ImmutableStack by adding <paramref name=\"item\"/> to this stack.</summary>\n    public ImmutableStackCollection<T> Push(T item) { return new ImmutableStackCollection<T>(item, this); }\n\n    /// <summary>Construct a new empty instance.</summary>\n    public ImmutableStackCollection(T start) : this(start, null) {}\n    /// <summary>Construct a new instance by Push-ing <paramref name=\"item\"/> onto <paramref name=\"remainder\"/>.</summary>\n    private ImmutableStackCollection(T item, ImmutableStackCollection<T> remainder) {\n      TopItem   = item;\n      Remainder = remainder;\n    }\n\n    /// <summary>Returns the stackitems in order from top to bottom.</summary>\n    public IEnumerator<T> GetEnumerator() {\n      for (ImmutableStackCollection<T> p = this; p != null; p = p.Remainder)  yield return p.TopItem;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/IntMatrix2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Row-major order representation of an immutable integer @this.</summary>\n  /// <remarks> Represents Points as row vectors and planes as column vectors.\n  /// This representation is standard for computer graphics, though opposite \n  /// to standard mathematical (and physics) representation, and treats \n  /// row vectors as contravariant and column vectors as covariant.</remarks>\n  [DebuggerDisplay(\"(({M11},{M12}), ({M21},{M22}), ({M31},{M32}), {M33}))\")]\n  public struct IntMatrix2D : IEquatable<IntMatrix2D>, IFormattable {\n    static IntMatrix2D TransposeMatrix = new IntMatrix2D(0,1, 1,0);\n    /// <summary>TODO</summary>\n    public static IntMatrix2D Transpose(IntMatrix2D matrix) {\n      return matrix * TransposeMatrix;\n    }\n\n    #region Properties\n    /// <summary>Get the i-scale component.</summary>\n    public int M11 { get; private set; }\n    /// <summary>Get the X-shear component</summary>\n    public int M12 { get; private set; }\n    /// <summary>Get the j-shear component</summary>\n    public int M21 { get; private set; }\n    /// <summary>Get the Y-scale component</summary>\n    public int M22 { get; private set; }\n    /// <summary>Get the i-translation component</summary>\n    public int M31 { get; private set; }\n    /// <summary>Get the j-translationcomponent</summary>\n    public int M32 { get; private set; }\n    /// <summary>Ge the normalization component</summary>\n    public int M33 { get; private set; }\n    /// <summary>Get the identity @this.</summary>\n    public static readonly IntMatrix2D Identity = new IntMatrix2D(1,0,0,1,0,0, 1);\n\n    /// <summary>Returns the matrix elements as an array of <c>int</c>.</summary>\n    /// <param name=\"i\"></param>\n    /// <returns></returns>\n    public int this[int i] { get {  return (new int[] {M11,M12,M21,M22,M31,M32})[i];} }\n    #endregion\n\n    #region Constructors\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector vector.</summary>\n    /// <param name=\"vector\">the translation vector</param>\n    public IntMatrix2D(IntVector2D vector)  : this(1,0, 0,1, vector.X,vector.Y, 1) {}\n    /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation (dx,dy).</summary>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int dx, int dy)  : this(1,0, 0,1, dx,dy,1) {}\n    /// <summary> Initialies a new <code>IntMatrix2D</code> with a rotation.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1025:ReplaceRepetitiveArgumentsWithParamsArray\")]\n    public IntMatrix2D(int m11, int m12, int m21, int m22) : this(m11,m12, m21,m22, 0,0, 1) {}\n    /// <summary>Copy Constructor for a new <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m\">Source IntegerMatrix</param>\n    public IntMatrix2D(IntMatrix2D m) : this(m.M11,m.M21, m.M12,m.M22, m.M31,m.M32, m.M33) { }\n    /// <summary>Initializes a new fully-specificed <code>IntMatrix2D</code> .</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy) : this(m11,m12,m21,m22,dx,dy,1) {}\n    /// <summary>Initializes a new fully-specificed non-normed <code>IntMatrix2D</code>.</summary>\n    /// <param name=\"m11\">X-scale component.</param>\n    /// <param name=\"m12\">Y-shear component</param>\n    /// <param name=\"m21\">X-shear component</param>\n    /// <param name=\"m22\">Y-scale component</param>\n    /// <param name=\"dx\">X-translate component</param>\n    /// <param name=\"dy\">Y-translate component</param>\n    /// <param name=\"norm\">Normalization component</param>\n    public IntMatrix2D(int m11, int m12, int m21, int m22, int dx, int dy, int norm) : this() {\n//      if (norm <= 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter norm must be > 0.\");\n      if (norm <= 0) norm = 1;\n      M11 = m11;  M12 = m12;\n      M21 = m21;  M22 = m22;\n      M31 = dx;   M32 = dy;   M33 = norm;\n    }\n    #endregion\n\n    #region operators\n    /// <summary>(Contravariant) Vector transformation by a matrix.</summary>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <returns>New IntVector2D resulting from application of vector <c>v</c> to matrix <c>m</c>.</returns>\n    public static IntVector2D operator * (IntVector2D v, IntMatrix2D m) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M21 + m.M31,   v.X * m.M12 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>(Covariant) Vector transformation by a matrix.</summary>\n    /// <param name=\"m\">IntMatrix2D to be applied.</param>\n    /// <param name=\"v\">IntVector2D to be transformed.</param>\n    /// <returns>New IntVector2D resulting from application of matrix<c>m</c> to vector <c>v</c>.</returns>\n    [Obsolete(\"The standard in PGNapoleonics is to use Contravariant (ie column) vectors.\")]\n    public static IntVector2D operator * (IntMatrix2D m, IntVector2D v) {\n      return new IntVector2D (\n        v.X * m.M11 + v.Y * m.M12 + m.M31,   v.X * m.M21 + v.Y * m.M22 + m.M32,  v.W * m.M33\n      ).Normalize();\n    }\n    /// <summary>Matrix multiplication.</summary>\n    /// <param name=\"m1\">Prepended transformation.</param>\n    /// <param name=\"m2\">Appended transformation.</param>\n    /// <returns></returns>\n    public static IntMatrix2D operator * (IntMatrix2D m1, IntMatrix2D m2) {\n      return new IntMatrix2D (\n        m1.M11*m2.M11 + m1.M12*m2.M21,           m1.M11*m2.M12 + m1.M12*m2.M22,\n        m1.M21*m2.M11 + m1.M22*m2.M21,           m1.M21*m2.M12 + m1.M22*m2.M22,\n        m1.M31*m2.M11 + m1.M32*m2.M21 + m2.M31,  m1.M31*m2.M12 + m1.M32*m2.M22 + m2.M32,  m1.M33 * m2.M33\n      );\n    }\n    /// <summary>Returns the result of applying the (row) vector <c>vector</c> to the @this <c>m</c>.</summary>\n    public static IntVector2D Multiply(IntVector2D v, IntMatrix2D m) { return v * m; }\n    /// <summary>Returns the <c>IntMatrix2D</c> representing the transformation <c>m1</c> composed with <c>m2</c>.</summary>\n    public static IntMatrix2D Multiply(IntMatrix2D m1, IntMatrix2D m2) { return m1 * m2; }\n    #endregion\n\n    /// <summary>Vector Rotation (only).</summary>\n    /// <param name=\"v\">IntVector2D to be rotated.</param>\n    /// <returns>New IntVector2D resulting from rotaion (only) of vector vector by this @this \n    /// (ignoring any translation components of this @this).</returns>\n    public IntVector2D Rotate(IntVector2D v) {\n      return new IntVector2D (v.X * M11 + v.Y * M12, v.X * M21 + v.Y * M22, v.W * M33).Normalize();\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      return (obj is IntMatrix2D) && this.Equals((IntMatrix2D)obj); \n    }\n    /// <inheritdoc/>\n    public bool          Equals(IntMatrix2D other)              { return this == other; }\n    /// <inheritdoc/>\n    public static bool operator != (IntMatrix2D lhs, IntMatrix2D rhs) { return ! (lhs == rhs); }\n    /// <inheritdoc/>\n    public static bool operator == (IntMatrix2D lhs, IntMatrix2D rhs) {\n      return lhs.M11== rhs.M11 && lhs.M12 == rhs.M12\n          && lhs.M21== rhs.M21 && lhs.M22 == rhs.M22\n          && lhs.M31== rhs.M31 && lhs.M32 == rhs.M32 && lhs.M33 == rhs.M33;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return M11 ^ M12 ^ M21 ^ M22 ^ M31 ^ M32 ^ M33; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return ToString(\"G\", CultureInfo.InvariantCulture);\n    }\n    /// <summary>Returns a string representation of the @this.</summary>\n    /// <param name=\"format\"></param>\n    /// <param name=\"formatProvider\"></param>\n    /// <returns></returns>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      return string.Format(CultureInfo.CurrentCulture,\"(({0},{1}), ({2},{3}), ({4},{5}), {6})\",  \n        M11.ToString(format,formatProvider), M12.ToString(format,formatProvider),\n        M21.ToString(format,formatProvider), M22.ToString(format,formatProvider),\n        M31.ToString(format,formatProvider), M32.ToString(format,formatProvider), M33.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/IntVector2D.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Globalization;\n\n#pragma warning disable 1587\n/// <summary>Shared technoloiges across the library, and useful gadgets.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Representation of an immutable integer 2D vector.</summary>\n  [DebuggerDisplay(\"({X},{Y},{W})\")]\n  public struct IntVector2D : IEquatable<IntVector2D>, IFormattable {\n    /// <summary>Returns the origin vector.</summary>\n    public static readonly IntVector2D Empty = new IntVector2D(Point.Empty);\n\n    #region Properties\n    /// <summary>Get the i-component.</summary>\n    public int X { get {return _x;} } readonly int _x;\n    /// <summary>Get the j-component.</summary>\n    public int Y { get {return _y;} } readonly int _y;\n    /// <summary>Get the w-component (ie scale factor).</summary>\n    public int W { get {return _w;} } readonly int _w;\n    #endregion\n\n    #region Constructors\n    /// <summary>Construct a new instance from <paramref name=\"point\"/>.</summary>\n    public IntVector2D(Point point)              : this(point.X, point.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"size\"/>.</summary>\n    public IntVector2D(Size size)                : this(size.Width, size.Height, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"intVector2D\"/>.</summary>\n    public IntVector2D(IntVector2D intVector2D)  : this(intVector2D.X, intVector2D.Y, 1) {}\n    /// <summary>Construct a new instance from <paramref name=\"x\"/> and <paramref name=\"y\"/>.</summary>\n    public IntVector2D(int x, int y)             : this(x, y, 1) {}\n    /// <summary>Construct a new instance from i, j, and w.</summary>\n    internal IntVector2D(int x, int y, int norm) : this() {\n      if (norm == 0) throw new ArgumentOutOfRangeException(\"norm\", norm, \"Parameter 'norm' cannot be 0.\");\n//      if (norm == 0) norm = 1;\n      _x = x;\n      _y = y;\n      _w = norm;\n    }\n    #endregion\n\n    /// <summary>Returns a new instance with coordinates normalized using integer arithmetic.</summary>\n    public IntVector2D Normalize() {\n      switch (W) {\n        case 0:   throw new InvalidOperationException(\"IntVector2D is uninitialized.\");\n        case 1:   return this;\n        case 2:   return new IntVector2D(X >> 1, Y >> 1);\n        case 4:   return new IntVector2D(X >> 2, Y >> 2);\n        case 8:   return new IntVector2D(X >> 3, Y >> 3);\n\n        default:  return new IntVector2D(Math.Sign(X)*Math.Sign(W)*Math.Abs(X)/Math.Abs(W),\n                                         Math.Sign(Y)*Math.Sign(W)*Math.Abs(Y)/Math.Abs(W));\n      }\n    }\n\n    #region Scalar operators\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D operator * (IntVector2D v, int s) {\n      return new IntVector2D(v.X*s, v.Y*s);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, int i) {\n      return new IntVector2D(v.X/i, v.Y/i);\n    }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D operator / (IntVector2D v, float s) {\n      return new IntVector2D((int)Math.Floor(v.X/(float)s), (int)Math.Floor(v.Y/(float)s));\n    }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (int s, IntVector2D v) { return v * s; }\n    /// <summary>Scalar Multiplication into a new IntegerVector2D.</summary>\n    public static IntVector2D Multiply (IntVector2D v, int s) { return v * s; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, int i)   { return v / i; }\n    /// <summary>Scalar Division into a new IntegerVector2D.</summary>\n    public static IntVector2D Divide (IntVector2D v, float s) { return v / s; }\n    #endregion\n\n    #region Vector operators\n    /// <summary>Scalar (Inner, or Dot) Product of two <code>IntVector2D</code> as an Int32.</summary>\n    public static int operator * (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.X + v1.Y*v2.Y;\n    }\n    /// <summary>Z component of the 'Vector'- or Cross-Product of two <code>IntVector2D</code>s</summary>\n    /// <returns>A pseudo-scalar (it reverses sign on exchange of its arguments).</returns>\n    public static int operator ^ (IntVector2D v1, IntVector2D v2) {\n      return v1.X*v2.Y - v1.Y*v2.X;\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D operator + (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X+v2.X, v1.Y+v2.Y);\n    }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D operator - (IntVector2D v1, IntVector2D v2) {\n      return new IntVector2D(v1.X-v2.X, v1.Y-v2.Y);\n    }\n    /// <summary>Vector Addition of two <code>IntVector2D</code> as a new <code>IntVector2D</code>.</summary>\n    public static IntVector2D Add  (IntVector2D v1, IntVector2D v2) { return v1 + v2; }\n    /// <summary>Vector Subtraction of two <code>IntVector2D</code> as a new <code>IntVector2D</code></summary>\n    public static IntVector2D Subtract (IntVector2D v1, IntVector2D v2) { return v1 - v2; }\n\n    /// <summary>Returns the vector corss-product of v1 and v2.</summary>\n    public static int CrossProduct (IntVector2D v1, IntVector2D v2) { return v1 ^ v2; }\n    /// <summary>Returns the inner- / scalar / dot-product of v1 and v2.</summary>\n    public static int InnerProduct (IntVector2D v1, IntVector2D v2) { return v1 * v2; }\n    /// <summary>Obsolete - use InnerProduct operaotr instead.</summary>\n    [Obsolete(\"Deprecated (as really confusing) - use InnerProduct instead.\")]\n    public static int Xor (IntVector2D v1, IntVector2D v2) { return InnerProduct(v1, v2); }\n\n    #endregion\n\n    #region Casts\n    /// <summary>Returns a new instance initialized from point.</summary>\n    public static implicit operator IntVector2D (Point point) { return new IntVector2D(point);  }\n    /// <summary>Returns a new instance initialized from size.</summary>\n    public static implicit operator IntVector2D (Size size)   { return new IntVector2D(size);  }\n    /// <summary>Returns a new Point instance initialized from vector.</summary>\n    public static implicit operator Point (IntVector2D vector) { return new Point(vector.X, vector.Y); }\n    /// <summary>Returns a new Size instance initialized from vector.</summary>\n    public static implicit operator Size (IntVector2D vector)  { return new Size(vector.X, vector.Y);  }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as IntVector2D?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return X << 16  ^  Y  ^  W; }\n\n    /// <inheritdoc/>\n    public bool Equals(IntVector2D other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (IntVector2D lhs, IntVector2D rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (IntVector2D lhs, IntVector2D rhs) {\n      return (lhs.X == rhs.X)  &&  (lhs.Y == rhs.Y)  &&  (lhs.W == rhs.W);\n    }\n    #endregion\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"G\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'V' or 'vector': Vector formatting - Vector output like (nn,mm);\n    /// - 'G' or 'g': General formatting - same as 'V' or 'vector';  \n    /// - 'I' or 'i': 2-Dimensional  vector formatting as 11I + 22J;\n    /// - 'W' or 'w': 3-Dimensional  vector formatting as 11I + 22J = 33K;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// For the 2-D and 3-D vector formatting (ie 'I', 'i', 'W', or 'w'), the case of the \n    /// unit vectors follows that of the supplied formatting command character.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0 || Char.IsDigit(format[0])) format = \"G\";\n      var formatChar = format[0];\n      format = \"D\" + format.Substring(1);\n      string layout;\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'G':\n        case 'g': \n        case 'V':\n        case 'v':   layout = \"({0}, {1})\"; break;\n        case 'I':   layout = \"{0}I + {1}J\"; break;\n        case 'i':   layout = \"{0}i + {1}j\"; break;\n        case 'W':   layout = \"{0}I + {1}J + {2}K\"; break;\n        case 'w':   layout = \"{0}i + {1}j + {2}k\"; break;\n      }\n      return string.Format(CultureInfo.CurrentCulture,layout, X.ToString(format,formatProvider),\n                                                              Y.ToString(format,formatProvider),\n                                                              W.ToString(format,formatProvider));\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Common/New Text Document.txt",
    "content": ""
  },
  {
    "path": "old/HexInterfaces/Common/PointExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class PointExtensions {\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Point Scale(this Point @this, int valueX, int valueY) {\n      return new Point(@this.X * valueX, @this.Y * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this Point @this, float valueX, float valueY) {\n      return new PointF(@this.X,@this.Y).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static PointF Scale(this PointF @this, float valueX, float valueY) {\n      return new PointF(@this.X * valueX, @this.Y * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "old/HexInterfaces/Common/SizeExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>TODO</summary>\n  public static class SizeExtensions {\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static Size Scale(this Size @this, int valueX, int valueY) {\n      return new Size(@this.Width * valueX, @this.Height * valueY);\n    }\n\n\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float value) {\n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this Size @this, float valueX, float valueY) {\n      return new SizeF(@this).Scale(valueX,valueY);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float value) { \n      return @this.Scale(value,value);\n    }\n    /// <summary>TODO</summary>\n    public static SizeF Scale(this SizeF @this, float valueX, float valueY) {\n      return new SizeF(@this.Width * valueX, @this.Height * valueY);\n    }\n  }\n}\n\n"
  },
  {
    "path": "old/HexInterfaces/Common/UserCoordsRectangle.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Drawing;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities.Common {\n  /// <summary>Stores a rectangular board region as a a location and extent of <see cref=\"HexCoords\"/>.</summary>\n  [DebuggerDisplay(\"({Location}):({Size})\")]\n  public struct CoordsRectangle : IEquatable<CoordsRectangle> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public CoordsRectangle(HexCoords location, HexCoords size)  : this(new Rectangle(location.User, size.User)) {}\n    /// <summary>TODO</summary>\n    public CoordsRectangle(int x, int y, int width, int height) : this(new Rectangle(x,y,width,height)) {}\n    /// <summary>TODO</summary>\n    private CoordsRectangle(Rectangle rectangle) : this() { Rectangle = rectangle; }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public int       Bottom     { get { return Rectangle.Bottom; } }\n    /// <summary>TODO</summary>\n    public int       Height     { get { return Rectangle.Height; } }\n    /// <summary>TODO</summary>\n    public bool      IsEmpty    { get { return Rectangle.IsEmpty; } }\n    /// <summary>TODO</summary>\n    public int       Left       { get { return Rectangle.Left; } }\n    /// <summary>TODO</summary>\n    public HexCoords Location   { get { return HexCoords.NewUserCoords(Rectangle.Location); } }\n    /// <summary>TODO</summary>\n    public int       Right      { get { return Rectangle.Right; } }\n    /// <summary>TODO</summary>\n    public HexCoords Size       { get { return HexCoords.NewUserCoords(Rectangle.Size); } }\n    /// <summary>TODO</summary>\n    public int       Top        { get { return Rectangle.Top; } }\n    /// <summary>TODO</summary>\n    public int       Width      { get { return Rectangle.Width; } }\n    /// <summary>TODO</summary>\n    public int       X          { get { return Rectangle.X; } }\n    /// <summary>TODO</summary>\n    public int       Y          { get { return Rectangle.Y; } }\n\n    /// <summary>TODO</summary>\n    public Rectangle Rectangle  { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords UpperLeft  { get { return HexCoords.NewUserCoords(Left,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords UpperRight { get { return HexCoords.NewUserCoords(Right,Top); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerLeft  { get { return HexCoords.NewUserCoords(Left,Bottom); } }\n    /// <summary>TODO</summary>\n    public HexCoords LowerRight { get { return HexCoords.NewUserCoords(Right,Bottom); } }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() {\n      return string.Format(CultureInfo.CurrentCulture,\"({0},{1}):({2},{3})\",X,Y,Width,Height);\n    }\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as CoordsRectangle?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Rectangle.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(CoordsRectangle other) { return this == other; }\n\n    /// <summary>Tests value inequality of two CoordsRectangle instances.</summary>\n    public static bool operator != (CoordsRectangle lhs, CoordsRectangle rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value equality of two CoordsRectangle instances.</summary>\n    public static bool operator == (CoordsRectangle lhs, CoordsRectangle rhs) { \n      return lhs.Rectangle == rhs.Rectangle; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/CustomCoordsFactory.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n    /// <summary>TODO</summary>\n  public static class CustomCoords {\n\n    /// <summary>Return the coordinate vector of this hex in the Custom frame.</summary>\n    public static IntVector2D UserToCustom(this HexCoords @this) {\n      return @this.User * MatrixUserToCustom;\n    }\n    /// <summary>Return the coordinate vector of this hex in the User frame.</summary>\n    public static HexCoords CustomToUser(this IntVector2D @this) {\n      return HexCoords.NewUserCoords(@this * MatrixUserToCustom);\n    }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D matrix) { SetMatrices(matrix,matrix); }\n\n    /// <summary>Initialize the conversion matrices for the Custom coordinate frame.</summary>\n    public static void SetMatrices(IntMatrix2D userToCustom, IntMatrix2D customToUser) {\n      MatrixUserToCustom = userToCustom;\n      MatrixCustomToUser = customToUser;\n    }\n\n    /// <summary>Gets the conversion @this from Custom to Rectangular (User) coordinates.</summary>\n    public static IntMatrix2D MatrixCustomToUser { get; private set; }\n\n    /// <summary>Gets the conversion @this from Rectangular (User) to Custom coordinates.</summary>\n    public static IntMatrix2D MatrixUserToCustom { get; private set; }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/CustomDictionary.xml",
    "content": "﻿<Dictionary>\n      <Words>\n         <Unrecognized>\n           <Word>cb</Word>\n         </Unrecognized>\n         <Recognized>\n            <Word>Alt</Word>\n            <Word>App</Word>\n            <Word>Bkgnd</Word>\n            <Word>Cb</Word>\n            <Word>Calc</Word>\n            <Word>Char</Word>\n            <Word>coloured</Word>\n            <Word>Comm</Word>\n            <Word>Coords</Word>\n            <Word>Ctl</Word>\n            <Word>Dbl</Word>\n            <Word>Dlg</Word>\n            <Word>Eachable</Word>\n            <Word>Fov</Word>\n            <Word>Fwd</Word>\n            <Word>functor</Word>      <Word>functors</Word>\n            <Word>hexgrid</Word>\n            <Word>HexgridExampleWinForms</Word>\n            <Word>HexgridUtilities</Word>\n            <Word>hexside</Word>      <Word>hexsides</Word>\n            <Word>Hotspot</Word>\n            <Word>Hwheel</Word>\n            <Word>Ime</Word>\n            <Word>Init</Word>\n            <Word>Lang</Word>\n            <Word>lhs</Word>\n            <Word>m11</Word>   <Word>m12</Word>  <Word>m13</Word>\n            <Word>m21</Word>   <Word>m22</Word>  <Word>m23</Word>\n            <Word>m31</Word>   <Word>m32</Word>  <Word>m33</Word>\n            <Word>Mdi</Word>\n            <Word>Msgbox</Word>\n            <Word>Napoleonics</Word>\n            <Word>NC</Word>\n            <Word>Neighbour</Word>    <Word>Neighbours</Word>\n            <Word>Pos</Word>\n            <Word>rhs</Word>\n            <Word>c</Word>\n            <Word>dx</Word>\n            <Word>dy</Word>\n            <Word>f</Word>\n            <Word>g</Word>\n            <Word>h</Word>\n            <Word>i</Word>   <Word>j</Word>   <Word>k</Word>\n            <Word>l</Word>\n            <Word>m</Word>\n            <Word>p</Word>\n            <Word>Pathfinding</Word>\n            <Word>s</Word>\n            <Word>Sync</Word>\n            <Word>Sys</Word>\n            <Word>TransparentPanel</Word>\n            <Word>Uni</Word>\n            <Word>Uninit</Word>\n            <Word>v</Word>\n            <Word>w</Word>\n            <Word>Wts</Word>\n            <Word>x</Word>      <Word>dx</Word>\n            <Word>y</Word>      <Word>dy</Word>\n            <Word>z</Word>      <Word>dz</Word>\n            <Word>wParam</Word>\n            <Word>lParam</Word>\n            <Word>param</Word>\n            <Word>param</Word>\n            <Word>Lbutton</Word>\n            <Word>Rbutton</Word>\n            <Word>Mbutton</Word>\n            <Word>Xbutton</Word>\n            <Word>Vscroll</Word>\n            <Word>Hscroll</Word>\n            <Word>Afx</Word>\n            <Word>DWM</Word>\n            <Word>Cpl</Word>\n            <Word>Rtl</Word>\n            <Word>Ltr</Word>\n         </Recognized>\n         <Deprecated>\n            <Term PreferredAlternate=\"EnterpriseServices\">ComPlus</Term>\n         </Deprecated>\n         <DiscreteExceptions>\n            <Term>LParam</Term>\n            <Term>lParam</Term>\n            <Term>TransparentPanel</Term>\n            <Term>WParam</Term>\n            <Term>wParam</Term>\n            <Term>LineUp</Term>\n         </DiscreteExceptions>\n      </Words>\n      <Acronyms>\n         <CasingExceptions>\n            <Acronym>ASL</Acronym>\n            <Acronym>CB</Acronym>\n            <Acronym>DWM</Acronym>\n            <Acronym>Fov</Acronym>\n            <Acronym>NC</Acronym>\n            <Acronym>PG</Acronym>\n            <Acronym>TransparentPanel</Acronym>\n            <Acronym>x</Acronym>\n         </CasingExceptions>\n      </Acronyms>\n   </Dictionary>"
  },
  {
    "path": "old/HexInterfaces/HexCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\n\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint = System.Drawing.Point;\n  using HexSize  = System.Drawing.Size;\n\n  /// <summary>Coordinate structure for hexagonal grids that abstracts the distinction \n  /// between rectangular (User) and canonical (Canon) bases (basis vectors, or reference \n  /// frame).</summary>\n  /// <remarks>\n  /// An obtuse reference frmae, with basis vectors at 120 degrees, eases most grid \n  /// calculations and movement operations; a rectangular reference frmae is easier for \n  /// most user interactions, and optimal for board storage. This structure hides the\n  /// distinction betwene them, and automatically converting from one to the other on \n  /// demand (and caching the result).\n  /// </remarks>\n  [DebuggerDisplay(\"User: {User}\")]\n  public struct HexCoords : IEquatable<HexCoords>, IFormattable  {\n    #region Public static members\n    /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (int x, int y) { return NewCanonCoords(new IntVector2D(x,y)); }\n    /// <summary>Create a new instance located at the specified i and j offsets as interpreted in the ectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (int x, int y) { return NewUserCoords(new IntVector2D(x,y)); }\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Canon(ical) frame.</summary>\n    public static HexCoords NewCanonCoords (IntVector2D vector){ return new HexCoords(vector, vector * MatrixCanonToUser); }\n    /// <summary>Create a new instance located at the specified vector offset as interpreted in the Rectangular (User) frame.</summary>\n    public static HexCoords NewUserCoords  (IntVector2D vector){ return new HexCoords(vector * MatrixUserToCanon, vector); }\n\n    /// <summary>Origin of the Canon(ical) coordinate frame.</summary>\n    public static HexCoords EmptyCanon { get { return _EmptyCanon; } }\n    /// <summary>Origin of the Rectangular (User) coordinate frame.</summary>\n    public static HexCoords EmptyUser  { get { return _EmptyUser; } }\n\n    /// <summary>Returns the drawing origin (upper-left) for the hex with specified user components.</summary>\n    [SuppressMessage(\"Microsoft.Usage\", \"CA2233:OperationsShouldNotOverflow\", MessageId = \"i+1\",\n    Justification=\"No board remotely near large enough to cause overflow here.\")]\n    public static HexPoint HexOrigin(HexSize gridSize, int i, int j) {\n     return new HexPoint(\n       i * gridSize.Width,\n       j * gridSize.Height + (i+1)%2 * (gridSize.Height)/2);\n    }\n    #endregion\n\n    #region Private static methods\n    static readonly IntMatrix2D MatrixUserToCanon = new IntMatrix2D(2, 1,  0,2,  0,0,  2);\n    static readonly IntMatrix2D MatrixCanonToUser = new IntMatrix2D(2,-1,  0,2,  0,1,  2);\n\n    static readonly HexCoords _EmptyCanon  = HexCoords.NewCanonCoords(0,0);\n    static readonly HexCoords _EmptyUser   = HexCoords.NewUserCoords(0,0);\n\n    static readonly IntVector2D vectorN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D vectorNE = new IntVector2D( 1, 0);\n    static readonly IntVector2D vectorSE = new IntVector2D( 1, 1);\n    static readonly IntVector2D vectorS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D vectorSW = new IntVector2D(-1, 0);\n    static readonly IntVector2D vectorNW = new IntVector2D(-1,-1);\n    static readonly IntVector2D[] HexsideVectorsCanon = new IntVector2D[] {\n      vectorN,  vectorNE, vectorSE, vectorS,  vectorSW, vectorNW\n    };\n\n    static readonly IntVector2D userEvenN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D userEvenNE = new IntVector2D( 1, 0);\n    static readonly IntVector2D userEvenSE = new IntVector2D( 1, 1);\n    static readonly IntVector2D userEvenS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D userEvenSW = new IntVector2D(-1,+1);\n    static readonly IntVector2D userEvenNW = new IntVector2D(-1, 0);\n    static readonly IntVector2D[] HexsideVectorsUserEven = new IntVector2D[] {\n      userEvenN,  userEvenNE, userEvenSE, userEvenS,  userEvenSW, userEvenNW\n    };\n\n    static readonly IntVector2D userOddN  = new IntVector2D( 0,-1);\n    static readonly IntVector2D userOddNE = new IntVector2D( 1,-1);\n    static readonly IntVector2D userOddSE = new IntVector2D( 1, 0);\n    static readonly IntVector2D userOddS  = new IntVector2D( 0, 1);\n    static readonly IntVector2D userOddSW = new IntVector2D(-1, 0);\n    static readonly IntVector2D userOddNW = new IntVector2D(-1,-1);\n    static readonly IntVector2D[] HexsideVectorsUserOdd = new IntVector2D[] {\n      userOddN,  userOddNE, userOddSE, userOddS,  userOddSW, userOddNW\n    };\n    #endregion\n\n    #region Constructors\n    private HexCoords(IntVector2D canon, IntVector2D user) :this() {\n      _canon = canon;\n      _user  = user;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Returns an <c>IntVector2D</c> representing the Canonical (obtuse) coordinates of this hex.</summary>\n    public  IntVector2D Canon { get {return _canon;} } readonly IntVector2D _canon;\n\n    /// <summary>Returns an <c>IntVector2D</c> representing the User (rectangular) coordinates of this hex.</summary>\n    public  IntVector2D User  { get {return _user;} } readonly IntVector2D _user;\n\n    /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from the origin.</summary>\n    public  int         RangeFromOrigin { get { return EmptyCanon.Range(this);} }\n    #endregion\n\n    #region Methods\n    /// <summary>Returns an <c>HexCoords</c> for the hex in direction <c>hexside</c> from this one.</summary>\n    public HexCoords GetNeighbour(Hexside hexside) {\n      if ((User.X % 2) == 0) \n        return new HexCoords(Canon + HexsideVectorsCanon[(int)hexside]\n                            ,User  + HexsideVectorsUserEven[(int)hexside]);\n      else \n        return new HexCoords(Canon + HexsideVectorsCanon[(int)hexside]\n                            ,User  + HexsideVectorsUserOdd[(int)hexside]);\n    }\n\n    /// <summary>Returns all neighbouring hexes as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours() { \n      for (var hexside=0; hexside<HexsideVectorsCanon.Length; hexside++)\n        yield return new NeighbourCoords(NewCanonCoords(Canon + HexsideVectorsCanon[hexside]),\n                                        (Hexside)hexside); \n    }\n\n    /// <summary>Returns set of hexes at direction(s) specified by <c>hexsides</c>, as IEnumerable.</summary>\n    public IEnumerable<NeighbourCoords> GetNeighbours(Hexsides hexsides) { \n      return GetNeighbours().Where(n=>hexsides.HasFlag(n.Hexside));\n    }\n\n    /// <summary>Returns the drawing origin (upper-left) for the specified hex.</summary>\n    public HexPoint HexOrigin(HexSize gridSize) { \n      return HexCoords.HexOrigin(gridSize, User.X, User.Y); \n    }\n\n    /// <summary>Modified <i>Manhattan</i> distance of supplied coordinate from this one.</summary>\n    public int       Range(HexCoords coords) { \n      var deltaX = coords.Canon.X - Canon.X;\n      var deltaY = coords.Canon.Y - Canon.Y;\n      return ( Math.Abs(deltaX) + Math.Abs(deltaY) + Math.Abs(deltaX-deltaY) ) / 2;\n    }\n\n    /// <summary>Culture-invariant string representation of this instance's value.</summary>\n    public override string ToString() { return ToString(\"g\", CultureInfo.InvariantCulture); }\n\n    /// <summary>Converts the value of this instance to its equivalent string representation using the \n    /// specified format and culture-specific format information.</summary>\n    /// <param name=\"format\">Type: System.String. \n    /// \n    /// > A standard or custom numeric format string.</param>\n    /// <param name=\"formatProvider\">Type: IFormatProvider - \n    /// \n    /// > An object that supplies culture-specific formatting information.</param>\n    /// <remarks>Format characters:\n    /// - 'C' or 'c': Canonical formatting - Int2Vector output of the Canonical coordinates for this hex;\n    /// - 'G' or 'g': General formatting - same as 'R';  \n    /// - 'R' or 'r': Range formatting - Scalar output of the Range of this hex from canonical (0,0);\n    /// - 'U' or 'u': Custom formatting - Int2Vector output of the Custom coordinates for this hex;\n    /// In all cases the leading character of the format string is stripped off and parsed, \n    /// with the remainder passed to the formatter completing the display formatting.\n    /// \n    /// The lower-case format comands prefix a descriptive string on the output (ie one of \"Canon: \",\n    /// \"User: \", \"Custom: \", or \"Range: \" respectivelly), while the upper-case commands do not.\n    /// </remarks>\n    public string ToString(string format, IFormatProvider formatProvider) {\n      if (format==null || format.Length==0) format = \"G\";\n      var formatChar = format[0];\n      format = format.Substring(1);\n      switch(formatChar) {\n        default:    throw new FormatException();\n        case 'C':   return this.Canon.ToString(format, formatProvider);\n        case 'G':   return this.User.ToString(format, formatProvider);\n        case 'U':   return this.UserToCustom().ToString(format, formatProvider);\n        case 'R':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n\n        case 'c':   return \"Canon: \"  + this.Canon.ToString(format, formatProvider);\n        case 'g':   return \"User: \"   + this.User.ToString(format, formatProvider);\n        case 'u':   return \"Custom: \" + this.UserToCustom().ToString(format, formatProvider);\n        case 'r':   if (Char.IsDigit(format[0])) format =  \"G\" + format;\n                    return \"Range: \"  + this.Range(HexCoords.EmptyCanon).ToString(format, formatProvider);\n      }\n    }\n    #endregion\n\n    #region Operators\n    /// <summary>Vector sum; <see cref=\"Add\"/>.</summary>\n    public static HexCoords operator + (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon + rhs.Canon);\n    }\n    /// <summary>Vector difference; <see cref=\"Subtract\"/>.</summary>\n    public static HexCoords operator - (HexCoords lhs, HexCoords rhs) {\n      return HexCoords.NewCanonCoords(lhs.Canon - rhs.Canon);\n    }\n    /// <summary>(Canonical) vector sum of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Add(HexCoords lhs, HexCoords rhs) { return lhs + rhs; }\n    /// <summary>(Canonical) vector difference of lhs plus rhs.</summary>\n    /// <param name=\"lhs\"></param>\n    /// <param name=\"rhs\"></param>\n    /// <returns>A new HexCoords struct containing the vector sum of lhs and rhs calculated \n    /// in the Canonical frame of reference.</returns>\n    public static HexCoords Subtract(HexCoords lhs, HexCoords rhs) { return lhs - rhs; }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"this\"></param>\n    /// <returns></returns>\n    public static implicit operator IntVector2D(HexCoords @this) { return @this.Canon; }\n    #endregion\n\n    #region Value Equality\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as HexCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n    /// <inheritdoc/>\n    public override int GetHashCode() { return User.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(HexCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (HexCoords lhs, HexCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (HexCoords lhs, HexCoords rhs) { return lhs.User == rhs.User; }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/HexInterfaces.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{FB103F54-74CA-4646-824D-248D33237100}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexInterfaces</RootNamespace>\n    <AssemblyName>PGNapoleonics.HexInterfaces</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>NET45, HotPriorityQueue</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\PGNapoleonics.HexInterfaces.XML</DocumentationFile>\n    <NoWarn>1587,1607</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <DocumentationFile>\n    </DocumentationFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|x86'\">\n    <OutputPath>bin\\x86\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1587,1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Common\\DebugTracing.cs\" />\n    <Compile Include=\"Common\\EnumExtensions.cs\" />\n    <Compile Include=\"Common\\Extensions.cs\" />\n    <Compile Include=\"Common\\FastList.cs\" />\n    <Compile Include=\"Common\\ImmutableStack.cs\" />\n    <Compile Include=\"Common\\IntMatrix2D.cs\" />\n    <Compile Include=\"Common\\IntVector2D.cs\" />\n    <Compile Include=\"Common\\PointExtensions.cs\" />\n    <Compile Include=\"Common\\SizeExtensions.cs\" />\n    <Compile Include=\"Common\\UserCoordsRectangle.cs\" />\n    <Compile Include=\"CustomCoordsFactory.cs\" />\n    <Compile Include=\"GlobalSuppressions.cs\" />\n    <Compile Include=\"HexCoords.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Hexside.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Hexsides.cs\" />\n    <Compile Include=\"IBoardStorage.cs\" />\n    <Compile Include=\"IHexBoard.cs\" />\n    <Compile Include=\"IHexgrid.cs\" />\n    <Compile Include=\"IFieldOfView.cs\" />\n    <Compile Include=\"IHex.cs\" />\n    <Compile Include=\"IMapDisplay.cs\" />\n    <Compile Include=\"NeighbourCoords.cs\" />\n    <Compile Include=\"NeighbourHex.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"HexInterfaces.pfx.snk\" />\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"CustomDictionary.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Pathfinding\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "old/HexInterfaces/Hexside.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Enumeration of the six hexagonal directions.</summary>\n  public enum Hexside {\n    /// <summary>The hexside on the top of the hex.</summary>\n    North,    \n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast,    \n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast,    \n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South,    \n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest,   \n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest\n  }\n\n  /// <summary>Common <i>extension methods</i> for <c>Hexside</c> and <c>HexSideFlags</c>.</summary>\n  public static partial class HexsideExtensions {\n    /// <summary><c>Static List {Hexside}</c> for enumerations.</summary>\n    public static IFastList<Hexside> HexsideList { get {  return _hexsideList; } }\n    static IFastList<Hexside> _hexsideList  = EnumExtensions.EnumGetValues<Hexside>().ToFastList();\n\n    internal static readonly IFastList<Hexsides> HexsideBits\n      = HexsideList.Select(h=>EnumExtensions.ParseEnum<Hexsides>(h.ToString())).ToFastList();\n\n    /// <summary>Static List {HexSideFlags} for enumerations.</summary>\n    public static IFastList<Hexsides> HexsideCollection { get { return HexsideBits; } }\n\n    /// <summary>The <c>Hexside</c> corresponding to this <c>Hexside</c> bit, or -1 if it doesn't exist.</summary>\n    public static Hexside IndexOf(this Hexsides @this) {\n      return (Hexside)HexsideBits.IndexOf(@this);\n    }\n\n    /// <summary>The <c>Hexsides</c> bit corresponding to this <c>HexSide</c>.</summary>\n    public static Hexsides Direction(this Hexside @this) { return HexsideBits[(int)@this]; }\n\n    /// <summary>Returns the reversed, or opposite, <see cref=\"Hexside\"/> to the supplied value.</summary>\n    /// <param name=\"this\">The Hexside for which a reversal is desired.</param>\n    public static Hexside Reversed(this Hexside @this) {\n      return (@this <= Hexside.Southeast) ? (@this + 3) : (@this - 3);\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Hexsides.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Linq;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>Flags for combinations of the six hexagonal directions.</summary>\n  [Flags]public enum Hexsides {\n    /// <summary>The selection of no hexsides.</summary>\n    None      = 0x00,\n    /// <summary>The hexside on the top of the hex.</summary>\n    North     = 1 << Hexside.North,\n    /// <summary>The hexside on the upper-right of the hex.</summary>\n    Northeast = 1 << Hexside.Northeast,\n    /// <summary>The hexside on the lower-right of the hex</summary>\n    Southeast = 1 << Hexside.Southeast,\n    /// <summary>The hexside on the bottom of the hex.</summary>\n    South     = 1 << Hexside.South,\n    /// <summary>The hexside on the lower-left of the hex.</summary>\n    Southwest = 1 << Hexside.Southwest,\n    /// <summary>The hexside on the upper-left of the hex.</summary>\n    Northwest = 1 << Hexside.Northwest\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class HexsidesExtensions {\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool AreAllClear(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//,\"Value must not be 0.\");\n      return (@this & testBits) == 0;\n    }\n    /// <summary>Tests (without boxing) if all flags are set.</summary>\n    public static bool AreAllSet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) == testBits;\n    }\n    /// <summary>Tests (without boxing) if all flags are clear.</summary>\n    public static bool IsAnySet(this Hexsides @this, Hexsides testBits) {\n      if (@this == 0) throw new ArgumentOutOfRangeException(\"this\");//\"Value must not be 0.\");\n      return (@this & testBits) != 0;\n    }\n    /// <summary>Clears the bits clearBits in this.</summary>\n    public static Hexsides ClearBits(this Hexsides @this, Hexsides bits) {\n      return @this & ~bits;\n    }\n    /// <summary>Sets the bits setBits in this.</summary>\n    public static Hexsides SetBits(this Hexsides @this, Hexsides bits) {\n      return @this | bits;\n    }\n    /// <summary>TODO</summary>\n    public static Hexsides ValidBitsMask(this Hexsides @this) {\n      const Hexsides HexsidesMask = Hexsides.North | Hexsides.Northeast | Hexsides.Southeast\n                                  | Hexsides.South | Hexsides.Southwest | Hexsides.Northwest;\n      return @this &= HexsidesMask;\n    }\n    /// <summary>Performs action for all bits set in this.</summary>\n    public static void ForEach(this Hexsides @this, Action<Hexsides> action) {\n      if (action == null) throw new ArgumentNullException(\"action\");\n      for (UInt32 bit = 1; bit != 0; bit <<= 1) {\n        var flag = (Hexsides) bit;\n        if (@this.IsAnySet(flag)) action(flag);\n      }\n    }\n\n    private static readonly int[] LookupTable = \n      Enumerable.Range(0,256).Select(CountBits).ToArray();\n\n    private static int CountBits(int value) {\n      int count = 0;\n      for (int i=0; i < 8; i++) { count += (value >> i) & 1; }\n      return count;\n    }\n\n    /// <summary>Returns the count of of set bit-flags in the argument.</summary>\n    /// <param name=\"this\"></param>\n    public static int BitCount(this Hexsides @this) { return LookupTable[(int)@this]; }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/IBoardStorage.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public interface IBoardStorage<out T> : IDisposable {\n    /// <summary>Returns the <c>THex</c> instance at the specified coordinates.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    T this[HexCoords coords] { get; }\n\n    /// <summary>Perform <paramref name=\"action\"/> for all neighbours of <paramref name=\"coords\"/>.</summary>\n    void ForAllNeighbours(HexCoords coords, Action<T,Hexside> action);\n\n    /// <summary>Perform the specified <c>action</c> serially on all hexes.</summary>\n    void ForEach(Action<T> action);\n\n    /// <summary>Returns whether the hex with <see cref=\"HexCoords\"/> <c>coords</c> is \n    /// within the extent of the board.</summary>\n    bool IsOnboard(HexCoords coords);\n\n    /// <summary>TODO</summary>\n    /// <param name=\"coords\"></param>\n    /// <param name=\"hexside\"></param>\n    /// <returns></returns>\n    T Neighbour(HexCoords coords, Hexside hexside);\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/IFieldOfView.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace PGNapoleonics.HexUtilities.FieldOfView {\n  /// <summary>Enumeration of line-of-sight modes</summary>\n  public enum FovTargetMode {\n    /// <summary>Target height and observer height both set to the same constant value \n    /// (ShadowCasting.DefaultHeight) above ground eleevation</summary>\n    EqualHeights,\n    /// <summary>Use actual observer height and ground level as target height.</summary>\n    TargetHeightEqualZero,\n    /// <summary>Use actual observer and target height.</summary>\n    TargetHeightEqualActual\n  }\n\n  /// <summary>Interface required to make use of ShadowCasting Field-of-View calculation.</summary>\n  public interface IFovBoard<out THex> where THex : IHex {\n    /// <summary>Distance in hexes out to which Field-of-View is to be calculated.</summary>\n    int  FovRadius               { get; set; }\n\n    /// <summary>The rectangular extent of the board's hexagonal grid, in hexes.</summary>\n    Size MapSizeHexes            { get; }\n\n    /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n    [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    THex this[HexCoords  coords] { get; }\n\n    /// <summary>TODO</summary>\n    int  ElevationGroundASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationHexsideASL(HexCoords coords, Hexside hexside);\n    /// <summary>TODO</summary>\n    int  ElevationObserverASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationTargetASL(HexCoords coords);\n    /// <summary>TODO</summary>\n    int  ElevationTerrainASL(HexCoords coords);\n\n    /// <summary>Returns whether the hex at location <c>coords</c>is \"on board\".</summary>\n    bool IsOnboard(HexCoords coords);\n\n    /// <summary>Returns whether the hex at location <c>coords</c> is passable.</summary>\n    /// <param name=\"coords\"></param>\n    bool IsPassable(HexCoords coords);\n  }\n\n  /// <summary>Structure returned by the Field-of-View factory.</summary>\n  public interface IFov {\n    /// <summary>True if the hex at location <c>coords</c>c> is visible in this field-of-view.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    bool this[HexCoords coords] { get; }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/IHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>External interface exposed by individual hexes.</summary>\n  public interface IHex {\n    /// <summary>The <c>HexCoords</c> coordinates for this hex on <c>Board</c>.</summary>\n    HexCoords       Coords         { get; }\n\n    /// <summary>Elevation of this hex in \"steps\" above the minimum elevation of the board.</summary>\n    int             ElevationLevel { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of observer's eyes for FOV calculations.</summary>\n    int             HeightObserver { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of target above ground level to be spotted.</summary>\n    int             HeightTarget   { get; }\n\n    /// <summary>Height ASL in <i>game units</i> of any blocking terrian in this hex.</summary>\n    int             HeightTerrain  { get; }\n\n    /// <summary>Cost to extend the path with the hex located across the <c>Hexside</c> at <c>direction</c>.</summary>\n    int  StepCost(Hexside hexsideExit);\n\n    /// <summary>Height ASL in <i>game units</i> of any blocking terrain in this hex and the specified Hexside.</summary>\n    int  HeightHexside(Hexside hexside);\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/IHexBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Diagnostics.CodeAnalysis;\n\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>External interface exposed by the the implementation of <see cref=\"IHexBoard{THex}\"/>.</summary>\n  public interface IHexBoard<out THex> : IBoardStorage<THex>, INavigableBoard<THex>, IFovBoard<THex> where THex : class, IHex {\n    /// <summary>Gets the extent in pixels o fhte grid on which hexes are to be laid out. </summary>\n    HexSize  GridSize    { get; }\n\n    /// <summary>Range beyond which Fast PathFinding is used instead of Stable PathFinding.</summary>\n    int      RangeCutoff { get; }\n\n    /// <summary>Returns whether the specified hex coordinates as a valid hex on this board.</summary>\n    new bool IsOnboard(HexCoords coords);\n\n    /// <summary>Returns the <c>IHex</c> at location <c>coords</c>.</summary>\n   [SuppressMessage(\"Microsoft.Design\", \"CA1043:UseIntegralOrStringArgumentForIndexers\")]\n    new THex this[HexCoords coords] {get; }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/IHexgrid.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Collections.Generic;\n\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexPoint  = System.Drawing.Point;\n  using HexPointF = System.Drawing.PointF;\n  using HexPoints = IList<System.Drawing.Point>;\n  using HexSize   = System.Drawing.Size;\n  using HexSizeF  = System.Drawing.SizeF;\n\n  /// <summary>TODO</summary>\n  public interface IHexgrid {\n    /// <summary>TODO</summary>\n    HexPoint  GetScrollPosition(HexPoint scrollPosition);\n    /// <summary>TODO</summary>\n    HexSize   GetSize(HexSize mapSizePixels, float mapScale);\n\n    /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n    HexCoords GetHexCoords(HexPoint point, HexSize autoScroll);\n\n    /// <summary><c>HexCoords</c> for the hex at the screen point, with the given AutoScroll position.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <param name=\"autoScroll\">AutoScrollPosition for game-display Panel.</param>\n    HexCoords GetHexCoords(HexPointF point, HexSizeF autoScroll);\n\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <param name=\"visibleRectangle\"></param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    HexPoint  ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex, CoordsRectangle visibleRectangle);\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    HexPoint  HexCenterPoint(HexCoords coordsNewULHex);\n\n    /// <summary>TODO</summary>\n    HexSize   GridSize      { get; }\n    /// <summary>TODO</summary>\n    HexSizeF  GridSizeF     { get; }\n    /// <summary>TODO</summary>\n    HexPoints HexCorners    { get; }\n    /// <summary>TODO</summary>\n    bool      IsTransposed  { get; }\n    /// <summary>Offset of grid origin, from control's client-area origin.</summary>\n    HexSize   Margin        { get; set; }\n    /// <summary>TODO</summary>\n    float     Scale         { get; }\n}\n}\n"
  },
  {
    "path": "old/HexInterfaces/IMapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing PGNapoleonics.HexUtilities.Pathfinding;\n\nnamespace PGNapoleonics.HexUtilities {\n  using HexSize = System.Drawing.Size;\n\n  /// <summary>(Technology-independent portion of) interface contract required of a map board to be displayed by the Hexgrid control.</summary>\n  public interface IMapDisplay {\n    /// <summary>TODO</summary>\n     int      FovRadius       { get; set; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the goal hex for path-fnding.</summary>\n    HexCoords GoalHex         { get; set; }\n    /// <summary>Gets the extens in pixels of the grid upon whch hexes are to be laid out.</summary>\n    /// <remarks>>Width is 3/4 of the point-to-point width of each hex, and Height is the full height.\n    /// Hexes should be defined assumed flat-topped and pointy-sided, and the entire board transposed \n    /// if necessary.</remarks>\n    HexSize   GridSize        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the hex currently under the mouse.</summary>\n    HexCoords HotspotHex      { get; set; }\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    bool      IsTransposed    { get; set; }\n    /// <summary>Gets or sets the index (-1 for none) of the path-finding <see cref=\"ILandmark\"/> to show.</summary>\n     int      LandmarkToShow  { get; set; }\n    /// <summary>Current scaling factor for map display.</summary>\n    float     MapScale        { get; set; } \n    /// <summary>Rectangular extent in pixels of the defined mapboard.</summary>\n    HexSize   MapSizePixels   { get; }\n    /// <summary>Gets the display name for this HexgridPanel host.</summary>\n    string    Name            { get; }\n    /// <summary>Gets the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    IDirectedPathCollection Path        { get; }\n    /// <summary>Gets or sets the <see cref=\"HexCoords\"/> of the start hex for path-finding.</summary>\n    HexCoords StartHex        { get; set; }\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/NeighbourCoords.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"{Coords} at {Hexside}\")]\n  public struct NeighbourCoords : IEquatable<NeighbourCoords> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourCoords(HexCoords coords, Hexside hexside) : this() {\n      Coords = coords; Hexside = hexside;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public Hexside   Hexside   { get; private set; }\n    /// <summary>TODO</summary>\n    public HexCoords Coords    { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\"Neighbour: {0} at {1}\", Coords.User,Hexside);\n    }\n\n    /// <summary>TODO</summary>\n    public static Func<NeighbourCoords,T> Bind<T>(Func<HexCoords,T> f) {\n      return n => f(n.Coords);\n    }\n\n    #region Value Equality - on Coords field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj) { \n      var other = obj as NeighbourCoords?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int  GetHashCode() { return Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourCoords other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourCoords lhs, NeighbourCoords rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourCoords lhs, NeighbourCoords rhs) { \n      return lhs.Coords == rhs.Coords; \n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/NeighbourHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace PGNapoleonics.HexUtilities {\n  /// <summary>TODO</summary>\n  [DebuggerDisplay(\"NeighbourHex: {Hex.Coords} enters from {HexsideEntry}\")]\n  public struct NeighbourHex : IEquatable<NeighbourHex> {\n    #region Constructors\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex) : this(hex, Hexside.North) {}\n    /// <summary>TODO</summary>\n    public NeighbourHex(IHex hex, Hexside hexsideExit) : this() {\n      Hex          = hex;\n      HexsideExit  = hexsideExit;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>The Hex</summary>\n    public IHex    Hex          { get; private set; }\n\n    /// <summary>The hexside of the neighbour through which the agent exits from the neighbour.</summary>\n    public Hexside HexsideEntry { get {return HexsideExit.Reversed();} }\n\n    /// <summary>The hexside of this hex through which the agent enters from the neighbour.</summary>\n    public Hexside HexsideExit  { get; private set; }\n    #endregion\n\n    /// <inheritdoc/>\n    public override string ToString() { \n      return string.Format(CultureInfo.InvariantCulture,\n        \"NeighbourHex: {0} enters from {1}\", Hex.Coords, HexsideEntry);\n    }\n\n    #region Value Equality - on Hex field only\n    /// <inheritdoc/>\n    public override bool Equals(object obj)                  {\n      var other = obj as NeighbourHex?;\n      return other.HasValue  &&  this == other.Value;\n    }\n\n    /// <inheritdoc/>\n    public override int GetHashCode() { return Hex.Coords.GetHashCode(); }\n\n    /// <inheritdoc/>\n    public bool Equals(NeighbourHex other) { return this == other; }\n\n    /// <summary>Tests value-inequality.</summary>\n    public static bool operator != (NeighbourHex lhs, NeighbourHex rhs) { return ! (lhs == rhs); }\n\n    /// <summary>Tests value-equality.</summary>\n    public static bool operator == (NeighbourHex lhs, NeighbourHex rhs) {\n      return lhs.Hex.Coords == rhs.Hex.Coords;\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexInterfaces/Properties/AssemblyInfo.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n[assembly: CLSCompliant(true)]\n[assembly:NeutralResourcesLanguage(\"en-US\")]\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexInterfaces\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexInterfaces\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"dfb21827-7efc-461a-98f7-ca837eaff8b7\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"6.4.0.0\")]\n[assembly: AssemblyFileVersion(\"6.4.0.0\")]\n"
  },
  {
    "path": "old/HexgridExampleWinForms/HexgridExampleWinForms.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{CEB56CDC-BB94-405B-B6AF-302587C14A82}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>HexgridExampleWinForms</RootNamespace>\n    <AssemblyName>HexgridExampleWinForms</AssemblyName>\n    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Service Include=\"{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexgridPanel\\HexgridPanel.csproj\">\n      <Project>{388ad675-d18e-4dfa-abb9-55ab3ea993a2}</Project>\n      <Name>HexgridPanel</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "old/HexgridExampleWinForms/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridExampleWinForms\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridExampleWinForms\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"1d5a152c-a3f2-4a9c-9496-b448fa66ecfa\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/NativeMethods.cs",
    "content": "﻿//#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n///////////////////////////////////////////////////////////////////////////////////////////\n////                PG Software Solutions Inc. - Hex-Grid Utilities\n///////////////////////////////////////////////////////////////////////////////////////////\n//// The MIT License:\n//// ----------------\n//// \n//// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n//// \n//// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n//// software and associated documentation files (the \"Software\"), to deal in the Software\n//// without restriction, including without limitation the rights to use, copy, modify, \n//// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n//// permit persons to whom the Software is furnished to do so, subject to the following \n//// conditions:\n////     The above copyright notice and this permission notice shall be \n////     included in all copies or substantial portions of the Software.\n//// \n////     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n////     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n////     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n////     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n////     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n////     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n////     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n////     OTHER DEALINGS IN THE SOFTWARE.\n///////////////////////////////////////////////////////////////////////////////////////////\n//#endregion\n//using System;\n//using System.Runtime.InteropServices;\n//using System.Runtime.Versioning;\n//using System.Windows.Forms;\n\n//using System.Diagnostics.CodeAnalysis;\n\n//#pragma warning disable 1587\n///// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridPanel.</summary>\n//#pragma warning restore 1587\n//namespace PGNapoleonics.WinForms {\n//  /// <summary>Extern declarations from the Win32 API.</summary>\n//  internal static partial class NativeMethods {\n//    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n//    /// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n//    /// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n//    /// <returns>Window handle (hWnd).</returns>\n//    [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", \n//      MessageId = \"0\", Justification=\"Research suggests the Code Analysis message is incorrect.\")]\n//    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n//    [DllImport(\"user32.dll\")]\n//    public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n//    /// <summary>TODO</summary>\n//    [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n//    [ResourceExposure(ResourceScope.None)] \n//    public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n//                                     HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n//    /// <summary>Message Cracker for HiWord</summary>\n//    /// <param name=\"ptr\">A Windows message IntPtr</param>\n//    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n//    public static Int32 HIWORD(IntPtr ptr) {\n//      Int32 val32 = ptr.ToInt32();\n//      return ((val32 >> 16) & 0xFFFF);\n//    }\n\n//    /// <summary>Message Cracker for LoWord</summary>\n//    /// <param name=\"ptr\">A Windows message IntPtr</param>\n//    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n//    public static Int32 LOWORD(IntPtr ptr) {\n//      Int32 val32 = ptr.ToInt32();\n//      return (val32 & 0xFFFF);\n//    }\n//  }\n\n//    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n//  public static partial class ControlExtensions {\n//    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n//    /// <param name=\"this\"></param>\n//    /// <param name=\"action\"></param>\n//    public static void UIThread(this Control @this, Action action) {\n//      if (@this==null) throw new ArgumentNullException(\"this\");\n//      if (action==null) throw new ArgumentNullException(\"action\");\n\n//      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n//      else                        action.Invoke();\n//    }\n\n//    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n//    /// <param name=\"this\"></param>\n//    /// <param name=\"action\"></param>\n//    /// <param name=\"args\"></param>\n//    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n//      if (@this==null) throw new ArgumentNullException(\"this\");\n//      if (action==null) throw new ArgumentNullException(\"action\");\n\n//      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n//       else                       action.Invoke(args);\n      \n//    }\n//  }\n//}\n"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/ScrollBarCommand.cs",
    "content": "﻿//#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n///////////////////////////////////////////////////////////////////////////////////////////\n////                PG Software Solutions Inc. - Hex-Grid Utilities\n///////////////////////////////////////////////////////////////////////////////////////////\n//// The MIT License:\n//// ----------------\n//// \n//// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n//// \n//// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n//// software and associated documentation files (the \"Software\"), to deal in the Software\n//// without restriction, including without limitation the rights to use, copy, modify, \n//// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n//// permit persons to whom the Software is furnished to do so, subject to the following \n//// conditions:\n////     The above copyright notice and this permission notice shall be \n////     included in all copies or substantial portions of the Software.\n//// \n////     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n////     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n////     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n////     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n////     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n////     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n////     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n////     OTHER DEALINGS IN THE SOFTWARE.\n///////////////////////////////////////////////////////////////////////////////////////////\n//#endregion\n//using System;\n\n//namespace PGNapoleonics.WinForms {\n//  #pragma warning disable 1570,1591\n//  /// <summary>TODO</summary>\n//  internal enum ScrollBarCommand {\n//      SB_LINEUP           = 0,  //!< TODO\n//      SB_LINELEFT         = 0,  //!< TODO\n//      SB_LINEDOWN         = 1,  //!< TODO\n//      SB_LINERIGHT        = 1,  //!< TODO\n//      SB_PAGEUP           = 2,  //!< TODO\n//      SB_PAGELEFT         = 2,  //!< TODO\n//      SB_PAGEDOWN         = 3,  //!< TODO\n//      SB_PAGERIGHT        = 3,  //!< TODO\n//      SB_THUMBPOSITION    = 4,  //!< TODO\n//      SB_THUMBTRACK       = 5,  //!< TODO\n//      SB_TOP              = 6,  //!< TODO\n//      SB_LEFT             = 6,  //!< TODO\n//      SB_BOTTOM           = 7,  //!< TODO\n//      SB_RIGHT            = 7,  //!< TODO\n//      SB_ENDSCROLL        = 8   //!< TODO\n//  }\n//  #pragma warning restore 1570,1591\n//}\n"
  },
  {
    "path": "old/HexgridExampleWinForms/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.Transparent;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void Invalidate2() { \n\t\t\tInvalidate2(new Rectangle(this.Location,this.Size));\n\t\t} \n    /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n    /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n    public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\ttry {\n\t\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t\t} catch (InvalidOperationException e) { \n\t\t\t\t\tMessageBox.Show(\"Why is \" + e.Message + \"\\n occurring in\\n\" +\n\t\t\t\t\t\t\"TransparentPanel.Invalidate2(Rectangle r).\");\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"pevent\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs e) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "old/HexgridScrollable/BufferedHexgridScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class BufferedHexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2213:DisposableFieldsShouldBeDisposed\", MessageId = \"_bufferedGraphicsContext\",\n      Justification=\"Not owned by this objcet.\")]\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/BufferedHexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public partial class BufferedHexgridScrollable : HexgridScrollable {\n    /// <summary>TODO</summary>\n    public BufferedHexgridScrollable() {\n      InitializeComponent();\n    }\n    /// <summary>Creates a new instance of HexgridPanel.</summary>\n    public BufferedHexgridScrollable(IContainer container) {\n      if (container==null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public override void SetMapDirty() { \n      if (MapBuffer!=null) PaintBuffer(ScaleRectangle(base.ClientRectangle, MapScale)); \n      base.SetMapDirty();; \n    }\n\n    /// <summary>TODO</summary>\n    protected override void RenderMap(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush,ClientRectangle);\n      g.ScaleTransform(1.0f/MapScale, 1.0f/MapScale);\n      MapBuffer.Render(g, Point.Empty, ClientSize);\n    }\n\n     /// <summary>TODO</summary>\n    static Rectangle ScaleRectangle(Rectangle rectangle, float scale) {\n      return new Rectangle(new Point(new SizeF(rectangle.Location.Scale(scale)).ToSize()), \n                                               rectangle.Size.Scale(scale).ToSize());\n    }\n   #region BufferedGraphics\n    /// <summary>Gets or sets backing buffer for the map underlay.</summary>\n    protected BufferedGraphics MapBuffer { get; private set; }\n    /// <summary>Gets or sets spare buffer for the map underlay.</summary>\n    protected BufferedGraphics MapSpare  { get; private set; }\n\n    /// <summary>Service routine to paint the backing store bitmap for the map underlay.</summary>\n    protected virtual void PaintBuffer(Rectangle clipBounds) {\n      if (DataContext.Model==null  ||  MapBuffer==null) return;\n\n      var g = MapBuffer.Graphics;\n      if (g != null) {\n        var state = g.Save();\n\n        g.Clip = new Region(clipBounds);\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n        var scroll = DataContext.Hexgrid.GetScrollPosition(AutoScrollPosition);\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.TranslateTransform(Margin.Left,Margin.Top);\n        g.ScaleTransform(MapScale,MapScale);\n        TraceFlags.PaintDetail.Trace(\"{0}.PaintBuffer - VisibleClipBounds: ({1})\", Name, g.VisibleClipBounds);\n\n        using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, g.VisibleClipBounds);\n        DataContext.Model.PaintMap(g);\n\n        g.Restore(state);\n      }\n    }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      if(Application.OpenForms.Count > 0 \n      && Application.OpenForms[0].WindowState != FormWindowState.Minimized) ResizeBuffer();\n      base.OnResize(e);\n    }\n\n    /// <inheritdoc/>\n    protected override void OnScaleChange(EventArgs e) {\n      ResizeBuffer();\n      base.OnScaleChange(e);\n    }\n\n    BufferedGraphicsContext _bufferedGraphicsContext = new BufferedGraphicsContext();\n\n    /// <inheritdoc/>\n    protected override void OnScroll(ScrollEventArgs se) {\n      if (se==null) throw new ArgumentNullException(\"se\");\n      var clip = (se.ScrollOrientation == ScrollOrientation.HorizontalScroll)\n               ? HorizontalScrollBufferedGraphics(se.NewValue - se.OldValue)\n               : VerticalScrollBufferedGraphics(se.NewValue - se.OldValue);\n\n      if (clip.Size != Size.Empty) PaintBuffer(clip);\n      base.OnScroll(se);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"delta\"></param>\n    /// <returns>Clipping rectangle requiring re-painting.</returns>\n    protected virtual Rectangle HorizontalScrollBufferedGraphics(int delta) {\n      if (delta == 0)    return Rectangle.Empty;\n\n//      Render(MapBuffer, MapSpare.Graphics, new Point(-delta,0));\n      MapBuffer.Render(MapSpare.Graphics, new Point(-delta,0), ClientSize);\n      var temp = MapBuffer; MapBuffer = MapSpare; MapSpare = temp;\n      if (delta < 0) \n        return new Rectangle(0, 0, -delta,ClientSize.Height);\n      else\n        return new Rectangle(ClientSize.Width-delta,0, delta,ClientSize.Height);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"delta\"></param>\n    /// <returns>Clipping rectangle requiring re-painting.</returns>\n    protected virtual Rectangle VerticalScrollBufferedGraphics(int delta) {\n      if (delta == 0)    return Rectangle.Empty;\n\n//      Render(MapBuffer, MapSpare.Graphics, new Point(0,-delta));\n      MapBuffer.Render(MapSpare.Graphics, new Point(0,-delta), ClientSize);\n      var temp = MapBuffer; MapBuffer = MapSpare; MapSpare = temp;\n      if (delta < 0) \n        return new Rectangle(0, 0, ClientSize.Width,-delta);\n      else\n        return new Rectangle(0,ClientSize.Height-delta, ClientSize.Width,delta);\n    }\n\n    /// <summary>TODO</summary>\n    void ResizeBuffer() {\n      var rectangle = new Rectangle(Point.Empty, ClientSize);\n      if (ClientSize != _bufferedGraphicsContext.MaximumBuffer) {\n        _bufferedGraphicsContext.MaximumBuffer = ClientSize;\n\n        if (MapBuffer != null) MapBuffer.Dispose();\n        MapBuffer = _bufferedGraphicsContext.Allocate(this.CreateGraphics(), rectangle);\n\n        if (MapSpare != null) MapSpare.Dispose();\n        MapSpare  = _bufferedGraphicsContext.Allocate(this.CreateGraphics(), rectangle);\n      }\n      PaintBuffer(rectangle);\n    }\n    #endregion\n  }\n\n  /// <summary>TODO</summary>\n  public static partial class BufferedGraphicsExtensions {\n    /// <summary>TODO</summary>\n    /// <param name=\"buffer\"></param>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    /// <param name=\"virtualSize\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public static void Render(this BufferedGraphics buffer, Graphics target, Point scrollPosition, Size virtualSize) {\n      if (target != null) {\n        IntPtr targetDC = target.GetHdc();\n \n        try { RenderInternal(new HandleRef(target, targetDC), buffer, scrollPosition, virtualSize); } \n        finally { target.ReleaseHdcInternal(targetDC);  }\n      }\n    }\n    /// <summary>TODO</summary>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n    private static void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition, Size virtualSize) {\n      const int  rop = GdiRasterOps.SrcCopy;\n\n      var sourceDC    = buffer.Graphics.GetHdc(); \n//      var virtualSize = ClientSize;\n      try { \n        NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                          virtualSize.Width, virtualSize.Height, \n                            new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n      } \n      finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n    } \n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/EmptyBoard.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\n\n\nnamespace PGNapoleonics.HexgridPanel {\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyBoard : MapDisplay<MapGridHex> {\n    /// <summary>TODO</summary>\n    public EmptyBoard() : base(new Size(1,1), new Size(26,30), (mb,c) => new EmptyGridHex(mb,c)) {\n      FovRadius = 20;\n    }\n  }\n\n  /// <summary>TODO</summary>\n  public sealed class EmptyGridHex : MapGridHex {\n    /// <summary>TODO</summary>\n    public EmptyGridHex(HexBoard<MapGridHex> board, HexCoords coords) : base(board, coords) {}\n\n    /// <summary>TODO</summary>\n    public override int ElevationASL  { get { return 10 * Elevation; } }\n    /// <summary>TODO</summary>\n    public override int HeightTerrain { get { return ElevationASL;   } }\n    /// <summary>TODO</summary>\n    public override int StepCost(Hexside direction) { return -1; }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/HexEventArgs.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary></summary>\n  public class HexEventArgs : MouseEventArgs {\n    /// <summary>TODO</summary>\n    public HexCoords  Coords       { get; private set; }\n\n    /// <summary>TODO</summary>\n    public bool     Alt          { get { return ModifierKeys.HasFlag(Keys.Alt);  } }\n    /// <summary>TODO</summary>\n    public bool     Control      { get { return ModifierKeys.HasFlag(Keys.Control); } }\n    /// <summary>TODO</summary>\n    public bool     Shift        { get { return ModifierKeys.HasFlag(Keys.Shift); } }\n\n    /// <summary>TODO</summary>\n    public Keys     ModifierKeys { get; private set; }\n\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0)) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, Keys modifierKeys) \n      : this(coords, new MouseEventArgs(MouseButtons.None,0,0,0,0), modifierKeys) {}\n    /// <summary>TODO</summary>\n    public HexEventArgs(HexCoords coords, MouseEventArgs e) \n      : this(coords, e, Keys.None) {}\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1062:Validate arguments of public methods\", MessageId = \"1\")]\n    public HexEventArgs(HexCoords coords, MouseEventArgs e, Keys modifierKeys)\n      : base(e.Button,e.Clicks,e.X,e.Y,e.Delta) {\n      Coords       = coords;\n      ModifierKeys = modifierKeys;\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/HexgridScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class HexgridScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n//        _bufferedGraphicsContext.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/HexgridScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nusing WpfInput = System.Windows.Input;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class TiltAwareScrollableControl : ScrollableControl {\n    /// <summary>TODO</summary>\n    public TiltAwareScrollableControl() {\n      this.SetStyle(ControlStyles.Selectable, true);\n      this.TabStop = true;\n    }\n\n    #region SelectablePanel implementation\n    /// <inheritdoc/>\n    protected override void OnMouseDown(MouseEventArgs e) {\n      this.Focus();\n      base.OnMouseDown(e);\n    }\n    /// <inheritdoc/>\n    protected override bool IsInputKey(Keys keyData) {\n      if (keyData == Keys.Up || keyData == Keys.Down) return true;\n      if (keyData == Keys.Left || keyData == Keys.Right) return true;\n      return base.IsInputKey(keyData);\n    }\n    /// <inheritdoc/>\n    protected override void OnEnter(EventArgs e) {\n      this.Invalidate();\n      base.OnEnter(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnLeave(EventArgs e) {\n      this.Invalidate();\n      base.OnLeave(e);\n    }\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnPaint(e);\n      if (this.Focused) {\n        var rc = this.ClientRectangle;\n        rc.Inflate(-2, -2);\n        ControlPaint.DrawFocusRectangle(e.Graphics, rc);\n      }\n    }\n    #endregion\n\n    #region Mouse Tilt Wheel (MouseHWheel) event implementation\n    /// <summary>Occurs when the mouse tilt-wheel moves while the control has focus.</summary>\n    public event EventHandler<MouseEventArgs> MouseHWheel;\n\n    private int _wheelHPos = 0;   //!< <summary>Unapplied horizontal scroll.</summary>\n\n    /// <summary>TODO</summary>\n    protected override void WndProc(ref Message m) {\n      if (!IsDisposed  &&  m.HWnd == this.Handle) {\n        switch ((WM)m.Msg) {\n          case WM.MOUSEHWHEEL: OnMouseHWheel(CreateMouseEventArgs(m));\n            m.Result = (IntPtr)0;\n            break;\n          default: break;\n        }\n      }\n      base.WndProc(ref m);\n    }\n\n    /// <summary>TODO</summary>\n    /// <param name=\"e\"></param>\n    protected virtual void OnMouseHWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      if (!AutoScroll) return;\n\n      _wheelHPos += e.Delta;\n      while (_wheelHPos > MouseWheelStep) {\n        ScrollHorizontal(MouseWheelStep);\n        _wheelHPos -= MouseWheelStep;\n      }\n      while (_wheelHPos < -MouseWheelStep) {\n        ScrollHorizontal(-MouseWheelStep);\n        _wheelHPos += MouseWheelStep;\n      }\n\n      if (MouseHWheel != null) MouseHWheel.Raise(this, e);\n    }\n\n    /// <summary>TODO</summary>\n    private void ScrollHorizontal(int delta) {\n      AutoScrollPosition = new Point(\n        -AutoScrollPosition.X + delta,\n        -AutoScrollPosition.Y);\n    }\n\n    /// <summary>TODO</summary>\n    private static int MouseWheelStep {\n      get {\n        return SystemInformation.MouseWheelScrollDelta\n             / SystemInformation.MouseWheelScrollLines;\n      }\n    }\n\n    /// <summary>TODO</summary>\n    private static MouseEventArgs CreateMouseEventArgs(Message m) {\n      return new MouseEventArgs(\n          (MouseButtons)NativeMethods.LOWORD(m.WParam),\n          0,\n          NativeMethods.LOWORD(m.LParam),\n          NativeMethods.HIWORD(m.LParam),\n          (Int16)NativeMethods.HIWORD(m.WParam)\n        );\n    }\n    #endregion\n\n    #region Panel Scroll extensions\n    /// <summary>TODO</summary>\n    public void ScrollVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.HasFlag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n\n    /// <summary>Service routine to execute a Panel scroll.</summary>\n    [Obsolete(\"Use ScrollPanelVertical or ScrollPanelHorizontal instead.\")]\n    public void ScrollPanel(ScrollEventType type, ScrollOrientation orientation, int sign) {\n      if (orientation == ScrollOrientation.VerticalScroll)\n        ScrollVertical(type, sign);\n      else\n        ScrollHorizontal(type, sign);\n    }\n    #endregion\n  }\n\n  /// <summary>Sub-class implementation of a <b>WinForms</b> Panel with integrated <see cref=\"Hexgrid\"/> support.</summary>\n  [DockingAttribute(DockingBehavior.AutoDock)]\n  public partial class HexgridScrollable : TiltAwareScrollableControl, IHexgridHost, ISupportInitialize {\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    protected HexgridScrollable() {\n      InitializeComponent();\n    }\n    /// <summary>Creates a new instance of HexgridScrollable.</summary>\n    public HexgridScrollable(IContainer container) {\n      if (container==null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n      RefreshCmd  = new RelayCommand(o => { if (o != null) { SetMapDirty(); }  Refresh(); } );\n      DataContext = new HexgridViewModel(this);\n      SetScales (new float[] {1.00F});\n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n    }\n    #endregion\n\n    #region Events\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    public event EventHandler<HexEventArgs> HotspotHexChange;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseAltClick;\n    /// <summary>Announces occurrence of a mouse left-click with the <b>Ctl</b> key depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseCtlClick;\n    /// <summary>Announces a mouse left-click with no <i>shift</i> keys depressed.</summary>\n    public event EventHandler<HexEventArgs> MouseLeftClick;\n    /// <summary>Announces a mouse right-click. </summary>\n    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Properties\n    /// <summary>TODO</summary>\n    public HexgridViewModel        DataContext       { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public         SizeF           GridSizeF         { get { return DataContext.Model.GridSize.Scale(MapScale); } }\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public         HexCoords       HotspotHex        { get { return DataContext.HotspotHex; } }\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsAltKeyDown      { get { return ModifierKeys.HasFlag(Keys.Alt); } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsCtlKeyDown      { get { return ModifierKeys.HasFlag(Keys.Control); } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    public static  bool            IsShiftKeyDown    { get { return ModifierKeys.HasFlag(Keys.Shift); } }\n    /// <summary>TODO</summary>\n    public         bool            IsMapDirty        { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public         bool            IsUnitsDirty      { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public         bool            IsTransposed      { \n      get { return DataContext.IsTransposed; }\n      set { DataContext.IsTransposed = value;  SetScrollLimits(DataContext.Model); }\n    }\n    /// <inheritdoc/>\n    public         Size            MapSizePixels     { get { return DataContext.Model.MapSizePixels; } } // + MapMargin.Scale(2);} }\n    /// <summary>Current scaling factor for map display.</summary>\n    public         float           MapScale          { get { return DataContext.MapScale; } }\n//    /// <summary>MapBoard hosting this panel.</summary>\n//    public         IMapDisplay     Model             { get { return DataContext.Model; } }\n    /// <summary>Returns <code>HexCoords</code> of the hex closest to the center of the current viewport.</summary>\n    public         HexCoords       PanelCenterHex    { \n      get { return GetHexCoords( Location + Size.Round(ClientSize.Scale(0.50F)) ); }\n    }\n    /// <summary>TODO</summary>\n    public WpfInput.ICommand       RefreshCmd        { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int             ScaleIndex        { \n      get { return DataContext.ScaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(DataContext.Scales.Count-1, value));\n            var CenterHex           = PanelCenterHex;\n            DataContext.ScaleIndex  = newValue; \n\n//            SetScrollLimits(DataContext.Model);\n            SetScroll(CenterHex);\n            OnScaleChange(EventArgs.Empty); \n          } \n    }\n    /// <summary>Returns, as a Rectangle, the IUserCoords for the currently visible extent.</summary>\n    public virtual CoordsRectangle VisibleRectangle  {\n      get { return GetClipCells( AutoScrollPosition.Scale(-1.0F/MapScale), \n                                         ClientSize.Scale( 1.0F/MapScale) );\n      }\n    }\n    #endregion\n\n    #region Methods\n    /// <summary>TODO</summary>\n    public         void CenterOnHex(HexCoords coords) {\n      AutoScrollPosition = ScrollPositionToCenterOnHex(coords);\n      IsMapDirty = true;\n      Invalidate();\n    }\n\n    /// <summary>TODO</summary>\n        CoordsRectangle GetClipCells(PointF point, SizeF size) { return DataContext.Model.GetClipCells(point, size); }\n    /// <summary><c>HexCoords</c> for a selected hex.</summary>\n    /// <param name=\"point\">Screen point specifying hex to be identified.</param>\n    /// <returns>Coordinates for a hex specified by a screen point.</returns>\n    /// <remarks>See \"file://Documentation/HexGridAlgorithm.mht\"</remarks>\n    public    HexCoords GetHexCoords(Point point) {\n      return DataContext.Hexgrid.GetHexCoords(point, new Size(AutoScrollPosition));\n    }\n\n    /// <summary>Force repaint of backing buffer for Map underlay.</summary>\n    public virtual void SetMapDirty() { Invalidate(ClientRectangle); }\n\n    /// <summary>TODO</summary>\n    public         void SetModel(IMapDisplay model) {\n      SetScrollLimits(DataContext.Model);   \n      DataContext.SetModel(model);\n      SetMapDirty();\n    }\n\n    /// <summary>TODO</summary>\n    public         void SetPanelSize() {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; ClientSize = {1}\", DataContext.Model.Name, ClientSize); \n      SetScroll(PanelCenterHex);\n    }\n\n    /// <summary>Sets ScrollBars, then centres on <c>newCenterHex</c>.</summary>\n    public virtual void SetScroll(HexCoords newCenterHex) {\n      if(DesignMode || !IsHandleCreated) return;\n      DebugTracing.Trace(TraceFlags.Sizing,\" - {0}.SetPanelSize; Center Hex = {1}\", DataContext.Model.Name, newCenterHex.ToString()); \n\n      SetScrollLimits(DataContext.Model);\n\n      CenterOnHex(newCenterHex);\n    }\n\n    /// <summary>Set ScrollBar increments and bounds from map dimensions.</summary>\n    public virtual void SetScrollLimits(IMapDisplay model) {\n      if (model == null  ||  !AutoScroll) return;\n      var smallChange              = Size.Ceiling(model.GridSize.Scale(MapScale));\n      HorizontalScroll.SmallChange = smallChange.Width;\n      VerticalScroll.SmallChange   = smallChange.Height;\n\n      var largeChange              = Size.Round(ClientSize.Scale(0.75F));\n      HorizontalScroll.LargeChange = Math.Max(largeChange.Width,  smallChange.Width);\n      VerticalScroll.LargeChange   = Math.Max(largeChange.Height, smallChange.Height);\n\n      var size                     = DataContext.Hexgrid.GetSize(MapSizePixels,MapScale)\n                                   + Margin.Size;\n      if (AutoScrollMinSize != size) {\n        AutoScrollMinSize          = size;\n        HorizontalScroll.Maximum   = Math.Min(1, Math.Max(1, Margin.Horizontal \n                                   + size.Width  - ClientSize.Width));\n        VerticalScroll.Maximum     = Math.Min(1, Math.Max(1, Margin.Vertical \n                                   + size.Height - ClientSize.Height));\n        Invalidate();\n      }\n    }\n    #endregion\n\n    #region Grid Coordinates\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point HexCenterPoint(HexCoords coordsNewULHex) {\n      return DataContext.Hexgrid.HexCenterPoint(coordsNewULHex);\n    }\n    /// <summary>Returns the scroll position to center a specified hex in viewport.</summary>\n    /// <param name=\"coordsNewCenterHex\"><c>HexCoords</c> for the hex to be centered in viewport.</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    protected Point ScrollPositionToCenterOnHex(HexCoords coordsNewCenterHex) {\n      return DataContext.Hexgrid.ScrollPositionToCenterOnHex(coordsNewCenterHex,VisibleRectangle);\n    }\n    #endregion\n\n    #region Painting\n    /// <inheritdoc/>\n    protected override void OnPaintBackground(PaintEventArgs e) { ; }\n\n    /// <inheritdoc/>\n    protected override void OnPaint(PaintEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n\n      if(IsHandleCreated) { \n        var g      = e.Graphics;\n        if (DesignMode) { g.FillRectangle(Brushes.Gray, ClientRectangle);  return; }\n\n        g.Clip = new Region(e.ClipRectangle);\n        if (IsTransposed) { g.Transform = TransposeMatrix; }\n\n        var scroll = DataContext.Hexgrid.GetScrollPosition(AutoScrollPosition);\n        g.TranslateTransform(scroll.X, scroll.Y);\n        g.TranslateTransform(Margin.Left,Margin.Top);\n        g.ScaleTransform(MapScale,MapScale);\n        TraceFlags.PaintDetail.Trace(\"{0}.PaintPanel: ({1})\", Name, g.VisibleClipBounds);\n\n        var state = g.Save();\n        RenderMap(g);\n\n        g.Restore(state); state = g.Save();\n        RenderUnits(g);\n\n        g.Restore(state); state = g.Save();\n        RenderHighlight(g);\n\n        g.Restore(state);\n      }\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderMap(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      using(var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, g.VisibleClipBounds);\n      DataContext.Model.PaintMap(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderUnits(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintUnits(g);\n    }\n    /// <summary>TODO</summary>\n    protected virtual void RenderHighlight(Graphics g) {\n      if (g == null) throw new ArgumentNullException(\"g\");\n      DataContext.Model.PaintHighlight(g);\n    }\n\n    /// <summary>TODO</summary>\n    static protected readonly Matrix TransposeMatrix = new Matrix(0F,1F, 1F,0F, 0F,0F);\n    #endregion\n\n    /// <summary>TODO</summary>\n    protected override void OnMarginChanged(EventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      base.OnMarginChanged(e);\n      DataContext.Margin = Margin;\n    }\n\n    #region Mouse event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseClick(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      TraceFlags.Mouse.Trace(\" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}\", \n                                      Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown);\n\n      var coords    = GetHexCoords(e.Location);\n      var eventArgs = new HexEventArgs(coords, e, ModifierKeys);\n\n           if (e.Button == MouseButtons.Middle)   base.OnMouseClick(eventArgs);\n      else if (e.Button == MouseButtons.Right)    this.OnMouseRightClick(eventArgs);\n      else if (IsAltKeyDown  && !IsCtlKeyDown)    this.OnMouseAltClick(eventArgs);\n      else if (IsCtlKeyDown)                      this.OnMouseCtlClick(eventArgs);\n      else                                        this.OnMouseLeftClick(eventArgs);\n    }\n    /// <inheritdoc/>\n    protected override void OnMouseMove(MouseEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      OnHotspotHexChange(new HexEventArgs(GetHexCoords(e.Location - Margin.OffsetSize())));\n\n      base.OnMouseMove(e);\n    }\n\n    /// <summary>Raise the MouseAltClick event.</summary>\n    protected virtual void OnMouseAltClick(HexEventArgs e) { MouseAltClick.Raise(this,e); }\n    /// <summary>Raise the MouseCtlClick event.</summary>\n    protected virtual void OnMouseCtlClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.GoalHex = e.Coords;\n      MouseCtlClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseLeftClick event.</summary>\n    protected virtual void OnMouseLeftClick(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.StartHex = e.Coords;\n      MouseLeftClick.Raise(this,e);\n      Refresh();\n    }\n    /// <summary>Raise the MouseRightClick event.</summary>\n    protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this,e); }\n   /// <summary>Raise the HotspotHexChange event.</summary>\n    protected virtual void OnHotspotHexChange(HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      DataContext.Model.HotspotHex = e.Coords;\n      HotspotHexChange.Raise(this,e);\n      Refresh();\n    }\n\n    /// <summary>Raise the ScaleChange event.</summary>\n    protected virtual void OnScaleChange(EventArgs e) {\n      SetMapDirty();\n      OnResize(e);\n      Invalidate();\n      ScaleChange.Raise(this, e);\n    }\n\n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      SetScrollLimits(DataContext.Model);\n      base.OnResize(e);\n    }\n    #endregion\n\n    #region MouseWheel & Scroll event handlers\n    /// <inheritdoc/>\n    protected override void OnMouseWheel(MouseEventArgs e) {\n      if (e == null) throw new ArgumentNullException(\"e\");\n      TraceFlags.ScrollEvents.Trace(\" - {0}.OnMouseWheel: {1}\", Name, e.ToString());\n\n      if (Control.ModifierKeys.HasFlag(Keys.Control)) ScaleIndex += Math.Sign(e.Delta);\n      else if (IsShiftKeyDown)                        base.OnMouseHWheel(e);\n      else                                            base.OnMouseWheel(e);\n    }\n\n    /// <summary>TODO</summary>\n    public void ScrollPanelVertical(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, VerticalScroll);\n    }\n    /// <summary>TODO</summary>\n    public void ScrollPanelHorizontal(ScrollEventType type, int sign) {\n      ScrollPanelCommon(type, sign, HorizontalScroll);\n    }\n    /// <summary>TODO</summary>\n    private void ScrollPanelCommon(ScrollEventType type, int sign, ScrollProperties scroll) {\n      if (sign == 0) return;\n      Func<Point, int, Point> func = (p, step) => new Point(-p.X, -p.Y + step * sign);\n      AutoScrollPosition = func(AutoScrollPosition,\n        type.HasFlag(ScrollEventType.LargeDecrement) ? scroll.LargeChange : scroll.SmallChange);\n    }\n    #endregion\n\n    /// <summary>Array of supported map scales  as IList&lt;float&gt;.</summary>\n    public ReadOnlyCollection<float>     Scales        { get; private set; }\n    public void SetScales (IList<float> scales) { Scales = new ReadOnlyCollection<float>(scales); }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/HexgridScrollable.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{224E881A-C3E9-42D5-99A9-5D901529E1CE}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PGNapoleonics.HexgridPanel</RootNamespace>\n    <AssemblyName>HexgridScrollable</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1607</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Release\\</OutputPath>\n    <DefineConstants>NET45</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>..\\bin\\HexgridPanel\\bin\\Release\\HexgridPanel.XML</DocumentationFile>\n    <NoWarn>1607</NoWarn>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'\">\n    <OutputPath>..\\bin\\HexgridPanel\\bin\\Checked\\</OutputPath>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>\n    <NoWarn>1607,1587</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>PGSoftwareSolutions.pfx</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BufferedHexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"BufferedHexgridScrollable.Designer.cs\">\n      <DependentUpon>BufferedHexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"EmptyBoard.cs\" />\n    <Compile Include=\"HexEventArgs.cs\" />\n    <Compile Include=\"HexgridScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"HexgridScrollable.Designer.cs\">\n      <DependentUpon>HexgridScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"HexgridViewModel.cs\" />\n    <Compile Include=\"LayeredScrollable.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"LayeredScrollable.Designer.cs\">\n      <DependentUpon>LayeredScrollable.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MapDisplay.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ViewModelBase.cs\" />\n    <Compile Include=\"WinForms\\ExceptionDialog.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\ExceptionDialog.Designer.cs\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"WinForms\\GdiRasterOps.cs\" />\n    <Compile Include=\"WinForms\\NativeMethods.cs\" />\n    <Compile Include=\"WinForms\\ScrollBarCommand.cs\" />\n    <Compile Include=\"WinForms\\ThreadExceptionHandler.cs\" />\n    <Compile Include=\"WinForms\\TransparentPanel.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"WinForms\\WindowsMessages.cs\" />\n    <Compile Include=\"WinForms\\WindowsMouseInput.cs\" />\n    <Compile Include=\"WinForms\\WindowsStylesEx.cs\" />\n    <Compile Include=\"WinForms\\WinFormsExtensions.cs\" />\n    <Service Include=\"{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HexUtilities\\HexUtilities.csproj\">\n      <Project>{013628e1-60e2-40a6-91d4-8b446f397a0a}</Project>\n      <Name>HexUtilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.en-US.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"WinForms\\ExceptionDialog.resx\">\n      <DependentUpon>ExceptionDialog.cs</DependentUpon>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"PGSoftwareSolutions.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"license.txt\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <CodeAnalysisDictionary Include=\"..\\CustomDictionary.xml\">\n      <Link>CustomDictionary.xml</Link>\n    </CodeAnalysisDictionary>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "old/HexgridScrollable/HexgridViewModel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2014 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public class HexgridViewModel : IHexgridHost {\n    /// <summary>TODO</summary>\n    public HexgridViewModel(PGNapoleonics.HexgridPanel.HexgridScrollable panel) {\n      HotspotHex    = HexCoords.EmptyUser;\n\n      Panel         = panel;\n\n      Panel.HotspotHexChange  += HotspotHexChange;\n      Panel.MarginChanged     += MarginChanged;\n//      Panel.MouseAltClick     += MouseAltClick;\n//      Panel.MouseCtlClick     += GoalHexChange;\n//      Panel.MouseRightClick   += MouseRightClick;\n//      Panel.ScaleChange       += ScaleChange;\n\n      Scales        = new List<float>() {1.000F}.AsReadOnly();\n      SetModel(new EmptyBoard());\n      Hexgrid       = GetHexgrid();\n    }\n\n    HexgridScrollable Panel { get; set; }\n\n    ///// <summary>Return new AutoScrollPosition for applied muse-wheel scroll.</summary>\n    //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,\n    //  Func<int,Point> newAutoScroll)\n    //{\n    //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;\n    //  var steps = (delta+remainder) \n    //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  remainder = (delta+remainder) \n    //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);\n    //  return newAutoScroll(scroll.SmallChange * steps);\n    //}\n    ///// <summary>TODO</summary>\n    //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {\n    //  return new ScrollEventArgs(\n    //    ScrollEventType.ThumbTrack,\n    //    isHorizontal ? -oldScroll.X : -oldScroll.Y,\n    //    isHorizontal ? -newScroll.X : -newScroll.Y,\n    //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll\n    //  );\n    //}\n\n    /// <summary>TODO</summary>\n    public void SetModel(IMapDisplay model) {\n      Model = model;   \n    }\n\n    Hexgrid GetHexgrid() { \n      var margin          = Margin.OffsetSize();\n      return IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale),margin) \n                          : new Hexgrid(Model.GridSize.Scale(MapScale),margin);     \n    }\n\n    #region Properties\n    ///// <summary>TODO</summary>\n    //public WpfInput.ICommand RefreshCmd { \n    //  get { return _refreshCmd; } private set {_refreshCmd = value; } \n    //} WpfInput.ICommand _refreshCmd;\n\n    /// <summary>MapBoard hosting this panel.</summary>\n    public IMapDisplay Model           { get; private set; }\n\n    /// <summary>Gets or sets the coordinates of the hex currently underneath the mouse.</summary>\n    public HexCoords   HotspotHex      { get; set; }\n\n    /// <summary>Gets whether the <b>Alt</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsAltKeyDown   { get { return HexgridScrollable.IsAltKeyDown; } }\n    /// <summary>Gets whether the <b>Ctl</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsCtlKeyDown   { get { return HexgridScrollable.IsCtlKeyDown; } }\n    /// <summary>Gets whether the <b>Shift</b> <i>shift</i> key is depressed.</summary>\n    protected static  bool  IsShiftKeyDown { get { return HexgridScrollable.IsShiftKeyDown; } }\n\n    /// <summary>Gets or sets whether the board is transposed from flat-topped hexes to pointy-topped hexes.</summary>\n    public bool        IsTransposed    { \n      get { return _isTransposed; }\n      set { _isTransposed = value;  \n            Hexgrid = GetHexgrid();\n            if (Panel.IsHandleCreated) Panel.SetScrollLimits(Model);   \n          }\n    } bool _isTransposed;\n\n    /// <inheritdoc/>\n    public Size        MapSizePixels   { get {return Model.MapSizePixels;} } // + MapMargin.Scale(2);} }\n\n    /// <summary>Current scaling factor for map display.</summary>\n    public float       MapScale      { \n      get { return Model.MapScale; } \n      private set { Model.MapScale = value; } \n    }\n\n    /// <inheritdoc/>\n    public Padding  Margin     { \n      get { return _margin; } \n      set { _margin = value; Hexgrid.Margin = new Size(_margin.Left, _margin.Top); }\n    } Padding _margin;\n\n    /// <summary>TODO</summary>\n    public    bool   IsMapDirty   { \n      get { return _isMapDirty; }\n      set { \n        _isMapDirty = value; \n        if(_isMapDirty) { IsUnitsDirty = true; } \n      }\n    } bool _isMapDirty;\n    /// <summary>TODO</summary>\n    public    bool   IsUnitsDirty { \n      get { return _isUnitsDirty; }\n      set { \n        _isUnitsDirty = value; \n        if(_isUnitsDirty) { Panel.Invalidate(); }\n      }\n    } bool _isUnitsDirty;\n\n    /// <summary>Array of supported map scales  as IList&lt;float&gt;.</summary>\n    public ReadOnlyCollection<float> Scales        { get; private set; }\n    /// <summary>Index into <code>Scales</code> of current map scale.</summary>\n    public virtual int ScaleIndex    { \n      get { return _scaleIndex; }\n      set { var newValue = Math.Max(0, Math.Min(Scales.Count-1, value));\n            if( _scaleIndex != newValue) {\n              _scaleIndex = newValue;\n              MapScale    = Scales[ScaleIndex];\n              Hexgrid     = IsTransposed ? new TransposedHexgrid(Model.GridSize.Scale(MapScale)) \n                                         : new Hexgrid(Model.GridSize.Scale(MapScale)); \n              ScaleChange.Raise(this, EventArgs.Empty);\n            }\n          } \n    } int _scaleIndex;\n    #endregion\n\n    /// <summary>TODO</summary>\n    public void SetScales (IList<float> scales) {\n//      if (scales == null) throw new ArgumentNullException(\"scales\");\n      Scales = new ReadOnlyCollection<float>(scales);\n    }\n    #region Events\n    /// <summary>TODO</summary>\n    void MarginChanged(object sender, EventArgs e) { Margin = Panel.Margin; }\n\n    /// <summary>Announces that the mouse is now over a new hex.</summary>\n    void HotspotHexChange(object sender, HexEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if ( e.Coords != HotspotHex)    HotspotHex = e.Coords;\n    }\n\n//    /// <summary>Announces that the Path-Goal hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> GoalHexChange;\n//    /// <summary>Announces that the Path-Start hex has changed.</summary>\n//    public event EventHandler<HexEventArgs> StartHexChange;\n//    /// <summary>Announces occurrence of a mouse left-click with the <b>Alt</b> key depressed.</summary>\n//    public event EventHandler<HexEventArgs> MouseAltClick;\n//    /// <summary>Announces a mouse right-click. </summary>\n//    public event EventHandler<HexEventArgs> MouseRightClick;\n    /// <summary>Announces a change of drawing scale on this HexgridPanel.</summary>\n    public event EventHandler<EventArgs>    ScaleChange;\n    #endregion\n\n    #region Grid Coordinates\n    /// <inheritdoc/>\n    public Hexgrid    Hexgrid        { get; set; }\n    /// <summary>Gets a SizeF struct for the hex GridSize under the current scaling.</summary>\n    public SizeF      GridSizeF      { get { return Model.GridSize.Scale(MapScale); } }\n\n    //CoordsRectangle  GetClipCells(PointF point, SizeF size) {\n    //  return Model.GetClipCells(point, size);\n    //}\n\n    /// <summary>Returns ScrollPosition that places given hex in the upper-Left of viewport.</summary>\n    /// <param name=\"coordsNewULHex\"><c>HexCoords</c> for new upper-left hex</param>\n    /// <returns>Pixel coordinates in Client reference frame.</returns>\n    public Point     HexCenterPoint(HexCoords coordsNewULHex) {\n      return Hexgrid.HexCenterPoint(coordsNewULHex);\n    }\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/LayeredScrollable.Designer.cs",
    "content": "﻿namespace PGNapoleonics.HexgridPanel {\n  partial class LayeredScrollable {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary> \n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Component Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      components = new System.ComponentModel.Container();\n    }\n\n    #endregion\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/LayeredScrollable.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.WinForms;\n\nnamespace PGNapoleonics.HexgridPanel {\n  using PaintAction = Action<Graphics>;\n\n    /// <summary>TODO</summary>\n  public partial class LayeredScrollable : ScrollableControl, ISupportInitialize { //, IMessageFilter {\n    /// <summary>TODO</summary>\n    public LayeredScrollable() {\n      InitializeComponent();\n    }\n\n    /// <summary>TODO</summary>\n    public LayeredScrollable(IContainer container) {\n      if (container == null) throw new ArgumentNullException(\"container\");\n      container.Add(this);\n\n      InitializeComponent();\n    }\n\n    #region ISupportInitialize implementation\n    /// <summary>Signals the object that initialization is starting.</summary>\n    public virtual void BeginInit() { \n    }\n    /// <summary>Signals the object that initialization is complete.</summary>\n    public virtual void EndInit() { \n//\t\t\tApplication.AddMessageFilter(this);\n\n      SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);\n      SetStyle(ControlStyles.OptimizedDoubleBuffer, true);\n      SetStyle(ControlStyles.Opaque, true);\n\n      Layers = new LayerCollection(this.CreateGraphics(), DisplayRectangle.Size);\n    }\n    #endregion\n\n    /// <summary>TODO</summary>\n    public    LayerCollection   Layers    { get; private set; }\n \n    /// <inheritdoc/>\n    protected override void OnResize(EventArgs e) {\n      Layers.Resize(ClientRectangle);\n      base.OnResize(e);\n    }\n\n    //#region IMessageFilter implementation\n    ///// <summary>Redirect WM_MouseWheel messages to window under mouse.</summary>\n    ///// <remarks>Redirect WM_MouseWheel messages to window under mouse (rather than \n    ///// that with focus) with adjusted delta.\n    ///// <a href=\"http://www.flounder.com/virtual_screen_coordinates.htm\">Virtual Screen Coordinates</a>\n    ///// Dont forget to add this to constructor:\n    ///// \t\t\tApplication.AddMessageFilter(this);\n    ///// </remarks>\n    ///// <param name=\"m\">The Windows Message to filter and/or process.</param>\n    ///// <returns>Success (true) or failure (false) to OS.</returns>\n    //[System.Security.Permissions.PermissionSetAttribute(\n    //  System.Security.Permissions.SecurityAction.Demand, Name=\"FullTrust\")]\n    //public bool PreFilterMessage(ref Message m) {\n    //  if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL) return false;\n    //  var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));\n    //  var ctl\t  = Control.FromHandle(hWnd);\n    //  if (hWnd != IntPtr.Zero  &&  hWnd != m.HWnd  &&  ctl != null) {\n    //    switch((WM)m.Msg) {\n    //      case WM.MOUSEHWHEEL:\n    //      case WM.MOUSEWHEEL:\n    //        DebugTracing.Trace(TraceFlags.ScrollEvents, true,\" - {0}.WM.{1}: \", Name, ((WM)m.Msg)); \n    //        return (NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);\n    //      default: break;\n    //    }\n    //  }\n    //  return false;\n    //}\n    //#endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class LayerCollection : ReadOnlyCollection<Layer> {\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size) : this(g, size, new List<PaintAction>()) {}\n\n    /// <summary>TODO</summary>\n    internal LayerCollection(Graphics g, Size size, IList<PaintAction> list) : base(new List<Layer>()) {\n      Context   = new BufferedGraphicsContext();\n      Graphics  = g;\n      Size      = size;\n\n      foreach (var action in list) this.AddLayer(action);\n    }\n\n    /// <summary>TODO</summary>\n    public void AddLayer(PaintAction paintAction) { Items.Add(NewLayer(paintAction)); }\n\n    /// <summary>TODO</summary>\n    public void Render(Graphics g, Point scrollPosition) {\n      for(var i=0; i < this.Count; i++) this[i].Render(g, scrollPosition); \n    }\n\n    /// <summary>TODO</summary>\n    public void Resize (Rectangle rectangle) {\n      Size = rectangle.Size;\n      Context.MaximumBuffer = Size;\n      foreach(var layer in this) {\n        layer.Resize(Context.Allocate(Graphics, rectangle));\n      }\n    }\n\n    BufferedGraphicsContext Context   { get; set; }\n    Graphics                Graphics  { get; set; }\n    Size                    Size      { get; set; }\n\n    /// <summary>TODO</summary>\n    Layer            NewLayer(PaintAction paintAction) {\n      return new Layer(\n        Context.Allocate(Graphics, new Rectangle(Point.Empty,Size)), \n        paintAction\n      );\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n          if (Context  != null) Context.Dispose();  Context  = null;\n          if (Graphics != null) Graphics.Dispose(); Graphics = null;\n        }\n        _isDisposed = true;\n      }\n    }\n\n    /// <summary>Finalize this instance.</summary>\n    ~LayerCollection() { Dispose(false); }\n    #endregion\n  }\n\n}\nnamespace PGNapoleonics.HexgridPanel {\n  using System.Reflection;\n\n  using PaintAction = Action<Graphics>;\n\n  /// <summary>TODO</summary>\n  public sealed class Layer {\n\n    /// <summary>TODO</summary>\n    internal Layer(BufferedGraphics buffer, PaintAction paintAction) {\n      Buffer      = buffer;\n      PaintAction = paintAction;\n\n      Background  = Color.Transparent;\n      IsOn        = true;\n      Resize(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    internal void Resize(BufferedGraphics buffer) {\n      const BindingFlags binding = BindingFlags.NonPublic | BindingFlags.Instance;\n\n      Buffer   = buffer;\n      var info = Buffer.GetType().GetField(\"virtualSize\",binding);\n      Size     = (Size)info.GetValue(Buffer);\n    }\n\n    /// <summary>TODO</summary>\n    public Color            Background      { get; private set; }\n    /// <summary>TODO</summary>\n    public BufferedGraphics Buffer          { \n      get { return _buffer; }\n      private set { if (_buffer != null) _buffer.Dispose(); _buffer = value; }\n    } BufferedGraphics _buffer;\n    /// <summary>TODO</summary>\n    public bool             IsOn            { get; set; }\n    /// <summary>TODO</summary>\n    public PaintAction      PaintAction     { get; private set; }\n    /// <summary>TODO</summary>\n    public Size             Size            { get; private set; }\n\n    /// <summary>TODO</summary>\n    public void Refresh() {\n      if (IsOn) {\n        var g     = Buffer.Graphics;\n        var state = g.Save();\n\n        g.Clear(Background);\n\n        PaintAction(g);\n\n        g.Restore(state);\n      }\n    }\n\n#if NET45\n    /// <summary>TODO</summary>\n    public async Task RefreshAsync() { await Task.Run(() => Refresh()); }\n\n    /// <summary>TODO</summary>\n    public async Task RenderAsync(Graphics target, Point scrollPosition) {\n      await Task.Run(() => Render(target,scrollPosition));\n    }\n#endif\n\n    /// <summary>TODO</summary>\n    /// <param name=\"target\"></param>\n    /// <param name=\"scrollPosition\"></param>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] \n    public void Render(Graphics target, Point scrollPosition) {\n      if (target != null) {\n        IntPtr targetDC = target.GetHdc();\n \n        try { RenderInternal(new HandleRef(target, targetDC), Buffer, scrollPosition); } \n        finally { target.ReleaseHdcInternal(targetDC);  }\n      }\n    }\n\n    /// <summary>TODO</summary>\n    [ResourceExposure(ResourceScope.None)]\n    [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]\n    private void RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer, Point scrollPosition) {\n      const int  rop = 0xcc0020; // RasterOp.SOURCE.GetRop();\n\n      var sourceDC    = buffer.Graphics.GetHdc(); \n      var virtualSize = Size;\n      try { \n        NativeMethods.BitBlt(refTargetDC, scrollPosition.X,  scrollPosition.Y, \n                                              virtualSize.Width, virtualSize.Height, \n                                  new HandleRef(buffer.Graphics, sourceDC), 0, 0, rop);\n      } \n      finally { buffer.Graphics.ReleaseHdcInternal(sourceDC); }\n    } \n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/MapDisplay.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.ObjectModel;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\nusing PGNapoleonics.HexUtilities.Pathfinding;\nusing PGNapoleonics.HexUtilities.FieldOfView;\n\n#pragma warning disable 1587\n/// <summary>WinForms-specific utilities, including implementation of the subclasses HexgridPanel\n/// and MapDisplay<THex>, utilizing the System.Windows.Forms technology.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.HexgridPanel {\n  using Int32ValueEventArgs = ValueChangedEventArgs<Int32>;\n\n  /// <summary>Abstract class representing the basic game board.</summary>\n  /// <typeparam name=\"THex\">Type of the hex for which a game board is desired.</typeparam>\n  public abstract class MapDisplay<THex> : HexBoard<THex>, IBoard<THex>, IMapDisplay\n    where THex : MapGridHex {\n\n    #region Constructors\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<THex>, HexCoords, THex> initializeHex) \n    : this(sizeHexes, gridSize, initializeHex, DefaultLandmarks(sizeHexes)) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    protected MapDisplay(Size sizeHexes, Size gridSize, Func<HexBoard<THex>, HexCoords, THex> initializeHex, \n                         ReadOnlyCollection<HexCoords> landmarkCoords) \n    : base(sizeHexes, gridSize, \n          (map) => new BoardStorage<THex>.FlatBoardStorage(sizeHexes, coords => initializeHex(map,coords)),\n          landmarkCoords\n    ) {\n      InitializeProperties();\n    }\n\n    void InitializeProperties() {\n      GoalHex         = \n      HotspotHex      = \n      StartHex        = HexCoords.EmptyUser;\n      ShadeBrushAlpha = 78;\n      ShadeBrushColor = Color.Black;\n      ShowFov         = true;\n      ShowHexgrid     = true;\n      ShowPath        = true;\n      ShowPathArrow   = true;\n    }\n    #endregion\n\n    #region Properties\n    /// <summary>Gets or sets the Field-of-View for the current <see cref=\"HotspotHex\"/>, as an <see cref=\"IFov\"/> object.</summary>\n    public virtual  IFov          Fov             {\n//      get { return _fov ?? (_fov = this.GetFieldOfView(HotspotHex)); }\n      get { return _fov ?? (_fov = this.GetFieldOfView(ShowRangeLine ? StartHex : HotspotHex)); }\n      protected set { _fov = value; }\n    } IFov _fov;\n    /// <inheritdoc/>\n    public override int           FovRadius       { set { RangeCutoff = base.FovRadius = value; Fov = null; } }\n    /// <inheritdoc/>\n    public virtual  HexCoords     GoalHex         { \n      get { return _goalHex; }\n      set { _goalHex=value; _path = null; } \n    } HexCoords _goalHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public virtual  HexCoords     HotspotHex      { \n      get { return _hotSpotHex; }\n      set { if (IsOnboard(value)) _hotSpotHex = value; if (!ShowRangeLine) _fov = null; }\n    } HexCoords _hotSpotHex = HexCoords.EmptyUser;\n    /// <inheritdoc/>\n    public          int           LandmarkToShow  { get; set; }\n    /// <inheritdoc/>\n    public          string        Name            { get {return \"MapDisplay\";} }\n    /// <inheritdoc/>\n    public          IDirectedPath Path            { \n      get { return _path ?? (_path = this.GetDirectedPath(this[StartHex], this[GoalHex])); } \n    } IDirectedPath _path;\n    /// <summary>Gets or sets the alpha component for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          byte          ShadeBrushAlpha { get; set; }\n    /// <summary>Gets or sets the base color for the shading brush used by Field-of-View display to indicate non-visible hexes.</summary>\n    public          Color         ShadeBrushColor { get; set; }\n    /// <summary>Gets or sets whether to display the FIeld-of-View for <see cref=\"HotspotHex\"/>.</summary>\n    public          bool          ShowFov         { get; set; }\n    /// <summary>Gets or sets whether to display the hexgrid.</summary>\n    public          bool          ShowHexgrid     { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowPath        { get; set; }\n    /// <summary>Gets or sets whether to display direction indicators for the current path.</summary>\n    public          bool          ShowPathArrow   { get; set; }\n    /// <summary>Gets or sets whether to display the shortest path from <see cref=\"StartHex\"/> to <see cref=\"GoalHex\"/>.</summary>\n    public          bool          ShowRangeLine   { \n      get { return _showRangeLine; } \n      set { _showRangeLine = value; if (_showRangeLine) Fov = null; }\n    } bool _showRangeLine = false;\n    /// <inheritdoc/>\n    public virtual  HexCoords     StartHex        { \n      get { return _startHex; }\n      set { if (IsOnboard(value)) _startHex = value; _path = null; if (ShowRangeLine) _fov = null; } \n    } HexCoords _startHex = HexCoords.EmptyUser;\n    #endregion\n\n    /// <inheritdoc/>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \n      \"CA2233:OperationsShouldNotOverflow\", MessageId = \"10*elevationLevel\")]\n    public override int   ElevationASL(int elevationLevel) { return 10 * elevationLevel; }\n\n    #region Painting\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(PointF point, SizeF size) {\n      return GetClipInHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n\n    /// <inheritdoc/>\n    public CoordsRectangle GetClipInHexes(RectangleF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintHighlight(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n      var container = g.BeginContainer(); // Set all transformations relative to current origin!\n      TranslateGraphicsToHex(g, StartHex);\n      g.DrawPath(Pens.Red, HexgridPath);\n\n      if (ShowPath) {\n        g.EndContainer(container); container = g.BeginContainer();\n        PaintPath(g,Path);\n      }\n\n      if (ShowRangeLine) {\n        g.EndContainer(container); container = g.BeginContainer();\n        var target = CentreOfHex(HotspotHex);\n        g.DrawLine(Pens.Red, CentreOfHex(StartHex), target);\n        g.DrawLine(Pens.Red, target.X-8,target.Y-8, target.X+8,target.Y+8);\n        g.DrawLine(Pens.Red, target.X-8,target.Y+8, target.X+8,target.Y-8);\n      }\n\n      if (ShowFov) {\n        g.EndContainer(container); container = g.BeginContainer();\n        var clipHexes  = GetClipInHexes(g.VisibleClipBounds);\n        using(var shadeBrush = new SolidBrush(Color.FromArgb(ShadeBrushAlpha, ShadeBrushColor))) {\n          PaintForEachHex(g, clipHexes, coords => {\n            if (Fov!=null && ! Fov[coords]) { g.FillPath(shadeBrush, HexgridPath);  }\n          } );\n        }\n      }\n      g.EndContainer(container); \n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintMap(Graphics g) { \n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var container = g.BeginContainer(); // Set all transformations relative to current origin!\n      var clipHexes  = GetClipInHexes(g.VisibleClipBounds);\n      g.InterpolationMode = InterpolationMode.HighQualityBicubic;\n      var font       = SystemFonts.MenuFont;\n      var brush      = Brushes.Black;\n      var textOffset = new Point((GridSize.Scale(0.50F)\n                     - new SizeF(font.Size,font.Size).Scale(0.8F)).ToSize());\n      PaintForEachHex(g, clipHexes, coords => {\n        this[coords].Paint(g);\n        if (ShowHexgrid) g.DrawPath(Pens.Black, HexgridPath);\n        if (LandmarkToShow > 0) {\n          g.DrawString(LandmarkDistance(coords,LandmarkToShow-1), font, brush, textOffset);\n        }\n      } );\n      g.EndContainer(container); \n    }\n\n    /// <summary>Paint the current shortese path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be painted.</param>\n    protected virtual  void PaintPath(Graphics g, IDirectedPath path) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      using(var brush = new SolidBrush(Color.FromArgb(78, Color.PaleGoldenrod))) {\n        while (path != null) {\n          var coords = path.PathStep.Hex.Coords;\n          TranslateGraphicsToHex(g, coords);\n          g.FillPath(brush, HexgridPath);\n\n          if (ShowPathArrow) PaintPathArrow(g, path);\n\n          path = path.PathSoFar;\n        }\n      }\n    }\n\n    /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"path\">Type: <see cref=\"IDirectedPath\"/> - \n    /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>\n    protected virtual  void PaintPathArrow(Graphics g, IDirectedPath path) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n      if (path==null) throw new ArgumentNullException(\"path\");\n\n      g.TranslateTransform(CentreOfHexOffset.Width, CentreOfHexOffset.Height);\n      if (path.PathSoFar == null)    PaintPathDestination(g);\n      else                           PaintPathArrow(g, path.PathStep.HexsideEntry);\n    }\n\n    /// <summary>Paint the direction arrow for each hex of the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <param name=\"hexside\">Type: <see cref=\"Hexside\"/> - \n    /// Direction from this hex in which the next step is made.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathArrow(Graphics g, Hexside hexside) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var unit = GridSize.Height/8.0F;\n      g.RotateTransform(60 * (int)hexside);\n      g.DrawLine(Pens.Black, 0,unit*4,       0,  -unit);\n      g.DrawLine(Pens.Black, 0,unit*4, -unit*3/2, unit*2);\n      g.DrawLine(Pens.Black, 0,unit*4,  unit*3/2, unit*2);\n    }\n\n    /// <summary>Paint the destination indicator for the current shortest path.</summary>\n    /// <param name=\"g\">Type: Graphics - Object representing the canvas being painted.</param>\n    /// <remarks>The current graphics origin must be the centre of the current hex.</remarks>\n    protected virtual  void PaintPathDestination(Graphics g) {\n      if (g==null) throw new ArgumentNullException(\"g\");\n\n      var unit = GridSize.Height/8.0F;\n      g.DrawLine(Pens.Black, -unit*2,-unit*2, unit*2, unit*2);\n      g.DrawLine(Pens.Black, -unit*2, unit*2, unit*2,-unit*2);\n    }\n\n    /// <inheritdoc/>\n    public    virtual  void PaintUnits(Graphics g) {}\n\n    /// <summary>Paints all the hexes in <paramref name=\"clipHexes\"/> by executing <paramref name=\"paintAction\"/>\n    /// for each hex on <paramref name=\"g\"/>.</summary>\n    /// <param name=\"g\">Graphics object for the canvas being painted.</param>\n    /// <param name=\"clipHexes\">Type: CoordRectangle - \n    /// The rectangular extent of hexes to be painted.</param>\n    /// <param name=\"paintAction\">Type: Action&lt;HexCoords&gt; - \n    /// The paint action to be performed for each hex.</param>\n    void PaintForEachHex(Graphics g, CoordsRectangle clipHexes, Action<HexCoords> paintAction) {\n      BoardHexes.ForEach(hex => {\n        if (clipHexes.Left <= hex.Coords.User.X  &&  hex.Coords.User.X <= clipHexes.Right\n        &&  clipHexes.Top  <= hex.Coords.User.Y  &&  hex.Coords.User.Y <= clipHexes.Bottom) {\n          TranslateGraphicsToHex(g, hex.Coords);\n          paintAction(hex.Coords);\n        }\n      } );\n      return;\n    }\n\n    /// <summary>Translates the origin of <paramref name=\"g\"/> to the upper-left corner of the hex with \n    /// coordinates <paramref name=\"coords\"/>.</summary>\n    /// <param name=\"g\">Type: Graphics - The canvas to be painted.</param>\n    /// <param name=\"coords\">Type: HexCoords - \n    /// Coordinates of the hex to be painted next.</param>\n    void TranslateGraphicsToHex(Graphics g, HexCoords coords) {\n      var offset  = UpperLeftOfHex(coords);\n      g.Transform = new Matrix(1, 0, 0, 1, offset.X, offset.Y);\n    }\n\n    /// <summary>Returns pixel coordinates of upper-left corner of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (upper-left corner of the) specified hex.</returns>\n    protected Point UpperLeftOfHex(HexCoords coords) {\n      return new Point(\n        coords.User.X * GridSize.Width,\n        coords.User.Y * GridSize.Height + (coords.User.X+1)%2 * GridSize.Height/2\n      );\n    }\n\n    /// <summary>Returns pixel coordinates of centre of specified hex.</summary>\n    /// <param name=\"coords\"></param>\n    /// <returns>A Point structure containing pixel coordinates for the (centre of the) specified hex.</returns>\n    protected Point CentreOfHex(HexCoords coords) {\n      return UpperLeftOfHex(coords) + CentreOfHexOffset;\n    }\n    #endregion\n\n    /// <summary>String representation of the distance from a given landmark to a specified hex</summary>\n    /// <param name=\"coords\">Type HexCoords - \n    /// Hex for which to return Landmark distanace.</param>\n    /// <param name=\"landmarkToShow\">Type int - \n    /// Index of the Landmark from which to display distances.</param>\n    protected virtual string LandmarkDistance(HexCoords coords, int landmarkToShow) { \n      if (landmarkToShow < 0  ||  Landmarks.Count <= landmarkToShow) return \"\";\n\n      return string.Format(\"{0,3}\", Landmarks[landmarkToShow].HexDistance(coords));\n    }\n\n    /// <summary>TODO</summary>\n    private void Host_FovRadiusChanged(object sender, Int32ValueEventArgs e) {\n      if (e==null) throw new ArgumentNullException(\"e\");\n      FovRadius = RangeCutoff = e.Value;\n    }\n\n    #region deprecated\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    [Obsolete(\"Use MapDisplay(Size,Size,Func<HexBoard<THex>, HexCoords, THex>) instead; client should set hex size.\")]\n    protected MapDisplay(Size sizeHexes, Func<HexBoard<THex>, HexCoords, THex> initializeHex) \n      : this(sizeHexes, new Size(27,30), initializeHex) {}\n\n    /// <summary>Creates a new instance of the MapDisplay class.</summary>\n    [Obsolete(\"Use MapDisplay(Size,Size,Func<HexBoard<THex>, HexCoords, THex>) instead; client should set hex size.\")]\n    protected MapDisplay(Size sizeHexes, Func<HexBoard<THex>, HexCoords, THex> initializeHex, \n                       ReadOnlyCollection<HexCoords> landmarkCoords) \n    : this(sizeHexes, new Size(27,30), initializeHex, landmarkCoords) {}\n\n    /// <inheritdoc/>\n    [Obsolete(\"Use GetClipInHexes(PointF,SizeF) instead.\")]\n    public CoordsRectangle GetClipCells(PointF point, SizeF size) {\n      return GetClipInHexes( new RectangleF(point,size), MapSizeHexes );\n    }\n    /// <inheritdoc/>\n    [Obsolete(\"Use GetClipInHexes(RectangleF) instead.\")]\n    public CoordsRectangle GetClipCells(RectangleF visibleClipBounds) {\n      return GetClipInHexes(visibleClipBounds, MapSizeHexes);\n    }\n    #endregion\n  }\n\n  /// <summary>TODO</summary>\n  /// <typeparam name=\"T\"></typeparam>\n  public class ValueChangedEventArgs<T> : EventArgs {\n    /// <summary>TODO</summary>\n    public ValueChangedEventArgs(T value) : base() { Value = value; }\n    /// <summary>TODO</summary>\n    public T Value { get; private set; }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/MapGridHex.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nusing PGNapoleonics.HexUtilities;\n\nnamespace PGNapoleonics.HexgridScrollable {\n  /// <summary>Deprecated; use interface IHex or abstract class MapGridHex instead.</summary>\n//  [Obsolete(\"Use interface IHex or abstract class MapGridHex instead.\")]\n  public interface IMapGridHex : IHex {\n    /// <summary></summary>\n    new HexBoard<MapGridHex> Board      { get; set; }\n  }\n\n  /// <summary>TODO</summary>\n  public abstract class MapGridHex : Hex<IMapGridHex>, IMapGridHex {\n    /// <summary>TODO</summary>\n    protected MapGridHex(HexBoard<MapGridHex> board, HexCoords coords) : base(board, coords) { \n      ((IMapGridHex)this).Board = board;\n    }\n\n    /// <inheritdoc/>\n    new public HexBoard<MapGridHex> Board      { get; set; }\n//    HexBoard<MapGridHex> IMapGridHex.Board      { get; set; }\n\n    /// <summary>TODO</summary>\n    protected  Size                 GridSize   { get { return Board.GridSize; } }\n\n    /// <inheritdoc/>\n    public virtual  void Paint(Graphics g) {;}\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HexgridScrollable\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"HexgridScrollable\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"607605fc-a17f-433f-8f02-f967fd996cbd\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "old/HexgridScrollable/ViewModelBase.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Input;\n\nusing PGNapoleonics.HexUtilities;\nusing PGNapoleonics.HexUtilities.Common;\n\nnamespace PGNapoleonics.HexgridPanel {\n  /// <summary>TODO</summary>\n  public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable {\n    /// <summary>TODO</summary>\n    protected ViewModelBase(string displayName) { DisplayName = displayName; }\n\n    /// <summary>TODO</summary>\n    public            string DisplayName                { get; private set; }\n    /// <summary>TODO</summary>\n    protected virtual bool   ThrowOnInvalidPropertyName { get { return true; } }\n\n    /// <summary>Raised when a property on this object has a new value.</summary>\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    /// <summary>Raises this object's PropertyChanged event.</summary>\n    /// <param name=\"propertyName\">The property that has a new value.</param>\n    protected virtual void OnPropertyChanged(string propertyName) {\n      this.VerifyPropertyName(propertyName);\n      this.PropertyChanged.Raise(this, new PropertyChangedEventArgs(propertyName));\n    }\n\n    /// <summary>Verify that propertyName exists as public instance property on this object.</summary>\n    [Conditional(\"DEBUG\"), DebuggerStepThrough]\n    public void VerifyPropertyName(string propertyName) {\n      if (TypeDescriptor.GetProperties(this)[propertyName] == null) {\n        string msg = \"Invalid property name: \" + propertyName;\n        if (this.ThrowOnInvalidPropertyName)       throw new ArgumentOutOfRangeException(\"propertyName\",msg);\n\n        Debug.Fail(msg);\n      }\n    }\n\n    #region IDisposable implementation with Finalizeer\n    bool _isDisposed = false;\n    /// <inheritdoc/>\n    public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }\n    /// <summary>Anchors the Dispose chain for sub-classes.</summary>\n    protected virtual void Dispose(bool disposing) {\n      if (!_isDisposed) {\n        if (disposing) {\n        }\n        _isDisposed = true;\n      }\n    }\n    /// <summary>Finalize this instance.</summary>\n    ~ViewModelBase() { Dispose(false); }\n    #endregion\n  }\n\n    /// <summary>TODO</summary>\n  public class CommandViewModel : ViewModelBase { \n    /// <summary>TODO</summary>\n    public CommandViewModel(string displayName, ICommand command) : base(displayName) { \n      if (command == null) throw new ArgumentNullException(\"command\"); \n      this.Command = command; \n    } \n    /// <summary>TODO</summary>\n    public ICommand Command { get; private set; } \n  }\n\n  /// <summary>TODO</summary>\n  public class RelayCommand : ICommand { \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute) : this(execute, (o) => true) { } \n    /// <summary>TODO</summary>\n    public RelayCommand(Action<object> execute, Predicate<object> canExecute) { \n      if (execute == null) throw new ArgumentNullException(\"execute\");\n      if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n      _execute    = execute; \n      _canExecute = canExecute;\n    } \n  \n    /// <summary>TODO</summary>\n    [DebuggerStepThrough] \n    public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n    /// <summary>TODO</summary>\n    public event EventHandler CanExecuteChanged { \n      add    { CommandManager.RequerySuggested += value; } \n      remove { CommandManager.RequerySuggested -= value; } \n    }\n  \n    /// <summary>TODO</summary>\n    public void Execute(object parameter) { _execute(parameter); }\n\n    readonly Action<object>    _execute; \n    readonly Predicate<object> _canExecute; \n  }\n\n  ///// <summary>TODO</summary>\n  //public class RelayCommand<T> : ICommand { \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute) : this(execute, (o) => true) { } \n  //  /// <summary>TODO</summary>\n  //  public RelayCommand(Action<T> execute, Predicate<object> canExecute) { \n  //    if (execute == null) throw new ArgumentNullException(\"execute\");\n  //    if (canExecute == null) throw new ArgumentNullException(\"canExecute\");\n\n  //    _execute    = execute; \n  //    _canExecute = canExecute;\n  //  } \n  \n  //  /// <summary>TODO</summary>\n  //  [DebuggerStepThrough] \n  //  public bool CanExecute(object parameter) { return  _canExecute(parameter); } \n\n  //  /// <summary>TODO</summary>\n  //  public event EventHandler CanExecuteChanged { \n  //    add    { CommandManager.RequerySuggested += value; } \n  //    remove { CommandManager.RequerySuggested -= value; } \n  //  }\n  \n  //  /// <summary>TODO</summary>\n  //  public void Execute(T parameter) { _execute(parameter); }\n\n  //  readonly Action<T>    _execute; \n  //  readonly Predicate<object> _canExecute; \n  //}\n\n  /// <summary>TODO</summary>\n  public abstract class WorkspaceViewModel : ViewModelBase {\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel() : this (\"WorkspaceViewModel_None\") { ; }\n    /// <summary>TODO</summary>\n    protected WorkspaceViewModel(string displayName) : base (displayName) {\n      _closeCommand = new RelayCommand(param => this.OnRequestClose());\n    }\n\n    /// <summary>Returns the command to remove this workspace from the user interface.</summary>\n    public virtual ICommand CloseCommand { get { return _closeCommand; } } ICommand _closeCommand;\n\n    /// <summary>Raised when this workspace should be removed from the UI.</summary>\n    public event EventHandler RequestClose;\n\n    void OnRequestClose()  { RequestClose.Raise(this,EventArgs.Empty); }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ExceptionDialog.Designer.cs",
    "content": "﻿namespace PGNapoleonics.WinForms {\n  partial class ExceptionDialog {\n    /// <summary>\n    /// Required designer variable.\n    /// </summary>\n    private System.ComponentModel.IContainer components = null;\n\n    /// <summary>\n    /// Clean up any resources being used.\n    /// </summary>\n    /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n    protected override void Dispose(bool disposing) {\n      if (disposing && (components != null)) {\n        components.Dispose();\n      }\n      base.Dispose(disposing);\n    }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    /// Required method for Designer support - do not modify\n    /// the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));\n      this.ErrorText = new System.Windows.Forms.TextBox();\n      this.OkButton = new System.Windows.Forms.Button();\n      this.SuspendLayout();\n      // \n      // ErrorText\n      // \n      resources.ApplyResources(this.ErrorText, \"ErrorText\");\n      this.ErrorText.Name = \"ErrorText\";\n      // \n      // OkButton\n      // \n      resources.ApplyResources(this.OkButton, \"OkButton\");\n      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n      this.OkButton.Name = \"OkButton\";\n      this.OkButton.UseVisualStyleBackColor = true;\n      // \n      // ExceptionDialog\n      // \n      this.AcceptButton = this.OkButton;\n      resources.ApplyResources(this, \"$this\");\n      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n      this.CancelButton = this.OkButton;\n      this.Controls.Add(this.OkButton);\n      this.Controls.Add(this.ErrorText);\n      this.Name = \"ExceptionDialog\";\n      this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n      this.TopMost = true;\n      this.ResumeLayout(false);\n      this.PerformLayout();\n\n    }\n\n    #endregion\n\n    private System.Windows.Forms.TextBox ErrorText;\n    private System.Windows.Forms.Button OkButton;\n  }\n}"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ExceptionDialog.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public partial class ExceptionDialog : Form {\n  /// <summary>TODO</summary>\n    public ExceptionDialog(string messageText) {\n      InitializeComponent();\n      this.ErrorText.Text = messageText;\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ExceptionDialog.en-US.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.AutoScrollMinSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>270, 240</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"$this.StartPosition\" type=\"System.Windows.Forms.FormStartPosition, System.Windows.Forms\">\n    <value>CenterParent</value>\n  </data>\n</root>"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ExceptionDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"&gt;&gt;OkButton.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"ErrorText.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>0, 0</value>\n  </data>\n  <assembly alias=\"mscorlib\" name=\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>0</value>\n  </data>\n  <data name=\"OkButton.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>75, 23</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"$this.AutoScroll\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"ErrorText.Size\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>287, 214</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.ZOrder\" xml:space=\"preserve\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Name\" xml:space=\"preserve\">\n    <value>ErrorText</value>\n  </data>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"ErrorText.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Top, Bottom, Left, Right</value>\n  </data>\n  <data name=\"OkButton.TabIndex\" type=\"System.Int32, mscorlib\">\n    <value>1</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Type\" xml:space=\"preserve\">\n    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"&gt;&gt;ErrorText.Parent\" xml:space=\"preserve\">\n    <value>$this</value>\n  </data>\n  <data name=\"ErrorText.Multiline\" type=\"System.Boolean, mscorlib\">\n    <value>True</value>\n  </data>\n  <data name=\"$this.AutoScaleDimensions\" type=\"System.Drawing.SizeF, System.Drawing\">\n    <value>6, 13</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.ZOrder\" xml:space=\"preserve\">\n    <value>0</value>\n  </data>\n  <data name=\"&gt;&gt;OkButton.Name\" xml:space=\"preserve\">\n    <value>OkButton</value>\n  </data>\n  <data name=\"OkButton.Text\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"$this.Text\" xml:space=\"preserve\">\n    <value>Exception Dialog</value>\n  </data>\n  <data name=\"OkButton.Location\" type=\"System.Drawing.Point, System.Drawing\">\n    <value>105, 227</value>\n  </data>\n  <data name=\"OkButton.Anchor\" type=\"System.Windows.Forms.AnchorStyles, System.Windows.Forms\">\n    <value>Bottom, Left, Right</value>\n  </data>\n  <data name=\"$this.ClientSize\" type=\"System.Drawing.Size, System.Drawing\">\n    <value>284, 262</value>\n  </data>\n  <data name=\"&gt;&gt;$this.Name\" xml:space=\"preserve\">\n    <value>ExceptionDialog</value>\n  </data>\n  <metadata name=\"$this.Localizable\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <metadata name=\"$this.Language\" type=\"System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>en-US</value>\n  </metadata>\n</root>"
  },
  {
    "path": "old/HexgridScrollable/WinForms/GdiRasterOps.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  internal static partial class GdiRasterOps {\n    public const int SrcCopy                 = 0x00CC0020; /* dest = source                   */ \n    public const int SrcPaint                = 0x00EE0086; /* dest = source OR dest           */\n    public const int SrcAnd                  = 0x008800C6; /* dest = source AND dest          */\n    public const int SrcInvert               = 0x00660046; /* dest = source XOR dest          */\n    public const int SrcErase                = 0x00440328; /* dest = source AND (NOT dest )   */ \n    public const int NotSrcCopy              = 0x00330008; /* dest = (NOT source)             */\n    public const int NotSrcErase             = 0x001100A6; /* dest = (NOT src) AND (NOT dest) */ \n    public const int MergeCopy               = 0x00C000CA; /* dest = (source AND pattern)     */ \n    public const int MergePaint              = 0x00BB0226; /* dest = (NOT source) OR dest     */\n    public const int PatCopy                 = 0x00F00021; /* dest = pattern                  */ \n    public const int PatPaint                = 0x00FB0A09; /* dest = DPSnoo                   */\n    public const int PatInvert               = 0x005A0049; /* dest = pattern XOR dest         */\n    public const int DstInvert               = 0x00550009; /* dest = (NOT dest)               */\n    public const int Blackness               = 0x00000042; /* dest = BLACK                    */ \n    public const int Whiteness               = 0x00FF0062; /* dest = WHITE                    */\n//    public const int CaptureBlt              = 0x40000000; /* Include layered windows */ \n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/NativeMethods.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Versioning;\nusing System.Windows.Forms;\n\n#pragma warning disable 1587\n/// <summary>Extensions to the System.Windows.Forms technologies used by namespace PGNapoleonics.HexgridScrollable.</summary>\n#pragma warning restore 1587\nnamespace PGNapoleonics.WinForms {\n  /// <summary>Extern declarations from the Win32 API.</summary>\n  internal static partial class NativeMethods {\n    /// <summary>P/Invoke declaration for user32.dll.WindowFromPoint</summary>\n\t\t/// <remarks><a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx\"></a></remarks>\n\t\t/// <param name=\"point\">(Sign-extended) screen coordinates as a Point structure.</param>\n\t\t/// <returns>Window handle (hWnd).</returns>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \n      \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\",\n      Justification=\"Research suggests the Code Analysis message is incorrect.\")\n    ,System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n       \"CA1811:AvoidUncalledPrivateCode\")]\n    [DllImport(\"user32.dll\")]\n    public static extern IntPtr WindowFromPoint(System.Drawing.Point point);\n\n    /// <summary>TODO</summary>\n    [DllImport(\"Gdi32.dll\", SetLastError=true, ExactSpelling=true, CharSet=CharSet.Auto)]\n    [ResourceExposure(ResourceScope.None)] \n    public static extern bool BitBlt(HandleRef hDC, int x, int y, int nWidth, int nHeight, \n                                     HandleRef hSrcDC, int xSrc, int ySrc, int dwRop);\n\n    /// <summary>Message Cracker for HiWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Most significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 HIWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return ((val32 >> 16) & 0xFFFF);\n    }\n\n    /// <summary>Message Cracker for LoWord</summary>\n    /// <param name=\"ptr\">A Windows message IntPtr</param>\n    /// <returns>Least significant 16 bits of <c>ptr</c> as Int32.</returns>\n    public static Int32 LOWORD(IntPtr ptr) {\n      Int32 val32 = ptr.ToInt32();\n      return (val32 & 0xFFFF);\n    }\n  }\n\n    /// <summary>Extension methods for System.Windows.Forms.Control.</summary>\n  public static partial class ControlExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    public static void UIThread(this Control @this, Action action) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    public static void UIThread(this Control @this, Action<object[]> action, params object[] args) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n      \n    }\n  }\n\n  /// <summary>Extension methods for System.Windows.Forms.Form.</summary>\n  public static partial class FormExtensions {\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1011:ConsiderPassingBaseTypesAsParameters\")]\n    public static void UIThread(this Form @this, Action action) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action);\n      else                        action.Invoke();\n    }\n\n    /// <summary>Executes Action asynchronously on the UI thread, without blocking the calling thread.</summary>\n    /// <param name=\"this\"></param>\n    /// <param name=\"action\"></param>\n    /// <param name=\"args\"></param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1011:ConsiderPassingBaseTypesAsParameters\")]\n    public static void UIThread(this Form @this, Action<object[]> action, params object[] args) {\n      if (@this==null) throw new ArgumentNullException(\"this\");\n      if (action==null) throw new ArgumentNullException(\"action\");\n\n      if (@this.InvokeRequired)   @this.BeginInvoke(action,args);\n       else                       action.Invoke(args);\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ScrollBarCommand.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  #pragma warning disable 1570,1591\n  /// <summary>TODO</summary>\n  internal enum ScrollBarCommand {\n      SB_LINEUP           = 0,  //!< TODO\n      SB_LINELEFT         = 0,  //!< TODO\n      SB_LINEDOWN         = 1,  //!< TODO\n      SB_LINERIGHT        = 1,  //!< TODO\n      SB_PAGEUP           = 2,  //!< TODO\n      SB_PAGELEFT         = 2,  //!< TODO\n      SB_PAGEDOWN         = 3,  //!< TODO\n      SB_PAGERIGHT        = 3,  //!< TODO\n      SB_THUMBPOSITION    = 4,  //!< TODO\n      SB_THUMBTRACK       = 5,  //!< TODO\n      SB_TOP              = 6,  //!< TODO\n      SB_LEFT             = 6,  //!< TODO\n      SB_BOTTOM           = 7,  //!< TODO\n      SB_RIGHT            = 7,  //!< TODO\n      SB_ENDSCROLL        = 8   //!< TODO\n  }\n  #pragma warning restore 1570,1591\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/ThreadExceptionHandler.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Threading;\nusing System.Windows.Forms;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>A Last-chance THread Exception handler.</summary>\n  [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()]\n  public class ThreadExceptionHandler {\n    /// <summary>Handles the thread exception.</summary> \n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n      \"CA1031:DoNotCatchGeneralExceptionTypes\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1303:Do not pass literals as localized parameters\", \n      MessageId = \"System.Windows.Forms.MessageBox.Show(System.String,System.String,\"\n                + \"System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1804:RemoveUnusedLocals\", MessageId = \"result\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1300:SpecifyMessageBoxOptions\")]\n    public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) {\n      if (sender==null) throw new ArgumentNullException(\"sender\");\n      if (e==null) throw new ArgumentNullException(\"e\");\n      if(e.Exception is NotImplementedException \n      || e.Exception is NotSupportedException\n      || e.Exception is InvalidOperationException\n      ) {\n          MessageBox.Show(e.Exception.Message, \n            \"Application Error\", \n            MessageBoxButtons.OK, \n            MessageBoxIcon.Information);\n      } else {\n        try {\n          var result = ShowThreadExceptionDialog(e.Exception);\n          Application.ExitThread();\n        }\n        catch {  // Fatal error, terminate program\n          try {\n            MessageBox.Show(\"Fatal Error in Unhandled Exception Handler.\", \n              \"Fatal Application Error\", \n              MessageBoxButtons.OK, \n              MessageBoxIcon.Stop);\n          }\n          finally { Application.Exit(); }\n        }\n      }\n    }\n\n    /// <summary>Creates and displays the error message.</summary>\n    private static DialogResult ShowThreadExceptionDialog(Exception ex) {\n      var errorMessage= \n        \"Unhandled Exception:\" + Environment.NewLine + Environment.NewLine +\n        ex.Message + Environment.NewLine + Environment.NewLine +\n        ex.GetType() + Environment.NewLine + Environment.NewLine +\n        \"Stack Trace:\" + Environment.NewLine +\n        ex.StackTrace;\n\n      var dialog = new ExceptionDialog(errorMessage);\n      try {\n        dialog.Show();\n      } finally { if (dialog!=null) dialog.Dispose(); }\n      return DialogResult.Abort;\n    }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/TransparentPanel.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary> Transparent Panel control.</summary>\n\t/// <remarks>\n\t/// See \"http://componentfactory.blogspot.ca/2005/06/net2-transparent-controls.html\"\n\t/// See \"http://www.bobpowell.net/transcontrols.htm\"\n\t/// </remarks>\n\tpublic class TransparentPanel : Panel {\n    /// <summary>TODO</summary>\n\t\tpublic TransparentPanel() : base() {\n\t\t\tSetStyle(ControlStyles.SupportsTransparentBackColor,true);\n\t\t\tBackColor  = Color.Transparent;\n\t\t}\n\t\t/// <summary>Make a truly transparent Panel control.</summary>\n\t\t/// <remarks>Change the behaviour of the window by giving it a TRANSPARENT style.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tprotected override CreateParams CreateParams { \n\t\t\tget { \n\t\t\t\tvar cp=base.CreateParams; \n\t\t\t\tcp.ExStyle |= (int)WindowStylesEx.TRANSPARENT;\n\t\t\t\treturn cp; \n\t\t\t} \n\t\t}\n\n\t\t/// <summary> Invalidate entire parent control to redraw on our background.</summary>\n\t\t/// <remarks>Invalidate the parent of the control, not the control itself, whenever \n\t\t/// we need to update the graphics. This ensures that whatever is behind the control \n\t\t/// gets painted before we need to do our own graphics output.\n\t\t/// See \"http://www.bobpowell.net/transcontrols.htm\"</remarks>\n\t\tpublic virtual void Invalidate2() { \n\t\t\tInvalidate2(new Rectangle(this.Location,this.Size));\n\t\t} \n    /// <summary>Invalidates the entire surface of the control and causes the control to be redrawn.</summary>\n    /// <param name=\"rectangle\">Clipping <c>Rectangle</c> to be invalidated.</param>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \n      \"CA1300:SpecifyMessageBoxOptions\")]\n    public virtual void Invalidate2(Rectangle rectangle) { \n\t\t\tif(Parent!=null  &&  Parent.IsHandleCreated) {\n\t\t\t\ttry {\n\t\t\t\t\tParent.Invoke((Action<Rectangle,bool>)((rc,b) => Parent.Invalidate(rc,b)), rectangle,true); \n\t\t\t\t} catch (InvalidOperationException e) { \n\t\t\t\t\tMessageBox.Show(\"Why is \" + e.Message + \"\\n occurring in\\n\" +\n\t\t\t\t\t\t\"TransparentPanel.Invalidate2(Rectangle r).\");\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t/// <summary> Prevent background painting from overwriting transparent background</summary>\n\t\t/// <param name=\"pevent\"></param>\n\t\tprotected override void OnPaintBackground(PaintEventArgs pevent) { /* NO-OP */ } \n\t}\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/WinFormsExtensions.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\nusing System.Reflection;\nusing System.Windows.Forms;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  public static partial class WinFormsExtensions {\n    /// <summary>Reflect to set Double-Buffering on Control.</summary>\n    /// <param name=\"control\">Control to operate on.</param>\n    /// <param name=\"setting\">New value for parameter.</param>\n    public static void MakeDoubleBuffered(this Control control, bool setting)\n    {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      control.GetType()\n             .GetProperty(\"DoubleBuffered\", BindingFlags.Instance | BindingFlags.NonPublic)\n             .SetValue(control, setting, null);\n    }\n\n    /// <summary>Use COMPOSITED to make a flicker-free form control.</summary>\n\t\t/// See \"http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c\"\n    public static CreateParams SetCompositedStyle(this Control control, CreateParams parameters) {\n      if (control==null) throw new ArgumentNullException(\"control\");\n      if (parameters==null) throw new ArgumentNullException(\"parameters\");\n      parameters.ExStyle |= (int)WindowStylesEx.COMPOSITED;\n      return parameters;\n    }\n  }\n\n  /// <summary>TODO</summary>/>\n  public static partial class PaddingExtensions {\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Point Offset(this Padding @this) { return new Point(@this.Left, @this.Top); }\n    /// <summary>Point for the Upper-Left corner of the Padding rectangle.</summary>/>\n    public static Size OffsetSize(this Padding @this) { return new Size(@this.Left, @this.Top); }\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/WindowsMessages.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace PGNapoleonics.WinForms {\n  /// <summary>\n    /// Windows Messages\n    /// Defined in winuser.h from Windows SDK v6.1\n    /// Documentation pulled from MSDN.\n    /// </summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1034:NestedTypesShouldNotBeVisible\")]\n  public enum WM : int //: uint\n  {\n    /// <summary>\n    /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\n    /// </summary>\n    NULL = 0x0000,\n    /// <summary>\n    /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\n    /// </summary>\n    CREATE = 0x0001,\n    /// <summary>\n    /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. \n    /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\n    /// /// </summary>\n    DESTROY = 0x0002,\n    /// <summary>\n    /// The WM_MOVE message is sent after a window has been moved. \n    /// </summary>\n    MOVE = 0x0003,\n    /// <summary>\n    /// The WM_SIZE message is sent to a window after its size has changed.\n    /// </summary>\n    SIZE = 0x0005,\n    /// <summary>\n    /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. \n    /// </summary>\n    ACTIVATE = 0x0006,\n    /// <summary>\n    /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. \n    /// </summary>\n    SETFOCUS = 0x0007,\n    /// <summary>\n    /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. \n    /// </summary>\n    KILLFOCUS = 0x0008,\n    /// <summary>\n    /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. \n    /// </summary>\n    ENABLE = 0x000A,\n    /// <summary>\n    /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. \n    /// </summary>\n    SETREDRAW = 0x000B,\n    /// <summary>\n    /// An application sends a WM_SETTEXT message to set the text of a window. \n    /// </summary>\n    SETTEXT = 0x000C,\n    /// <summary>\n    /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. \n    /// </summary>\n    GETTEXT = 0x000D,\n    /// <summary>\n    /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. \n    /// </summary>\n    GETTEXTLENGTH = 0x000E,\n    /// <summary>\n    /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. \n    /// </summary>\n    PAINT = 0x000F,\n    /// <summary>\n    /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\n    /// </summary>\n    CLOSE = 0x0010,\n    /// <summary>\n    /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\n    /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\n    /// </summary>\n    QUERYENDSESSION = 0x0011,\n    /// <summary>\n    /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\n    /// </summary>\n    QUERYOPEN = 0x0013,\n    /// <summary>\n    /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\n    /// </summary>\n    ENDSESSION = 0x0016,\n    /// <summary>\n    /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\n    /// </summary>\n    QUIT = 0x0012,\n    /// <summary>\n    /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. \n    /// </summary>\n    ERASEBKGND = 0x0014,\n    /// <summary>\n    /// This message is sent to all top-level windows when a change is made to a system color setting. \n    /// </summary>\n    SYSCOLORCHANGE = 0x0015,\n    /// <summary>\n    /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\n    /// </summary>\n    SHOWWINDOW = 0x0018,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    WININICHANGE = 0x001A,\n    /// <summary>\n    /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\n    /// Note  The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\n    /// </summary>\n    SETTINGCHANGE = WM.WININICHANGE,\n    /// <summary>\n    /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. \n    /// </summary>\n    DEVMODECHANGE = 0x001B,\n    /// <summary>\n    /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\n    /// </summary>\n    ACTIVATEAPP = 0x001C,\n    /// <summary>\n    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. \n    /// </summary>\n    FONTCHANGE = 0x001D,\n    /// <summary>\n    /// A message that is sent whenever there is a change in the system time.\n    /// </summary>\n    TIMECHANGE = 0x001E,\n    /// <summary>\n    /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\n    /// </summary>\n    CANCELMODE = 0x001F,\n    /// <summary>\n    /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. \n    /// </summary>\n    SETCURSOR = 0x0020,\n    /// <summary>\n    /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\n    /// </summary>\n    MOUSEACTIVATE = 0x0021,\n    /// <summary>\n    /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\n    /// </summary>\n    CHILDACTIVATE = 0x0022,\n    /// <summary>\n    /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. \n    /// </summary>\n    QUEUESYNC = 0x0023,\n    /// <summary>\n    /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. \n    /// </summary>\n    GETMINMAXINFO = 0x0024,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\n    /// </summary>\n    PAINTICON = 0x0026,\n    /// <summary>\n    /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\n    /// </summary>\n    ICONERASEBKGND = 0x0027,\n    /// <summary>\n    /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. \n    /// </summary>\n    NEXTDLGCTL = 0x0028,\n    /// <summary>\n    /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. \n    /// </summary>\n    SPOOLERSTATUS = 0x002A,\n    /// <summary>\n    /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\n    /// </summary>\n    DRAWITEM = 0x002B,\n    /// <summary>\n    /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\n    /// </summary>\n    MEASUREITEM = 0x002C,\n    /// <summary>\n    /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\n    /// </summary>\n    DELETEITEM = 0x002D,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. \n    /// </summary>\n    VKEYTOITEM = 0x002E,\n    /// <summary>\n    /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. \n    /// </summary>\n    CHARTOITEM = 0x002F,\n    /// <summary>\n    /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. \n    /// </summary>\n    SETFONT = 0x0030,\n    /// <summary>\n    /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. \n    /// </summary>\n    GETFONT = 0x0031,\n    /// <summary>\n    /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. \n    /// </summary>\n    SETHOTKEY = 0x0032,\n    /// <summary>\n    /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. \n    /// </summary>\n    GETHOTKEY = 0x0033,\n    /// <summary>\n    /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\n    /// </summary>\n    QUERYDRAGICON = 0x0037,\n    /// <summary>\n    /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. \n    /// </summary>\n    COMPAREITEM = 0x0039,\n    /// <summary>\n    /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. \n    /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. \n    /// </summary>\n    GETOBJECT = 0x003D,\n    /// <summary>\n    /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\n    /// </summary>\n    COMPACTING = 0x0041,\n    /// <summary>\n    /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\n    /// </summary>\n    [Obsolete]\n    COMMNOTIFY = 0x0044,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGING = 0x0046,\n    /// <summary>\n    /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\n    /// </summary>\n    WINDOWPOSCHANGED = 0x0047,\n    /// <summary>\n    /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\n    /// Use: POWERBROADCAST\n    /// </summary>\n    [Obsolete]\n    POWER = 0x0048,\n    /// <summary>\n    /// An application sends the WM_COPYDATA message to pass data to another application. \n    /// </summary>\n    COPYDATA = 0x004A,\n    /// <summary>\n    /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. \n    /// </summary>\n    CANCELJOURNAL = 0x004B,\n    /// <summary>\n    /// Sent by a common control to its parent window when an event has occurred or the control requires some information. \n    /// </summary>\n    NOTIFY = 0x004E,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. \n    /// </summary>\n    INPUTLANGCHANGEREQUEST = 0x0050,\n    /// <summary>\n    /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. \n    /// </summary>\n    INPUTLANGCHANGE = 0x0051,\n    /// <summary>\n    /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\n    /// </summary>\n    TCARD = 0x0052,\n    /// <summary>\n    /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. \n    /// </summary>\n    HELP = 0x0053,\n    /// <summary>\n    /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\n    /// </summary>\n    USERCHANGED = 0x0054,\n    /// <summary>\n    /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\n    /// </summary>\n    NOTIFYFORMAT = 0x0055,\n    /// <summary>\n    /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\n    /// </summary>\n    CONTEXTMENU = 0x007B,\n    /// <summary>\n    /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\n    /// </summary>\n    STYLECHANGING = 0x007C,\n    /// <summary>\n    /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\n    /// </summary>\n    STYLECHANGED = 0x007D,\n    /// <summary>\n    /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\n    /// </summary>\n    DISPLAYCHANGE = 0x007E,\n    /// <summary>\n    /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. \n    /// </summary>\n    GETICON = 0x007F,\n    /// <summary>\n    /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. \n    /// </summary>\n    SETICON = 0x0080,\n    /// <summary>\n    /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\n    /// </summary>\n    NCCREATE = 0x0081,\n    /// <summary>\n    /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. \n    /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\n    /// </summary>\n    NCDESTROY = 0x0082,\n    /// <summary>\n    /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\n    /// </summary>\n    NCCALCSIZE = 0x0083,\n    /// <summary>\n    /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\n    /// </summary>\n    NCHITTEST = 0x0084,\n    /// <summary>\n    /// The WM_NCPAINT message is sent to a window when its frame must be painted. \n    /// </summary>\n    NCPAINT = 0x0085,\n    /// <summary>\n    /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\n    /// </summary>\n    NCACTIVATE = 0x0086,\n    /// <summary>\n    /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\n    /// </summary>\n    GETDLGCODE = 0x0087,\n    /// <summary>\n    /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\n    /// </summary>\n    SYNCPAINT = 0x0088,\n    /// <summary>\n    /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMOUSEMOVE = 0x00A0,\n    /// <summary>\n    /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDOWN = 0x00A1,\n    /// <summary>\n    /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONUP = 0x00A2,\n    /// <summary>\n    /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCLBUTTONDBLCLK = 0x00A3,\n    /// <summary>\n    /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDOWN = 0x00A4,\n    /// <summary>\n    /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONUP = 0x00A5,\n    /// <summary>\n    /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCRBUTTONDBLCLK = 0x00A6,\n    /// <summary>\n    /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDOWN = 0x00A7,\n    /// <summary>\n    /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONUP = 0x00A8,\n    /// <summary>\n    /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCMBUTTONDBLCLK = 0x00A9,\n    /// <summary>\n    /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDOWN = 0x00AB,\n    /// <summary>\n    /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONUP = 0x00AC,\n    /// <summary>\n    /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\n    /// </summary>\n    NCXBUTTONDBLCLK = 0x00AD,\n    /// <summary>\n    /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\n    /// </summary>\n    INPUT_DEVICE_CHANGE = 0x00FE,\n    /// <summary>\n    /// The WM_INPUT message is sent to the window that is getting raw input. \n    /// </summary>\n    INPUT = 0x00FF,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYFIRST = 0x0100,\n    /// <summary>\n    /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. \n    /// </summary>\n    KEYDOWN = 0x0100,\n    /// <summary>\n    /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. \n    /// </summary>\n    KEYUP = 0x0101,\n    /// <summary>\n    /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. \n    /// </summary>\n    CHAR = 0x0102,\n    /// <summary>\n    /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. \n    /// </summary>\n    DEADCHAR = 0x0103,\n    /// <summary>\n    /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYDOWN = 0x0104,\n    /// <summary>\n    /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. \n    /// </summary>\n    SYSKEYUP = 0x0105,\n    /// <summary>\n    /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. \n    /// </summary>\n    SYSCHAR = 0x0106,\n    /// <summary>\n    /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. \n    /// </summary>\n    SYSDEADCHAR = 0x0107,\n    /// <summary>\n    /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. \n    /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\n    /// </summary>\n    UNICHAR = 0x0109,\n    /// <summary>\n    /// This message filters for keyboard messages.\n    /// </summary>\n    KEYLAST = 0x0109,\n    /// <summary>\n    /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_STARTCOMPOSITION = 0x010D,\n    /// <summary>\n    /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_ENDCOMPOSITION = 0x010E,\n    /// <summary>\n    /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITION = 0x010F,\n    /// <summary>TODO</summary>\n    IME_KEYLAST = 0x010F,\n    /// <summary>\n    /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. \n    /// </summary>\n    INITDIALOG = 0x0110,\n    /// <summary>\n    /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. \n    /// </summary>\n    COMMAND = 0x0111,\n    /// <summary>\n    /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\n    /// </summary>\n    SYSCOMMAND = 0x0112,\n    /// <summary>\n    /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. \n    /// </summary>\n    TIMER = 0x0113,\n    /// <summary>\n    /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    HSCROLL = 0x0114,\n    /// <summary>\n    /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. \n    /// </summary>\n    VSCROLL = 0x0115,\n    /// <summary>\n    /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. \n    /// </summary>\n    INITMENU = 0x0116,\n    /// <summary>\n    /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. \n    /// </summary>\n    INITMENUPOPUP = 0x0117,\n    /// <summary>\n    /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. \n    /// </summary>\n    MENUSELECT = 0x011F,\n    /// <summary>\n    /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. \n    /// </summary>\n    MENUCHAR = 0x0120,\n    /// <summary>\n    /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. \n    /// </summary>\n    ENTERIDLE = 0x0121,\n    /// <summary>\n    /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. \n    /// </summary>\n    MENURBUTTONUP = 0x0122,\n    /// <summary>\n    /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. \n    /// </summary>\n    MENUDRAG = 0x0123,\n    /// <summary>\n    /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. \n    /// </summary>\n    MENUGETOBJECT = 0x0124,\n    /// <summary>\n    /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. \n    /// </summary>\n    UNINITMENUPOPUP = 0x0125,\n    /// <summary>\n    /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. \n    /// </summary>\n    MENUCOMMAND = 0x0126,\n    /// <summary>\n    /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\n    /// </summary>\n    CHANGEUISTATE = 0x0127,\n    /// <summary>\n    /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\n    /// </summary>\n    UPDATEUISTATE = 0x0128,\n    /// <summary>\n    /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\n    /// </summary>\n    QUERYUISTATE = 0x0129,\n    /// <summary>\n    /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. \n    /// </summary>\n    CTLCOLORMSGBOX = 0x0132,\n    /// <summary>\n    /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. \n    /// </summary>\n    CTLCOLOREDIT = 0x0133,\n    /// <summary>\n    /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. \n    /// </summary>\n    CTLCOLORLISTBOX = 0x0134,\n    /// <summary>\n    /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. \n    /// </summary>\n    CTLCOLORBTN = 0x0135,\n    /// <summary>\n    /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. \n    /// </summary>\n    CTLCOLORDLG = 0x0136,\n    /// <summary>\n    /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. \n    /// </summary>\n    CTLCOLORSCROLLBAR = 0x0137,\n    /// <summary>\n    /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. \n    /// </summary>\n    CTLCOLORSTATIC = 0x0138,\n    /// <summary>\n    /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\n    /// </summary>\n    MOUSEFIRST = 0x0200,\n    /// <summary>\n    /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MOUSEMOVE = 0x0200,\n    /// <summary>\n    /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDOWN = 0x0201,\n    /// <summary>\n    /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONUP = 0x0202,\n    /// <summary>\n    /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    LBUTTONDBLCLK = 0x0203,\n    /// <summary>\n    /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDOWN = 0x0204,\n    /// <summary>\n    /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONUP = 0x0205,\n    /// <summary>\n    /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    RBUTTONDBLCLK = 0x0206,\n    /// <summary>\n    /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDOWN = 0x0207,\n    /// <summary>\n    /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONUP = 0x0208,\n    /// <summary>\n    /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    MBUTTONDBLCLK = 0x0209,\n    /// <summary>\n    /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEWHEEL = 0x020A,\n    /// <summary>\n    /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. \n    /// </summary>\n    XBUTTONDOWN = 0x020B,\n    /// <summary>\n    /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONUP = 0x020C,\n    /// <summary>\n    /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\n    /// </summary>\n    XBUTTONDBLCLK = 0x020D,\n    /// <summary>\n    /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\n    /// </summary>\n    MOUSEHWHEEL = 0x020E,\n    /// <summary>\n    /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\n    /// </summary>\n    MOUSELAST = 0x020E,\n    /// <summary>\n    /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\n    /// </summary>\n    PARENTNOTIFY = 0x0210,\n    /// <summary>\n    /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. \n    /// </summary>\n    ENTERMENULOOP = 0x0211,\n    /// <summary>\n    /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. \n    /// </summary>\n    EXITMENULOOP = 0x0212,\n    /// <summary>\n    /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. \n    /// </summary>\n    NEXTMENU = 0x0213,\n    /// <summary>\n    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. \n    /// </summary>\n    SIZING = 0x0214,\n    /// <summary>\n    /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\n    /// </summary>\n    CAPTURECHANGED = 0x0215,\n    /// <summary>\n    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\n    /// </summary>\n    MOVING = 0x0216,\n    /// <summary>\n    /// Notifies applications that a power-management event has occurred.\n    /// </summary>\n    POWERBROADCAST = 0x0218,\n    /// <summary>\n    /// Notifies an application of a change to the hardware configuration of a device or the computer.\n    /// </summary>\n    DEVICECHANGE = 0x0219,\n    /// <summary>\n    /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. \n    /// </summary>\n    MDICREATE = 0x0220,\n    /// <summary>\n    /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. \n    /// </summary>\n    MDIDESTROY = 0x0221,\n    /// <summary>\n    /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. \n    /// </summary>\n    MDIACTIVATE = 0x0222,\n    /// <summary>\n    /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. \n    /// </summary>\n    MDIRESTORE = 0x0223,\n    /// <summary>\n    /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. \n    /// </summary>\n    MDINEXT = 0x0224,\n    /// <summary>\n    /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. \n    /// </summary>\n    MDIMAXIMIZE = 0x0225,\n    /// <summary>\n    /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. \n    /// </summary>\n    MDITILE = 0x0226,\n    /// <summary>\n    /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. \n    /// </summary>\n    MDICASCADE = 0x0227,\n    /// <summary>\n    /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. \n    /// </summary>\n    MDIICONARRANGE = 0x0228,\n    /// <summary>\n    /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. \n    /// </summary>\n    MDIGETACTIVE = 0x0229,\n    /// <summary>\n    /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. \n    /// </summary>\n    MDISETMENU = 0x0230,\n    /// <summary>\n    /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\n    /// </summary>\n    ENTERSIZEMOVE = 0x0231,\n    /// <summary>\n    /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. \n    /// </summary>\n    EXITSIZEMOVE = 0x0232,\n    /// <summary>\n    /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\n    /// </summary>\n    DROPFILES = 0x0233,\n    /// <summary>\n    /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. \n    /// </summary>\n    MDIREFRESHMENU = 0x0234,\n    /// <summary>\n    /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SETCONTEXT = 0x0281,\n    /// <summary>\n    /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_NOTIFY = 0x0282,\n    /// <summary>\n    /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\n    /// </summary>\n    IME_CONTROL = 0x0283,\n    /// <summary>\n    /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_COMPOSITIONFULL = 0x0284,\n    /// <summary>\n    /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_SELECT = 0x0285,\n    /// <summary>\n    /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_CHAR = 0x0286,\n    /// <summary>\n    /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_REQUEST = 0x0288,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYDOWN = 0x0290,\n    /// <summary>\n    /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. \n    /// </summary>\n    IME_KEYUP = 0x0291,\n    /// <summary>\n    /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSEHOVER = 0x02A1,\n    /// <summary>\n    /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    MOUSELEAVE = 0x02A3,\n    /// <summary>\n    /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSEHOVER = 0x02A0,\n    /// <summary>\n    /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\n    /// </summary>\n    NCMOUSELEAVE = 0x02A2,\n    /// <summary>\n    /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\n    /// </summary>\n    WTSSESSION_CHANGE = 0x02B1,\n    /// <summary>TODO</summary>\n    TABLET_FIRST = 0x02c0,\n    /// <summary>TODO</summary>\n    TABLET_LAST = 0x02df,\n    /// <summary>\n    /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. \n    /// </summary>\n    CUT = 0x0300,\n    /// <summary>\n    /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. \n    /// </summary>\n    COPY = 0x0301,\n    /// <summary>\n    /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. \n    /// </summary>\n    PASTE = 0x0302,\n    /// <summary>\n    /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. \n    /// </summary>\n    CLEAR = 0x0303,\n    /// <summary>\n    /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\n    /// </summary>\n    UNDO = 0x0304,\n    /// <summary>\n    /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERFORMAT = 0x0305,\n    /// <summary>\n    /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. \n    /// </summary>\n    RENDERALLFORMATS = 0x0306,\n    /// <summary>\n    /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. \n    /// </summary>\n    DESTROYCLIPBOARD = 0x0307,\n    /// <summary>\n    /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. \n    /// </summary>\n    DRAWCLIPBOARD = 0x0308,\n    /// <summary>\n    /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. \n    /// </summary>\n    PAINTCLIPBOARD = 0x0309,\n    /// <summary>\n    /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    VSCROLLCLIPBOARD = 0x030A,\n    /// <summary>\n    /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. \n    /// </summary>\n    SIZECLIPBOARD = 0x030B,\n    /// <summary>\n    /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\n    /// </summary>\n    ASKCBFORMATNAME = 0x030C,\n    /// <summary>\n    /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. \n    /// </summary>\n    CHANGECBCHAIN = 0x030D,\n    /// <summary>\n    /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. \n    /// </summary>\n    HSCROLLCLIPBOARD = 0x030E,\n    /// <summary>\n    /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. \n    /// </summary>\n    QUERYNEWPALETTE = 0x030F,\n    /// <summary>\n    /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. \n    /// </summary>\n    PALETTEISCHANGING = 0x0310,\n    /// <summary>\n    /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. \n    /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\n    /// </summary>\n    PALETTECHANGED = 0x0311,\n    /// <summary>\n    /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. \n    /// </summary>\n    HOTKEY = 0x0312,\n    /// <summary>\n    /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINT = 0x0317,\n    /// <summary>\n    /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\n    /// </summary>\n    PRINTCLIENT = 0x0318,\n    /// <summary>\n    /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\n    /// </summary>\n    APPCOMMAND = 0x0319,\n    /// <summary>\n    /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\n    /// </summary>\n    THEMECHANGED = 0x031A,\n    /// <summary>\n    /// Sent when the contents of the clipboard have changed.\n    /// </summary>\n    CLIPBOARDUPDATE = 0x031D,\n    /// <summary>\n    /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\n    /// </summary>\n    DWMCOMPOSITIONCHANGED = 0x031E,\n    /// <summary>\n    /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. \n    /// </summary>\n    DWMNCRENDERINGCHANGED = 0x031F,\n    /// <summary>\n    /// Sent to all top-level windows when the colorization color has changed. \n    /// </summary>\n    DWMCOLORIZATIONCOLORCHANGED = 0x0320,\n    /// <summary>\n    /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\n    /// </summary>\n    DWMWINDOWMAXIMIZEDCHANGE = 0x0321,\n    /// <summary>\n    /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\n    /// </summary>\n    GETTITLEBARINFOEX = 0x033F,\n    /// <summary>TODO</summary>\n    HANDHELDFIRST = 0x0358,\n    /// <summary>TODO</summary>\n    HANDHELDLAST = 0x035F,\n    /// <summary>TODO</summary>\n    AFXFIRST = 0x0360,\n    /// <summary>TODO</summary>\n    AFXLAST = 0x037F,\n    /// <summary>TODO</summary>\n    PENWINFIRST = 0x0380,\n    /// <summary>TODO</summary>\n    PENWINLAST = 0x038F,\n    /// <summary>\n    /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. \n    /// </summary>\n    APP = 0x8000,\n    /// <summary>\n    /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. \n    /// </summary>\n    USER = 0x0400,\n\n    /// <summary>\n    /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. \n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1707:IdentifiersShouldNotContainUnderscores\")]\n    CPL_LAUNCH = USER+0x1000,\n    /// <summary>\n    /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. \n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1707:IdentifiersShouldNotContainUnderscores\")]\n    CPL_LAUNCHED = USER+0x1001,\n    /// <summary>\n    /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\n    /// </summary>\n    SYSTIMER = 0x118\n\t}\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/WindowsMouseInput.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\nusing System.Drawing;\n\nnamespace  PGNapoleonics.WinForms {\n\t/// <summary>Enumeration for buttons and modifiers in Windows Mouse messages.</summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n    \"CA1028:EnumStorageShouldBeInt32\")]\n\t[Flags]public enum MouseKeys : short {\n\t\t/// <summary>None.</summary>\n\t\tNone\t\t= 0x00,\n\t\t/// <summary>Left mouse button.</summary>\n\t\tLButton\t= 0x01,\n\t\t/// <summary>Right mouse button.</summary>\n\t\tRButton\t= 0x02,\n\t\t/// <summary>Shift key.</summary>\n\t\tShift\t\t= 0x04,\n\t\t/// <summary>Control key.</summary>\n\t\tControl\t= 0x08,\n\t\t/// <summary>Middle mouse button.</summary>\n\t\tMButton\t= 0x10,\n\t\t/// <summary>First mouse X button.</summary>\n\t\tXButton1\t= 0x20,\n\t\t/// <summary>Second mouse X button.</summary>\n\t\tXButton2\t= 0x40\n\t}\n\n  /// <summary>TODO</summary>\n\tpublic static class WindowsMouseInput {\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static MouseKeys GetKeyStateWParam(IntPtr wParam) {\n\t\t\treturn (MouseKeys)(wParam.ToInt64() & 0x0000ffff);\n\t\t}\n\n\t\t/// <summary> Determine (sign-extended for multiple monitors) screen coordinates at m.LParam.</summary>\n\t\t/// <param name=\"lParam\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static System.Drawing.Point GetPointLParam(IntPtr lParam) {\n\t\t\treturn new System.Drawing.Point(\n\t\t\t\t\t (int)(short)(lParam.ToInt64() & 0x0000ffff), \n\t\t\t\t\t (int)(short)(lParam.ToInt64() >> 16)\n\t\t\t\t);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static Int16 WheelDelta(IntPtr wParam) {\n\t\t\treturn (Int16)(wParam.ToInt64() >> 16);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\")]\n    public static IntPtr LParam(Point point) {\n\t\t\tif (point.X<Int16.MinValue || point.X > Int16.MaxValue\n      ||  point.Y<Int16.MinValue || point.Y > Int16.MaxValue)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"point\",point,\n\t\t\t\t\t\"Must be a valid Point struct.\");\n\t\t\treturn (IntPtr)((Int16)point.Y <<16 + (Int16)point.X);\n\t\t}\n\n    /// <summary>TODO</summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \n      \"CA1811:AvoidUncalledPrivateCode\"), \n    System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1702:CompoundWordsShouldBeCasedCorrectly\", MessageId = \"WParam\")]\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n      \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"Param\")]\n    public static IntPtr WParam (Int16 wheelDelta, MouseKeys mouseKeys) {\n\t\t\treturn IntPtr.Zero + (wheelDelta << 16) + (Int16)mouseKeys;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "old/HexgridScrollable/WinForms/WindowsStylesEx.cs",
    "content": "﻿#region The MIT License - Copyright (C) 2012-2013 Pieter Geerkens\n/////////////////////////////////////////////////////////////////////////////////////////\n//                PG Software Solutions Inc. - Hex-Grid Utilities\n/////////////////////////////////////////////////////////////////////////////////////////\n// The MIT License:\n// ----------------\n// \n// Copyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, \n// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to \n// permit persons to whom the Software is furnished to do so, subject to the following \n// conditions:\n//     The above copyright notice and this permission notice shall be \n//     included in all copies or substantial portions of the Software.\n// \n//     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n//     NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n//     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n//     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n//     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n//     OTHER DEALINGS IN THE SOFTWARE.\n/////////////////////////////////////////////////////////////////////////////////////////\n#endregion\nusing System;\n\nnamespace  PGNapoleonics.WinForms {\n  /// <summary>TODO</summary>\n  [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \n    \"CA1008:EnumsShouldHaveZeroValue\"), \n  System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n    \"CA1714:FlagsEnumsShouldHavePluralNames\"), \n  System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \n    \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n  [Flags]internal enum WindowStylesEx\n  {\n    /// <summary>TODO</summary>\n    NONE = 0x00000000,\n    /// <summary>Specifies that a window created with this style accepts drag-drop files.</summary>\n    ACCEPTFILES = 0x00000010,\n    /// <summary>Forces a top-level window onto the taskbar when the window is visible.</summary>\n    APPWINDOW = 0x00040000,\n    /// <summary>Specifies that a window has a border with a sunken edge.</summary>\n    CLIENTEDGE = 0x00000200,\n    /// <summary>Windows XP: Paints all descendants of a window in bottom-to-top painting order w/ double-buffering.</summary>\n    /// <remarks>\n    /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </remarks>\n    COMPOSITED = 0x02000000,\n    /// <summary>Includes a question mark in the title bar of the window.</summary>\n    /// <remarks>\n    /// When the user clicks the question mark, the cursor changes to a question mark \n    /// with a pointer. If the user then clicks a child window, the child receives a \n    /// WM_HELP message. The child window should pass the message to the parent window \n    /// procedure, which should call the WinHelp function using the HELP_WM_HELP command. \n    /// The Help application displays a pop-up window that typically contains help for\n    /// the child window.  \n    /// CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\n    /// </remarks>\n    CONTEXTHELP = 0x00000400,\n    /// <summary>The window itself contains child windows that should take part in dialog box navigation. </summary>\n    /// <remarks>\n    /// If this style is specified, the dialog manager recurses into children of this \n    /// window when performing navigation operations such as handling the TAB key, \n    /// an arrow key, or a keyboard mnemonic.\n    /// </remarks>\n    CONTROLPARENT = 0x00010000,\n    /// <summary>Creates a window that has a double border.</summary>\n    /// <remarks>\n    /// The window can, optionally, be created with a title bar by specifying the \n    /// WS_CAPTION style in the dwStyle parameter.\n    /// </remarks>\n    DLGMODALFRAME = 0x00000001,\n    /// <summary>\n    /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. \n    /// </summary>\n    LAYERED = 0x00080000,\n    /// <summary>\n    /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. \n    /// </summary>\n    LAYOUTRTL = 0x00400000,\n    /// <summary>\n    /// Creates a window that has generic left-aligned properties. This is the default.\n    /// </summary>\n    LEFT = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\n    /// </summary>\n    LEFTSCROLLBAR = 0x00004000,\n    /// <summary>The window text is displayed using left-to-right reading-order properties.</summary>\n    /// <remarks>\n    /// This is the default.\n    /// </remarks>\n    LTRREADING = 0x00000000,\n    /// <summary>Creates a multiple-document interface (MDI) child window.</summary>\n    MDICHILD = 0x00000040,\n    /// <summary>The window doesn't become the foreground window when the user clicks it.</summary>\n    /// <remarks>\n    /// Windows 2000/XP: A top-level window created with this style does not become the \n    /// foreground window when the user clicks it. \n    /// \n    /// The system does not bring this window to the foreground when the user minimizes \n    /// or closes the foreground window.  To activate the window, use the SetActiveWindow\n    /// or SetForegroundWindow function.  The window does not appear on the taskbar by \n    /// default. To force the window to appear on the taskbar, use the APPWINDOW \n    /// style.\n    /// </remarks>\n    NOACTIVATE = 0x08000000,\n    /// <summary>\n    /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\n    /// </summary>\n    NOINHERITLAYOUT = 0x00100000,\n    /// <summary>\n    /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\n    /// </summary>\n    NOPARENTNOTIFY = 0x00000004,\n    /// <summary>Combines the CLIENTEDGE and WINDOWEDGE styles.</summary>\n    OVERLAPPEDWINDOW = WINDOWEDGE | CLIENTEDGE,\n    /// <summary>Combines the WINDOWEDGE, TOOLWINDOW, and TOPMOST styles.</summary>\n    PALETTEWINDOW = WINDOWEDGE | TOOLWINDOW | TOPMOST,\n    /// <summary>Gives the window has generic \"right-aligned\" properties.</summary>\n    /// <remarks>\n    /// This depends on the window class. This style has an effect only if the \n    /// shell language is Hebrew, Arabic, or another language that supports \n    /// reading-order alignment; otherwise, the style is ignored.\n    /// \n    /// Using the RIGHT style for static or edit controls has the same \n    /// effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this \n    /// style with button controls has the same effect as using BS_RIGHT and \n    /// BS_RIGHTBUTTON styles.\n    /// </remarks>\n    RIGHT = 0x00001000,\n    /// <summary>\n    /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\n    /// </summary>\n    RIGHTSCROLLBAR = 0x00000000,\n    /// <summary>\n    /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\n    /// </summary>\n    RTLREADING = 0x00002000,\n    /// <summary>\n    /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\n    /// </summary>\n    STATICEDGE = 0x00020000,\n    /// <summary>Creates a tool window; that is, a window intended to be used as a floating toolbar. </summary>\n    /// <remarks>\n    /// A tool window has a title bar that is shorter than a normal title bar, and the \n    /// window title is drawn using a smaller font. A tool window does not appear in \n    /// the taskbar or in the dialog that appears when the user presses ALT+TAB. If a \n    /// tool window has a system menu, its icon is not displayed on the title bar. \n    /// However, you can display the system menu by right-clicking or by typing ALT+SPACE.\n    /// </remarks>\n    TOOLWINDOW = 0x00000080,\n    /// <summary>Specifies that a window should be, and remain, topmost.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should be placed above all \n    /// non-topmost windows and should stay above them, even when the window is \n    /// deactivated. To add or remove this style, use the SetWindowPos function.\n    /// </remarks>\n    TOPMOST = 0x00000008,\n    /// <summary>Specifies that a window should be painted after all siblings.</summary>\n    /// <remarks>\n    /// Specifies that a window created with this style should not be painted until \n    /// siblings beneath the window (that were created by the same thread) have been \n    /// painted. The window appears transparent because the bits of underlying sibling \n    /// windows have already been painted.\n    /// To achieve transparency w/o these restrictions, use the SetWindowRgn function.\n    /// </remarks>\n    TRANSPARENT = 0x00000020,\n    /// <summary>Specifies that a window has a border with a raised edge.</summary>\n    WINDOWEDGE = 0x00000100\n  }\n}\n"
  },
  {
    "path": "old/HexgridScrollable/license.txt",
    "content": "The MIT License:\n----------------\n\nCopyright (c) 2012-2013 Pieter Geerkens (email: pgeerkens@hotmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following \nconditions:\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n    NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n    OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "old/WpfControlLibrary1/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"WpfControlLibrary1\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"WpfControlLibrary1\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly:ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n                             //(used if a resource is not found in the page, \n                             // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n                                      //(used if a resource is not found in the page, \n                                      // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "old/WpfControlLibrary1/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace WpfControlLibrary1.Properties {\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if ((resourceMan == null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"WpfControlLibrary1.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfControlLibrary1/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "old/WpfControlLibrary1/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace WpfControlLibrary1.Properties\n{\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\n    {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default\n        {\n            get\n            {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfControlLibrary1/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "old/WpfControlLibrary1/UserControl1.xaml",
    "content": "﻿<UserControl x:Class=\"WpfControlLibrary1.UserControl1\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             d:DesignHeight=\"300\" d:DesignWidth=\"300\">\n    <Grid>\n            \n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "old/WpfControlLibrary1/UserControl1.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nnamespace WpfControlLibrary1\n{\n    /// <summary>\n    /// Interaction logic for UserControl1.xaml\n    /// </summary>\n    public partial class UserControl1 : UserControl\n    {\n        public UserControl1()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfControlLibrary1/WpfControlLibrary1.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A0127DF0-3B51-491C-B5A8-E3782B39AB3D}</ProjectGuid>\n    <OutputType>library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>WpfControlLibrary1</RootNamespace>\n    <AssemblyName>WpfControlLibrary1</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"UserControl1.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Compile Include=\"UserControl1.xaml.cs\">\n      <DependentUpon>UserControl1.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "old/WpfCustomControlLibrary1/CustomControl1.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nnamespace WpfCustomControlLibrary1\n{\n    /// <summary>\n    /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.\n    ///\n    /// Step 1a) Using this custom control in a XAML file that exists in the current project.\n    /// Add this XmlNamespace attribute to the root element of the markup file where it is \n    /// to be used:\n    ///\n    ///     xmlns:MyNamespace=\"clr-namespace:WpfCustomControlLibrary1\"\n    ///\n    ///\n    /// Step 1b) Using this custom control in a XAML file that exists in a different project.\n    /// Add this XmlNamespace attribute to the root element of the markup file where it is \n    /// to be used:\n    ///\n    ///     xmlns:MyNamespace=\"clr-namespace:WpfCustomControlLibrary1;assembly=WpfCustomControlLibrary1\"\n    ///\n    /// You will also need to add a project reference from the project where the XAML file lives\n    /// to this project and Rebuild to avoid compilation errors:\n    ///\n    ///     Right click on the target project in the Solution Explorer and\n    ///     \"Add Reference\"->\"Projects\"->[Select this project]\n    ///\n    ///\n    /// Step 2)\n    /// Go ahead and use your control in the XAML file.\n    ///\n    ///     <MyNamespace:CustomControl1/>\n    ///\n    /// </summary>\n    public class CustomControl1 : Control\n    {\n        static CustomControl1()\n        {\n            DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1)));\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"WpfCustomControlLibrary1\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"PG Software Solutions Inc.\")]\n[assembly: AssemblyProduct(\"WpfCustomControlLibrary1\")]\n[assembly: AssemblyCopyright(\"Copyright © PG Software Solutions Inc. 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly:ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n                             //(used if a resource is not found in the page, \n                             // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n                                      //(used if a resource is not found in the page, \n                                      // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace WpfCustomControlLibrary1.Properties {\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if ((resourceMan == null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"WpfCustomControlLibrary1.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace WpfCustomControlLibrary1.Properties\n{\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\n    {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default\n        {\n            get\n            {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "old/WpfCustomControlLibrary1/Themes/Generic.xaml",
    "content": "﻿<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"clr-namespace:WpfCustomControlLibrary1\">\n    <Style TargetType=\"{x:Type local:CustomControl1}\">\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type local:CustomControl1}\">\n                    <Border Background=\"{TemplateBinding Background}\"\n                            BorderBrush=\"{TemplateBinding BorderBrush}\"\n                            BorderThickness=\"{TemplateBinding BorderThickness}\">\n\n                    </Border>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "old/WpfCustomControlLibrary1/WpfCustomControlLibrary1.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A81CB1B7-DBFB-4DF7-B5D0-A8DD3BD4F1F2}</ProjectGuid>\n    <OutputType>library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>WpfCustomControlLibrary1</RootNamespace>\n    <AssemblyName>WpfCustomControlLibrary1</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"Themes\\Generic.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Compile Include=\"CustomControl1.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  }
]