[
  {
    "path": "EasyJob/App.xaml",
    "content": "﻿<Application x:Class=\"EasyJob.App\"\r\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n             xmlns:local=\"clr-namespace:EasyJob\"\r\n             xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n             StartupUri=\"MainWindow.xaml\">\r\n    <Application.Resources>\r\n        <ResourceDictionary>\r\n            <ResourceDictionary.MergedDictionaries>\r\n                <ui:ThemeResources />\r\n                <ui:XamlControlsResources />\r\n            </ResourceDictionary.MergedDictionaries>\r\n        </ResourceDictionary>\r\n    </Application.Resources>\r\n</Application>\r\n"
  },
  {
    "path": "EasyJob/App.xaml.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Configuration;\r\nusing System.Data;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\n\r\nnamespace EasyJob\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for App.xaml\r\n    /// </summary>\r\n    public partial class App : Application\r\n    {\r\n        protected override void OnStartup(StartupEventArgs e)\r\n        {\r\n            base.OnStartup(e);\r\n\r\n            SetDropDownMenuToBeRightAligned();\r\n        }\r\n\r\n        private static void SetDropDownMenuToBeRightAligned()\r\n        {\r\n            var menuDropAlignmentField = typeof(SystemParameters).GetField(\"_menuDropAlignment\", BindingFlags.NonPublic | BindingFlags.Static);\r\n            Action setAlignmentValue = () =>\r\n            {\r\n                if (SystemParameters.MenuDropAlignment && menuDropAlignmentField != null) menuDropAlignmentField.SetValue(null, false);\r\n            };\r\n\r\n            setAlignmentValue();\r\n\r\n            SystemParameters.StaticPropertyChanged += (sender, e) =>\r\n            {\r\n                setAlignmentValue();\r\n            };\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/AssemblyInfo.cs",
    "content": "using System.Windows;\r\n\r\n[assembly: ThemeInfo(\r\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\r\n                                     //(used if a resource is not found in the page,\r\n                                     // or application resource dictionaries)\r\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\r\n                                              //(used if a resource is not found in the page,\r\n                                              // app, or any theme specific resource dictionaries)\r\n)]\r\n"
  },
  {
    "path": "EasyJob/Documentation/HelpDocumentation.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<items>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonText</name>\r\n\t\t<heading>Text</heading>\r\n\t\t<description>The button text. This is an actual name of your button which will be shown on the panel.&#10;&#10;Example: \"Restart server\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonText.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonDescription</name>\r\n\t\t<heading>Description</heading>\r\n\t\t<description>The button description. This parameter sets the description for the button which will be shown in tooltip when mouse is on the button.&#10;&#10;Example: \"This button restarts specified server\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonDescription.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonScript</name>\r\n\t\t<heading>Script</heading>\r\n\t\t<description>The button script file. This is used to set path to the script. Value may differ based on the Script Path Type parameter.&#10;&#10;&#10;Example:&#10;&#10;If Script Path Type parameter is Relative then script file must be put to the direction where is EasyJob is located and should look like: \"restart_server.ps1\".&#10;&#10;If Script Path Type parameter is Absolute then script file must be put to any other direction and should look like: \"C:\\your\\folder\\name\\restart_server.ps1\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonScript.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonScriptPathType</name>\r\n\t\t<heading>Script path type</heading>\r\n\t\t<description>The button script path type. My be set to Relative or Absolute. Relative means that your script is in the same folder with an application executable. Absolute means that your script is located in any other folder in your system.&#10;&#10;Example: \"Relative\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonScriptPathType.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonScriptType</name>\r\n\t\t<heading>Script type</heading>\r\n\t\t<description>The button script type. My be set to PowerShell or Batch script.&#10;&#10;Example: \"PowerShell\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonScriptType.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpAddActionButtonArguments</name>\r\n\t\t<heading>Arguments</heading>\r\n\t\t<description>The button arguments. You have to specify list of questions which will be asked when executiong your script.&#10;&#10;Example: \"Please specify server DNS name or IP address\"</description>\r\n\t\t<used>Adding button</used>\r\n\t\t<video>HelpAddActionButtonArguments.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationDefaultPowershellPath</name>\r\n\t\t<heading>Default PowerShell path</heading>\r\n\t\t<description>Absolute path to PowerShell.exe. You can specify path to new versions of PowerShell.&#10;&#10;Example: \"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\"</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationDefaultPowershellPath.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationDefaultCMDPath</name>\r\n\t\t<heading>Default CMD path</heading>\r\n\t\t<description>Absolute path to command promt.&#10;&#10;Example: \"C:\\Windows\\System32\\cmd.exe\"</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationDefaultCMDPath.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationPowerShellArguments</name>\r\n\t\t<heading>PowerShell arguments</heading>\r\n\t\t<description>Additional parameters sent to PowerShell.&#10;&#10;Example: -ExecutionPolicy Unrestricted</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationPowerShellArguments.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationConsoleBackground</name>\r\n\t\t<heading>Console background</heading>\r\n\t\t<description>Background color of the console.&#10;&#10;Example: Black</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationConsoleBackground.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationConsoleForeground</name>\r\n\t\t<heading>Console foreground</heading>\r\n\t\t<description>Color of the text in the console.&#10;&#10;Example: Red</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationConsoleForeground.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationConsoleIgnoreColorTags</name>\r\n\t\t<heading>Console ignore color tags</heading>\r\n\t\t<description>Determines if special color tags are ignored during output.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationConsoleIgnoreColorTags.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationClearEventsWhenReload</name>\r\n\t\t<heading>Clear events when reload</heading>\r\n\t\t<description>Clear events on Events list after configuration reload from the File-> Reload config menu.&#10;&#10;Example: Yes</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationClearEventsWhenReload.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockTabsRemove</name>\r\n\t\t<heading>Block tabs remove</heading>\r\n\t\t<description>Hides \"Remove Tab\" context menu item from when Right click on the Tab.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockTabsRemove.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsRemove</name>\r\n\t\t<heading>Block buttons remove</heading>\r\n\t\t<description>Hides \"Remove button\" context menu item when Right click on the buttons bar.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsRemove.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockTabsAdd</name>\r\n\t\t<heading>Block tabs add</heading>\r\n\t\t<description>Hides \"Add tab\" context menu item when Right Click on the Tab.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockTabsAdd.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsAdd</name>\r\n\t\t<heading>Block buttons add</heading>\r\n\t\t<description>Hides \"Add button\" context menu item when Right click on the buttons bar.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsAdd.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsReorder</name>\r\n\t\t<heading>Block buttons reorder</heading>\r\n\t\t<description>Hides \"Reorder buttons\" context menu item when Right click on the buttons bar.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsReorder.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsEdit</name>\r\n\t\t<heading>Block buttons edit</heading>\r\n\t\t<description>Hides \"Edit button\" context menu item when Right click on the button.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsEdit.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockTabsRename</name>\r\n\t\t<heading>Block tabs rename</heading>\r\n\t\t<description>Hides \"Rename tab\" context menu item when Right click on the tab.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockTabsRename.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsPaste</name>\r\n\t\t<heading>Block buttons paste</heading>\r\n\t\t<description>Hides \"Paste button\" context menu item when Right click on the tab.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsPaste.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationBlockButtonsCopy</name>\r\n\t\t<heading>Block buttons copy</heading>\r\n\t\t<description>Hides \"Copy button\" context menu item when Right click on the tab.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationBlockButtonsCopy.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideFileReloadConfig</name>\r\n\t\t<heading>Hide File->Reload config</heading>\r\n\t\t<description>Hides \"File->Reload config\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideFileReloadConfig.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideFileOpenAppFolder</name>\r\n\t\t<heading>Hide File->Open app folder</heading>\r\n\t\t<description>Hides \"File->Open app folder\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideFileOpenAppFolder.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideClearEventsList</name>\r\n\t\t<heading>Hide File->Clear events list</heading>\r\n\t\t<description>Hides \"Hide File->Clear events list\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideClearEventsList.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettings</name>\r\n\t\t<heading>Hide Settings</heading>\r\n\t\t<description>Hides \"Hide Settings\" main menu item.&#10;&#10;Example: No&#10;&#10;Note: In order to bring back Settings menu, you have to manually find \"hide_menu_item_settings\" parameter in config.json and change its value to \"false\"</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettings.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflow</name>\r\n\t\t<heading>Hide Settings->Workflow</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflow.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowReorderTabs</name>\r\n\t\t<heading>Hide Settings->Workflow->Reorder tabs</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Reorder tabs\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowReorderTabs.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowAddTab</name>\r\n\t\t<heading>Hide Settings->Workflow->Add tab</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Add tab\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowAddTab.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowRemoveCurrentTab</name>\r\n\t\t<heading>Hide Settings->Workflow->Remove current tab</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Remove current tab\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowRemoveCurrentTab.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowRenameCurrentTab</name>\r\n\t\t<heading>Hide Settings->Workflow->Rename current tab</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Rename current tab\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowRenameCurrentTab.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowAddButtonToCurrentTab</name>\r\n\t\t<heading>Hide Settings->Workflow->Add button to current tab\" main menu item.&#10;&#10;Example: No</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Add button to current tab</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowAddButtonToCurrentTab.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsWorkflowReorderButtonsInCurrentTab</name>\r\n\t\t<heading>Hide Settings->Workflow->Reorder buttons in current tab</heading>\r\n\t\t<description>Hides \"Hide Settings->Workflow->Reorder buttons in current tab\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsWorkflowReorderButtonsInCurrentTab.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideSettingsConfiguration</name>\r\n\t\t<heading>Hide Settings->Configuration</heading>\r\n\t\t<description>Hides \"Hide Settings->Configuration\" main menu item.&#10;&#10;Example: No&#10;&#10;Note: In order to bring back Configuration menu, you have to manually find \"hide_menu_item_settings_configuration\" parameter in config.json and change its value to \"false\"</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideSettingsConfiguration.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideHelp</name>\r\n\t\t<heading>Hide Help</heading>\r\n\t\t<description>Hides \"Hide Help\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideHelp.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideTroubleshooting</name>\r\n\t\t<heading>Hide Help->Troubleshooting</heading>\r\n\t\t<description>Hides \"Hide Help->Troubleshooting\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideTroubleshooting.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideColorTags</name>\r\n\t\t<heading>Hide Help->Troubleshooting</heading>\r\n\t\t<description>Hides \"Hide Help->Color tags\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideColorTags.mp4</video>\r\n\t</item>\r\n\t<item>\r\n\t\t<name>HelpConfigurationHideAbout</name>\r\n\t\t<heading>Hide Help->About</heading>\r\n\t\t<description>Hides \"Hide Help->About\" main menu item.&#10;&#10;Example: No</description>\r\n\t\t<used>Configuration</used>\r\n\t\t<video>HelpConfigurationHideAbout.mp4</video>\r\n\t</item>\r\n</items>\r\n\r\n"
  },
  {
    "path": "EasyJob/EasyJob.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\r\n\r\n  <PropertyGroup>\r\n    <OutputType>WinExe</OutputType>\r\n    <TargetFramework>net5.0-windows</TargetFramework>\r\n    <UseWPF>true</UseWPF>\r\n    <ApplicationIcon>Images\\icon.ico</ApplicationIcon>\r\n    <Version>1.1.9</Version>\r\n    <Authors>Akshin Mustafayev</Authors>\r\n    <Description>Keep and execute your PowerShell scripts from one interface</Description>\r\n    <Copyright>Akshin Mustafayev</Copyright>\r\n    <PackageProjectUrl>https://github.com/akshinmustafayev/EasyJob</PackageProjectUrl>\r\n    <RepositoryUrl>https://github.com/akshinmustafayev/EasyJob</RepositoryUrl>\r\n    <RepositoryType>Git</RepositoryType>\r\n    <AssemblyVersion>1.1.9.0</AssemblyVersion>\r\n  </PropertyGroup>\r\n\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|AnyCPU'\">\r\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|AnyCPU'\">\r\n\t<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n  </PropertyGroup>\r\n\r\n  <ItemGroup>\r\n    <None Remove=\"HelpDocumentation.xml\" />\r\n    <None Remove=\"Images\\about.png\" />\r\n    <None Remove=\"Images\\add.png\" />\r\n    <None Remove=\"Images\\addbutton.png\" />\r\n    <None Remove=\"Images\\addtab.png\" />\r\n    <None Remove=\"Images\\clear.png\" />\r\n    <None Remove=\"Images\\close.png\" />\r\n    <None Remove=\"Images\\colortags.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag01.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag02.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag03.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag04.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag05.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag06.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag07.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag08.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag09.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag10.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag11.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag12.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag13.png\" />\r\n    <None Remove=\"Images\\ColorTags\\tag14.png\" />\r\n    <None Remove=\"Images\\configuration.png\" />\r\n    <None Remove=\"Images\\convert.png\" />\r\n    <None Remove=\"Images\\copy.png\" />\r\n    <None Remove=\"Images\\down.png\" />\r\n    <None Remove=\"Images\\editbutton.png\" />\r\n    <None Remove=\"Images\\exit.png\" />\r\n    <None Remove=\"Images\\find.png\" />\r\n    <None Remove=\"Images\\folder.png\" />\r\n    <None Remove=\"Images\\github.png\" />\r\n    <None Remove=\"Images\\help.png\" />\r\n    <None Remove=\"Images\\icon.ico\" />\r\n    <None Remove=\"Images\\paste.png\" />\r\n    <None Remove=\"Images\\play.png\" />\r\n    <None Remove=\"Images\\reload.png\" />\r\n    <None Remove=\"Images\\removebutton.png\" />\r\n    <None Remove=\"Images\\removetab.png\" />\r\n    <None Remove=\"Images\\renametab.png\" />\r\n    <None Remove=\"Images\\reorderbuttons.png\" />\r\n    <None Remove=\"Images\\reordertabs.png\" />\r\n    <None Remove=\"Images\\stop.png\" />\r\n    <None Remove=\"Images\\troubleshoot.png\" />\r\n    <None Remove=\"Images\\up.png\" />\r\n    <None Remove=\"Images\\workflow.png\" />\r\n    <None Remove=\"LICENSE.txt\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <EmbeddedResource Include=\"Documentation\\HelpDocumentation.xml\" />\r\n    <EmbeddedResource Include=\"LICENSE.txt\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <Resource Include=\"Images\\about.png\" />\r\n    <Resource Include=\"Images\\add.png\" />\r\n    <Resource Include=\"Images\\addbutton.png\" />\r\n    <Resource Include=\"Images\\addtab.png\" />\r\n    <Resource Include=\"Images\\clear.png\" />\r\n    <Resource Include=\"Images\\close.png\" />\r\n    <Resource Include=\"Images\\colortags.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag01.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag02.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag03.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag04.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag05.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag06.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag07.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag08.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag09.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag10.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag11.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag12.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag13.png\" />\r\n    <Resource Include=\"Images\\ColorTags\\tag14.png\" />\r\n    <Resource Include=\"Images\\convert.png\" />\r\n    <Resource Include=\"Images\\copy.png\" />\r\n    <Resource Include=\"Images\\down.png\" />\r\n    <Resource Include=\"Images\\editbutton.png\" />\r\n    <Resource Include=\"Images\\exit.png\" />\r\n    <Resource Include=\"Images\\find.png\" />\r\n    <Resource Include=\"Images\\folder.png\" />\r\n    <Resource Include=\"Images\\github.png\" />\r\n    <Resource Include=\"Images\\help.png\" />\r\n    <Resource Include=\"Images\\icon.ico\" />\r\n    <Resource Include=\"Images\\paste.png\" />\r\n    <Resource Include=\"Images\\play.png\" />\r\n    <Resource Include=\"Images\\reload.png\" />\r\n    <Resource Include=\"Images\\removebutton.png\" />\r\n    <Resource Include=\"Images\\removetab.png\" />\r\n    <Resource Include=\"Images\\renametab.png\" />\r\n    <Resource Include=\"Images\\reorderbuttons.png\" />\r\n    <Resource Include=\"Images\\reordertabs.png\" />\r\n    <Resource Include=\"Images\\configuration.png\" />\r\n    <Resource Include=\"Images\\stop.png\" />\r\n    <Resource Include=\"Images\\troubleshoot.png\" />\r\n    <Resource Include=\"Images\\up.png\" />\r\n    <Resource Include=\"Images\\workflow.png\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <PackageReference Include=\"HtmlAgilityPack\" Version=\"1.11.37\" />\r\n    <PackageReference Include=\"ModernWpfUis\" Version=\"1.2.0\" />\r\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.1\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <None Update=\"config.json\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonArguments.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonDescription.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonScript.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonScriptPathType.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonScriptType.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpAddActionButtonText.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsAdd.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsCopy.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsEdit.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsPaste.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsRemove.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockButtonsReorder.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockTabsAdd.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockTabsRemove.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationBlockTabsRename.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationClearEventsWhenReload.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationConsoleBackground.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationConsoleForeground.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationConsoleIgnoreColorTags.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationDefaultCMDPath.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationDefaultPowershellPath.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideAbout.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideClearEventsList.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideColorTags.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideFileOpenAppFolder.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideFileReloadConfig.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideHelp.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettings.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsConfiguration.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflow.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowAddButtonToCurrentTab.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowAddTab.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowRemoveCurrentTab.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowRenameCurrentTab.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowReorderButtonsInCurrentTab.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideSettingsWorkflowReorderTabs.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationHideTroubleshooting.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Update=\"Documentation\\Videos\\HelpConfigurationPowerShellArguments.mp4\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n  </ItemGroup>\r\n  \r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\WpfRichText\\WpfRichText.csproj\" />\r\n  </ItemGroup>\r\n\r\n</Project>\r\n"
  },
  {
    "path": "EasyJob/EasyJob.csproj.user",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"Current\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup />\r\n  <ItemGroup>\r\n    <ApplicationDefinition Update=\"App.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </ApplicationDefinition>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Update=\"Windows\\AddActionButtonDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\AnswerDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\ColorTagsDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\ConfigurationDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\EditActionButtonDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\HelpDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\NewTabDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\RenameTabDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\ReorderActionButtonsDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\ReorderTabsDialog.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Update=\"Windows\\TroubleshootingWindow.xaml.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Page Update=\"MainWindow.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\AboutDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\AddActionButtonDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\AnswerDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\ColorTagsDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\ConfigurationDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\EditActionButtonDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\HelpDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\NewTabDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\RenameTabDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\ReorderActionButtonsDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\ReorderTabsDialog.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n    <Page Update=\"Windows\\TroubleshootingWindow.xaml\">\r\n      <SubType>Designer</SubType>\r\n    </Page>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "EasyJob/EasyJobPS/EasyJobPS.psd1",
    "content": "# Module manifest for module 'EasyJobPS'\r\n# Generated by: Akshin Mustafayev\r\n# Generated on: 10/8/2021\r\n\r\n@{\r\n\r\n    # Script module or binary module file associated with this manifest.\r\n    RootModule        = 'EasyJobPS.psm1'\r\n    \r\n    # Version number of this module.\r\n    ModuleVersion     = '1.0'\r\n    \r\n    # ID used to uniquely identify this module\r\n    GUID              = 'd6c56376-ae08-4c23-b901-9bc75144e0c6'\r\n    \r\n    # Author of this module\r\n    Author            = 'Akshin Mustafayev'\r\n    \r\n    # Company or vendor of this module\r\n    CompanyName       = 'Akshin Mustafayev'\r\n    \r\n    # Copyright statement for this module\r\n    Copyright         = '(c) 2021 Akshin Mustafayev. Apache-2.0 license.'\r\n    \r\n    # Description of the functionality provided by this module\r\n    Description       = 'Module for implementing EasyJob additional helper functions'\r\n    \r\n    # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.\r\n    FunctionsToExport = 'Show-EJInputBox'\r\n    \r\n}"
  },
  {
    "path": "EasyJob/EasyJobPS/EasyJobPS.psm1",
    "content": "[void][Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')\r\n\r\nfunction Show-EJInputBox {\r\n    <#\r\n        .SYNOPSIS\r\n        Shows Input-Box for you script.\r\n\r\n        .DESCRIPTION\r\n        Shows Input-Box for you script. This might be necessary\r\n        when you want to get som input while executing your script,\r\n        since EasyJob does not support Read from console.\r\n\r\n        .PARAMETER Title\r\n        Specifies Title for message box.\r\n\r\n        .PARAMETER Message\r\n        Specifies Message for message box.\r\n\r\n        .INPUTS\r\n        None.\r\n\r\n        .OUTPUTS\r\n        String value of the input from the box.\r\n\r\n        .EXAMPLE\r\n        C:\\PS> $Result = Show-EJInputBox -Title \"Specify your name\" -Message \"What is your name?\"\r\n        C:\\PS> Write-Host \"Your name is $Result\"\r\n        Your name is test\r\n\r\n        .LINK\r\n        https://github.com/akshinmustafayev/EasyJob\r\n    #>\r\n\r\n    param (\r\n        [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()] [string]$Title,\r\n        [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()] [string]$Message\r\n    )\r\n    \r\n    $Result = [Microsoft.VisualBasic.Interaction]::InputBox($Message, $Title)\r\n    return $Result\r\n}"
  },
  {
    "path": "EasyJob/LICENSE.txt",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>."
  },
  {
    "path": "EasyJob/MainWindow.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.MainWindow\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:wpfRichTextBox=\"clr-namespace:WpfRichText;assembly=WpfRichText\"\r\n        xmlns:ej=\"clr-namespace:EasyJob.Windows\"\r\n        xmlns:local=\"clr-namespace:EasyJob\" \r\n        xmlns:myAttachedProperties=\"clr-namespace:EasyJob.Utils\" \r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"EasyJob Executor\" Height=\"450\" Width=\"800\" WindowStartupLocation=\"CenterScreen\">\r\n    <Window.Resources>\r\n        <ContextMenu x:Key=\"OnTabContextMenu\">\r\n            <MenuItem Header=\"_Add tab\" Click=\"ContextMenuAddTab_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/addtab.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"_Remove tab\" Click=\"ContextMenuRemoveTab_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/removetab.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"Re_name tab\" Click=\"ContextMenuRenameTab_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/renametab.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n        </ContextMenu>\r\n        <ContextMenu x:Key=\"OnActionButtonPannelContextMenu\">\r\n            <MenuItem Header=\"_Add button\" Click=\"ContextMenuAddActionButton_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/addbutton.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"Re_order buttons\" Click=\"ContextMenuReorderActionButtons_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/reorderbuttons.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"_Paste button\" IsEnabled=\"False\" Click=\"ContextMenuPasteActionButton_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/paste.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n        </ContextMenu>\r\n        <ContextMenu x:Key=\"OnActionButtonContextMenu\">\r\n            <MenuItem Header=\"_Edit button\" Click=\"ContextMenuEditActionButton_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/editbutton.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"_Remove button\" Click=\"ContextMenuRemoveActionButton_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/removebutton.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n            <MenuItem Header=\"_Copy button\" Click=\"ContextMenuCopyActionButton_Click\">\r\n                <MenuItem.Icon>\r\n                    <Image Source=\"pack://application:,,,/Images/copy.png\"/>\r\n                </MenuItem.Icon>\r\n            </MenuItem>\r\n        </ContextMenu>\r\n    </Window.Resources>\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"Auto\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n            <RowDefinition Height=\"7\"/>\r\n            <RowDefinition Height=\"84\"/>\r\n        </Grid.RowDefinitions>\r\n        <Menu Grid.Row=\"0\" FlowDirection=\"LeftToRight\" IsMainMenu=\"True\">\r\n            <MenuItem Header=\"_File\" Focusable=\"False\" IsTabStop=\"False\">\r\n                <MenuItem Name=\"FileReloadConfigMenuItem\" Header=\"Re_load config\" Click=\"ReloadConfigMenuItem_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/reload.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n                <MenuItem Name=\"FileOpenAppFolderMenuItem\" Header=\"_Open app folder\" Click=\"OpenAppFolderMenuItem_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/folder.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n                <MenuItem Name=\"FileClearEventsLogListMenuItem\" Header=\"_Clear events list\" Click=\"ClearEventsLogListMenuItem_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/clear.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n                <Separator Name=\"FileSeparator1\"/>\r\n                <MenuItem Name=\"FileExitMenuItem\" Header=\"E_xit\" Click=\"ExitMenuItem_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/exit.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n            </MenuItem>\r\n            <MenuItem Name=\"SettingsMenuItem\" Header=\"_Settings\" Focusable=\"False\" IsTabStop=\"False\">\r\n                <MenuItem Name=\"SettingsWorkflowMenuItem\" Header=\"_Workflow\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/workflow.png\"/>\r\n                    </MenuItem.Icon>\r\n                    <MenuItem Name=\"SettingsWorkflowReorderTabsMenuItem\" Header=\"Re_order tabs\" Click=\"ReorderTabsMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/reordertabs.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                    <MenuItem Name=\"SettingsWorkflowAddTabMenuItem\" Header=\"_Add tab\" Click=\"AddTabMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/addtab.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                    <MenuItem Name=\"SettingsWorkflowRemoveCurrentTabMenuItem\" Header=\"Remo_ve current tab\" Click=\"RemoveCurrentTabMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/removetab.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                    <MenuItem Name=\"SettingsWorkflowRenameCurrentTabMenuItem\" Header=\"_Rename current tab\" Click=\"RenameCurrentTabMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/renametab.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                    <MenuItem Name=\"SettingsWorkflowAddButtonToCurrentTabMenuItem\" Header=\"Add _button to current tab\" Click=\"AddButtonToCurrentTabMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/addbutton.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                    <MenuItem Name=\"SettingsWorkflowReorderButtonsInCurrentTabMenuItem\" Header=\"R_eorder buttons in current tab\" Click=\"ReorderButtonsInCurrentTabMenuItem_Click\">\r\n                        <MenuItem.Icon>\r\n                            <Image Source=\"pack://application:,,,/Images/reorderbuttons.png\"/>\r\n                        </MenuItem.Icon>\r\n                    </MenuItem>\r\n                </MenuItem>\r\n                <MenuItem Name=\"SettingsConfigurationMenuItem\" Header=\"_Configuration\" Click=\"ConfigurationMenuItem_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/configuration.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n            </MenuItem>\r\n            <MenuItem Name=\"HelpMenuItem\" Header=\"_Help\" Focusable=\"False\" IsTabStop=\"False\">\r\n                <MenuItem Name=\"HelpTroubleshootingMenuItem\" Header=\"_Troubleshooting\" Click=\"MenuTroubleshooting_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/troubleshoot.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n                <MenuItem Name=\"HelpColorTagsMenuItem\" Header=\"_Color tags\" Click=\"MenuColorTags_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/colortags.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n                <MenuItem Name=\"HelpAboutMenuItem\" Header=\"_About\" Click=\"MenuAbout_Click\">\r\n                    <MenuItem.Icon>\r\n                        <Image Source=\"pack://application:,,,/Images/about.png\"/>\r\n                    </MenuItem.Icon>\r\n                </MenuItem>\r\n            </MenuItem>\r\n        </Menu>\r\n        <TabControl x:Name=\"MainTab\" Grid.Row=\"1\">\r\n            <TabControl.ItemTemplate>\r\n                <DataTemplate>\r\n                    <Label AutomationProperties.Name=\"{Binding TabHeader}\" Content=\"{Binding TabHeader}\" Name=\"TabHeaderSelector\" PreviewMouseDown=\"OnTabHeader_PreviewMouseDown\"/>\r\n                </DataTemplate>\r\n            </TabControl.ItemTemplate>\r\n            <TabControl.ContentTemplate>\r\n                <DataTemplate>\r\n                    <Grid>\r\n                        <Grid.RowDefinitions>\r\n                            <RowDefinition Height=\"Auto\"/>\r\n                            <RowDefinition Height=\"7\"/>\r\n                            <RowDefinition Height=\"*\"/>\r\n                            <RowDefinition Height=\"Auto\"/>\r\n                        </Grid.RowDefinitions>\r\n                        <ScrollViewer Focusable=\"False\" IsTabStop=\"False\" x:Name=\"MainScroll\" Grid.Row=\"0\" Background=\"#F7F7F7\" VerticalScrollBarVisibility=\"Auto\" HorizontalScrollBarVisibility=\"Auto\" PreviewMouseDown=\"OnActionButtonPannel_PreviewMouseDown\">\r\n                            <ItemsControl ItemsSource=\"{Binding TabActionButtons}\" Margin=\"8\">\r\n                                <ItemsControl.ItemsPanel>\r\n                                    <ItemsPanelTemplate>\r\n                                        <WrapPanel Orientation=\"Horizontal\" MaxWidth=\"{Binding ActualWidth, ElementName=MainScroll}\" Margin=\"0,0,-10,0\"/>\r\n                                    </ItemsPanelTemplate>\r\n                                </ItemsControl.ItemsPanel>\r\n                                <ItemsControl.ItemTemplate>\r\n                                    <DataTemplate>\r\n                                        <Button AutomationProperties.Name=\"{Binding ButtonText}\" Margin=\"0,5,5,0\" Padding=\"5\" Content=\"{Binding ButtonText}\" Click=\"ActionButton_Click\" PreviewMouseDown=\"ActionButton_PreviewMouseDown\">\r\n                                            <Button.ToolTip>\r\n                                                <ToolTip Focusable=\"False\" IsTabStop=\"False\" Content=\"{Binding ButtonDescription}\" />\r\n                                            </Button.ToolTip>\r\n                                        </Button>\r\n                                    </DataTemplate>\r\n                                </ItemsControl.ItemTemplate>\r\n                            </ItemsControl>\r\n                        </ScrollViewer>\r\n                        <GridSplitter Grid.Row=\"1\" Height=\"5\" HorizontalAlignment=\"Stretch\"/>\r\n                        <ScrollViewer IsTabStop=\"False\" Focusable=\"False\" Grid.Row=\"2\" myAttachedProperties:ScrollViewerExtensions.AlwaysScrollToEnd=\"True\">\r\n                            <wpfRichTextBox:RichTextEditor Text=\"{Binding Path=TabTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" AutomationProperties.Name=\"Content\" FontFamily=\"Consolas\" Background=\"{Binding Path=ConsoleBackground}\" Foreground=\"{Binding Path=ConsoleForeground}\"/>\r\n                            <!--<TextBox Text=\"{Binding Path=TabTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" TextWrapping=\"Wrap\" AcceptsReturn=\"True\" FontFamily=\"Consolas\" Background=\"{Binding Path=ConsoleBackground}\" Foreground=\"{Binding Path=ConsoleForeground}\" VerticalScrollBarVisibility=\"Visible\" HorizontalScrollBarVisibility=\"Disabled\"/>-->\r\n                        </ScrollViewer>\r\n                        <Grid Grid.Row=\"3\" Margin=\"0,5,0,5\">\r\n                            <Grid.ColumnDefinitions>\r\n                                <ColumnDefinition Width=\"Auto\"/>\r\n                                <ColumnDefinition Width=\"*\"/>\r\n                                <ColumnDefinition Width=\"30\"/>\r\n                                <ColumnDefinition Width=\"30\"/>\r\n                            </Grid.ColumnDefinitions>\r\n                            <Button AutomationProperties.Name=\"Clear content\" Grid.Column=\"0\" Margin=\"10,0,5,0\" Padding=\"5\" Content=\"_Clear Output\" Click=\"ClearOutputButton_Click\" />\r\n                            <Button AutomationProperties.Name=\"Scroll to top\" x:Name=\"ScrollToTopButton\" Grid.Column=\"2\" Margin=\"0,0,5,0\" Padding=\"5\" Click=\"ScrollToTopButton_Click\">\r\n                                <Image Source=\"pack://application:,,,/Images/up.png\" Margin=\"-1\"/>\r\n                            </Button>\r\n                            <Button AutomationProperties.Name=\"Scroll to bottom\" x:Name=\"ScrollToBottomButton\" Grid.Column=\"3\"  Margin=\"0,0,5,0\" Padding=\"5\" Click=\"ScrollToBottomButton_Click\">\r\n                                <Image Source=\"pack://application:,,,/Images/down.png\" Margin=\"-1\"/>\r\n                            </Button>\r\n                        </Grid>\r\n                    </Grid>\r\n                </DataTemplate>\r\n            </TabControl.ContentTemplate>\r\n        </TabControl>\r\n        <GridSplitter Focusable=\"False\" IsTabStop=\"False\" Grid.Row=\"2\" Height=\"5\" HorizontalAlignment=\"Stretch\"/>\r\n        <Grid Grid.Row=\"3\">\r\n            <Grid.ColumnDefinitions>\r\n                <ColumnDefinition Width=\"*\"/>\r\n                <ColumnDefinition Width=\"7\"/>\r\n                <ColumnDefinition Width=\"250\"/>\r\n            </Grid.ColumnDefinitions>\r\n            <ListBox AutomationProperties.Name=\"Events list\" Grid.Column=\"0\" x:Name=\"EventsList\" ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\">\r\n                <ListBox.ItemTemplate>\r\n                    <DataTemplate>\r\n                        <Grid>\r\n                            <TextBlock Text=\"{Binding}\" TextWrapping=\"Wrap\"/>\r\n                        </Grid>\r\n                    </DataTemplate>\r\n                </ListBox.ItemTemplate>\r\n            </ListBox>\r\n            <GridSplitter Focusable=\"False\" IsTabStop=\"False\" Grid.Column=\"1\" Width=\"5\" HorizontalAlignment=\"Stretch\"/>\r\n            <ListBox AutomationProperties.Name=\"Tasks list\" x:Name=\"TasksList\" Grid.Column=\"2\">\r\n                <ListBox.ItemTemplate>\r\n                    <DataTemplate>\r\n                        <StackPanel Margin=\"2\" Orientation=\"Horizontal\">\r\n                            <Button AutomationProperties.Name=\"Stop task\" Name=\"TasksListStop\" Margin=\"0\" Height=\"25\" Width=\"25\" Click=\"TasksListStop_Click\">\r\n                                <StackPanel Focusable=\"False\"  VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                                    <Image Source=\"pack://application:,,,/Images/close.png\" Margin=\"-6,-2,-6,-2\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                                </StackPanel>\r\n                            </Button>\r\n                            <TextBlock Margin=\"10 0 2 0\" Text=\"{Binding Path=TaskID, Mode=TwoWay}\" HorizontalAlignment=\"Left\" Foreground=\"Blue\"/>\r\n                            <TextBlock Margin=\"5 0 2 0\" Text=\"{Binding Path=TaskFile, Mode=TwoWay}\" HorizontalAlignment=\"Left\"/>\r\n                        </StackPanel>\r\n                    </DataTemplate>\r\n                </ListBox.ItemTemplate>\r\n            </ListBox>\r\n        </Grid>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/MainWindow.xaml.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.Diagnostics;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing EasyJob.Serialization;\r\nusing EasyJob.Serialization.AnswerDialog;\r\nusing EasyJob.Serialization.TasksList;\r\nusing EasyJob.TabItems;\r\nusing EasyJob.Utils;\r\nusing EasyJob.Windows;\r\nusing Newtonsoft.Json;\r\nusing WpfRichText;\r\n\r\nnamespace EasyJob\r\n{\r\n    public partial class MainWindow : Window\r\n    {\r\n        ActionButton actionButtonForCopy = null;\r\n        TabData selectedTabItem = null;\r\n        ActionButton selectedActionButton = null;\r\n        ObservableCollection<TaskListTask> tasksList = new ObservableCollection<TaskListTask>();\r\n        public Config config;\r\n\r\n        public MainWindow()\r\n        {\r\n            InitializeComponent();\r\n            LoadConfig();\r\n            MainMenuItemsVisibility();\r\n        }\r\n\r\n        public void LoadConfig()\r\n        {\r\n            if (File.Exists(ConfigUtils.ConfigJsonPath))\r\n            {\r\n                try\r\n                {\r\n                    string configJson = File.ReadAllText(ConfigUtils.ConfigJsonPath);\r\n                    config = JsonConvert.DeserializeObject<Config>(configJson);\r\n\r\n                    MainTab.ItemsSource = ConfigUtils.ConvertTabsFromConfigToUI(config);\r\n\r\n                    AddTextToEventsList(\"Config loaded from file: \" + ConfigUtils.ConfigJsonPath, false);\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(ex.Message, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\r\n                    AddTextToEventsList(\"Error occured while loading file: \" + ex.Message, false);\r\n                }\r\n            }\r\n            else\r\n            {\r\n                MessageBox.Show(\"File \" + ConfigUtils.ConfigJsonPath + \" does not exist.\", \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\r\n            }\r\n        }\r\n\r\n        public bool SaveConfig()\r\n        {\r\n            if (File.Exists(ConfigUtils.ConfigJsonPath))\r\n            {\r\n                try\r\n                {\r\n                    IEnumerable<TabData> tabs = (IEnumerable<TabData>)MainTab.ItemsSource;\r\n\r\n                    config.tabs.Clear();\r\n\r\n                    List<ConfigTab> configTabs = new List<ConfigTab>();\r\n                    List<ConfigButton> buttons = null;\r\n                    List<ConfigArgument> configArguments = null;\r\n\r\n                    foreach (TabData tab in tabs)\r\n                    {\r\n                        buttons = new List<ConfigButton>();\r\n                        foreach (ActionButton button in tab.TabActionButtons)\r\n                        {\r\n                            configArguments = new List<ConfigArgument>();\r\n                            foreach (Answer answer in button.ButtonArguments)\r\n                            {\r\n                                configArguments.Add(new ConfigArgument(answer.AnswerQuestion, answer.AnswerResult));\r\n                            }\r\n\r\n                            buttons.Add(new ConfigButton(button.ID, button.ButtonText, button.ButtonDescription, button.ButtonScript, button.ButtonScriptPathType, button.ButtonScriptType, configArguments));\r\n                        }\r\n\r\n                        configTabs.Add(new ConfigTab(tab.ID, tab.TabHeader, buttons));\r\n                    }\r\n\r\n                    config.tabs = configTabs;\r\n\r\n                    if (ConfigUtils.SaveFromConfigToFile(config) == true)\r\n                    {\r\n                        return true;\r\n                    }\r\n                    else\r\n                    {\r\n                        return false;\r\n                    }\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(ex.Message, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\r\n                    return false;\r\n                }\r\n            }\r\n            else\r\n            {\r\n                SaveConfig();\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        private void MainMenuItemsVisibility()\r\n        {\r\n            // File\r\n            if (config.restrictions.hide_menu_item_file_reload_config == true) { FileReloadConfigMenuItem.Visibility = Visibility.Collapsed; } else { FileReloadConfigMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_file_open_app_folder == true) { FileOpenAppFolderMenuItem.Visibility = Visibility.Collapsed; } else { FileOpenAppFolderMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_file_clear_events_list == true) { FileClearEventsLogListMenuItem.Visibility = Visibility.Collapsed; } else { FileClearEventsLogListMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_file_reload_config == true && config.restrictions.hide_menu_item_file_open_app_folder == true && config.restrictions.hide_menu_item_file_clear_events_list == true) { FileSeparator1.Visibility = Visibility.Collapsed; } else { FileSeparator1.Visibility = Visibility.Visible; }\r\n\r\n            // Settings\r\n            if (config.restrictions.hide_menu_item_settings == true) { SettingsMenuItem.Visibility = Visibility.Collapsed; } else { SettingsMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow == true) { SettingsWorkflowMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_reorder_tabs == true) { SettingsWorkflowReorderTabsMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowReorderTabsMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_add_tab == true) { SettingsWorkflowAddTabMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowAddTabMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_remove_current_tab == true) { SettingsWorkflowRemoveCurrentTabMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowRemoveCurrentTabMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_rename_current_tab == true) { SettingsWorkflowRenameCurrentTabMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowRenameCurrentTabMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_add_button_to_current_tab == true) { SettingsWorkflowAddButtonToCurrentTabMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowAddButtonToCurrentTabMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_workflow_reorder_buttons_in_current_tab == true) { SettingsWorkflowReorderButtonsInCurrentTabMenuItem.Visibility = Visibility.Collapsed; } else { SettingsWorkflowReorderButtonsInCurrentTabMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_settings_configuration == true) { SettingsConfigurationMenuItem.Visibility = Visibility.Collapsed; } else { SettingsConfigurationMenuItem.Visibility = Visibility.Visible; }\r\n\r\n            // Help\r\n            if (config.restrictions.hide_menu_item_help == true) { HelpMenuItem.Visibility = Visibility.Collapsed; } else { HelpMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_help_troubleshooting == true) { HelpTroubleshootingMenuItem.Visibility = Visibility.Collapsed; } else { HelpTroubleshootingMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_help_colortags == true) { HelpColorTagsMenuItem.Visibility = Visibility.Collapsed; } else { HelpColorTagsMenuItem.Visibility = Visibility.Visible; }\r\n            if (config.restrictions.hide_menu_item_help_about == true) { HelpAboutMenuItem.Visibility = Visibility.Collapsed; } else { HelpAboutMenuItem.Visibility = Visibility.Visible; }\r\n        }\r\n\r\n        private void AddTextToConsole (string Text, int OwnerTab)\r\n        {\r\n            if(Text == \"\" || Text == null || Text == \"Error: \")\r\n            {\r\n                return;\r\n            }\r\n\r\n            if (config.console_ignore_color_tags == false)\r\n            {\r\n                Text = CommonUtils.ApplyConsoleColorTagsToText(Text);\r\n            }\r\n\r\n            //this.Dispatcher.Invoke(() =>\r\n            //{\r\n                TabData td = (TabData)MainTab.Items[OwnerTab];\r\n                td.TabTextBoxText = td.TabTextBoxText + \"<br>\" + Text;\r\n            //});\r\n        }\r\n\r\n        public void AddTextToEventsList(string Text, bool IsAsync)\r\n        {\r\n            if (Text == \"\" || Text == null || Text == \"Error: \")\r\n            {\r\n                return;\r\n            }\r\n\r\n            if (IsAsync == true)\r\n            {\r\n                this.Dispatcher.Invoke(() =>\r\n                {\r\n                    EventsList.Items.Add(Text);\r\n                    EventsList.ScrollIntoView(EventsList.Items.Count - 1);\r\n                });\r\n            }\r\n            else\r\n            {\r\n                EventsList.Items.Add(Text);\r\n                EventsList.ScrollIntoView(EventsList.Items.Count - 1);\r\n            }\r\n        }\r\n\r\n        private void ScrollToBottomListBox(ListBox listBox, bool IsAsync)\r\n        {\r\n            if(listBox == null && listBox.Items.Count == 0)\r\n            {\r\n                return;\r\n            }\r\n\r\n            if (IsAsync == true)\r\n            {\r\n                this.Dispatcher.Invoke(() =>\r\n                {\r\n                    if (listBox != null)\r\n                    {\r\n                        var border = (Border)VisualTreeHelper.GetChild(listBox, 0);\r\n                        var scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);\r\n                        scrollViewer.ScrollToBottom();\r\n                    }\r\n                });\r\n            }\r\n            else\r\n            {\r\n                if (listBox != null)\r\n                {\r\n                    var border = (Border)VisualTreeHelper.GetChild(listBox, 0);\r\n                    var scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);\r\n                    scrollViewer.ScrollToBottom();\r\n                }\r\n            }\r\n        }\r\n\r\n        private void RemoveTaskFromTasksList(int ProcessID, bool IsAsync)\r\n        {\r\n            if (IsAsync == true)\r\n            {\r\n                this.Dispatcher.Invoke(() =>\r\n                {\r\n                    ObservableCollection<TaskListTask> taskListsNew = new ObservableCollection<TaskListTask>();\r\n                    foreach (TaskListTask tlt in tasksList)\r\n                    {\r\n                        if (tlt.TaskID == ProcessID)\r\n                        {\r\n                            continue;\r\n                        }\r\n                        taskListsNew.Add(new TaskListTask { TaskID = tlt.TaskID });\r\n                    }\r\n                    tasksList = taskListsNew;\r\n                    TasksList.ItemsSource = taskListsNew;\r\n                });\r\n            }\r\n            else\r\n            {\r\n                ObservableCollection<TaskListTask> taskListsNew = new ObservableCollection<TaskListTask>();\r\n                foreach (TaskListTask tlt in tasksList)\r\n                {\r\n                    if (tlt.TaskID == ProcessID)\r\n                    {\r\n                        continue;\r\n                    }\r\n                    taskListsNew.Add(new TaskListTask { TaskID = tlt.TaskID });\r\n                }\r\n                tasksList = taskListsNew;\r\n                TasksList.ItemsSource = taskListsNew;\r\n            }\r\n        }\r\n\r\n        private void AddTaskToTasksList(int ProcessID, string ProcessFileName)\r\n        {\r\n            tasksList.Add(new TaskListTask { TaskID = ProcessID, TaskFile = ProcessFileName });\r\n            TasksList.ItemsSource = tasksList;\r\n        }\r\n\r\n        private string GetScriptPath(string ButtonScript, string ButtonScriptPathType)\r\n        {\r\n            string scriptPath = \"\";\r\n            if (ButtonScriptPathType.ToLower() == \"absolute\")\r\n            {\r\n                scriptPath = ButtonScript;\r\n            }\r\n            else if (ButtonScriptPathType.ToLower() == \"relative\")\r\n            {\r\n                scriptPath = AppDomain.CurrentDomain.BaseDirectory + ButtonScript;\r\n            }\r\n            else\r\n            {\r\n                scriptPath = ButtonScript;\r\n            }\r\n            return scriptPath;\r\n        }\r\n\r\n        private string GetPowerShellArguments(string Arguments)\r\n        {\r\n            string arguments = \"\";\r\n            \r\n            if(Arguments.Length > 0)\r\n            {\r\n                arguments = \" \" + Arguments + \" \";\r\n            }\r\n\r\n            return arguments;\r\n        }\r\n\r\n        private void ShowAddButtonDialog()\r\n        {\r\n            AddActionButtonDialog aabd = new AddActionButtonDialog();\r\n            if (aabd.ShowDialog() == true)\r\n            {\r\n                if (MainTab.Items[MainTab.SelectedIndex] is TabData button)\r\n                {\r\n                    List<Answer> answers = new List<Answer>();\r\n                    foreach (ConfigArgument ca in aabd.configButton.Arguments)\r\n                    {\r\n                        answers.Add(new Answer { AnswerQuestion = ca.ArgumentQuestion, AnswerResult = ca.ArgumentAnswer });\r\n                    }\r\n                    button.TabActionButtons.Add(new ActionButton { ButtonText = aabd.configButton.Text, ButtonDescription = aabd.configButton.Description, ButtonScript = aabd.configButton.Script, ButtonScriptPathType = aabd.configButton.ScriptPathType, ButtonScriptType = aabd.configButton.ScriptType, ButtonArguments = answers });\r\n                }\r\n\r\n                if (SaveConfig())\r\n                {\r\n                    MainTab.Items.Refresh();\r\n                    this.UpdateLayout();\r\n                    AddTextToEventsList(\"Button '\" + aabd.configButton.Text + \"' has been successfully added\", false);\r\n                }\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Adding button cancelled by user\", false);\r\n            }\r\n        }\r\n\r\n        private void ShowRenameTabDialog(int SelectedTab, string SelectedTabHeader)\r\n        {\r\n            RenameTabDialog rtd = new RenameTabDialog(SelectedTabHeader);\r\n            if (rtd.ShowDialog() == true)\r\n            {\r\n                List<TabData> newSourceTabs = new List<TabData>();\r\n                foreach (TabData tab in MainTab.Items)\r\n                {\r\n                    TabData currentTab = MainTab.Items[SelectedTab] as TabData;\r\n                    if (tab == currentTab)\r\n                    {\r\n                        tab.TabHeader = rtd.NewTabName;\r\n                    }\r\n                    newSourceTabs.Add(tab);\r\n                }\r\n\r\n                MainTab.ItemsSource = null;\r\n                MainTab.ItemsSource = newSourceTabs;\r\n\r\n                if (SaveConfig())\r\n                {\r\n                    MainTab.Items.Refresh();\r\n                    this.UpdateLayout();\r\n                }\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Current tab rename cancelled by user\", false);\r\n            }\r\n        }\r\n\r\n        private void ShowAddNewTabDialog()\r\n        {\r\n            NewTabDialog ntd = new NewTabDialog();\r\n            if(ntd.ShowDialog() == true)\r\n            {\r\n                LoadConfig();\r\n\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Adding new Tab cancelled by user\", false);\r\n            }\r\n        }\r\n\r\n        private void ShowReorderActionButtonsDialog()\r\n        {\r\n            int currentTab = MainTab.SelectedIndex;\r\n\r\n            ReorderActionButtonsDialog rabd = new ReorderActionButtonsDialog(MainTab.SelectedIndex, config);\r\n            rabd.ShowDialog();\r\n\r\n            if (rabd.changesOccured)\r\n            {\r\n                LoadConfig();\r\n\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n                AddTextToEventsList(\"Reorder action buttons dialog ended!\", false);\r\n                MainTab.SelectedIndex = currentTab;\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Reorder action buttons dialog ended. No changes occured!\", false);\r\n            }\r\n        }\r\n\r\n        public void ClearOutputButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            TabData td = (TabData)MainTab.SelectedItem;\r\n            td.TabTextBoxText = \"\";\r\n            AddTextToEventsList(\"Output has been cleared!\", false);\r\n        }\r\n\r\n        public AnswerData ConvertArgumentsToAnswers(List<Answer> Answers)\r\n        {\r\n            AnswerData answerData = new AnswerData();\r\n            answerData.Answers = Answers;\r\n            return answerData;\r\n        }\r\n\r\n        public string ConvertArgumentsToPowerShell(List<Answer> Answers)\r\n        {\r\n            string powerShellArguments = \"\";\r\n            foreach (Answer answer in Answers)\r\n            {\r\n                powerShellArguments = powerShellArguments + answer.AnswerResult + \" \";\r\n            }\r\n\r\n            if (powerShellArguments.EndsWith(\" \"))\r\n            {\r\n                powerShellArguments = powerShellArguments.Remove(powerShellArguments.Length - 1);\r\n            }\r\n\r\n            return powerShellArguments;\r\n        }\r\n\r\n        public string ConvertArgumentsToCMD(List<Answer> Answers)\r\n        {\r\n            string powerShellArguments = \"\";\r\n            foreach (Answer answer in Answers)\r\n            {\r\n                powerShellArguments = powerShellArguments + answer.AnswerResult + \" \";\r\n            }\r\n\r\n            if (powerShellArguments.EndsWith(\" \"))\r\n            {\r\n                powerShellArguments = powerShellArguments.Remove(powerShellArguments.Length - 1);\r\n            }\r\n\r\n            return powerShellArguments;\r\n        }\r\n\r\n        public string RemoveScriptFileFromPath(string ScriptPath)\r\n        {\r\n            string[] scriptPathSplits = ScriptPath.Split(\"\\\\\");\r\n            string newScriptPath = \"\";\r\n\r\n            if(scriptPathSplits.Length > 0)\r\n            {\r\n                for (int i = 0; i < scriptPathSplits.Length - 1; i++)\r\n                {\r\n                    newScriptPath += scriptPathSplits[i] + \"\\\\\";\r\n                }\r\n            }\r\n\r\n            return newScriptPath;\r\n        }\r\n\r\n        public async void ActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            Button actionButton = sender as Button;\r\n            string buttonScript = ((ActionButton)actionButton.DataContext).ButtonScript;\r\n            string buttonScriptPathType = ((ActionButton)actionButton.DataContext).ButtonScriptPathType;\r\n            string buttonScriptType = ((ActionButton)actionButton.DataContext).ButtonScriptType;\r\n            string scriptPath = GetScriptPath(buttonScript, buttonScriptPathType);\r\n            string powershellArguments = GetPowerShellArguments(config.powershell_arguments);\r\n            int ownerTab = MainTab.SelectedIndex;\r\n\r\n            if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))\r\n            {\r\n                try\r\n                {\r\n                    Process.Start(\"explorer.exe\", GetScriptPath(RemoveScriptFileFromPath(buttonScript), buttonScriptPathType));\r\n                    AddTextToEventsList(\"Opened script location folder: \" + GetScriptPath(RemoveScriptFileFromPath(buttonScript), buttonScriptPathType), false);\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(ex.Message);\r\n                    AddTextToEventsList(\"Could not open script location folder: \" + ex.Message, false);\r\n                }\r\n                return;\r\n            }\r\n\r\n            if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))\r\n            {\r\n                try\r\n                {\r\n                    Process.Start(\"explorer.exe\", scriptPath);\r\n                    AddTextToEventsList(\"Opened script : \" + scriptPath, false);\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(ex.Message);\r\n                    AddTextToEventsList(\"Could not open script: \" + ex.Message, false);\r\n                }\r\n                return;\r\n            }\r\n\r\n            List<Answer> buttonArguments = ((ActionButton)actionButton.DataContext).ButtonArguments;\r\n            AddTextToConsole(\"Start script: \" + scriptPath + \"<br><span style=\\\"color:yellow;\\\">=====================================================================</span><br>\", ownerTab);\r\n            AddTextToEventsList(\"Execution of \" + scriptPath + \" has been started.\", false);\r\n\r\n            if (buttonArguments.Count == 0)\r\n            {\r\n                AddTextToEventsList(\"Starting script \" + scriptPath, false);\r\n                if (buttonScriptType.ToLower() == \"powershell\")\r\n                {\r\n                    await RunProcessAsync(config.default_powershell_path, powershellArguments + \"-File \\\"\" + scriptPath + \"\\\"\", ownerTab, buttonScript);\r\n                }\r\n                else\r\n                {\r\n                    await RunProcessAsync(config.default_cmd_path, \"/c \\\"\" + scriptPath + \"\\\"\", ownerTab, buttonScript);\r\n                }\r\n            }\r\n            else\r\n            {\r\n                AnswerDialog dialog = new AnswerDialog(ConvertArgumentsToAnswers(buttonArguments));\r\n                if (dialog.ShowDialog() == true)\r\n                {\r\n                    AddTextToEventsList(\"Starting script\" + scriptPath, false);\r\n                    if (buttonScriptType.ToLower() == \"powershell\")\r\n                    {\r\n                        await RunProcessAsync(config.default_powershell_path, powershellArguments + \"-File \\\"\" + scriptPath + \"\\\" \" + ConvertArgumentsToPowerShell(dialog.answerData.Answers), ownerTab, buttonScript);\r\n                    }\r\n                    else\r\n                    {\r\n                        await RunProcessAsync(config.default_cmd_path, powershellArguments + \"/c \\\"\" + scriptPath + \"\\\" \" + ConvertArgumentsToCMD(dialog.answerData.Answers), ownerTab, buttonScript);\r\n                    }\r\n                }\r\n                else\r\n                {\r\n                    AddTextToEventsList(\"Task cancelled by user\", false);\r\n                    AddTextToConsole(\"Task cancelled by user!\", ownerTab);\r\n                }\r\n            }\r\n        }\r\n\r\n        public async Task<int> RunProcessAsync(string FileName, string Args, int OwnerTab, string ScriptName)\r\n        {\r\n            using (var process = new Process\r\n            {\r\n                StartInfo =\r\n                {\r\n                    FileName = FileName, Arguments = Args,\r\n                    UseShellExecute = false, CreateNoWindow = true,\r\n                    RedirectStandardOutput = true, RedirectStandardError = true\r\n                },\r\n                EnableRaisingEvents = true\r\n            })\r\n            {\r\n                return await RunProcessAsync(process, OwnerTab, ScriptName).ConfigureAwait(false);\r\n            }\r\n        }\r\n\r\n        private Task<int> RunProcessAsync(Process process, int OwnerTab, string ScriptName)\r\n        {\r\n            var tcs = new TaskCompletionSource<int>();\r\n\r\n            // Process Exited\r\n            process.Exited += (s, ea) =>\r\n            {\r\n                RemoveTaskFromTasksList(process.Id, true);\r\n                tcs.SetResult(process.ExitCode);\r\n                AddTextToConsole(\"<br><span style=\\\"color:yellow;\\\">Task finished!</span><br>\", OwnerTab);\r\n                AddTextToEventsList(\"Task \" + process.StartInfo.Arguments.Replace(\"-File \", \"\") + \" finished\", true);\r\n                ScrollToBottomListBox(EventsList, true);\r\n            };\r\n\r\n            // Process Output data received\r\n            process.OutputDataReceived += (s, ea) => {\r\n                AddTextToConsole(ea.Data, OwnerTab); \r\n            };\r\n\r\n            // Process Error output received\r\n            process.ErrorDataReceived += (s, ea) => {\r\n\r\n                if (ea.Data != null)\r\n                {\r\n                    if (ea.Data != \"\")\r\n                    {\r\n                        AddTextToConsole(\"<span style=\\\"color:red;\\\">Error: \" + ea.Data + \"</span>\", OwnerTab);\r\n                        AddTextToEventsList(\"Task \" + process.StartInfo.Arguments.Replace(\"-File \", \"\") + \" failed\", true);\r\n                    }\r\n                }\r\n            };\r\n\r\n            // Start the process\r\n            bool started = process.Start();\r\n            if (!started)\r\n            {\r\n                throw new InvalidOperationException(\"Could not start process: \" + process);\r\n            }\r\n\r\n            // Add to tasks list\r\n            AddTaskToTasksList(process.Id, ScriptName.Split(\"\\\\\")[ScriptName.Split(\"\\\\\").Length - 1]);\r\n\r\n            // Begin to read data from the output\r\n            process.BeginOutputReadLine();\r\n            process.BeginErrorReadLine();\r\n\r\n            return tcs.Task;\r\n        }\r\n\r\n        private void TasksListStop_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                Button buttonStop = sender as Button;\r\n                int processID = ((TaskListTask)buttonStop.DataContext).TaskID;\r\n                Process.GetProcessById(processID).Kill();\r\n                AddTextToEventsList(\"Process has been cancelled by user!\", false);\r\n                RemoveTaskFromTasksList(processID, false);\r\n            }\r\n            catch (Exception ex) \r\n            {\r\n                MessageBox.Show(ex.Message, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\r\n                AddTextToEventsList(\"Process cancelled failed: \" + ex.Message, false);\r\n            }\r\n        }\r\n\r\n        private void ScrollToTopButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                RichTextEditor console = FindVisualChild<RichTextEditor>(MainTab);\r\n                console.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));\r\n                var scrollViewElement = console.Parent;\r\n                ScrollViewer scrollView = scrollViewElement as ScrollViewer;\r\n                scrollView.ScrollToTop();\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private void ScrollToBottomButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                RichTextEditor console = FindVisualChild<RichTextEditor>(MainTab);\r\n                console.MoveFocus(new TraversalRequest(FocusNavigationDirection.Last));\r\n                var scrollViewElement = console.Parent;\r\n                ScrollViewer scrollView = scrollViewElement as ScrollViewer;\r\n                scrollView.ScrollToBottom();\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private static T FindVisualChild<T>(DependencyObject parent) where T : DependencyObject\r\n        {\r\n            for (int childCount = 0; childCount < VisualTreeHelper.GetChildrenCount(parent); childCount++)\r\n            {\r\n                DependencyObject child = VisualTreeHelper.GetChild(parent, childCount);\r\n                if (child != null && child is T)\r\n                    return (T)child;\r\n                else\r\n                {\r\n                    T childOfChild = FindVisualChild<T>(child);\r\n                    if (childOfChild != null)\r\n                        return childOfChild;\r\n                }\r\n            }\r\n            return null;\r\n        }\r\n\r\n\r\n        #region MenuItems\r\n        private void ReloadConfigMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try \r\n            {\r\n                if (config.clear_events_when_reload == true)\r\n                {\r\n                    EventsList.Items.Clear();\r\n                }\r\n                else \r\n                {\r\n                    AddTextToEventsList(\"Relading config!\", false);\r\n                }\r\n\r\n                MainTab.ItemsSource = null;\r\n                LoadConfig();\r\n\r\n                if(MainTab.Items.Count > 0)\r\n                {\r\n                    MainTab.SelectedIndex = 0;\r\n                }\r\n            }\r\n            catch(Exception ex)\r\n            {\r\n                MessageBox.Show(ex.Message, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\r\n                AddTextToEventsList(\"Relading config failed: \" + ex.Message, false);\r\n            }\r\n        }\r\n        private void OpenAppFolderMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                Process.Start(\"explorer.exe\", AppDomain.CurrentDomain.BaseDirectory);\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                MessageBox.Show(ex.Message, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error); \r\n                AddTextToEventsList(\"Opened application running folder\", false);\r\n            }\r\n        }\r\n\r\n        private void ClearEventsLogListMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            EventsList.Items.Clear();\r\n        }\r\n\r\n        private void ReorderTabsMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ReorderTabsDialog rtd = new ReorderTabsDialog(config);\r\n            rtd.ShowDialog();\r\n            if (rtd.changesOccured)\r\n            {\r\n                LoadConfig();\r\n\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n                AddTextToEventsList(\"Reorder tabs dialog ended!\", false);\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Reorder tabs dialog ended. No changes occured!\", false);\r\n            }\r\n        }\r\n\r\n        private void ConfigurationMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ConfigurationDialog cfg = new ConfigurationDialog(config);\r\n            cfg.ShowDialog();\r\n\r\n            LoadConfig();\r\n            MainTab.Items.Refresh();\r\n            MainMenuItemsVisibility();\r\n            this.UpdateLayout();\r\n            AddTextToEventsList(\"Configuration ended!\", false);\r\n        }\r\n\r\n        private void AddTabMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowAddNewTabDialog();\r\n        }\r\n\r\n        private void RemoveCurrentTabMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (MessageBox.Show(\"Do you want to delete current tab?\", \"Please confirm\", MessageBoxButton.YesNo) == MessageBoxResult.Yes)\r\n            {\r\n                List<TabData> newSourceTabs = new List<TabData>();\r\n                foreach (TabData tab in MainTab.Items)\r\n                {\r\n                    TabData currentTab = MainTab.Items[MainTab.SelectedIndex] as TabData;\r\n                    if (tab != currentTab)\r\n                    {\r\n                        newSourceTabs.Add(tab);\r\n                    }\r\n                }\r\n\r\n                MainTab.ItemsSource = null;\r\n                MainTab.ItemsSource = newSourceTabs;\r\n\r\n                if (SaveConfig())\r\n                {\r\n                    MainTab.Items.Refresh();\r\n                    this.UpdateLayout();\r\n                }\r\n            }\r\n        }\r\n\r\n        private void RenameCurrentTabMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            TabData tab = (TabData)MainTab.Items[MainTab.SelectedIndex];\r\n            ShowRenameTabDialog(MainTab.SelectedIndex, tab.TabHeader);\r\n        }\r\n\r\n        private void AddButtonToCurrentTabMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowAddButtonDialog();\r\n        }\r\n\r\n        private void ReorderButtonsInCurrentTabMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowReorderActionButtonsDialog();\r\n        }\r\n\r\n        private void ExitMenuItem_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if(tasksList.Count > 0)\r\n            {\r\n                if(MessageBox.Show(\"Task is still going. Do you want to exit? You will have to kill process manually if you exit\", \"Please confirm\", MessageBoxButton.YesNoCancel) == MessageBoxResult.Yes)\r\n                {\r\n                    Application.Current.Shutdown();\r\n                }\r\n            }\r\n            else\r\n            {\r\n                Application.Current.Shutdown();\r\n            }\r\n        }\r\n\r\n        private void MenuAbout_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            AboutDialog aboutDialog = new AboutDialog();\r\n            aboutDialog.ShowDialog();\r\n        }\r\n\r\n        private void MenuTroubleshooting_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            TroubleshootingWindow troubleshootingDialog = new TroubleshootingWindow(config);\r\n            troubleshootingDialog.Show();\r\n        }\r\n\r\n        private void MenuColorTags_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ColorTagsDialog colorTagsDialog = new ColorTagsDialog();\r\n            colorTagsDialog.Show();\r\n        }\r\n\r\n\r\n        #endregion\r\n\r\n        #region ContextMenuItems\r\n\r\n        public void ActionButton_PreviewMouseDown(object sender, MouseButtonEventArgs e)\r\n        {\r\n            if (e.RightButton == MouseButtonState.Pressed)\r\n            {\r\n                selectedActionButton = ((Button)e.Source).DataContext as ActionButton;\r\n                ContextMenu cm = this.FindResource(\"OnActionButtonContextMenu\") as ContextMenu;\r\n\r\n                if (e.Source is not ScrollViewer && e.OriginalSource is TextBlock)\r\n                {\r\n                    if (config.restrictions.block_buttons_edit == true && config.restrictions.block_buttons_remove == true && config.restrictions.block_buttons_copy == true)\r\n                    {\r\n                        return;\r\n                    }\r\n                    else\r\n                    {\r\n                        if (config.restrictions.block_buttons_edit == false)\r\n                        {\r\n                            (cm.Items[0] as MenuItem).Visibility = Visibility.Visible;\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[0] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n\r\n                        if (config.restrictions.block_buttons_remove == false)\r\n                        {\r\n                            (cm.Items[1] as MenuItem).Visibility = Visibility.Visible;\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[1] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n\r\n                        if (config.restrictions.block_buttons_copy == false)\r\n                        {\r\n                            (cm.Items[2] as MenuItem).Visibility = Visibility.Visible;\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[2] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n                    }\r\n\r\n                    cm.PlacementTarget = sender as Button;\r\n                    cm.IsOpen = true;\r\n                }\r\n            }\r\n        }\r\n\r\n        public void OnActionButtonPannel_PreviewMouseDown(object sender, MouseButtonEventArgs e)\r\n        {\r\n            if (e.RightButton == MouseButtonState.Pressed)\r\n            {\r\n                ContextMenu cm = this.FindResource(\"OnActionButtonPannelContextMenu\") as ContextMenu;\r\n                if (e.Source is ScrollViewer && e.OriginalSource is not TextBlock)\r\n                {\r\n                    if (config.restrictions.block_buttons_add == true && config.restrictions.block_buttons_reorder == true && config.restrictions.block_buttons_paste == true)\r\n                    {\r\n                        return;\r\n                    }\r\n                    else\r\n                    {\r\n                        if (config.restrictions.block_buttons_add == false)\r\n                        {\r\n                            (cm.Items[0] as MenuItem).Visibility = Visibility.Visible;\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[0] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n\r\n                        if (config.restrictions.block_buttons_reorder == false)\r\n                        {\r\n                            (cm.Items[1] as MenuItem).Visibility = Visibility.Visible;\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[1] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n\r\n                        if (config.restrictions.block_buttons_paste == false)\r\n                        {\r\n                            (cm.Items[2] as MenuItem).Visibility = Visibility.Visible;\r\n\r\n                            if(actionButtonForCopy != null)\r\n                            {\r\n                                (cm.Items[2] as MenuItem).IsEnabled = true;\r\n                            }\r\n                            else\r\n                            {\r\n                                (cm.Items[2] as MenuItem).IsEnabled = false;\r\n                            }\r\n                        }\r\n                        else\r\n                        {\r\n                            (cm.Items[2] as MenuItem).Visibility = Visibility.Collapsed;\r\n                        }\r\n                    }\r\n\r\n                    cm.PlacementTarget = sender as ScrollViewer;\r\n                    cm.IsOpen = true;\r\n                }\r\n            }\r\n        }\r\n\r\n        private void OnTabHeader_PreviewMouseDown(object sender, MouseButtonEventArgs e)\r\n        {\r\n            if (e.RightButton == MouseButtonState.Pressed)\r\n            {\r\n                selectedTabItem = ((Label)e.Source).DataContext as TabData;\r\n                ContextMenu cm = this.FindResource(\"OnTabContextMenu\") as ContextMenu;\r\n\r\n                if (config.restrictions.block_tabs_add == true && config.restrictions.block_tabs_remove == true && config.restrictions.block_tabs_rename == true)\r\n                {\r\n                    return;\r\n                }\r\n                else\r\n                {\r\n                    if (config.restrictions.block_tabs_add == false)\r\n                    {\r\n                        (cm.Items[0] as MenuItem).Visibility = Visibility.Visible;\r\n                    }\r\n                    else\r\n                    {\r\n                        (cm.Items[0] as MenuItem).Visibility = Visibility.Collapsed;\r\n                    }\r\n\r\n                    if (config.restrictions.block_tabs_remove == false)\r\n                    {\r\n                        (cm.Items[1] as MenuItem).Visibility = Visibility.Visible;\r\n                    }\r\n                    else\r\n                    {\r\n                        (cm.Items[1] as MenuItem).Visibility = Visibility.Collapsed;\r\n                    }\r\n\r\n                    if (config.restrictions.block_tabs_rename == false)\r\n                    {\r\n                        (cm.Items[2] as MenuItem).Visibility = Visibility.Visible;\r\n                    }\r\n                    else\r\n                    {\r\n                        (cm.Items[2] as MenuItem).Visibility = Visibility.Collapsed;\r\n                    }\r\n                }\r\n\r\n                cm.PlacementTarget = sender as Label;\r\n                cm.IsOpen = true;\r\n            }\r\n        }\r\n\r\n        private void ContextMenuRemoveTab_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (selectedTabItem == null)\r\n            {\r\n                MessageBox.Show(\"Selected Tab is still null. Please try again.\");\r\n                return;\r\n            }\r\n\r\n            List<TabData> newSourceTabs = new List<TabData>();\r\n            foreach (TabData tab in MainTab.Items)\r\n            {\r\n                if (tab != selectedTabItem)\r\n                {\r\n                    newSourceTabs.Add(tab);\r\n                }\r\n            }\r\n\r\n            MainTab.ItemsSource = null;\r\n            MainTab.ItemsSource = newSourceTabs;\r\n\r\n            if (SaveConfig())\r\n            {\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n            }\r\n        }\r\n\r\n        private void ContextMenuRenameTab_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (selectedTabItem == null)\r\n            {\r\n                MessageBox.Show(\"Selected Tab is still null. Please try again.\");\r\n                return;\r\n            }\r\n\r\n            int currentTabIndex = 0;\r\n\r\n            List<TabData> newSourceTabs = new List<TabData>();\r\n            foreach (TabData tab in MainTab.Items)\r\n            {\r\n                if (tab == selectedTabItem)\r\n                {\r\n                    ShowRenameTabDialog(currentTabIndex, selectedTabItem.TabHeader);\r\n                    return;\r\n                }\r\n                else\r\n                {\r\n                    currentTabIndex = currentTabIndex + 1;\r\n                }\r\n            }\r\n        }\r\n\r\n        private void ContextMenuAddTab_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowAddNewTabDialog();\r\n        }\r\n\r\n        private void ContextMenuRemoveActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (selectedActionButton == null)\r\n            {\r\n                MessageBox.Show(\"Selected Action button is still null. Please try again.\");\r\n                return;\r\n            }\r\n\r\n            for (int i = 0; i < MainTab.Items.Count; i++)\r\n            {\r\n                if (MainTab.Items[i] is TabData button)\r\n                {\r\n                    var item = button.TabActionButtons.Where(x => x.Equals(selectedActionButton)).FirstOrDefault();\r\n                    if (item != null)\r\n                    {\r\n                        button.TabActionButtons.Remove(item);\r\n                    }\r\n                }\r\n            }\r\n\r\n            if (SaveConfig())\r\n            {\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n            }\r\n        }\r\n\r\n        private void ContextMenuCopyActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (selectedActionButton == null)\r\n            {\r\n                MessageBox.Show(\"Selected Action button is still null. Please try again.\");\r\n                return;\r\n            }\r\n\r\n            actionButtonForCopy = selectedActionButton;\r\n        }\r\n\r\n        private void ContextMenuEditActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (selectedActionButton == null)\r\n            {\r\n                MessageBox.Show(\"Selected Action button is still null. Please try again.\");\r\n                return;\r\n            }\r\n\r\n            EditActionButtonDialog eabd = new EditActionButtonDialog(selectedActionButton);\r\n            if(eabd.ShowDialog() == true)\r\n            {\r\n                for (int i = 0; i < MainTab.Items.Count; i++)\r\n                {\r\n                    if (MainTab.Items[i] is TabData button)\r\n                    {\r\n                        var item = button.TabActionButtons.Where(x => x.Equals(selectedActionButton)).FirstOrDefault();\r\n                        if (item != null)\r\n                        {\r\n                            item = eabd.actionButton;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                if (SaveConfig())\r\n                {\r\n                    MainTab.Items.Refresh();\r\n                    this.UpdateLayout();\r\n                }\r\n            }\r\n            else\r\n            {\r\n                AddTextToEventsList(\"Edit button cancelled by user\", false);\r\n            }\r\n        }\r\n\r\n        private void ContextMenuAddActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowAddButtonDialog();\r\n        }\r\n\r\n        private void ContextMenuReorderActionButtons_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            ShowReorderActionButtonsDialog();\r\n        }\r\n\r\n        private void ContextMenuPasteActionButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (actionButtonForCopy == null)\r\n            {\r\n                return;\r\n            }\r\n\r\n            TabData tab = (TabData) MainTab.Items[MainTab.SelectedIndex];\r\n            actionButtonForCopy.ID = Guid.NewGuid();\r\n            tab.TabActionButtons.Add(actionButtonForCopy);\r\n\r\n            if (SaveConfig())\r\n            {\r\n                MainTab.Items.Refresh();\r\n                this.UpdateLayout();\r\n            }\r\n        }\r\n\r\n        #endregion\r\n\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/AnswerDialog/Answer.cs",
    "content": "﻿namespace EasyJob.Serialization.AnswerDialog\r\n{\r\n    public class Answer\r\n    {\r\n        public string AnswerQuestion { get; set; }\r\n        public string AnswerResult { get; set; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/AnswerDialog/AnswerData.cs",
    "content": "﻿using System.Collections.Generic;\r\n\r\nnamespace EasyJob.Serialization.AnswerDialog\r\n{\r\n    public class AnswerData\r\n    {\r\n        private List<Answer> _Answers = new List<Answer>();\r\n\r\n        public List<Answer> Answers\r\n        {\r\n            get { return _Answers; }\r\n            set { _Answers = value; }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/Config/Config.cs",
    "content": "﻿using System.Collections.Generic;\r\n\r\nnamespace EasyJob.Serialization\r\n{\r\n    public class Config\r\n    {\r\n        public string default_powershell_path { get; set; }\r\n        public string default_cmd_path { get; set; }\r\n        public string powershell_arguments { get; set; }\r\n        public string console_background { get; set; }\r\n        public string console_foreground { get; set; }\r\n        public bool console_ignore_color_tags { get; set; }\r\n        public bool clear_events_when_reload { get; set; }\r\n        public ConfigRestrictions restrictions { get; set; }\r\n        public List<ConfigTab> tabs { get; set; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/Config/ConfigArgument.cs",
    "content": "﻿namespace EasyJob.Serialization\r\n{\r\n    public class ConfigArgument\r\n    {\r\n        private string _argument_question;\r\n        private string _argument_answer;\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"ConfigArgument\"/> class.\r\n        /// </summary>\r\n        /// <param name=\"argument_question\">The argument question.</param>\r\n        /// <param name=\"argument_answer\">The argument answer.</param>\r\n        public ConfigArgument(string argument_question, string argument_answer)\r\n        {\r\n            this._argument_question = argument_question;\r\n            this._argument_answer = argument_answer;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the argument question.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The argument question.\r\n        /// </value>\r\n        public string ArgumentQuestion { get => _argument_question; set => _argument_question = value; }\r\n        /// <summary>\r\n        /// Gets or sets the argument answer.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The argument answer.\r\n        /// </value>\r\n        public string ArgumentAnswer { get => _argument_answer; set => _argument_answer = value; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/Config/ConfigButton.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\n\r\nnamespace EasyJob.Serialization\r\n{\r\n    public class ConfigButton\r\n    {\r\n        private Guid _id;\r\n        private string _text;\r\n        private string _description;\r\n        private string _script;\r\n        private string _scriptpathtype;\r\n        private string _scripttype;\r\n        private List<ConfigArgument> _arguments;\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"ConfigButton\"/> class.\r\n        /// </summary>\r\n        /// <param name=\"text\">The text.</param>\r\n        /// <param name=\"description\">The description.</param>\r\n        /// <param name=\"script\">The script.</param>\r\n        /// <param name=\"scriptpathtype\">The scriptpathtype.</param>\r\n        /// <param name=\"scripttype\">The scripttype.</param>\r\n        /// <param name=\"arguments\">The arguments.</param>\r\n        /// <summary>\r\n        public ConfigButton(Guid id, string text, string description, string script, string scriptpathtype, string scripttype, List<ConfigArgument> arguments)\r\n        {\r\n            this._id = id.Equals(Guid.Empty) ? Guid.NewGuid() : id;\r\n            this._text = text;\r\n            this._description = description;\r\n            this._script = script;\r\n            this._scriptpathtype = scriptpathtype;\r\n            this._scripttype = scripttype;\r\n            this._arguments = arguments;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the identifier.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The identifier.\r\n        /// </value>\r\n        public Guid Id { get => _id; set => _id = value; }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the text.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The text.\r\n        /// </value>\r\n        public string Text { get => _text; set => _text = value; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the description.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The description.\r\n        /// </value>\r\n        public string Description { get => _description; set => _description = value; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the script.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The script.\r\n        /// </value>\r\n        public string Script { get => _script; set => _script = value; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the type of the script path.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The type of the script path.\r\n        /// </value>\r\n        public string ScriptPathType { get => _scriptpathtype; set => _scriptpathtype = value; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the type of the script.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The type of the script.\r\n        /// </value>\r\n        public string ScriptType { get => _scripttype; set => _scripttype = value; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the arguments.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The arguments.\r\n        /// </value>\r\n        public List<ConfigArgument> Arguments { get => _arguments; set => _arguments = value; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/Config/ConfigRestrictions.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace EasyJob.Serialization\r\n{\r\n    public class ConfigRestrictions\r\n    {\r\n        public bool block_tabs_remove { get; set; }\r\n        public bool block_buttons_remove { get; set; }\r\n        public bool block_tabs_add { get; set; }\r\n        public bool block_buttons_add { get; set; }\r\n        public bool block_buttons_reorder { get; set; }\r\n        public bool block_buttons_edit { get; set; }\r\n        public bool block_tabs_rename { get; set; }\r\n        public bool block_buttons_paste { get; set; }\r\n        public bool block_buttons_copy { get; set; }\r\n        public bool hide_menu_item_file_reload_config { get; set; }\r\n        public bool hide_menu_item_file_open_app_folder { get; set; }\r\n        public bool hide_menu_item_file_clear_events_list { get; set; }\r\n        public bool hide_menu_item_settings { get; set; }\r\n        public bool hide_menu_item_settings_workflow { get; set; }\r\n        public bool hide_menu_item_settings_workflow_reorder_tabs { get; set; }\r\n        public bool hide_menu_item_settings_workflow_add_tab { get; set; }\r\n        public bool hide_menu_item_settings_workflow_remove_current_tab { get; set; }\r\n        public bool hide_menu_item_settings_workflow_rename_current_tab { get; set; }\r\n        public bool hide_menu_item_settings_workflow_add_button_to_current_tab { get; set; }\r\n        public bool hide_menu_item_settings_workflow_reorder_buttons_in_current_tab { get; set; }\r\n        public bool hide_menu_item_settings_configuration { get; set; }\r\n        public bool hide_menu_item_help { get; set; }\r\n        public bool hide_menu_item_help_troubleshooting { get; set; }\r\n        public bool hide_menu_item_help_colortags { get; set; }\r\n        public bool hide_menu_item_help_about { get; set; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/Config/ConfigTab.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\n\r\nnamespace EasyJob.Serialization\r\n{\r\n    public class ConfigTab\r\n    {\r\n        private Guid _id;\r\n        private string _header;\r\n        private List<ConfigButton> _buttons;\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"ConfigTab\"/> class.\r\n        /// </summary>\r\n        /// <param name=\"id\">The identifier.</param>\r\n        /// <param name=\"header\">The header.</param>\r\n        /// <param name=\"buttons\">The buttons.</param>\r\n        public ConfigTab(Guid id, string header, List<ConfigButton> buttons)\r\n        {\r\n            this._id = id.Equals(Guid.Empty) ? Guid.NewGuid() : id;\r\n            this._header = header;\r\n            this._buttons = buttons;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the identifier.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The identifier.\r\n        /// </value>\r\n        public Guid ID { get => _id; set => _id = value; }\r\n\r\n\r\n        /// <summary>\r\n        /// Gets or sets the header.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The header.\r\n        /// </value>\r\n        public string Header { get => _header; set => _header = value; }\r\n        /// <summary>\r\n        /// Gets or sets the buttons.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The buttons.\r\n        /// </value>\r\n        public List<ConfigButton> Buttons { get => _buttons; set => _buttons = value; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/TabItems/ActionButton.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Windows.Controls;\r\nusing EasyJob.Serialization.AnswerDialog;\r\n\r\nnamespace EasyJob.TabItems\r\n{\r\n    public class ActionButton\r\n    {\r\n        /// <summary>\r\n        /// Gets or sets the identifier.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The identifier.\r\n        /// </value>\r\n        public Guid ID { get; set; }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the button text.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The button text.\r\n        /// </value>\r\n        public string ButtonText { get; set; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the button description.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The button description.\r\n        /// </value>\r\n        public string ButtonDescription { get; set; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the button script.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The button script.\r\n        /// </value>\r\n        public string ButtonScript { get; set; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the type of the button script path.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The type of the button script path.\r\n        /// </value>\r\n        public string ButtonScriptPathType { get; set; }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the type of the button script.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The type of the button script.\r\n        /// </value>\r\n        public string ButtonScriptType { get; set; }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the button arguments.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The button arguments.\r\n        /// </value>\r\n        public List<Answer> ButtonArguments { get; set; }\r\n        \r\n        /// <summary>\r\n        /// Gets or sets the context menu.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The context menu.\r\n        /// </value>\r\n        public ContextMenu contextMenu { get; set; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/TabItems/TabData.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace EasyJob.TabItems\r\n{\r\n    public class TabData : INotifyPropertyChanged\r\n    {\r\n        private string _TabTextBoxText;\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"TabData\"/> class.\r\n        /// </summary>\r\n        public TabData()\r\n        {\r\n\r\n        }\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"TabData\"/> class.\r\n        /// </summary>\r\n        /// <param name=\"tabTextBoxText\">The tab text box text.</param>\r\n        public TabData(string tabTextBoxText)\r\n        {\r\n            this._TabTextBoxText = tabTextBoxText;\r\n            ID = Guid.NewGuid();\r\n            TabHeader = tabTextBoxText;\r\n            TabActionButtons = new List<ActionButton>();\r\n        }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the identifier.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The identifier.\r\n        /// </value>\r\n        public Guid ID { get; set; }\r\n\r\n        /// <summary>\r\n        /// Gets or sets the tab header.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The tab header.\r\n        /// </value>\r\n        public string TabHeader { get; set; }\r\n        /// <summary>\r\n        /// Gets or sets the console background.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The console background.\r\n        /// </value>\r\n        public string ConsoleBackground { get; set; }\r\n        /// <summary>\r\n        /// Gets or sets the console foreground.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The console foreground.\r\n        /// </value>\r\n        public string ConsoleForeground { get; set; }\r\n        /// <summary>\r\n        /// Gets or sets the tab action buttons.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The tab action buttons.\r\n        /// </value>\r\n        public List<ActionButton> TabActionButtons { get; set; }\r\n        /// <summary>\r\n        /// Gets or sets the tab text box text.\r\n        /// </summary>\r\n        /// <value>\r\n        /// The tab text box text.\r\n        /// </value>\r\n        public string TabTextBoxText {\r\n            get\r\n            {\r\n                return this._TabTextBoxText;\r\n            }\r\n            set\r\n            {\r\n                if (_TabTextBoxText != value)\r\n                {\r\n                    _TabTextBoxText = value;\r\n                    Task.Run(() => {\r\n                        OnChange(\"TabTextBoxText\");\r\n                    });\r\n                }\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// Occurs when a property value changes.\r\n        /// </summary>\r\n        public event PropertyChangedEventHandler PropertyChanged;\r\n        /// <summary>\r\n        /// Called when [change].\r\n        /// </summary>\r\n        /// <param name=\"info\">The information.</param>\r\n        protected void OnChange(string info)\r\n        {\r\n            if (PropertyChanged != null)\r\n            {\r\n                PropertyChanged(this, new PropertyChangedEventArgs(info));\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Serialization/TasksList/TaskListTask.cs",
    "content": "﻿namespace EasyJob.Serialization.TasksList\r\n{\r\n    public class TaskListTask\r\n    {\r\n        public int TaskID { get; set; }\r\n        public string TaskFile { get; set; }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Utils/CommonUtils.cs",
    "content": "﻿using System;\r\nusing System.Diagnostics;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing System.Windows;\r\n\r\nnamespace EasyJob.Utils\r\n{\r\n    public class CommonUtils\r\n    {\r\n        public static void OpenLinkInBrowser(string url)\r\n        {\r\n            try\r\n            {\r\n                Process proc = new Process();\r\n                proc.StartInfo.UseShellExecute = true;\r\n                proc.StartInfo.FileName = url;\r\n                proc.Start();\r\n            }\r\n            catch (Exception ex) { MessageBox.Show(ex.Message); }\r\n        }\r\n\r\n        public static string ReadAssemblyFile(string name)\r\n        {\r\n            // Determine path\r\n            var assembly = Assembly.GetExecutingAssembly();\r\n            string resourcePath = name;\r\n            // Format: \"{Namespace}.{Folder}.{filename}.{Extension}\"\r\n            if (!name.StartsWith(nameof(EasyJob)))\r\n            {\r\n                resourcePath = assembly.GetManifestResourceNames()\r\n                    .Single(str => str.EndsWith(name));\r\n            }\r\n\r\n            using (Stream stream = assembly.GetManifestResourceStream(resourcePath))\r\n            using (StreamReader reader = new StreamReader(stream))\r\n            {\r\n                return reader.ReadToEnd();\r\n            }\r\n        }\r\n\r\n        public static string ApplyConsoleColorTagsToText(string Text)\r\n        {\r\n            string[][] colorCodes = new string[][] { \r\n                new string[] { @\"\\c01EJ\", \"/c01EJ\", \"<span style=\\\"color: #DFFF00;\\\">\" },\r\n                new string[] { @\"\\c02EJ\", \"/c02EJ\", \"<span style=\\\"color: #FFBF00;\\\">\" },\r\n                new string[] { @\"\\c03EJ\", \"/c03EJ\", \"<span style=\\\"color: #FF7F50;\\\">\" },\r\n                new string[] { @\"\\c04EJ\", \"/c04EJ\", \"<span style=\\\"color: #DE3163;\\\">\" },\r\n                new string[] { @\"\\c05EJ\", \"/c05EJ\", \"<span style=\\\"color: #9FE2BF;\\\">\" },\r\n                new string[] { @\"\\c06EJ\", \"/c06EJ\", \"<span style=\\\"color: #40E0D0;\\\">\" },\r\n                new string[] { @\"\\c07EJ\", \"/c07EJ\", \"<span style=\\\"color: #6495ED;\\\">\" },\r\n                new string[] { @\"\\c08EJ\", \"/c08EJ\", \"<span style=\\\"color: #CCCCFF;\\\">\" },\r\n                new string[] { @\"\\c09EJ\", \"/c09EJ\", \"<span style=\\\"color: #800080;\\\">\" },\r\n                new string[] { @\"\\c10EJ\", \"/c10EJ\", \"<span style=\\\"color: #3D3D6B;\\\">\" },\r\n                new string[] { @\"\\c11EJ\", \"/c11EJ\", \"<span style=\\\"color: #ADD45C;\\\">\" },\r\n                new string[] { @\"\\c12EJ\", \"/c12EJ\", \"<span style=\\\"color: #57C785;\\\">\" },\r\n                new string[] { @\"\\c13EJ\", \"/c13EJ\", \"<span style=\\\"color: #00BAAD;\\\">\" },\r\n                new string[] { @\"\\c14EJ\", \"/c14EJ\", \"<span style=\\\"color: #2A7B9B;\\\">\" }\r\n            };\r\n\r\n            for (int i = 0; i <= colorCodes.GetLength(0) - 1; i++)\r\n            {\r\n                if (Text.Contains(colorCodes[i][0]) == true && Text.Contains(colorCodes[i][1]) == false)\r\n                {\r\n                    Text = Text.Replace(colorCodes[i][0], colorCodes[i][2]);\r\n                    Text = Text + \"</span>\";\r\n                }\r\n                else if (Text.Contains(colorCodes[i][0]) == false && Text.Contains(colorCodes[i][1]) == true)\r\n                {\r\n                    Text = Text.Replace(colorCodes[i][1], \"\");\r\n                }\r\n                else if (Text.Contains(colorCodes[i][0]) == true && Text.Contains(colorCodes[i][1]) == true)\r\n                {\r\n                    Text = Text.Replace(colorCodes[i][0], colorCodes[i][2]);\r\n                    Text = Text.Replace(colorCodes[i][1], \"</span>\");\r\n                }\r\n            }\r\n\r\n            return Text;\r\n        }\r\n\r\n        public static string ConvertPartToRelative(string Path)\r\n        {\r\n            Path = Path.Replace(AppDomain.CurrentDomain.BaseDirectory, \"\");\r\n            return Path;\r\n        }\r\n\r\n        public static string ApplicationStartupPath()\r\n        {\r\n            return AppDomain.CurrentDomain.BaseDirectory;\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Utils/ConfigUtils.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.Serialization.AnswerDialog;\r\nusing EasyJob.TabItems;\r\nusing Newtonsoft.Json;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\n\r\nnamespace EasyJob.Utils\r\n{\r\n    public class ConfigUtils\r\n    {\r\n        public static string ConfigJsonPath = AppDomain.CurrentDomain.BaseDirectory + \"config.json\";\r\n\r\n\r\n        public static ObservableCollection<TabData> ConvertTabsFromConfigToUI(Config config)\r\n        {\r\n            ObservableCollection<TabData> tabs = new ObservableCollection<TabData>();\r\n\r\n            foreach (ConfigTab configTab in config.tabs)\r\n            {\r\n                List<ActionButton> actionButtons = new List<ActionButton>();\r\n\r\n                foreach (ConfigButton configButton in configTab.Buttons)\r\n                {\r\n                    List<Answer> configArguments = new List<Answer>();\r\n                    foreach (ConfigArgument configArgument in configButton.Arguments)\r\n                    {\r\n                        configArguments.Add(new Answer { AnswerQuestion = configArgument.ArgumentQuestion, AnswerResult = configArgument.ArgumentAnswer });\r\n                    }\r\n\r\n                    actionButtons.Add(new ActionButton { ID = configButton.Id, ButtonText = configButton.Text, ButtonDescription = configButton.Description, ButtonScript = configButton.Script, ButtonScriptPathType = configButton.ScriptPathType, ButtonScriptType = configButton.ScriptType, ButtonArguments = configArguments });\r\n                }\r\n\r\n                tabs.Add(new TabData { ID = configTab.ID, TabHeader = configTab.Header, ConsoleBackground = config.console_background, ConsoleForeground = config.console_foreground, TabActionButtons = actionButtons, TabTextBoxText = \"\" });\r\n            }\r\n\r\n            return tabs;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Saves the configs.\r\n        /// </summary>\r\n        /// <param name=\"tabs\">The tabs.</param>\r\n        /// <returns></returns>\r\n        public static List<ConfigTab> ConvertTabsFromUIToConfig(IEnumerable<TabData> tabs)\r\n        {\r\n            List<ConfigTab> configTabs = new List<ConfigTab>();\r\n            List<ConfigButton> buttons = null;\r\n            List<ConfigArgument> configArguments = null;\r\n\r\n            foreach (TabData tab in tabs)\r\n            {\r\n                buttons = new List<ConfigButton>();\r\n                foreach (ActionButton button in tab.TabActionButtons)\r\n                {\r\n                    configArguments = new List<ConfigArgument>();\r\n                    foreach (Answer answer in button.ButtonArguments)\r\n                    {\r\n                        configArguments.Add(new ConfigArgument(answer.AnswerQuestion, answer.AnswerResult));\r\n                    }\r\n\r\n                    buttons.Add(new ConfigButton(button.ID, button.ButtonText, button.ButtonDescription, button.ButtonScript, button.ButtonScriptPathType, button.ButtonScriptType, configArguments));\r\n                }\r\n\r\n                configTabs.Add(new ConfigTab(tab.ID, tab.TabHeader, buttons));\r\n            }\r\n\r\n            return configTabs;\r\n        }\r\n\r\n        public static bool SaveFromConfigToFile(Config config)\r\n        {\r\n            try\r\n            {\r\n                string confifJson = JsonConvert.SerializeObject(config);\r\n                File.WriteAllText(ConfigJsonPath, confifJson, Encoding.UTF8);\r\n\r\n                return true;\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                MessageBox.Show(ex.Message);\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Utils/ScrollViewerExtensions.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\n\r\nnamespace EasyJob.Utils\r\n{\r\n    public class ScrollViewerExtensions\r\n    {\r\n        public static readonly DependencyProperty AlwaysScrollToEndProperty = DependencyProperty.RegisterAttached(\"AlwaysScrollToEnd\", typeof(bool), typeof(ScrollViewerExtensions), new PropertyMetadata(false, AlwaysScrollToEndChanged));\r\n        private static bool _autoScroll;\r\n\r\n        private static void AlwaysScrollToEndChanged(object sender, DependencyPropertyChangedEventArgs e)\r\n        {\r\n            ScrollViewer scroll = sender as ScrollViewer;\r\n            if (scroll != null)\r\n            {\r\n                bool alwaysScrollToEnd = (e.NewValue != null) && (bool)e.NewValue;\r\n                if (alwaysScrollToEnd)\r\n                {\r\n                    scroll.ScrollToEnd();\r\n                    scroll.ScrollChanged += ScrollChanged;\r\n                }\r\n                else { scroll.ScrollChanged -= ScrollChanged; }\r\n            }\r\n            else { throw new InvalidOperationException(\"The attached AlwaysScrollToEnd property can only be applied to ScrollViewer instances.\"); }\r\n        }\r\n\r\n        public static bool GetAlwaysScrollToEnd(ScrollViewer scroll)\r\n        {\r\n            if (scroll == null) { throw new ArgumentNullException(\"scroll\"); }\r\n            return (bool)scroll.GetValue(AlwaysScrollToEndProperty);\r\n        }\r\n\r\n        public static void SetAlwaysScrollToEnd(ScrollViewer scroll, bool alwaysScrollToEnd)\r\n        {\r\n            if (scroll == null) { throw new ArgumentNullException(\"scroll\"); }\r\n            scroll.SetValue(AlwaysScrollToEndProperty, alwaysScrollToEnd);\r\n        }\r\n\r\n        private static void ScrollChanged(object sender, ScrollChangedEventArgs e)\r\n        {\r\n            ScrollViewer scroll = sender as ScrollViewer;\r\n            if (scroll == null) { throw new InvalidOperationException(\"The attached AlwaysScrollToEnd property can only be applied to ScrollViewer instances.\"); }\r\n\r\n            // User scroll event : set or unset autoscroll mode\r\n            if (e.ExtentHeightChange == 0) { _autoScroll = scroll.VerticalOffset == scroll.ScrollableHeight; }\r\n\r\n            // Content scroll event : autoscroll eventually\r\n            if (_autoScroll && e.ExtentHeightChange != 0) { scroll.ScrollToVerticalOffset(scroll.ExtentHeight); }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/AboutDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.AboutDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\"\r\n        WindowStyle=\"SingleBorderWindow\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"About EasyJob\" Height=\"430\" Width=\"640\" ResizeMode=\"NoResize\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n        </Grid.RowDefinitions>\r\n        <Grid Grid.Row=\"0\">\r\n            <Grid.ColumnDefinitions>\r\n                <ColumnDefinition Width=\"*\"/>\r\n                <ColumnDefinition Width=\"90\"/>\r\n                <ColumnDefinition Width=\"10\"/>\r\n            </Grid.ColumnDefinitions>\r\n            <TextBlock AutomationProperties.Name=\"About\" Padding=\"12\" Grid.Column=\"0\" Text=\"About\" Style=\"{StaticResource HeaderTextBlockStyle}\" Background=\"#E2E2E2\"/>\r\n            <Image Grid.Column=\"1\" Source=\"pack://application:,,,/Images/github.png\" Height=\"Auto\" Width=\"Auto\" MouseLeftButtonDown=\"GithubImage_MouseLeftButtonDown\" Cursor=\"Hand\" Stretch=\"Fill\"/>\r\n            <DockPanel Grid.Column=\"2\" Background=\"#E2E2E2\"/>\r\n        </Grid>\r\n\r\n        <Grid Grid.Row=\"1\">\r\n            <Grid.RowDefinitions>\r\n                <RowDefinition Height=\"32\"/>\r\n                <RowDefinition Height=\"32\"/>\r\n                <RowDefinition Height=\"32\"/>\r\n                <RowDefinition Height=\"*\"/>\r\n                <RowDefinition Height=\"55\"/>\r\n            </Grid.RowDefinitions>\r\n\r\n            <Label Grid.Row=\"0\" Name=\"AboutTitle\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" Content=\"EasyJob Executor\"/>\r\n            <Label Grid.Row=\"1\" Name=\"AboutInfo\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" Content=\"Author\" />\r\n            <Label Grid.Row=\"2\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" Content=\"Licence: GNU AGPLv3\" />\r\n\r\n            <RichTextBox Grid.Row=\"3\" Margin=\"10,10,10,0\" Name=\"RichTextBox1\" HorizontalAlignment=\"Left\" Background=\"Black\" Foreground=\"White\"\r\n                         BorderThickness=\"0\" IsDocumentEnabled=\"True\" IsReadOnly=\"True\" VerticalScrollBarVisibility=\"Visible\" FontFamily=\"Consolas\">\r\n            </RichTextBox>\r\n\r\n            <Button Grid.Row=\"4\" Content=\"Get some inspiration\" Click=\"GetInspirationButton_Click\" Margin=\"5,0,10,0\" Padding=\"5\" HorizontalAlignment=\"Right\"/>\r\n            <Button Grid.Row=\"4\" Content=\"Check new releases\" Click=\"CheckNewReleasesButton_Click\" Margin=\"5,0,155,0\" Padding=\"5\" HorizontalAlignment=\"Right\"/>\r\n        </Grid>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/AboutDialog.xaml.cs",
    "content": "﻿using EasyJob.Utils;\r\nusing HtmlAgilityPack;\r\nusing System;\r\nusing System.Diagnostics;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing System.Windows;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for AboutDialog.xaml\r\n    /// </summary>\r\n    public partial class AboutDialog : Window\r\n    {\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"AboutDialog\"/> class.\r\n        /// </summary>\r\n        public AboutDialog()\r\n        {\r\n            InitializeComponent();\r\n            LoadDataInfoIntoTheForm();\r\n        }\r\n\r\n        public void LoadDataInfoIntoTheForm()\r\n        {\r\n            AboutTitle.Content = \"EasyJob Executor \" + Assembly.GetExecutingAssembly().GetName().Version.ToString();\r\n            AboutInfo.Content = \"Author: Akshin Mustafayev. Contrubutions made to the project by the Github community\";\r\n            string readme = CommonUtils.ReadAssemblyFile(\"LICENSE.txt\");\r\n            RichTextBox1.Document.Blocks.Clear();\r\n            var plainText = ConvertToPlainText(readme);\r\n            RichTextBox1.AppendText(plainText);\r\n        }\r\n\r\n        private static void ConvertContentTo(HtmlNode node, TextWriter outText)\r\n        {\r\n            foreach (HtmlNode subnode in node.ChildNodes)\r\n            {\r\n                ConvertTo(subnode, outText);\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// Converts to plain text.\r\n        /// </summary>\r\n        /// <param name=\"html\">The HTML.</param>\r\n        /// <returns></returns>\r\n        public static string ConvertToPlainText(string html)\r\n        {\r\n            HtmlDocument doc = new HtmlDocument();\r\n            doc.LoadHtml(html);\r\n\r\n            StringWriter sw = new StringWriter();\r\n            ConvertTo(doc.DocumentNode, sw);\r\n            sw.Flush();\r\n            return sw.ToString();\r\n        }\r\n\r\n        private static void ConvertTo(HtmlNode node, TextWriter outText)\r\n        {\r\n            string html;\r\n            switch (node.NodeType)\r\n            {\r\n                case HtmlNodeType.Comment:\r\n                    // don't output comments\r\n                    break;\r\n\r\n                case HtmlNodeType.Document:\r\n                    ConvertContentTo(node, outText);\r\n                    break;\r\n\r\n                case HtmlNodeType.Text:\r\n                    // script and style must not be output\r\n                    string parentName = node.ParentNode.Name;\r\n                    if ((parentName == \"script\") || (parentName == \"style\"))\r\n                        break;\r\n\r\n                    // get text\r\n                    html = ((HtmlTextNode)node).Text;\r\n\r\n                    // is it in fact a special closing node output as text?\r\n                    if (HtmlNode.IsOverlappedClosingElement(html))\r\n                        break;\r\n\r\n                    // check the text is meaningful and not a bunch of whitespaces\r\n                    if (html.Trim().Length > 0)\r\n                    {\r\n                        outText.Write(HtmlEntity.DeEntitize(html));\r\n                    }\r\n                    break;\r\n\r\n                case HtmlNodeType.Element:\r\n                    switch (node.Name)\r\n                    {\r\n                        case \"p\":\r\n                            // treat paragraphs as crlf\r\n                            outText.Write(\"\\r\\n\");\r\n                            break;\r\n                        case \"br\":\r\n                            outText.Write(\"\\r\\n\");\r\n                            break;\r\n                    }\r\n\r\n                    if (node.HasChildNodes)\r\n                    {\r\n                        ConvertContentTo(node, outText);\r\n                    }\r\n                    break;\r\n            }\r\n\r\n        }\r\n\r\n        private void GetInspirationButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            CommonUtils.OpenLinkInBrowser(\"https://www.youtube.com/watch?v=l0U7SxXHkPY\");\r\n        }\r\n\r\n        private void CheckNewReleasesButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            CommonUtils.OpenLinkInBrowser(\"https://github.com/akshinmustafayev/EasyJob/releases\");\r\n        }\r\n\r\n        private void GithubImage_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)\r\n        {\r\n            CommonUtils.OpenLinkInBrowser(\"https://github.com/akshinmustafayev/EasyJob\");\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/AddActionButtonDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.AddActionButtonDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Add button\" Height=\"600\" Width=\"400\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"22\"/>\r\n            <RowDefinition Height=\"34\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"64\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"64\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"38\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"38\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n            <RowDefinition Height=\"44\"/>\r\n        </Grid.RowDefinitions>\r\n        \r\n        <DockPanel Grid.Row=\"0\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Text\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for script button text\" Name=\"HelpAddActionButtonText\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <TextBox AutomationProperties.Name=\"Text displayed on script button\" x:Name=\"ButtonText\" Grid.Row=\"1\" Margin=\"10,2,10,0\" FontSize=\"14\" VerticalAlignment=\"Center\"/>\r\n\r\n        <DockPanel Grid.Row=\"2\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Description\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help on description text\" Name=\"HelpAddActionButtonDescription\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <TextBox AutomationProperties.Name=\"Script description\" x:Name=\"ButtonDescription\" Grid.Row=\"3\" Margin=\"10,2,10,0\" FontSize=\"14\" TextWrapping=\"Wrap\" VerticalScrollBarVisibility=\"Auto\"/>\r\n\r\n        <DockPanel Grid.Row=\"4\">\r\n            <TextBlock Grid.Row=\"4\" Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Select file dialog on script path\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"SelectFileButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/find.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n\t\t\t<Button AutomationProperties.Name=\"Help on script path\" Name=\"HelpAddActionButtonScript\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <TextBox AutomationProperties.Name=\"Script path\" x:Name=\"ButtonScript\" Grid.Row=\"5\" Margin=\"10,2,10,0\" FontSize=\"14\" TextWrapping=\"Wrap\" VerticalScrollBarVisibility=\"Auto\"/>\r\n\r\n        <DockPanel Grid.Row=\"6\">\r\n            <TextBlock AutomationProperties.Name=\"Path type\" Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script path type\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for script path type\" Name=\"HelpAddActionButtonScriptPathType\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <ComboBox AutomationProperties.Name=\"Path type\" x:Name=\"ButtonScriptPathType\" Grid.Row=\"7\" Margin=\"10,2,10,0\" FontSize=\"14\">\r\n            <ComboBoxItem IsSelected=\"True\">Relative</ComboBoxItem>\r\n            <ComboBoxItem >Absolute</ComboBoxItem>\r\n        </ComboBox>\r\n\r\n        <DockPanel Grid.Row=\"8\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script type\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for script type\" Name=\"HelpAddActionButtonScriptType\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <ComboBox AutomationProperties.Name=\"Script type\" x:Name=\"ButtonScriptType\" Grid.Row=\"9\" Margin=\"10,2,10,0\" FontSize=\"14\">\r\n            <ComboBoxItem IsSelected=\"True\">PowerShell</ComboBoxItem>\r\n            <ComboBoxItem >Batch</ComboBoxItem>\r\n        </ComboBox>\r\n\r\n        <DockPanel Grid.Row=\"10\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Arguments\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for script arguements\" Name=\"HelpAddActionButtonArguments\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <Grid Grid.Row=\"11\">\r\n            <Grid.RowDefinitions>\r\n                <RowDefinition Height=\"*\"/>\r\n                <RowDefinition Height=\"44\"/>\r\n            </Grid.RowDefinitions>\r\n            <Border Grid.Row=\"0\" Margin=\"10,0,10,0\" BorderBrush=\"#333333\" BorderThickness=\"1\" CornerRadius=\"2\">\r\n                <ListBox AutomationProperties.Name=\"Script arguements\" x:Name=\"ButtonScriptArguments\">\r\n                    <ListBox.ItemTemplate>\r\n                        <DataTemplate>\r\n                            <StackPanel Margin=\"-5\" Orientation=\"Horizontal\">\r\n                                <Button AutomationProperties.Name=\"Delete\" x:Name=\"DeleteArgumentButton\" Margin=\"0\" Height=\"25\" Width=\"25\" Click=\"DeleteArgumentButton_Click\">\r\n                                    <StackPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                                        <Image Source=\"pack://application:,,,/Images/close.png\" Margin=\"-6,-2,-6,-2\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                                    </StackPanel>\r\n                                </Button>\r\n                                <TextBlock Margin=\"10 0 2 0\" Text=\"{Binding Path=AnswerQuestion}\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\"/>\r\n                            </StackPanel>\r\n                        </DataTemplate>\r\n                    </ListBox.ItemTemplate>\r\n                </ListBox>\r\n            </Border>\r\n            <Button AutomationProperties.Name=\"Add script arguement\" Grid.Row=\"1\" Content=\"Add\" Click=\"ADDButton_Click\" Margin=\"10,0,0,0\" Padding=\"5\"/>\r\n            <TextBox AutomationProperties.Name=\"Script arguement\" x:Name=\"ButtonScriptArgumentText\" Grid.Row=\"2\" Margin=\"55,6,10,6\"/>\r\n        </Grid>\r\n        <Button Grid.Row=\"13\" Content=\"OK\" Click=\"OKButton_Click\" Margin=\"5\" Padding=\"5\" Style=\"{StaticResource AccentButtonStyle}\" HorizontalAlignment=\"Right\"/>\r\n        <Button AutomationProperties.Name=\"Cancel\" Grid.Row=\"13\" Content=\"Cancel\" Click=\"CANCELButton_Click\" Margin=\"5,5,40,5\" Padding=\"5\" HorizontalAlignment=\"Right\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/AddActionButtonDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.Serialization.AnswerDialog;\r\nusing EasyJob.Utils;\r\nusing Microsoft.Win32;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for AddActionButtonDialog.xaml\r\n    /// </summary>\r\n    public partial class AddActionButtonDialog : Window\r\n    {\r\n        public ConfigButton configButton;\r\n        public AddActionButtonDialog()\r\n        {\r\n            InitializeComponent();\r\n            configButton = null;\r\n        }\r\n\r\n        private void OKButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            List<ConfigArgument> configArguments = new List<ConfigArgument>();\r\n            foreach (Answer answer in ButtonScriptArguments.Items) { configArguments.Add(new ConfigArgument(answer.AnswerQuestion, answer.AnswerResult)); };\r\n            string buttonScriptPathTypeValue = ConvertScriptPathTypeComboBoxToString(ButtonScriptPathType);\r\n            string buttonScriptTypeValue = ConvertScriptTypeComboBoxToString(ButtonScriptType);\r\n            ConfigButton newConfigButton = new ConfigButton(Guid.NewGuid() ,ButtonText.Text, ButtonDescription.Text, ButtonScript.Text, buttonScriptPathTypeValue, buttonScriptTypeValue, configArguments);\r\n            configButton = newConfigButton;\r\n\r\n            DialogResult = true;\r\n        }\r\n        \r\n        private string ConvertScriptTypeComboBoxToString(ComboBox cb)\r\n        {\r\n            if(cb.SelectedIndex == 0)\r\n            {\r\n                return \"powershell\";\r\n            }\r\n            else\r\n            {\r\n                return \"bat\";\r\n            }\r\n        }\r\n\r\n        private string ConvertScriptPathTypeComboBoxToString(ComboBox cb)\r\n        {\r\n            if (cb.SelectedIndex == 0)\r\n            {\r\n                return \"relative\";\r\n            }\r\n            else\r\n            {\r\n                return \"absolute\";\r\n            }\r\n        }\r\n\r\n        private void CANCELButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n\r\n        private void ADDButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                ButtonScriptArguments.Items.Add(new Answer { AnswerQuestion = ButtonScriptArgumentText.Text, AnswerResult = \"\" });\r\n                ButtonScriptArgumentText.Text = \"\";\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private void DeleteArgumentButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                Button btn = sender as Button;\r\n                ButtonScriptArguments.Items.Remove((Answer)btn.DataContext);\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private void HelpButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            Button button = sender as Button;\r\n            HelpDialog hd = new HelpDialog(button.Name);\r\n            hd.ShowDialog();\r\n        }\r\n\r\n        private void SelectFileButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            OpenFileDialog ofd = new OpenFileDialog();\r\n            ofd.Multiselect = false;\r\n            ofd.InitialDirectory = CommonUtils.ApplicationStartupPath();\r\n            if (ofd.ShowDialog() == true)\r\n            {\r\n                if(ButtonScriptPathType.SelectedIndex == 0)\r\n                {\r\n                    ButtonScript.Text = CommonUtils.ConvertPartToRelative(ofd.FileName);\r\n                }\r\n                else\r\n                {\r\n                    ButtonScript.Text = ofd.FileName;\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/AnswerDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.AnswerDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Select\" ResizeMode=\"CanMinimize\" SizeToContent=\"WidthAndHeight\" WindowStartupLocation=\"CenterScreen\" MinWidth=\"400\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"*\" MaxHeight=\"450\"/>\r\n            <RowDefinition Height=\"64\"/>\r\n        </Grid.RowDefinitions>\r\n        \r\n        <ScrollViewer Focusable=\"False\" IsTabStop=\"False\" Grid.Row=\"0\" Margin=\"0,8,0,8\" VerticalScrollBarVisibility=\"Auto\" HorizontalScrollBarVisibility=\"Disabled\">\r\n            <ItemsControl AutomationProperties.Name=\"Answers\" x:Name=\"AnswerDialogItems\" ItemsSource=\"{Binding Answers}\" Margin=\"8\">\r\n                <ItemsControl.ItemsPanel>\r\n                    <ItemsPanelTemplate>\r\n                        <WrapPanel Orientation=\"Vertical\" ItemWidth=\"500\" Margin=\"10,0,10,0\"/>\r\n                    </ItemsPanelTemplate>\r\n                </ItemsControl.ItemsPanel>\r\n                <ItemsControl.ItemTemplate>\r\n                    <DataTemplate>\r\n                        <Grid Margin=\"8\">\r\n                            <Grid.RowDefinitions>\r\n                                <RowDefinition Height=\"Auto\"/>\r\n                                <RowDefinition Height=\"Auto\"/>\r\n                            </Grid.RowDefinitions>\r\n                            <TextBlock AutomationProperties.Name=\"{Binding AnswerQuestion}\" HorizontalAlignment=\"Left\" Grid.Row=\"0\" Text=\"{Binding AnswerQuestion}\"/>\r\n                            <TextBox Grid.Row=\"1\" Margin=\"5\" Text=\"{Binding AnswerResult}\"/>\r\n                        </Grid>\r\n                    </DataTemplate>\r\n                </ItemsControl.ItemTemplate>\r\n            </ItemsControl>\r\n        </ScrollViewer>\r\n        <Button AutomationProperties.Name=\"Cancel\" Grid.Row=\"1\" Content=\"Cancel\" Click=\"CANCELButton_Click\" Margin=\"5,5,40,5\" Padding=\"5\" HorizontalAlignment=\"Right\"/>\r\n        <Button AutomationProperties.Name=\"Okay\" Grid.Row=\"1\" Content=\"OK\" Click=\"OKButton_Click\" Margin=\"5\" Padding=\"5\" Style=\"{StaticResource AccentButtonStyle}\" HorizontalAlignment=\"Right\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/AnswerDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization.AnswerDialog;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for AnswerDialog.xaml\r\n    /// </summary>\r\n    public partial class AnswerDialog : Window\r\n    {\r\n        public AnswerData answerData = null;\r\n        public AnswerDialog(AnswerData _answerData)\r\n        {\r\n            InitializeComponent();\r\n            answerData = _answerData;\r\n            if (_answerData != null)\r\n            {\r\n                foreach (Answer answer in _answerData.Answers)\r\n                {\r\n                    answer.AnswerResult = \"\";\r\n                }\r\n                AnswerDialogItems.ItemsSource = _answerData.Answers;\r\n            }\r\n        }\r\n\r\n        private void OKButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            bool AllowConfirm = true;\r\n            answerData.Answers = (List<Answer>)AnswerDialogItems.ItemsSource;\r\n            foreach (Answer answer in answerData.Answers)\r\n            {\r\n                if(answer.AnswerResult == \"\" || answer.AnswerResult == null)\r\n                {\r\n                    AllowConfirm = false;\r\n                }\r\n            }\r\n            if(AllowConfirm == false)\r\n            {\r\n                MessageBox.Show(\"Please provide value to all textboxes!\", \"Fill all data\", MessageBoxButton.OK, MessageBoxImage.Warning);\r\n                return;\r\n            }\r\n            DialogResult = true;\r\n        }\r\n\r\n        private void CANCELButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/ColorTagsDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.ColorTagsDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\"\r\n        WindowStyle=\"SingleBorderWindow\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Color tags\" Height=\"430\" Width=\"640\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n        </Grid.RowDefinitions>\r\n        <TextBlock AutomationProperties.Name=\"Color tags\" Grid.Row=\"0\" Padding=\"12\" Grid.Column=\"0\" Text=\"Color tags\" Style=\"{StaticResource HeaderTextBlockStyle}\" Background=\"#E2E2E2\"/>\r\n\r\n        <ui:ScrollViewerEx Focusable=\"False\" IsTabStop=\"False\" Grid.Row=\"1\" VerticalScrollBarVisibility=\"Auto\">\r\n            <Grid Margin=\"15,0,15,0\">\r\n                <Grid.ColumnDefinitions>\r\n                    <ColumnDefinition Width=\"116\"/>\r\n                    <ColumnDefinition Width=\"*\"/>\r\n                </Grid.ColumnDefinitions>\r\n                <Grid.RowDefinitions>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                    <RowDefinition Height=\"56\"/>\r\n                </Grid.RowDefinitions>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"0\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag01.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#DFFF00\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c01EJ\" Grid.Column=\"1\" Grid.Row=\"0\" Text=\"\\c01EJSome text/c01EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"1\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag02.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#FFBF00\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c02EJ\" Grid.Column=\"1\" Grid.Row=\"1\" Text=\"\\c02EJSome text/c02EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"2\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag03.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#FFBF00\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c03EJ\" Grid.Column=\"1\" Grid.Row=\"2\" Text=\"\\c03EJSome text/c03EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"3\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag04.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#DE3163\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c04EJ\" Grid.Column=\"1\" Grid.Row=\"3\" Text=\"\\c04EJSome text/c04EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"4\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag05.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#9FE2BF\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c05EJ\" Grid.Column=\"1\" Grid.Row=\"4\" Text=\"\\c05EJSome text/c05EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"5\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag06.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#40E0D0\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c06EJ\" Grid.Column=\"1\" Grid.Row=\"5\" Text=\"\\c06EJSome text/c06EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"6\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag07.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#6495ED\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c07EJ\" Grid.Column=\"1\" Grid.Row=\"6\" Text=\"\\c07EJSome text/c07EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"7\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag08.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#CCCCFF\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c08EJ\" Grid.Column=\"1\" Grid.Row=\"7\" Text=\"\\c08EJSome text/c08EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"8\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag09.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#800080\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c09EJ\" Grid.Column=\"1\" Grid.Row=\"8\" Text=\"\\c09EJSome text/c09EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"9\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag10.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#3D3D6B\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c10EJ\" Grid.Column=\"1\" Grid.Row=\"9\" Text=\"\\c10EJSome text/c10EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"10\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag11.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#ADD45C\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c11EJ\" Grid.Column=\"1\" Grid.Row=\"10\" Text=\"\\c11EJSome text/c11EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"11\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag12.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#57C785\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c12EJ\" Grid.Column=\"1\" Grid.Row=\"11\" Text=\"\\c12EJSome text/c12EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"12\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag13.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#00BAAD\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c13EJ\" Grid.Column=\"1\" Grid.Row=\"12\" Text=\"\\c13EJSome text/c13EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n\r\n                <Border Grid.Column=\"0\" Grid.Row=\"13\" Margin=\"10,12,10,12\" CornerRadius=\"6\">\r\n                    <Border.Background>\r\n                        <ImageBrush Stretch=\"Fill\" ImageSource=\"pack://application:,,,/Images/ColorTags/tag14.png\"/>\r\n                    </Border.Background>\r\n                    <TextBlock Text=\"#2A7B9B\" VerticalAlignment=\"Center\" Margin=\"5,0,5,0\" TextAlignment=\"Center\" FontSize=\"16\"/>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Color tag \\c14EJ\" Grid.Column=\"1\" Grid.Row=\"13\" Text=\"\\c14EJSome text/c14EJ\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\" TextAlignment=\"Center\" IsReadOnly=\"True\"/>\r\n            </Grid>\r\n        </ui:ScrollViewerEx>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/ColorTagsDialog.xaml.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for ColorTagsDialog.xaml\r\n    /// </summary>\r\n    public partial class ColorTagsDialog : Window\r\n    {\r\n        public ColorTagsDialog()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/ConfigurationDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.ConfigurationDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Configuration\" Height=\"450\" Width=\"700\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n        </Grid.RowDefinitions>\r\n\r\n        <TextBlock Text=\"Configuration\" Grid.Row=\"0\" Background=\"#E2E2E2\" Padding=\"12\" Style=\"{StaticResource HeaderTextBlockStyle}\" />\r\n\r\n        <ui:ScrollViewerEx Focusable=\"False\" IsTabStop=\"False\" Grid.Row=\"1\" VerticalScrollBarVisibility=\"Auto\">\r\n            <Grid Margin=\"15,0,15,0\">\r\n                <Grid.ColumnDefinitions>\r\n                    <ColumnDefinition Width=\"280\"/>\r\n                    <ColumnDefinition Width=\"*\"/>\r\n                </Grid.ColumnDefinitions>\r\n                <Grid.RowDefinitions>\r\n                    <RowDefinition Height=\"64\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"64\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"58\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"48\"/>\r\n                    <RowDefinition Height=\"68\"/>\r\n                </Grid.RowDefinitions>\r\n\r\n                <!-- Common parameters part -->\r\n                <TextBlock Grid.Row=\"0\" Text=\"Common parameters\" FontSize=\"22\" FontWeight=\"DemiBold\" Margin=\"10,4,10,10\" VerticalAlignment=\"Bottom\"/>\r\n\r\n                <Border Grid.Row=\"1\" Grid.Column=\"0\" BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Default PowerShell path\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Default PowerShell path Help\" Name=\"HelpConfigurationDefaultPowershellPath\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Path to PowerShell executable\" Name=\"DefaultPowerShellPath\" Grid.Row=\"1\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"2\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Default CMD path\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for default cmd.exe path\" Name=\"HelpConfigurationDefaultCMDPath\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Path to cmd.exe executable\" Name=\"DefaultCMDPath\" Grid.Row=\"2\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"3\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"PowerShell arguments\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Arguements to pass to PowerShell Executable\" Name=\"HelpConfigurationPowerShellArguments\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Arguements to pass to PowerShell\" Name=\"PowerShellArguments\" Grid.Row=\"3\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"4\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Console background\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Console background colour\" Name=\"HelpConfigurationConsoleBackground\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Console background colour\" Name=\"ConsoleBackground\" Grid.Row=\"4\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"5\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Console foreground\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for console forground colour\" Name=\"HelpConfigurationConsoleForeground\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <TextBox AutomationProperties.Name=\"Console forground colour\" Name=\"ConsoleForeground\" Grid.Row=\"5\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"6\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Console ignore color tags\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for ignore console colour tags\" Name=\"HelpConfigurationConsoleIgnoreColorTags\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Ignore console colour tags\" Name=\"ConsoleIgnoreColorTags\" Grid.Row=\"6\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"7\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Clear events when reload\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"HElp for Clear output on reload\" Name=\"HelpConfigurationClearEventsWhenReload\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Clear output on reload\" Name=\"ClearEventsWhenReload\" Grid.Row=\"7\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <!-- Restrictions part -->\r\n                <TextBlock Grid.Row=\"8\" Text=\"Restrictions\" FontSize=\"22\" FontWeight=\"DemiBold\" Margin=\"10,4,10,10\" VerticalAlignment=\"Bottom\"/>\r\n\r\n                <Border Grid.Row=\"9\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block tabs remove\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for remove tabs\" Name=\"HelpConfigurationBlockTabsRemove\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Remove tabs\" Name=\"BlockTabsRemove\" Grid.Row=\"9\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"10\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons remove\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help on remove script buttons\" Name=\"HelpConfigurationBlockButtonsRemove\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Remove script buttons\" Name=\"BlockButtonsRemove\" Grid.Row=\"10\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"11\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block tabs add\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Add tabs\" Name=\"HelpConfigurationBlockTabsAdd\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Remove tabs\" Name=\"BlockTabsAdd\" Grid.Row=\"11\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"12\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons add\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for add buttons\" Name=\"HelpConfigurationBlockButtonsAdd\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Add buttons\" Name=\"BlockButtonsAdd\" Grid.Row=\"12\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"13\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons reorder\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow script button rename\" Name=\"HelpConfigurationBlockButtonsReorder\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow renaming script buttons\" Name=\"BlockButtonsReorder\" Grid.Row=\"13\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"14\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons edit\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow script buttons edit\" Name=\"HelpConfigurationBlockButtonsEdit\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow editing script buttons\" Name=\"BlockButtonsEdit\" Grid.Row=\"14\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"15\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block tabs rename\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow renaming block tabs\" Name=\"HelpConfigurationBlockTabsRename\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow renaming tabs\" Name=\"BlockTabsRename\" Grid.Row=\"15\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"16\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons paste\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for buttons paste\" Name=\"HelpConfigurationBlockButtonsPaste\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Block buttons paste\" Name=\"BlockButtonsPaste\" Grid.Row=\"16\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"17\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Block buttons copy\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow buttons copy\" Name=\"HelpConfigurationBlockButtonsCopy\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Block buttons copy\" Name=\"BlockButtonsCopy\" Grid.Row=\"17\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"18\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide File->Reload config\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow reload config\" Name=\"HelpConfigurationHideFileReloadConfig\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow reloading config\" Name=\"HideFileReloadConfigMenuItem\" Grid.Row=\"18\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"19\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide File->Open app folder\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Allow open app settings folder\" Name=\"HelpConfigurationHideFileOpenAppFolder\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow opening app settings folder\" Name=\"HideFileOpenAppFolderMenuItem\" Grid.Row=\"19\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"20\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide File->Clear events list\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow clear events list\" Name=\"HelpConfigurationHideClearEventsList\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow clear events list\" Name=\"HideFileClearEventsListMenuItem\" Grid.Row=\"20\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n                \r\n                <Border Grid.Row=\"21\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for allow configure settings\" Name=\"HelpConfigurationHideSettings\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow configure settings\" Name=\"HideSettingsMenuItem\" Grid.Row=\"21\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"22\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide workflow\" Name=\"HelpConfigurationHideSettingsWorkflow\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide settings workflow\" Name=\"HideSettingsWorkflowMenuItem\" Grid.Row=\"22\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"23\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Reorder tabs\" FontSize=\"16\" Margin=\"10,4,10,4\" Padding=\"0,0,8,0\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n                        <Button AutomationProperties.Name=\"Help for hide workflow reorder tabs\" Name=\"HelpConfigurationHideSettingsWorkflowReorderTabs\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide settings workflow reorder tabs\" Name=\"HideSettingsWorkflowReorderTabsMenuItem\" Grid.Row=\"23\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"24\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Add tab\" FontSize=\"16\" Margin=\"10,4,18,4\" VerticalAlignment=\"Center\" TextWrapping=\"WrapWithOverflow\"/>\r\n                        <Button AutomationProperties.Name=\"Help for hide settings workflow add tab\" Name=\"HelpConfigurationHideSettingsWorkflowAddTab\" Width=\"14\" Height=\"14\" Margin=\"2,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide settings workflow add tab\" Name=\"HideSettingsWorkflowAddTabMenuItem\" Grid.Row=\"24\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"25\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Remove current tab\" FontSize=\"16\" Margin=\"10,4,18,4\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n                        <Button AutomationProperties.Name=\"Help for add settings workflow hide current tab\" Name=\"HelpConfigurationHideSettingsWorkflowRemoveCurrentTab\" Width=\"14\" Height=\"14\" Margin=\"4,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Allow settings workflow hide current tab\" Name=\"HideSettingsWorkflowRemoveCurrentTabMenuItem\" Grid.Row=\"25\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"26\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Rename current tab\" FontSize=\"16\" Margin=\"10,4,18,4\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n                        <Button AutomationProperties.Name=\"Help for workflow settings hide rename current tab\" Name=\"HelpConfigurationHideSettingsWorkflowRenameCurrentTab\" Width=\"14\" Height=\"14\" Margin=\"4,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"settings workflow hide rename current tab\" Name=\"HideSettingsWorkflowRenameCurrentTabMenuItem\" Grid.Row=\"26\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"27\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Add button to current tab\" FontSize=\"16\" Margin=\"10,4,22,4\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n                        <Button AutomationProperties.Name=\"Help for settings workflow hide add button to current tab\" Name=\"HelpConfigurationHideSettingsWorkflowAddButtonToCurrentTab\" Width=\"14\" Height=\"14\" Margin=\"2,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Settings Workflow hide add button to current tab\" Name=\"HideSettingsWorkflowAddButtonToCurrentTabMenuItem\" Grid.Row=\"27\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"28\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Workflow->Reorder buttons in current tab\" FontSize=\"16\" Margin=\"10,4,22,4\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n                        <Button AutomationProperties.Name=\"Help for settings workflow hide reorder  buttons in current tab\" Name=\"HelpConfigurationHideSettingsWorkflowReorderButtonsInCurrentTab\" Width=\"14\" Height=\"14\" Margin=\"2,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Settings Workflow hide reorder buttons in current tab\" Name=\"HideSettingsWorkflowReorderButtonsInCurrentTabMenuItem\" Grid.Row=\"28\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"29\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Settings->Configuration\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide settings\" Name=\"HelpConfigurationHideSettingsConfiguration\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide settings\" Name=\"HideSettingsConfigurationMenuItem\" Grid.Row=\"29\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"30\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Help\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide Help menu\" Name=\"HelpConfigurationHideHelp\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide help menu\" Name=\"HideHelpMenuItem\" Grid.Row=\"30\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"31\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Help->Troubleshooting\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide Help Troubleshoot\" Name=\"HelpConfigurationHideTroubleshooting\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide Help Troubleshoot\" Name=\"HideHelpTroubleshootingMenuItem\" Grid.Row=\"31\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"32\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Help->Color tags\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide Help Color tags\" Name=\"HelpConfigurationHideColorTags\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide Help Color tags\" Name=\"HideHelpColorTagsMenuItem\" Grid.Row=\"32\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Border Grid.Row=\"33\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <DockPanel>\r\n                        <TextBlock Text=\"Hide Help->About\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Center\"/>\r\n                        <Button AutomationProperties.Name=\"Help for Hide Help About\" Name=\"HelpConfigurationHideAbout\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                            <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n                        </Button>\r\n                    </DockPanel>\r\n                </Border>\r\n                <ComboBox AutomationProperties.Name=\"Hide Help About\" Name=\"HideHelpAboutMenuItem\" Grid.Row=\"33\" Grid.Column=\"1\" VerticalAlignment=\"Center\" Margin=\"10,0,10,0\">\r\n                    <ComboBoxItem>Yes</ComboBoxItem>\r\n                    <ComboBoxItem>No</ComboBoxItem>\r\n                </ComboBox>\r\n\r\n                <Button AutomationProperties.Name=\"Save\" Grid.Row=\"34\" Grid.Column=\"1\" Content=\"Save\" HorizontalAlignment=\"Right\" Margin=\"10,4,10,14\" VerticalAlignment=\"Bottom\" Style=\"{StaticResource AccentButtonStyle}\" Click=\"SaveButton_Click\"/>\r\n            </Grid>\r\n        </ui:ScrollViewerEx>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/ConfigurationDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.Utils;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for Configuration.xaml\r\n    /// </summary>\r\n    public partial class ConfigurationDialog : Window\r\n    {\r\n        private Config config;\r\n\r\n        public ConfigurationDialog(Config _config)\r\n        {\r\n            InitializeComponent();\r\n            config = _config;\r\n            LoadConfiguration();\r\n        }\r\n\r\n        private void LoadConfiguration()\r\n        {\r\n            // Common parameters\r\n            DefaultPowerShellPath.Text = config.default_powershell_path;\r\n            DefaultCMDPath.Text = config.default_cmd_path;\r\n            PowerShellArguments.Text = config.powershell_arguments;\r\n            ConsoleBackground.Text = config.console_background;\r\n            ConsoleForeground.Text = config.console_foreground;\r\n            SetComboBoxFromValue(ConsoleIgnoreColorTags, config.console_ignore_color_tags);\r\n            SetComboBoxFromValue(ClearEventsWhenReload, config.clear_events_when_reload);\r\n\r\n            // Restrictions\r\n            SetComboBoxFromValue(BlockTabsRemove, config.restrictions.block_tabs_remove);\r\n            SetComboBoxFromValue(BlockButtonsRemove, config.restrictions.block_buttons_remove);\r\n            SetComboBoxFromValue(BlockTabsAdd, config.restrictions.block_tabs_add);\r\n            SetComboBoxFromValue(BlockButtonsAdd, config.restrictions.block_buttons_add);\r\n            SetComboBoxFromValue(BlockButtonsReorder, config.restrictions.block_buttons_reorder);\r\n            SetComboBoxFromValue(BlockButtonsEdit, config.restrictions.block_buttons_edit);\r\n            SetComboBoxFromValue(BlockTabsRename, config.restrictions.block_tabs_rename);\r\n            SetComboBoxFromValue(BlockButtonsPaste, config.restrictions.block_buttons_paste);\r\n            SetComboBoxFromValue(BlockButtonsCopy, config.restrictions.block_buttons_copy);\r\n            SetComboBoxFromValue(HideFileReloadConfigMenuItem, config.restrictions.hide_menu_item_file_reload_config);\r\n            SetComboBoxFromValue(HideFileOpenAppFolderMenuItem, config.restrictions.hide_menu_item_file_open_app_folder);\r\n            SetComboBoxFromValue(HideFileClearEventsListMenuItem, config.restrictions.hide_menu_item_file_clear_events_list);\r\n            SetComboBoxFromValue(HideSettingsMenuItem, config.restrictions.hide_menu_item_settings);\r\n            SetComboBoxFromValue(HideSettingsWorkflowMenuItem, config.restrictions.hide_menu_item_settings_workflow);\r\n            SetComboBoxFromValue(HideSettingsWorkflowReorderTabsMenuItem, config.restrictions.hide_menu_item_settings_workflow_reorder_tabs);\r\n            SetComboBoxFromValue(HideSettingsWorkflowAddTabMenuItem, config.restrictions.hide_menu_item_settings_workflow_add_tab);\r\n            SetComboBoxFromValue(HideSettingsWorkflowRemoveCurrentTabMenuItem, config.restrictions.hide_menu_item_settings_workflow_remove_current_tab);\r\n            SetComboBoxFromValue(HideSettingsWorkflowRenameCurrentTabMenuItem, config.restrictions.hide_menu_item_settings_workflow_rename_current_tab);\r\n            SetComboBoxFromValue(HideSettingsWorkflowAddButtonToCurrentTabMenuItem, config.restrictions.hide_menu_item_settings_workflow_add_button_to_current_tab);\r\n            SetComboBoxFromValue(HideSettingsWorkflowReorderButtonsInCurrentTabMenuItem, config.restrictions.hide_menu_item_settings_workflow_reorder_buttons_in_current_tab);\r\n            SetComboBoxFromValue(HideSettingsConfigurationMenuItem, config.restrictions.hide_menu_item_settings_configuration);\r\n            SetComboBoxFromValue(HideHelpMenuItem, config.restrictions.hide_menu_item_help);\r\n            SetComboBoxFromValue(HideHelpTroubleshootingMenuItem, config.restrictions.hide_menu_item_help_troubleshooting);\r\n            SetComboBoxFromValue(HideHelpColorTagsMenuItem, config.restrictions.hide_menu_item_help_colortags);\r\n            SetComboBoxFromValue(HideHelpAboutMenuItem, config.restrictions.hide_menu_item_help_about);\r\n        }\r\n\r\n        private void SetComboBoxFromValue(ComboBox comboBox, bool value)\r\n        {\r\n            if(value == true)\r\n            {\r\n                comboBox.SelectedIndex = 0;\r\n            }\r\n            else\r\n            {\r\n                comboBox.SelectedIndex = 1;\r\n            }\r\n        }\r\n\r\n        private bool GetComboBoxValue(ComboBox comboBox)\r\n        {\r\n            if (comboBox.SelectedIndex == 0)\r\n            {\r\n                return true;\r\n            }\r\n            else\r\n            {\r\n                return false;\r\n            }\r\n        }\r\n\r\n        private void SaveButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            config.default_powershell_path = DefaultPowerShellPath.Text;\r\n            config.default_cmd_path = DefaultCMDPath.Text;\r\n            config.powershell_arguments = PowerShellArguments.Text;\r\n            config.console_background = ConsoleBackground.Text;\r\n            config.console_foreground = ConsoleForeground.Text;\r\n            config.console_ignore_color_tags = GetComboBoxValue(ConsoleIgnoreColorTags);\r\n            config.clear_events_when_reload = GetComboBoxValue(ClearEventsWhenReload);\r\n\r\n            config.restrictions.block_tabs_remove = GetComboBoxValue(BlockTabsRemove);\r\n            config.restrictions.block_buttons_remove = GetComboBoxValue(BlockButtonsRemove);\r\n            config.restrictions.block_tabs_add = GetComboBoxValue(BlockTabsAdd);\r\n            config.restrictions.block_buttons_add = GetComboBoxValue(BlockButtonsAdd);\r\n            config.restrictions.block_buttons_reorder = GetComboBoxValue(BlockButtonsReorder);\r\n            config.restrictions.block_buttons_edit = GetComboBoxValue(BlockButtonsEdit);\r\n            config.restrictions.block_tabs_rename = GetComboBoxValue(BlockTabsRename);\r\n            config.restrictions.block_buttons_paste = GetComboBoxValue(BlockButtonsPaste);\r\n            config.restrictions.block_buttons_copy = GetComboBoxValue(BlockButtonsCopy);\r\n            config.restrictions.hide_menu_item_file_reload_config = GetComboBoxValue(HideFileReloadConfigMenuItem);\r\n            config.restrictions.hide_menu_item_file_open_app_folder = GetComboBoxValue(HideFileOpenAppFolderMenuItem);\r\n            config.restrictions.hide_menu_item_file_clear_events_list = GetComboBoxValue(HideFileClearEventsListMenuItem);\r\n            config.restrictions.hide_menu_item_settings = GetComboBoxValue(HideSettingsMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow = GetComboBoxValue(HideSettingsWorkflowMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_reorder_tabs = GetComboBoxValue(HideSettingsWorkflowReorderTabsMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_add_tab = GetComboBoxValue(HideSettingsWorkflowAddTabMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_remove_current_tab = GetComboBoxValue(HideSettingsWorkflowRemoveCurrentTabMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_rename_current_tab = GetComboBoxValue(HideSettingsWorkflowRenameCurrentTabMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_add_button_to_current_tab = GetComboBoxValue(HideSettingsWorkflowAddButtonToCurrentTabMenuItem);\r\n            config.restrictions.hide_menu_item_settings_workflow_reorder_buttons_in_current_tab = GetComboBoxValue(HideSettingsWorkflowReorderButtonsInCurrentTabMenuItem);\r\n            config.restrictions.hide_menu_item_settings_configuration = GetComboBoxValue(HideSettingsConfigurationMenuItem);\r\n            config.restrictions.hide_menu_item_help = GetComboBoxValue(HideHelpMenuItem);\r\n            config.restrictions.hide_menu_item_help_troubleshooting = GetComboBoxValue(HideHelpTroubleshootingMenuItem);\r\n            config.restrictions.hide_menu_item_help_colortags = GetComboBoxValue(HideHelpColorTagsMenuItem);\r\n            config.restrictions.hide_menu_item_help_about = GetComboBoxValue(HideHelpAboutMenuItem);\r\n\r\n            if(ConfigUtils.SaveFromConfigToFile(config) == true)\r\n            {\r\n                MessageBox.Show(\"Settings saved!\", \"Success\", MessageBoxButton.OK, MessageBoxImage.Information);\r\n            }\r\n        }\r\n\r\n        private void HelpButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            Button button = sender as Button;\r\n            HelpDialog hd = new HelpDialog(button.Name);\r\n            hd.ShowDialog();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/EditActionButtonDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.EditActionButtonDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Edit button\" Height=\"600\" Width=\"400\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"22\"/>\r\n            <RowDefinition Height=\"34\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"64\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"64\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"38\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"38\"/>\r\n            <RowDefinition Height=\"26\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n            <RowDefinition Height=\"44\"/>\r\n        </Grid.RowDefinitions>\r\n        <DockPanel Grid.Row=\"0\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Text\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for Script button name\" Name=\"HelpAddActionButtonText\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel><TextBox AutomationProperties.Name=\"Script button text\" x:Name=\"ButtonText\" Grid.Row=\"1\" Margin=\"10,2,10,0\" FontSize=\"14\" VerticalAlignment=\"Center\"/>\r\n\r\n        <DockPanel Grid.Row=\"2\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Description\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for Script description\" Name=\"HelpAddActionButtonDescription\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <TextBox x:Name=\"ButtonDescription\" AutomationProperties.Name=\"Script description\" Grid.Row=\"3\" Margin=\"10,2,10,0\" FontSize=\"14\" TextWrapping=\"Wrap\" VerticalScrollBarVisibility=\"Auto\"/>\r\n\r\n        <DockPanel Grid.Row=\"4\">\r\n            <TextBlock Grid.Row=\"4\" Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Select file dialog on script path\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"SelectFileButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/find.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n\t\t\t<Button AutomationProperties.Name=\"Help for Path to script\" Name=\"HelpAddActionButtonScript\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <TextBox AutomationProperties.Name=\"Path to script\" x:Name=\"ButtonScript\" Grid.Row=\"5\" Margin=\"10,2,10,0\" FontSize=\"14\" TextWrapping=\"Wrap\" VerticalScrollBarVisibility=\"Auto\"/>\r\n\r\n        <DockPanel Grid.Row=\"6\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script path type\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for Script path type\" Name=\"HelpAddActionButtonScriptPathType\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <ComboBox AutomationProperties.Name=\"Script path type\" x:Name=\"ButtonScriptPathType\" Grid.Row=\"7\" Margin=\"10,2,10,0\" FontSize=\"14\">\r\n            <ComboBoxItem IsSelected=\"True\">Relative</ComboBoxItem>\r\n            <ComboBoxItem >Absolute</ComboBoxItem>\r\n        </ComboBox>\r\n\r\n        <DockPanel Grid.Row=\"8\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Script type\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Script type\" Name=\"HelpAddActionButtonScriptType\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <ComboBox AutomationProperties.Name=\"Script type\" x:Name=\"ButtonScriptType\" Grid.Row=\"9\" Margin=\"10,2,10,0\" FontSize=\"14\">\r\n            <ComboBoxItem IsSelected=\"True\">PowerShell</ComboBoxItem>\r\n            <ComboBoxItem >Batch</ComboBoxItem>\r\n        </ComboBox>\r\n\r\n        <DockPanel Grid.Row=\"10\">\r\n            <TextBlock Margin=\"10,0,0,0\" FontSize=\"14\" VerticalAlignment=\"Center\" Text=\"Arguments\" HorizontalAlignment=\"Left\"/>\r\n            <Button AutomationProperties.Name=\"Help for Script Arguements\" Name=\"HelpAddActionButtonArguments\" Width=\"14\" Height=\"14\" Margin=\"8,0,0,0\" Click=\"HelpButton_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/help.png\" Margin=\"-9,-5,-5,-6\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        <Grid Grid.Row=\"11\">\r\n            <Grid.RowDefinitions>\r\n                <RowDefinition Height=\"*\"/>\r\n                <RowDefinition Height=\"44\"/>\r\n            </Grid.RowDefinitions>\r\n            <Border Grid.Row=\"0\" Margin=\"10,0,10,0\" BorderBrush=\"#333333\" BorderThickness=\"1\" CornerRadius=\"2\">\r\n                <ListBox AutomationProperties.Name=\"Script arguements\" x:Name=\"ButtonScriptArguments\">\r\n                    <ListBox.ItemTemplate>\r\n                        <DataTemplate>\r\n                            <StackPanel Margin=\"-5\" Orientation=\"Horizontal\">\r\n                                <Button AutomationProperties.Name=\"Delete arguement\" x:Name=\"DeleteArgumentButton\" Margin=\"0\" Height=\"25\" Width=\"25\" Click=\"DeleteArgumentButton_Click\">\r\n                                    <StackPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                                        <Image Source=\"pack://application:,,,/Images/close.png\" Margin=\"-6,-2,-6,-2\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                                    </StackPanel>\r\n                                </Button>\r\n                                <TextBlock AutomationProperties.LabeledBy=\"{Binding Path=AnswerQuestion}\" Margin=\"10 0 2 0\" Text=\"{Binding Path=AnswerQuestion}\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\"/>\r\n                            </StackPanel>\r\n                        </DataTemplate>\r\n                    </ListBox.ItemTemplate>\r\n                </ListBox>\r\n            </Border>\r\n            <Button AutomationProperties.Name=\"Add arguement\" Grid.Row=\"1\" Content=\"Add\" Click=\"ADDButton_Click\" Margin=\"10,0,0,0\" Padding=\"5\"/>\r\n            <TextBox AutomationProperties.Name=\"Arguement\" x:Name=\"ButtonScriptArgumentText\" Grid.Row=\"2\" Margin=\"55,6,10,6\"/>\r\n        </Grid>\r\n        <Button Grid.Row=\"13\" Content=\"Save\" AutomationProperties.Name=\"Save\" Margin=\"5\" Padding=\"5\" HorizontalAlignment=\"Right\" Style=\"{StaticResource AccentButtonStyle}\" Click=\"SaveButton_Click\"/>\r\n        <Button Grid.Row=\"13\" Content=\"Cancel\" AutomationProperties.Name=\"Cancel\" Margin=\"5,5,50,5\" Padding=\"5\" HorizontalAlignment=\"Right\" Click=\"CancelButton_Click\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/EditActionButtonDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.Serialization.AnswerDialog;\r\nusing EasyJob.TabItems;\r\nusing EasyJob.Utils;\r\nusing Microsoft.Win32;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for EditButtonDialog.xaml\r\n    /// </summary>\r\n    public partial class EditActionButtonDialog : Window\r\n    {\r\n        public ActionButton actionButton = null;\r\n\r\n        public EditActionButtonDialog(ActionButton _actionButton)\r\n        {\r\n            InitializeComponent();\r\n\r\n            actionButton = _actionButton;\r\n            ButtonText.Text = actionButton.ButtonText;\r\n            ButtonDescription.Text = actionButton.ButtonDescription;\r\n            ButtonScript.Text = actionButton.ButtonScript;\r\n            if (actionButton.ButtonScriptPathType == \"relative\") { ButtonScriptPathType.SelectedIndex = 0; }\r\n            else { ButtonScriptPathType.SelectedIndex = 1; }\r\n            if (actionButton.ButtonScriptType == \"powershell\"){ ButtonScriptType.SelectedIndex = 0; }\r\n            else { ButtonScriptType.SelectedIndex = 1; }\r\n            List<Answer> answers = actionButton.ButtonArguments;\r\n            foreach (Answer ans in answers)\r\n            {\r\n                ButtonScriptArguments.Items.Add(new Answer { AnswerQuestion = ans.AnswerQuestion, AnswerResult = ans.AnswerResult });\r\n            }\r\n        }\r\n\r\n        private string ConvertScriptTypeComboBoxToString(ComboBox cb)\r\n        {\r\n            if (cb.SelectedIndex == 0)\r\n            {\r\n                return \"powershell\";\r\n            }\r\n            else\r\n            {\r\n                return \"bat\";\r\n            }\r\n        }\r\n\r\n        private string ConvertScriptPathTypeComboBoxToString(ComboBox cb)\r\n        {\r\n            if (cb.SelectedIndex == 0)\r\n            {\r\n                return \"relative\";\r\n            }\r\n            else\r\n            {\r\n                return \"absolute\";\r\n            }\r\n        }\r\n\r\n        private void ADDButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                ButtonScriptArguments.Items.Add(new Answer { AnswerQuestion = ButtonScriptArgumentText.Text, AnswerResult = \"\" });\r\n                ButtonScriptArgumentText.Text = \"\";\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private void DeleteArgumentButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            try\r\n            {\r\n                Button btn = sender as Button;\r\n                ButtonScriptArguments.Items.Remove((Answer)btn.DataContext);\r\n            }\r\n            catch { }\r\n        }\r\n\r\n        private void SaveButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            actionButton.ButtonText = ButtonText.Text;\r\n            actionButton.ButtonDescription = ButtonDescription.Text;\r\n            actionButton.ButtonScript = ButtonScript.Text;\r\n            actionButton.ButtonScriptPathType = ConvertScriptPathTypeComboBoxToString(ButtonScriptPathType);\r\n            actionButton.ButtonScriptType = ConvertScriptTypeComboBoxToString(ButtonScriptType);\r\n\r\n            actionButton.ButtonArguments.Clear();\r\n            foreach (Answer ans in ButtonScriptArguments.Items)\r\n            {\r\n                actionButton.ButtonArguments.Add(new Answer { AnswerQuestion = ans.AnswerQuestion, AnswerResult = ans.AnswerResult });\r\n            }\r\n\r\n            DialogResult = true;\r\n        }\r\n\r\n        private void CancelButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n\r\n        private void HelpButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            Button button = sender as Button;\r\n            HelpDialog hd = new HelpDialog(button.Name);\r\n            hd.ShowDialog();\r\n        }\r\n\r\n        private void SelectFileButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            OpenFileDialog ofd = new OpenFileDialog();\r\n            ofd.Multiselect = false;\r\n            ofd.InitialDirectory = CommonUtils.ApplicationStartupPath();\r\n            if (ofd.ShowDialog() == true)\r\n            {\r\n                if (ButtonScriptPathType.SelectedIndex == 0)\r\n                {\r\n                    ButtonScript.Text = CommonUtils.ConvertPartToRelative(ofd.FileName);\r\n                }\r\n                else\r\n                {\r\n                    ButtonScript.Text = ofd.FileName;\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/HelpDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.HelpDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/help.png\"\r\n        Title=\"Help\" Height=\"470\" Width=\"300\" WindowStartupLocation=\"CenterScreen\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"Auto\"/>\r\n            <RowDefinition Height=\"Auto\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n        </Grid.RowDefinitions>\r\n\r\n        <TextBlock Grid.Row=\"0\" Name=\"HelpHeading\" Text=\"\" Padding=\"10\" Background=\"#E2E2E2\" FontSize=\"30\" VerticalAlignment=\"Center\" FontWeight=\"Bold\" TextWrapping=\"Wrap\"/>\r\n        <TextBlock Grid.Row=\"1\" Name=\"HelpUsed\" Text=\"\" Padding=\"10,12,10,6\" Foreground=\"#404040\" TextWrapping=\"Wrap\"/>\r\n        \r\n        <ui:ScrollViewerEx Focusable=\"False\" IsTabStop=\"False\" Grid.Row=\"2\" VerticalScrollBarVisibility=\"Auto\">\r\n            <Grid Name=\"HelpInfoGrid\" Margin=\"15,0,15,0\">\r\n                <Grid.RowDefinitions>\r\n                    <RowDefinition Height=\"Auto\"/>\r\n                    <RowDefinition Height=\"Auto\"/>\r\n                </Grid.RowDefinitions>\r\n                <TextBlock Grid.Row=\"0\" Name=\"HelpDescription\" Padding=\"0,8,0,8\" TextWrapping=\"Wrap\" FontStyle=\"Italic\"/>\r\n                <MediaElement Grid.Row=\"1\" Name=\"HelpVideo\" LoadedBehavior=\"Manual\"/>\r\n                <Button Grid.Row=\"1\" Margin=\"5,5,55,5\" Height=\"20\" Width=\"20\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Top\" Click=\"PlayVideoButton_Click\">\r\n                    <StackPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                        <Image Source=\"pack://application:,,,/Images/play.png\" Margin=\"-6,-2,-6,-2\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                    </StackPanel>\r\n                </Button>\r\n                <Button AutomationProperties.Name=\"Stop video\" Grid.Row=\"1\" Margin=\"5,5,30,5\" Height=\"20\" Width=\"20\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Top\" Click=\"StopVideoButton_Click\">\r\n                    <StackPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                        <Image Source=\"pack://application:,,,/Images/stop.png\" Margin=\"-6,-2,-6,-2\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                    </StackPanel>\r\n                </Button>\r\n                <Button AutomationProperties.Name=\"Reload video\" Grid.Row=\"1\" Margin=\"5\" Height=\"20\" Width=\"20\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Top\" Click=\"ReloadVideoButton_Click\">\r\n                    <StackPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\" Background=\"Transparent\">\r\n                        <Image Source=\"pack://application:,,,/Images/reload.png\" Margin=\"-8,-4,-8,-4\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"/>\r\n                    </StackPanel>\r\n                </Button>\r\n            </Grid>\r\n        </ui:ScrollViewerEx>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/HelpDialog.xaml.cs",
    "content": "﻿using EasyJob.Utils;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\nusing System.Xml;\r\nusing System.Xml.Linq;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for HelpDialog.xaml\r\n    /// </summary>\r\n    public partial class HelpDialog : Window\r\n    {\r\n        public HelpDialog(string helpitem)\r\n        {\r\n            InitializeComponent(); \r\n            LoadXml(helpitem);\r\n        }\r\n\r\n        private void LoadXml(string helpitem)\r\n        {\r\n            XmlDocument doc = new XmlDocument();\r\n            doc.LoadXml(CommonUtils.ReadAssemblyFile(@\"EasyJob.Documentation.HelpDocumentation.xml\"));\r\n\r\n            XmlNodeList nodeList = doc.SelectNodes(\"/items/item[name='\" + helpitem + \"']\");\r\n\r\n            HelpHeading.Text = nodeList[0][\"heading\"].InnerText;\r\n            HelpUsed.Text = nodeList[0][\"used\"].InnerText;\r\n            HelpDescription.Text = nodeList[0][\"description\"].InnerText;\r\n            if (nodeList[0][\"video\"].InnerText != \"\" || nodeList[0][\"video\"].InnerText != null)\r\n            {\r\n                try\r\n                {\r\n                    HelpVideo.HorizontalAlignment = HorizontalAlignment.Stretch;\r\n                    HelpVideo.VerticalAlignment = VerticalAlignment.Stretch;\r\n                    HelpVideo.Stretch = Stretch.Fill;\r\n                    HelpVideo.Volume = 0;\r\n                    HelpVideo.Source = new Uri(@\"Documentation\\Videos\\\" + nodeList[0][\"video\"].InnerText, UriKind.Relative);\r\n                    HelpVideo.Position = TimeSpan.FromSeconds(0);\r\n                    HelpVideo.Play();\r\n                }\r\n                catch { }\r\n            }\r\n        }\r\n\r\n        private void ReloadVideoButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            HelpVideo.Position = TimeSpan.FromSeconds(0);\r\n            HelpVideo.Play();\r\n        }\r\n\r\n        private void StopVideoButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            HelpVideo.Stop();\r\n        }\r\n\r\n        private void PlayVideoButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            HelpVideo.Play();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/NewTabDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.NewTabDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" ResizeMode=\"NoResize\" WindowStartupLocation=\"CenterScreen\"\r\n        Title=\"Create new Tab\" Height=\"260\" Width=\"400\" Icon=\"pack://application:,,,/Images/icon.ico\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"36\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n            <RowDefinition Height=\"40\"/>\r\n        </Grid.RowDefinitions>\r\n\r\n        <TextBlock Padding=\"12\" Grid.Row=\"0\" Text=\"Create new tab\" Style=\"{StaticResource HeaderTextBlockStyle}\" Background=\"#E2E2E2\"/>\r\n        <Label Content=\"Please specify new tab name\" Margin=\"8\" Grid.Row=\"1\"/>\r\n        <TextBox AutomationProperties.Name=\"Create new tab. Type the name\" x:Name=\"CreateNewTabTextBox\" Grid.Row=\"2\" Margin=\"10,10,10,10\" Height=\"16\"/>\r\n        <Button Grid.Row=\"3\" Content=\"Add\" Margin=\"0,0,10,0\" HorizontalAlignment=\"Right\" Style=\"{StaticResource AccentButtonStyle}\" Click=\"CreateNewTabButton_Click\"/>\r\n        <Button Grid.Row=\"13\" Content=\"Cancel\" Click=\"CancelButton_Click\" Margin=\"5,5,60,5\" Padding=\"5\" HorizontalAlignment=\"Right\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/NewTabDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.TabItems;\r\nusing EasyJob.Utils;\r\nusing Newtonsoft.Json;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for NewTabDialog.xaml\r\n    /// </summary>\r\n    public partial class NewTabDialog : Window\r\n    {\r\n        public string configJson = \"\";\r\n        public Config config;\r\n        ObservableCollection<TabData> TabItems = null;\r\n\r\n        public NewTabDialog()\r\n        {\r\n            InitializeComponent();\r\n            LoadConfig();\r\n        }\r\n\r\n        public void LoadConfig()\r\n        {\r\n            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + \"config.json\"))\r\n            {\r\n                try\r\n                {\r\n                    configJson = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + \"config.json\");\r\n                    config = JsonConvert.DeserializeObject<Config>(configJson);\r\n\r\n                    TabItems = ConfigUtils.ConvertTabsFromConfigToUI(config);\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(ex.Message);\r\n                }\r\n            }\r\n            else\r\n            {\r\n                MessageBox.Show(\"File \" + AppDomain.CurrentDomain.BaseDirectory + \"config.json does not exist.\");\r\n            }\r\n        }\r\n\r\n        public bool SaveConfig()\r\n        {\r\n            string path = AppDomain.CurrentDomain.BaseDirectory + \"config.json\";\r\n            if (File.Exists(path))\r\n            {\r\n                try\r\n                {\r\n                    config.tabs.Clear();\r\n                    config.tabs = ConfigUtils.ConvertTabsFromUIToConfig(TabItems);\r\n\r\n                    if (ConfigUtils.SaveFromConfigToFile(config) == true)\r\n                    {\r\n                        return true;\r\n                    }\r\n                    else\r\n                    {\r\n                        return false;\r\n                    }\r\n                }\r\n                catch\r\n                {\r\n                    return false;\r\n                }\r\n            }\r\n            else\r\n            {\r\n                //SaveConfig();\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        private void CreateNewTabButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (!string.IsNullOrEmpty(CreateNewTabTextBox.Text))\r\n            {\r\n                TabData tabData = new TabData(CreateNewTabTextBox.Text);\r\n                TabItems.Add(tabData);\r\n\r\n                if (SaveConfig())\r\n                {\r\n                    DialogResult = true;\r\n                }\r\n                else\r\n                {\r\n                    MessageBox.Show(\"Error trying to save added Tab.\");\r\n                }\r\n            }\r\n            else\r\n            {\r\n                MessageBox.Show(\"Tab header name should not be empty.\");\r\n            }\r\n        }\r\n        private void CancelButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/RenameTabDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.RenameTabDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" ResizeMode=\"NoResize\" WindowStartupLocation=\"CenterScreen\"\r\n        Title=\"Rename tab\" Height=\"260\" Width=\"400\" Icon=\"pack://application:,,,/Images/icon.ico\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"36\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n            <RowDefinition Height=\"40\"/>\r\n        </Grid.RowDefinitions>\r\n\r\n        <TextBlock Padding=\"12\" Grid.Row=\"0\" Text=\"Rename current tab\" Style=\"{StaticResource HeaderTextBlockStyle}\" Background=\"#E2E2E2\"/>\r\n        <Label Content=\"Please specify new tab name\" Margin=\"8\" Grid.Row=\"1\"/>\r\n        <TextBox AutomationProperties.Name=\"New name\" x:Name=\"RenameTabTextBox\" Grid.Row=\"2\" Margin=\"10,10,10,10\" Height=\"16\"/>\r\n        <Button Grid.Row=\"3\" Content=\"Rename\" Margin=\"0,0,10,0\" HorizontalAlignment=\"Right\" Style=\"{StaticResource AccentButtonStyle}\" Click=\"RenameTabButton_Click\"/>\r\n        <Button Grid.Row=\"3\" Content=\"Cancel\" Margin=\"0,0,85,0\" HorizontalAlignment=\"Right\" Click=\"CancelRenameButton_Click\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/RenameTabDialog.xaml.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for RenameTabDialog.xaml\r\n    /// </summary>\r\n    public partial class RenameTabDialog : Window\r\n    {\r\n        public string NewTabName = \"\";\r\n\r\n        public RenameTabDialog(string SelectedTabHeader)\r\n        {\r\n            InitializeComponent();\r\n            RenameTabTextBox.Text = SelectedTabHeader;\r\n        }\r\n\r\n        private void CancelRenameButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n\r\n        private void RenameTabButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if(RenameTabTextBox.Text.Length > 0)\r\n            {\r\n                NewTabName = RenameTabTextBox.Text;\r\n                DialogResult = true;\r\n            }\r\n            else\r\n            {\r\n                MessageBox.Show(\"Please specify new name for the tab\");\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/ReorderActionButtonsDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.ReorderActionButtonsDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" WindowStartupLocation=\"CenterScreen\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Reorder action buttons\" Height=\"360\" Width=\"280\" ResizeMode=\"NoResize\">\r\n    <Grid>\r\n        <Grid.ColumnDefinitions>\r\n            <ColumnDefinition Width=\"*\"/>\r\n            <ColumnDefinition Width=\"80\"/>\r\n        </Grid.ColumnDefinitions>\r\n\r\n        <Border Grid.Column=\"0\" BorderBrush=\"#E3E3E3\" BorderThickness=\"0,0,2,0\">\r\n            <Border BorderBrush=\"#E3E3E3\" BorderThickness=\"1\" CornerRadius=\"2\" Margin=\"12\">\r\n                <ListView AutomationProperties.Name=\"Reorder script buttons\" Name=\"MainWindowActionButtonsList\" ItemsSource=\"{Binding ActionButtons}\">\r\n                    <ListView.Resources>\r\n                        <Style TargetType=\"GridViewColumnHeader\">\r\n                            <Setter Property=\"Visibility\" Value=\"Collapsed\" />\r\n                        </Style>\r\n                    </ListView.Resources>\r\n                    <ListView.View>\r\n                        <GridView>\r\n                            <GridView.Columns>\r\n                                <GridViewColumn DisplayMemberBinding=\"{Binding ID}\" Width=\"0\"/>\r\n                                <GridViewColumn DisplayMemberBinding=\"{Binding ButtonText}\" />\r\n                            </GridView.Columns>\r\n                        </GridView>\r\n                    </ListView.View>\r\n                </ListView>\r\n            </Border>\r\n        </Border>\r\n\r\n        <DockPanel Grid.Column=\"1\" Height=\"80\" HorizontalAlignment=\"Center\">\r\n            <Button AutomationProperties.Name=\"Move up\" DockPanel.Dock=\"Top\" HorizontalAlignment=\"Center\" Height=\"28\" Width=\"28\" Click=\"ActionButtonsReorderUp_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/up.png\" Margin=\"-4\"/>\r\n            </Button>\r\n            <Button AutomationProperties.Name=\"Move down\" DockPanel.Dock=\"Bottom\" HorizontalAlignment=\"Center\" Height=\"28\" Width=\"28\" Click=\"ActionButtonsRedorderDown_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/down.png\" Margin=\"-4\"/>\r\n            </Button>\r\n        </DockPanel>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/ReorderActionButtonsDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.TabItems;\r\nusing EasyJob.Utils;\r\nusing Newtonsoft.Json;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for ReorderActionButtonsDialog.xaml\r\n    /// </summary>\r\n    public partial class ReorderActionButtonsDialog : Window\r\n    {\r\n        public Config config;\r\n        public int currentTabIndex = 0;\r\n        public bool changesOccured = false;\r\n        ObservableCollection<TabData> TabItems = null;\r\n        ObservableCollection<ActionButton> ActionButtons = null;\r\n\r\n        public ReorderActionButtonsDialog(int _currentTabIndex, Config _config)\r\n        {\r\n            InitializeComponent();\r\n            config = _config;\r\n            currentTabIndex = _currentTabIndex;\r\n            LoadConfig();\r\n        }\r\n\r\n        public void LoadConfig()\r\n        {\r\n            try\r\n            {\r\n                MainWindowActionButtonsList.ItemsSource = null;\r\n\r\n                TabItems = ConfigUtils.ConvertTabsFromConfigToUI(config);\r\n\r\n                List<ActionButton> list = TabItems[currentTabIndex].TabActionButtons;\r\n                ObservableCollection<ActionButton> collection = new ObservableCollection<ActionButton>(list);\r\n\r\n                ActionButtons = collection;\r\n                \r\n                MainWindowActionButtonsList.ItemsSource = ActionButtons;\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                MessageBox.Show(ex.Message);\r\n            }\r\n        }\r\n\r\n        public bool SaveConfig()\r\n        {\r\n            if (File.Exists(ConfigUtils.ConfigJsonPath))\r\n            {\r\n                try\r\n                {\r\n                    config.tabs.Clear();\r\n                    config.tabs = ConfigUtils.ConvertTabsFromUIToConfig(TabItems);\r\n\r\n                    if (ConfigUtils.SaveFromConfigToFile(config) == true)\r\n                    {\r\n                        return true;\r\n                    }\r\n                    else\r\n                    {\r\n                        return false;\r\n                    }\r\n                }\r\n                catch\r\n                {\r\n                    return false;\r\n                }\r\n            }\r\n            else\r\n            {\r\n                SaveConfig();\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        private void ActionButtonsRedorderDown_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (MainWindowActionButtonsList.SelectedIndex == -1)\r\n            {\r\n                MessageBox.Show(\"Please select item to reorder\");\r\n                return;\r\n            }\r\n\r\n            var selectedIndex = MainWindowActionButtonsList.SelectedIndex;\r\n            \r\n            if (selectedIndex + 1 < ActionButtons.Count)\r\n            {\r\n                var itemToMoveDown = ActionButtons[selectedIndex];\r\n                ActionButtons.RemoveAt(selectedIndex);\r\n                ActionButtons.Insert(selectedIndex + 1, itemToMoveDown);\r\n                MainWindowActionButtonsList.SelectedIndex = selectedIndex + 1;\r\n\r\n                List<ActionButton> myList = new List<ActionButton>(ActionButtons);\r\n                TabItems[currentTabIndex].TabActionButtons = myList;\r\n            }\r\n\r\n            changesOccured = true;\r\n\r\n            SaveConfig();\r\n        }\r\n\r\n        private void ActionButtonsReorderUp_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (MainWindowActionButtonsList.SelectedIndex == -1)\r\n            {\r\n                MessageBox.Show(\"Please select item to reorder\");\r\n                return;\r\n            }\r\n\r\n            var selectedIndex = MainWindowActionButtonsList.SelectedIndex;\r\n\r\n            if (selectedIndex > 0)\r\n            {\r\n                var itemToMoveUp = ActionButtons[selectedIndex];\r\n                ActionButtons.RemoveAt(selectedIndex);\r\n                ActionButtons.Insert(selectedIndex - 1, itemToMoveUp);\r\n                MainWindowActionButtonsList.SelectedIndex = selectedIndex - 1;\r\n                List<ActionButton> myList = new List<ActionButton>(ActionButtons);\r\n                TabItems[currentTabIndex].TabActionButtons = myList;\r\n            }\r\n\r\n            changesOccured = true;\r\n\r\n            SaveConfig();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/ReorderTabsDialog.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.ReorderTabsDialog\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        mc:Ignorable=\"d\" WindowStartupLocation=\"CenterScreen\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Reorder Tabs\" Height=\"360\" Width=\"280\" ResizeMode=\"NoResize\">\r\n    <Grid>\r\n        <Grid.ColumnDefinitions>\r\n            <ColumnDefinition Width=\"*\"/>\r\n            <ColumnDefinition Width=\"80\"/>\r\n        </Grid.ColumnDefinitions>\r\n\r\n        <Border Grid.Column=\"0\" BorderBrush=\"#E3E3E3\" BorderThickness=\"0,0,2,0\">\r\n            <Border BorderBrush=\"#E3E3E3\" BorderThickness=\"1\" CornerRadius=\"2\" Margin=\"12\">\r\n            <ListView AutomationProperties.Name=\"Reorder tabs\" Name=\"MainWindowTabsList\" ItemsSource=\"{Binding TabItems}\">\r\n            <ListView.Resources>\r\n                <Style TargetType=\"GridViewColumnHeader\">\r\n                    <Setter Property=\"Visibility\" Value=\"Collapsed\" />\r\n                </Style>\r\n            </ListView.Resources>\r\n            <ListView.View>\r\n                <GridView>\r\n                    <GridView.Columns>\r\n                        <GridViewColumn DisplayMemberBinding=\"{Binding ID}\" Width=\"0\"/>\r\n                        <GridViewColumn DisplayMemberBinding=\"{Binding TabHeader}\" />\r\n                    </GridView.Columns>\r\n                </GridView>\r\n            </ListView.View>\r\n        </ListView>\r\n            </Border>\r\n        </Border>\r\n\r\n        <DockPanel Grid.Column=\"1\" Height=\"80\" HorizontalAlignment=\"Center\">\r\n            <Button AutomationProperties.Name=\"Move up\" DockPanel.Dock=\"Top\" HorizontalAlignment=\"Center\" Height=\"28\" Width=\"28\" Click=\"TabsReorderUp_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/up.png\" Margin=\"-4\"/>\r\n            </Button>\r\n            <Button AutomationProperties.Name=\"Move down\" DockPanel.Dock=\"Bottom\" HorizontalAlignment=\"Center\" Height=\"28\" Width=\"28\" Click=\"TabsRedorderDown_Click\">\r\n                <Image Source=\"pack://application:,,,/Images/down.png\" Margin=\"-4\"/>\r\n            </Button>\r\n        </DockPanel>\r\n        \r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/ReorderTabsDialog.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing EasyJob.TabItems;\r\nusing EasyJob.Utils;\r\nusing Newtonsoft.Json;\r\nusing System;\r\nusing System.Collections.ObjectModel;\r\nusing System.IO;\r\nusing System.Text;\r\nusing System.Windows;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for ReorderTabsDialog.xaml\r\n    /// </summary>\r\n    public partial class ReorderTabsDialog : Window\r\n    {\r\n        public Config config;\r\n        ObservableCollection<TabData> TabItems = null;\r\n        public bool changesOccured = false;\r\n\r\n        public ReorderTabsDialog(Config _config)\r\n        {\r\n            InitializeComponent();\r\n            config = _config;\r\n            LoadConfig();\r\n        }\r\n\r\n        public void LoadConfig()\r\n        {\r\n            try\r\n            {\r\n                MainWindowTabsList.ItemsSource = null;\r\n                TabItems = ConfigUtils.ConvertTabsFromConfigToUI(config);\r\n                MainWindowTabsList.ItemsSource = TabItems;\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                MessageBox.Show(ex.Message);\r\n            }\r\n        }\r\n\r\n        public bool SaveConfig()\r\n        {\r\n            if (File.Exists(ConfigUtils.ConfigJsonPath))\r\n            {\r\n                try\r\n                {\r\n                    config.tabs.Clear();\r\n                    config.tabs = ConfigUtils.ConvertTabsFromUIToConfig(TabItems);\r\n\r\n                    if (ConfigUtils.SaveFromConfigToFile(config) == true)\r\n                    {\r\n                        return true;\r\n                    }\r\n                    else \r\n                    { \r\n                        return false; \r\n                    }\r\n                }\r\n                catch\r\n                {\r\n                    return false;\r\n                }\r\n            }\r\n            else\r\n            {\r\n                SaveConfig();\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        private void TabsRedorderDown_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if(MainWindowTabsList.SelectedIndex == -1)\r\n            {\r\n                MessageBox.Show(\"Please select item to reorder\");\r\n                return;\r\n            }\r\n\r\n            var selectedIndex = MainWindowTabsList.SelectedIndex;\r\n\r\n            if (selectedIndex + 1 < TabItems.Count)\r\n            {\r\n                var itemToMoveDown = TabItems[selectedIndex];\r\n                TabItems.RemoveAt(selectedIndex);\r\n                TabItems.Insert(selectedIndex + 1, itemToMoveDown);\r\n                MainWindowTabsList.SelectedIndex = selectedIndex + 1;\r\n            }\r\n\r\n            changesOccured = true;\r\n\r\n            SaveConfig();\r\n        }\r\n\r\n        private void TabsReorderUp_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (MainWindowTabsList.SelectedIndex == -1)\r\n            {\r\n                MessageBox.Show(\"Please select item to reorder\");\r\n                return;\r\n            }\r\n\r\n            changesOccured = true;\r\n\r\n            var selectedIndex = MainWindowTabsList.SelectedIndex;\r\n\r\n            if (selectedIndex > 0)\r\n            {\r\n                var itemToMoveUp = TabItems[selectedIndex];\r\n                TabItems.RemoveAt(selectedIndex);\r\n                TabItems.Insert(selectedIndex - 1, itemToMoveUp);\r\n                MainWindowTabsList.SelectedIndex = selectedIndex - 1;\r\n            }\r\n\r\n            SaveConfig();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/Windows/TroubleshootingWindow.xaml",
    "content": "﻿<Window x:Class=\"EasyJob.Windows.TroubleshootingWindow\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJob.Windows\"\r\n        mc:Ignorable=\"d\" Icon=\"pack://application:,,,/Images/icon.ico\"\r\n        Title=\"Troubleshooting\" Height=\"450\" Width=\"700\" WindowStartupLocation=\"CenterScreen\" Loaded=\"TroubleshootingWindow_Loaded\">\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"90\"/>\r\n            <RowDefinition Height=\"*\"/>\r\n        </Grid.RowDefinitions>\r\n\r\n        <Grid Grid.Row=\"0\">\r\n            <Grid.ColumnDefinitions>\r\n                <ColumnDefinition Width=\"*\"/>\r\n                <ColumnDefinition Width=\"250\"/>\r\n            </Grid.ColumnDefinitions>\r\n            <TextBlock Text=\"Troubleshooting\" Grid.Column=\"0\" Background=\"#E2E2E2\" Padding=\"12\" Style=\"{StaticResource HeaderTextBlockStyle}\" />\r\n            <Grid Grid.Column=\"1\" Background=\"#E2E2E2\">\r\n                <Grid.RowDefinitions>\r\n                    <RowDefinition Height=\"30\"/>\r\n                    <RowDefinition Height=\"30\"/>\r\n                    <RowDefinition Height=\"30\"/>\r\n                </Grid.RowDefinitions>\r\n                <TextBlock x:Name=\"OSDescription\" Grid.Row=\"0\" Text=\"\" FontSize=\"14\" Margin=\"0,0,10,0\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Right\"/>\r\n                <TextBlock x:Name=\"FrameworkDescription\" Grid.Row=\"1\" Text=\"\" FontSize=\"14\" Margin=\"0,0,10,0\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Right\"/>\r\n                <TextBlock x:Name=\"OsD\" Grid.Row=\"2\" Text=\"\" FontSize=\"14\" Margin=\"0,0,10,0\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Right\"/>\r\n            </Grid>\r\n        </Grid>\r\n\r\n        <ui:ScrollViewerEx Grid.Row=\"1\" VerticalScrollBarVisibility=\"Auto\">\r\n            <Grid Margin=\"15,0,15,0\">\r\n                <Grid.ColumnDefinitions>\r\n                    <ColumnDefinition Width=\"180\"/>\r\n                    <ColumnDefinition Width=\"*\"/>\r\n                </Grid.ColumnDefinitions>\r\n                <Grid.RowDefinitions>\r\n                    <RowDefinition Height=\"32\"/>\r\n                    <RowDefinition Height=\"32\"/>\r\n                    <RowDefinition Height=\"32\"/>\r\n                    <RowDefinition Height=\"Auto\"/>\r\n                    <RowDefinition Height=\"32\"/>\r\n                </Grid.RowDefinitions>\r\n\r\n                <Border Grid.Row=\"0\" Grid.Column=\"0\" BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <TextBlock Text=\"PowerShell path\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                </Border>\r\n                <TextBlock Name=\"PowerShellPath\" Grid.Row=\"0\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"1\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <TextBlock Text=\"PowerShell arguments\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                </Border>\r\n                <TextBlock Name=\"PowerShellArguments\" Grid.Row=\"1\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"2\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <TextBlock Text=\"PowerShell version\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n                </Border>\r\n                <TextBlock Name=\"PowerShellVersion\" Grid.Row=\"2\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n                <Border Grid.Row=\"3\" Grid.Column=\"0\"  BorderBrush=\"#E2E2E2\" BorderThickness=\"0,0,1,0\">\r\n                    <TextBlock Text=\"PowerShell modules\" FontSize=\"16\" Margin=\"10,4,10,4\" VerticalAlignment=\"Top\"/>\r\n                </Border>\r\n                <TextBlock Name=\"PowerShellModules\" Grid.Row=\"3\" Grid.Column=\"1\" FontSize=\"16\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n\r\n            </Grid>\r\n        </ui:ScrollViewerEx>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJob/Windows/TroubleshootingWindow.xaml.cs",
    "content": "﻿using EasyJob.Serialization;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Diagnostics;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Net;\r\nusing System.Runtime.InteropServices;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\nusing System.Windows.Threading;\r\n\r\nnamespace EasyJob.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for TroubleshootingWindow.xaml\r\n    /// </summary>\r\n    public partial class TroubleshootingWindow : Window\r\n    {\r\n        Config config = null;\r\n\r\n        public TroubleshootingWindow(Config _config)\r\n        {\r\n            InitializeComponent();\r\n            config = _config;\r\n            FillKnownData();\r\n        }\r\n\r\n        private void FillKnownData()\r\n        {\r\n            OSDescription.Text = RuntimeInformation.OSDescription;\r\n            FrameworkDescription.Text = RuntimeInformation.FrameworkDescription;\r\n            OsD.Text = RuntimeInformation.OSArchitecture.ToString();\r\n\r\n            PowerShellPath.Text = config.default_powershell_path;\r\n\r\n            if(config.powershell_arguments == \"\")\r\n            {\r\n                PowerShellArguments.Text = \"empty\";\r\n                PowerShellArguments.Foreground = new SolidColorBrush(Color.FromRgb(128, 128, 128));\r\n            }\r\n            else \r\n            { \r\n                PowerShellArguments.Text = config.powershell_arguments;\r\n            }\r\n\r\n            if(File.Exists(config.default_powershell_path))\r\n            {\r\n                try\r\n                {\r\n                    var versionInfo = FileVersionInfo.GetVersionInfo(config.default_powershell_path);\r\n                    PowerShellVersion.Text = versionInfo.FileVersion;\r\n                }\r\n                catch\r\n                {\r\n                    PowerShellVersion.Text = \"unable to get version\";\r\n                    PowerShellVersion.Foreground = new SolidColorBrush(Color.FromRgb(128, 128, 128));\r\n                }\r\n            }\r\n\r\n            if(Directory.Exists(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Program Files\\WindowsPowerShell\\Modules\"))\r\n            {\r\n                try\r\n                {\r\n                    string[] dirs = Directory.GetDirectories(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Program Files\\WindowsPowerShell\\Modules\", \"*\", SearchOption.TopDirectoryOnly);\r\n                    foreach (string dir in dirs)\r\n                    {\r\n                        PowerShellModules.Text = PowerShellModules.Text + dir + Environment.NewLine;\r\n                    }\r\n                }\r\n                catch { }\r\n            }\r\n            if (Directory.Exists(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Windows\\System32\\WindowsPowerShell\\v1.0\\Modules\"))\r\n            {\r\n                try\r\n                {\r\n                    string[] dirs = Directory.GetDirectories(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Windows\\System32\\WindowsPowerShell\\v1.0\\Modules\", \"*\", SearchOption.TopDirectoryOnly);\r\n                    foreach (string dir in dirs)\r\n                    {\r\n                        PowerShellModules.Text = PowerShellModules.Text + dir + Environment.NewLine;\r\n                    }\r\n                }\r\n                catch { }\r\n            }\r\n            if (Directory.Exists(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Program Files (x86)\\WindowsPowerShell\\Modules\"))\r\n            {\r\n                try\r\n                {\r\n                    string[] dirs = Directory.GetDirectories(System.IO.Path.GetPathRoot(Environment.SystemDirectory) + @\"Program Files (x86)\\WindowsPowerShell\\Modules\", \"*\", SearchOption.TopDirectoryOnly);\r\n                    foreach (string dir in dirs)\r\n                    {\r\n                        PowerShellModules.Text = PowerShellModules.Text + dir + Environment.NewLine;\r\n                    }\r\n                }\r\n                catch { }\r\n            }\r\n\r\n        }\r\n\r\n        private void TroubleshootingWindow_Loaded(object sender, RoutedEventArgs e)\r\n        {\r\n            /*\r\n            try\r\n            {\r\n                Task.Factory.StartNew(() =>\r\n                {\r\n                    string URL = \"https://google.com\";\r\n                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);\r\n                    request.ContentType = \"text/html\";\r\n                    HttpWebResponse response = request.GetResponse() as HttpWebResponse;\r\n                    using (Stream responseStream = response.GetResponseStream())\r\n                    {\r\n                        StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);\r\n                        MessageBox.Show(reader.ReadToEnd());\r\n                    }\r\n\r\n                }).ContinueWith((task) =>\r\n                {\r\n                    // do this on the UI thread once the task has finished..\r\n                }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());\r\n            }\r\n            catch (Exception ex) { MessageBox.Show(ex.Message); }\r\n            */\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJob/config.json",
    "content": "{\r\n  \"default_powershell_path\": \"C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\",\r\n  \"default_cmd_path\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\",\r\n  \"powershell_arguments\": \"\",\r\n  \"console_background\": \"Black\",\r\n  \"console_foreground\": \"White\",\r\n  \"console_ignore_color_tags\": false,\r\n  \"clear_events_when_reload\": true,\r\n  \"restrictions\": {\r\n    \"block_tabs_remove\": false,\r\n    \"block_buttons_remove\": false,\r\n    \"block_tabs_add\": false,\r\n    \"block_buttons_add\": false,\r\n    \"block_buttons_reorder\": false,\r\n    \"block_buttons_edit\": false,\r\n    \"block_tabs_rename\": false,\r\n    \"block_buttons_paste\": false,\r\n    \"block_buttons_copy\": false,\r\n    \"hide_menu_item_file_reload_config\": false,\r\n    \"hide_menu_item_file_open_app_folder\": false,\r\n    \"hide_menu_item_file_clear_events_list\": false,\r\n    \"hide_menu_item_settings\": false,\r\n    \"hide_menu_item_settings_workflow\": false,\r\n    \"hide_menu_item_settings_workflow_reorder_tabs\": false,\r\n    \"hide_menu_item_settings_workflow_add_tab\": false,\r\n    \"hide_menu_item_settings_workflow_remove_current_tab\": false,\r\n    \"hide_menu_item_settings_workflow_rename_current_tab\": false,\r\n    \"hide_menu_item_settings_workflow_add_button_to_current_tab\": false,\r\n    \"hide_menu_item_settings_workflow_reorder_buttons_in_current_tab\": false,\r\n    \"hide_menu_item_settings_configuration\": false,\r\n    \"hide_menu_item_help\": false,\r\n    \"hide_menu_item_help_troubleshooting\": false,\r\n    \"hide_menu_item_help_colortags\": false,\r\n    \"hide_menu_item_help_about\": false\r\n  },\r\n  \"tabs\": [\r\n    {\r\n      \"ID\": \"357f9827-f4f7-439f-b62c-792e880fd06c\",\r\n      \"Header\": \"Common actions\",\r\n      \"Buttons\": [\r\n        {\r\n          \"Id\": \"5e371407-140f-4fa2-abf3-2cec4bb174b2\",\r\n          \"Text\": \"test01\",\r\n          \"Description\": \"Some test script\",\r\n          \"Script\": \"scripts\\\\common\\\\test01.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"9159b485-39e5-42d6-adb4-275753db9027\",\r\n          \"Text\": \"test02\",\r\n          \"Description\": \"Some second test script\",\r\n          \"Script\": \"scripts\\\\test02.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"eaaff0bf-2a9f-4037-bdd6-e8405830d90e\",\r\n          \"Text\": \"bat\",\r\n          \"Description\": \"Some second test script\",\r\n          \"Script\": \"scripts\\\\1.bat\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"cmd\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"5ec086d9-7987-43ef-84fb-1d8481b05aea\",\r\n          \"Text\": \"Absolute script\",\r\n          \"Description\": \"\",\r\n          \"Script\": \"C:\\\\scripts\\\\absolute_script.ps1\",\r\n          \"ScriptPathType\": \"absolute\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"a7b94662-4d66-4a8a-af33-b326a99215cf\",\r\n          \"Text\": \"test03\",\r\n          \"Description\": \"Some test 03 script with arguments\",\r\n          \"Script\": \"scripts\\\\common\\\\test03.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": [\r\n            {\r\n              \"ArgumentQuestion\": \"Enter IP address or DNS name\",\r\n              \"ArgumentAnswer\": \"\"\r\n            }\r\n          ]\r\n        },\r\n        {\r\n          \"Id\": \"aabc2bf5-e26c-4a73-8e89-e702f14eaa8b\",\r\n          \"Text\": \"test04\",\r\n          \"Description\": \"Some test 04 script with arguments\",\r\n          \"Script\": \"scripts\\\\common\\\\test04.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": [\r\n            {\r\n              \"ArgumentQuestion\": \"What is your name?\",\r\n              \"ArgumentAnswer\": \"\"\r\n            },\r\n            {\r\n              \"ArgumentQuestion\": \"What is your surname\",\r\n              \"ArgumentAnswer\": \"\"\r\n            },\r\n            {\r\n              \"ArgumentQuestion\": \"No, really what is your name?\",\r\n              \"ArgumentAnswer\": \"\"\r\n            }\r\n          ]\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"ID\": \"fa774e10-7772-4074-8d8e-c57b09e9377e\",\r\n      \"Header\": \"Second Tab\",\r\n      \"Buttons\": [\r\n        {\r\n          \"Id\": \"b3ebb860-7682-4613-8f82-0ca59226b0f9\",\r\n          \"Text\": \"Some button\",\r\n          \"Description\": \"no description\",\r\n          \"Script\": \"scripts\\\\some_button_script.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"f9fc3c8f-fb36-432d-96c9-09c4169d540e\",\r\n          \"Text\": \"Test11\",\r\n          \"Description\": \"no description\",\r\n          \"Script\": \"scripts\\\\some_button_script2.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"ID\": \"a744a5e3-4dc0-4f42-abac-ee67dd17c6a1\",\r\n      \"Header\": \"Third Tab\",\r\n      \"Buttons\": [\r\n        {\r\n          \"Id\": \"5839ed21-7c33-4aac-9b3c-663cc794e3f5\",\r\n          \"Text\": \"Some button 1\",\r\n          \"Description\": \"no description\",\r\n          \"Script\": \"scripts\\\\some_button_script.ps1\",\r\n          \"ScriptPathType\": \"relative\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        },\r\n        {\r\n          \"Id\": \"7ecdea7a-8865-45d7-a037-0dd4dd1cb996\",\r\n          \"Text\": \"Button asd\",\r\n          \"Description\": \"\",\r\n          \"Script\": \"D:\\\\net50\\\\test04.ps1\",\r\n          \"ScriptPathType\": \"absolute\",\r\n          \"ScriptType\": \"powershell\",\r\n          \"Arguments\": []\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}"
  },
  {
    "path": "EasyJob.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 16\r\nVisualStudioVersion = 16.0.31624.102\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"EasyJob\", \"EasyJob\\EasyJob.csproj\", \"{E4A73656-4B1A-4A18-AC41-6AC59E1C8EB3}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"WpfRichText\", \"WpfRichText\\WpfRichText.csproj\", \"{BD7ECC34-44C8-4D3C-B0E5-0384E2F2DE02}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"EasyJobPSTools\", \"EasyJobPSTools\\EasyJobPSTools.csproj\", \"{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{E4A73656-4B1A-4A18-AC41-6AC59E1C8EB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{E4A73656-4B1A-4A18-AC41-6AC59E1C8EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{E4A73656-4B1A-4A18-AC41-6AC59E1C8EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{E4A73656-4B1A-4A18-AC41-6AC59E1C8EB3}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{BD7ECC34-44C8-4D3C-B0E5-0384E2F2DE02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{BD7ECC34-44C8-4D3C-B0E5-0384E2F2DE02}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{BD7ECC34-44C8-4D3C-B0E5-0384E2F2DE02}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{BD7ECC34-44C8-4D3C-B0E5-0384E2F2DE02}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {92C31FCF-A509-4155-9117-FDEC0F8333AD}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "EasyJobPSTools/EasyJobPSTools.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProjectGuid>{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}</ProjectGuid>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>EasyJobPSTools</RootNamespace>\r\n    <AssemblyName>EasyJobPSTools</AssemblyName>\r\n    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>\r\n    <FileAlignment>512</FileAlignment>\r\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Deterministic>true</Deterministic>\r\n    <TargetFrameworkProfile />\r\n    <NuGetPackageImportStamp>\r\n    </NuGetPackageImportStamp>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>..\\bin\\Debug\\EasyJobPSTools\\</OutputPath>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Prefer32Bit>false</Prefer32Bit>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <DebugType>pdbonly</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>..\\bin\\Release\\EasyJobPSTools\\</OutputPath>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Prefer32Bit>false</Prefer32Bit>\r\n  </PropertyGroup>\r\n  <PropertyGroup>\r\n    <StartupObject />\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Data\" />\r\n    <Reference Include=\"System.Windows.Forms\" />\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"Microsoft.CSharp\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.Xml.Linq\" />\r\n    <Reference Include=\"System.Data.DataSetExtensions\" />\r\n    <Reference Include=\"System.Xaml\">\r\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"WindowsBase\" />\r\n    <Reference Include=\"PresentationCore\" />\r\n    <Reference Include=\"PresentationFramework\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Program.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\r\n      <SubType>Code</SubType>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\r\n      <AutoGen>True</AutoGen>\r\n      <DesignTime>True</DesignTime>\r\n      <DependentUpon>Resources.resx</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\r\n      <AutoGen>True</AutoGen>\r\n      <DependentUpon>Settings.settings</DependentUpon>\r\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\r\n    </Compile>\r\n    <Compile Include=\"Utils\\CommonUtils.cs\" />\r\n    <Compile Include=\"Windows\\ShowEJInputBox.xaml.cs\">\r\n      <DependentUpon>ShowEJInputBox.xaml</DependentUpon>\r\n    </Compile>\r\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\r\n      <Generator>ResXFileCodeGenerator</Generator>\r\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r\n    </EmbeddedResource>\r\n    <None Include=\"app.config\" />\r\n    <None Include=\"EasyJobPSTools.psd1\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n    <None Include=\"Properties\\Settings.settings\">\r\n      <Generator>SettingsSingleFileGenerator</Generator>\r\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Page Include=\"Windows\\ShowEJInputBox.xaml\">\r\n      <SubType>Designer</SubType>\r\n      <Generator>MSBuild:Compile</Generator>\r\n    </Page>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <PackageReference Include=\"ModernWpfUI\">\r\n      <Version>0.9.4</Version>\r\n    </PackageReference>\r\n    <PackageReference Include=\"System.Runtime.WindowsRuntime\">\r\n      <Version>4.7.0</Version>\r\n    </PackageReference>\r\n    <PackageReference Include=\"System.ValueTuple\">\r\n      <Version>4.5.0</Version>\r\n    </PackageReference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"EasyJobPSTools.psm1\">\r\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r\n    </None>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\r\n</Project>"
  },
  {
    "path": "EasyJobPSTools/EasyJobPSTools.psd1",
    "content": "﻿# Module manifest for module 'EasyJobPSTools'\r\n# Generated by: Akshin Mustafayev\r\n# Generated on: 10/8/2021\r\n\r\n@{\r\n\r\n    # Script module or binary module file associated with this manifest.\r\n    RootModule        = 'EasyJobPSTools.psm1'\r\n    \r\n    # Version number of this module.\r\n    ModuleVersion     = '1.0'\r\n    \r\n    # ID used to uniquely identify this module\r\n    GUID              = 'd6c56376-ae08-4c23-b901-9bc75144e0c6'\r\n    \r\n    # Author of this module\r\n    Author            = 'Akshin Mustafayev'\r\n    \r\n    # Company or vendor of this module\r\n    CompanyName       = 'Akshin Mustafayev'\r\n    \r\n    # Copyright statement for this module\r\n    Copyright         = '(c) 2021 Akshin Mustafayev. GNU Affero General Public License v3.0.'\r\n    \r\n    # Description of the functionality provided by this module\r\n    Description       = 'Module for implementing EasyJob additional helper functions'\r\n    \r\n    # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.\r\n    FunctionsToExport = 'Show-EJInputBox', 'Show-EJSelectFileWindow', 'Show-EJSelectFolderWindow'\r\n    \r\n}"
  },
  {
    "path": "EasyJobPSTools/EasyJobPSTools.psm1",
    "content": "﻿Add-Type -Path \"$PSScriptRoot\\ModernWpf.dll\"\r\nAdd-Type -Path \"$PSScriptRoot\\EasyJobPSTools.dll\"\r\n\r\nfunction Show-EJInputBox {\r\n    <#\r\n        .SYNOPSIS\r\n        Shows Input-Box for you script.\r\n\r\n        .DESCRIPTION\r\n        Shows Input-Box for you script. This might be necessary\r\n        when you want to get some input while executing your script,\r\n        since EasyJob does not support Read from console.\r\n\r\n        .PARAMETER Header\r\n        Specifies Title for input box.\r\n\r\n        .PARAMETER Text\r\n        Specifies Text for the input box.\r\n\r\n        .PARAMETER AllowEmptyResult\r\n        Specifies if user can not enter any text and press OK.\r\n\r\n        .INPUTS\r\n        None.\r\n\r\n        .OUTPUTS\r\n        String value of the input from the box.\r\n\r\n        .EXAMPLE\r\n        C:\\PS> $Result = Show-EJInputBox -Header \"Specify your name\" -Text \"What is your name?\" -AllowEmptyResult $false\r\n        C:\\PS> Write-Host \"Your name is $Result\"\r\n        Your name is test\r\n\r\n        .LINK\r\n        https://github.com/akshinmustafayev/EasyJobPSTools\r\n        https://github.com/akshinmustafayev/EasyJob\r\n    #>\r\n\r\n    param (\r\n        [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()] [string]$Header,\r\n        [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()] [string]$Text,\r\n        [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()] $AllowEmptyResult\r\n    )\r\n    \r\n    $Result = [EasyJobPSTools.Program]::ShowEJInputBoxWindow($Header, $Text, $AllowEmptyResult)\r\n    return $Result\r\n}\r\n\r\nfunction Show-EJSelectFileWindow {\r\n    <#\r\n        .SYNOPSIS\r\n        Shows select file Window and returns selected file path.\r\n\r\n        .DESCRIPTION\r\n        Shows select file Window. This might be necessary\r\n        when you want to get selected file path and use it\r\n        in your script.\r\n\r\n        .PARAMETER FileType\r\n        Specifies File type which you would like for user to select.\r\n        This parameter may be empty. If it is empty then any file type is espected\r\n\r\n        .INPUTS\r\n        None.\r\n\r\n        .OUTPUTS\r\n        String path value of the selected file.\r\n\r\n        .EXAMPLE\r\n        C:\\PS> $Result = Show-EJSelectFileWindow\r\n        D:\\temp\\excel_list.xlsx\r\n\r\n        .EXAMPLE\r\n        C:\\PS> $Result = Show-EJSelectFileWindow -FileType \"txt files (*.txt)|*.txt|All files (*.*)|*.*\"\r\n        D:\\temp\\testfile.txt\r\n\r\n        .LINK\r\n        https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter?view=windowsdesktop-5.0#System_Windows_Forms_FileDialog_Filter\r\n        https://github.com/akshinmustafayev/EasyJobPSTools\r\n        https://github.com/akshinmustafayev/EasyJob\r\n    #>\r\n\r\n    param (\r\n        [Parameter(Mandatory = $false)] [string]$FileType\r\n    )\r\n\r\n    if($null -eq $FileType){\r\n        $Result = [EasyJobPSTools.Program]::ShowEJSelectFileWindow()\r\n        return $Result\r\n    }\r\n    else{\r\n        $Result = [EasyJobPSTools.Program]::ShowEJSelectFileWindow($FileType)\r\n        return $Result\r\n    }\r\n}\r\n\r\nfunction Show-EJSelectFolderWindow {\r\n    <#\r\n        .SYNOPSIS\r\n        Shows select folder Window and returns selected folder path.\r\n\r\n        .DESCRIPTION\r\n        Shows select folder Window. This might be necessary\r\n        when you want to get selected folder path and use it\r\n        in your script.\r\n\r\n        .INPUTS\r\n        None.\r\n\r\n        .OUTPUTS\r\n        String path value of the selected folder.\r\n\r\n        .EXAMPLE\r\n        C:\\PS> $Result = Show-EJSelectFolderWindow\r\n        D:\\temp\\\r\n\r\n        .LINK\r\n        https://github.com/akshinmustafayev/EasyJobPSTools\r\n        https://github.com/akshinmustafayev/EasyJob\r\n    #>\r\n\r\n    $Result = [EasyJobPSTools.Program]::ShowEJSelectFolderWindow()\r\n    return $Result\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/EasyJobPSTools.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 16\r\nVisualStudioVersion = 16.0.31624.102\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"EasyJobPSTools\", \"EasyJobPSTools.csproj\", \"{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{D4CD0099-4071-4516-8ADC-95ADCD8A7A4C}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {0D0B0E81-ED08-435B-82D0-A80FABEA9637}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "EasyJobPSTools/Program.cs",
    "content": "﻿using EasyJobPSTools.Windows;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows.Forms;\r\n\r\nnamespace EasyJobPSTools\r\n{\r\n    public class Program\r\n    {\r\n        public static string ShowEJInputBoxWindow(string Header, string Text, bool AllowEmptyResult)\r\n        {\r\n            ShowEJInputBox sejib = new ShowEJInputBox(Header, Text, AllowEmptyResult);\r\n            if (sejib.ShowDialog() == true)\r\n            {\r\n                return sejib.windowResult;\r\n            }\r\n            else\r\n            {\r\n                return \"\";\r\n            }\r\n        }\r\n\r\n        public static string ShowEJSelectFileWindow()\r\n        {\r\n            OpenFileDialog ofd = new OpenFileDialog();\r\n            if (ofd.ShowDialog() == DialogResult.OK)\r\n            {\r\n                return ofd.FileName;\r\n            }\r\n            else\r\n            {\r\n                return \"\";\r\n            }\r\n        }\r\n\r\n        public static string ShowEJSelectFileWindow(string fileType)\r\n        {\r\n            OpenFileDialog ofd = new OpenFileDialog();\r\n            ofd.Filter = fileType;\r\n            if (ofd.ShowDialog() == DialogResult.OK)\r\n            {\r\n                return ofd.FileName;\r\n            }\r\n            else\r\n            {\r\n                return \"\";\r\n            }\r\n        }\r\n\r\n        public static string ShowEJSelectFolderWindow()\r\n        {\r\n            using (var fbd = new FolderBrowserDialog())\r\n            {\r\n                DialogResult result = fbd.ShowDialog();\r\n\r\n                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))\r\n                {\r\n                    return fbd.SelectedPath;\r\n                }\r\n                else\r\n                {\r\n                    return \"\";\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\r\nusing System.Resources;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\nusing System.Windows;\r\n\r\n// General Information about an assembly is controlled through the following\r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"EasyJobPSTools\")]\r\n[assembly: AssemblyDescription(\"PowerShell tools for the EasyJob\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"Akshin Mustafayev\")]\r\n[assembly: AssemblyProduct(\"EasyJobPSTools\")]\r\n[assembly: AssemblyCopyright(\"Copyright ©  2021\")]\r\n[assembly: AssemblyTrademark(\"Akshin Mustafayev\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible\r\n// to COM components.  If you need to access a type in this assembly from\r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(true)]\r\n\r\n//In order to begin building localizable applications, set\r\n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\r\n//inside a <PropertyGroup>.  For example, if you are using US english\r\n//in your source files, set the <UICulture> to en-US.  Then uncomment\r\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\r\n//the line below to match the UICulture setting in the project file.\r\n\r\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\r\n\r\n\r\n[assembly: ThemeInfo(\r\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\r\n                                     //(used if a resource is not found in the page,\r\n                                     // or application resource dictionaries)\r\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\r\n                                              //(used if a resource is not found in the page,\r\n                                              // app, or any theme specific resource dictionaries)\r\n)]\r\n\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n//      Major Version\r\n//      Minor Version\r\n//      Build Number\r\n//      Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers\r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"1.0.1.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.1.0\")]\r\n"
  },
  {
    "path": "EasyJobPSTools/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n//     This code was generated by a tool.\r\n//     Runtime Version:4.0.30319.42000\r\n//\r\n//     Changes to this file may cause incorrect behavior and will be lost if\r\n//     the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\n\r\nnamespace EasyJobPSTools.Properties {\r\n    using System;\r\n    \r\n    \r\n    /// <summary>\r\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\r\n    /// </summary>\r\n    // This class was auto-generated by the StronglyTypedResourceBuilder\r\n    // class via a tool like ResGen or Visual Studio.\r\n    // To add or remove a member, edit your .ResX file then rerun ResGen\r\n    // with the /str option, or rebuild your VS project.\r\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\r\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r\n    internal class Resources {\r\n        \r\n        private static global::System.Resources.ResourceManager resourceMan;\r\n        \r\n        private static global::System.Globalization.CultureInfo resourceCulture;\r\n        \r\n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\r\n        internal Resources() {\r\n        }\r\n        \r\n        /// <summary>\r\n        ///   Returns the cached ResourceManager instance used by this class.\r\n        /// </summary>\r\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r\n        internal static global::System.Resources.ResourceManager ResourceManager {\r\n            get {\r\n                if (object.ReferenceEquals(resourceMan, null)) {\r\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"EasyJobPSTools.Properties.Resources\", typeof(Resources).Assembly);\r\n                    resourceMan = temp;\r\n                }\r\n                return resourceMan;\r\n            }\r\n        }\r\n        \r\n        /// <summary>\r\n        ///   Overrides the current thread's CurrentUICulture property for all\r\n        ///   resource lookups using this strongly typed resource class.\r\n        /// </summary>\r\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r\n        internal static global::System.Globalization.CultureInfo Culture {\r\n            get {\r\n                return resourceCulture;\r\n            }\r\n            set {\r\n                resourceCulture = value;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<root>\r\n  <!-- \r\n    Microsoft ResX Schema \r\n    \r\n    Version 2.0\r\n    \r\n    The primary goals of this format is to allow a simple XML format \r\n    that is mostly human readable. The generation and parsing of the \r\n    various data types are done through the TypeConverter classes \r\n    associated with the data types.\r\n    \r\n    Example:\r\n    \r\n    ... ado.net/XML headers & schema ...\r\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\r\n    <resheader name=\"version\">2.0</resheader>\r\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\r\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\r\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\r\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\r\n    </data>\r\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\r\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r\n        <comment>This is a comment</comment>\r\n    </data>\r\n                \r\n    There are any number of \"resheader\" rows that contain simple \r\n    name/value pairs.\r\n    \r\n    Each data row contains a name, and value. The row also contains a \r\n    type or mimetype. Type corresponds to a .NET class that support \r\n    text/value conversion through the TypeConverter architecture. \r\n    Classes that don't support this are serialized and stored with the \r\n    mimetype set.\r\n    \r\n    The mimetype is used for serialized objects, and tells the \r\n    ResXResourceReader how to depersist the object. This is currently not \r\n    extensible. For a given mimetype the value must be set accordingly:\r\n    \r\n    Note - application/x-microsoft.net.object.binary.base64 is the format \r\n    that the ResXResourceWriter will generate, however the reader can \r\n    read any of the formats listed below.\r\n    \r\n    mimetype: application/x-microsoft.net.object.binary.base64\r\n    value   : The object must be serialized with \r\n            : System.Serialization.Formatters.Binary.BinaryFormatter\r\n            : and then encoded with base64 encoding.\r\n    \r\n    mimetype: application/x-microsoft.net.object.soap.base64\r\n    value   : The object must be serialized with \r\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r\n            : and then encoded with base64 encoding.\r\n\r\n    mimetype: application/x-microsoft.net.object.bytearray.base64\r\n    value   : The object must be serialized into a byte array \r\n            : using a System.ComponentModel.TypeConverter\r\n            : and then encoded with base64 encoding.\r\n    -->\r\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\r\n      <xsd:complexType>\r\n        <xsd:choice maxOccurs=\"unbounded\">\r\n          <xsd:element name=\"metadata\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"assembly\">\r\n            <xsd:complexType>\r\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"data\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"resheader\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n        </xsd:choice>\r\n      </xsd:complexType>\r\n    </xsd:element>\r\n  </xsd:schema>\r\n  <resheader name=\"resmimetype\">\r\n    <value>text/microsoft-resx</value>\r\n  </resheader>\r\n  <resheader name=\"version\">\r\n    <value>2.0</value>\r\n  </resheader>\r\n  <resheader name=\"reader\">\r\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n  <resheader name=\"writer\">\r\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n</root>"
  },
  {
    "path": "EasyJobPSTools/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n//     This code was generated by a tool.\r\n//     Runtime Version:4.0.30319.42000\r\n//\r\n//     Changes to this file may cause incorrect behavior and will be lost if\r\n//     the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\n\r\nnamespace EasyJobPSTools.Properties {\r\n    \r\n    \r\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"16.10.0.0\")]\r\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\r\n        \r\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r\n        \r\n        public static Settings Default {\r\n            get {\r\n                return defaultInstance;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\r\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\r\n  <Profiles>\r\n    <Profile Name=\"(Default)\" />\r\n  </Profiles>\r\n  <Settings />\r\n</SettingsFile>"
  },
  {
    "path": "EasyJobPSTools/Utils/CommonUtils.cs",
    "content": "﻿using ModernWpf;\r\nusing ModernWpf.Controls;\r\nusing System.Windows;\r\n\r\nnamespace EasyJobPSTools.Utils\r\n{\r\n    public class CommonUtils\r\n    {\r\n        public static void FixModernWpfUI()\r\n        {\r\n            if (Application.Current is null)\r\n            {\r\n                var app = new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown };\r\n\r\n                var themeResources = new ThemeResources();\r\n                themeResources.BeginInit();\r\n                app.Resources.MergedDictionaries.Add(themeResources);\r\n                themeResources.EndInit();\r\n\r\n                app.Resources.MergedDictionaries.Add(new XamlControlsResources());\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/Windows/ShowEJInputBox.xaml",
    "content": "﻿<Window x:Class=\"EasyJobPSTools.Windows.ShowEJInputBox\"\r\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n        xmlns:ui=\"http://schemas.modernwpf.com/2019\"\r\n        ui:WindowHelper.UseModernWindowStyle=\"True\"\r\n        xmlns:local=\"clr-namespace:EasyJobPSTools.Windows\"\r\n        mc:Ignorable=\"d\" WindowStartupLocation=\"CenterScreen\"\r\n        Title=\"\" Height=\"230\" Width=\"400\" SizeToContent=\"Height\">\r\n    <Window.Resources>\r\n        <ResourceDictionary>\r\n            <ResourceDictionary.MergedDictionaries>\r\n                <ui:ThemeResources />\r\n                <ui:XamlControlsResources />\r\n            </ResourceDictionary.MergedDictionaries>\r\n        </ResourceDictionary>\r\n    </Window.Resources>\r\n    <Grid>\r\n        <Grid.RowDefinitions>\r\n            <RowDefinition Height=\"Auto\"/>\r\n            <RowDefinition Height=\"78\"/>\r\n            <RowDefinition Height=\"28\"/>\r\n            <RowDefinition Height=\"48\"/>\r\n        </Grid.RowDefinitions>\r\n        <TextBlock Name=\"FormText\" Grid.Row=\"0\" Text=\"\" Margin=\"12\" VerticalAlignment=\"Center\" TextWrapping=\"Wrap\"/>\r\n        <TextBox Name=\"FormAnswer\" Grid.Row=\"1\" Margin=\"20\" VerticalContentAlignment=\"Center\" TextChanged=\"FormAnswer_TextChanged\"/>\r\n        <TextBlock Name=\"FormError\" Foreground=\"Red\" Grid.Row=\"2\" Margin=\"10,0,10,0\" VerticalAlignment=\"Center\"/>\r\n        <Button Content=\"OK\" Name=\"OKButton\" Grid.Row=\"3\" HorizontalAlignment=\"Right\" Margin=\"10,10,10,10\" Padding=\"5\" Click=\"OKButton_Click\"/>\r\n        <Button Content=\"Cancel\" Name=\"CancelButton\" Grid.Row=\"3\" HorizontalAlignment=\"Right\" Margin=\"10,10,45,10\" Padding=\"5\" Click=\"CancelButton_Click\"/>\r\n    </Grid>\r\n</Window>\r\n"
  },
  {
    "path": "EasyJobPSTools/Windows/ShowEJInputBox.xaml.cs",
    "content": "﻿using EasyJobPSTools.Utils;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Data;\r\nusing System.Windows.Documents;\r\nusing System.Windows.Input;\r\nusing System.Windows.Media;\r\nusing System.Windows.Media.Imaging;\r\nusing System.Windows.Shapes;\r\n\r\nnamespace EasyJobPSTools.Windows\r\n{\r\n    /// <summary>\r\n    /// Interaction logic for ShowEJInputBox.xaml\r\n    /// </summary>\r\n    public partial class ShowEJInputBox : Window\r\n    {\r\n        private string _Header;\r\n        private string _Text;\r\n        private bool _AllowEmptyResult;\r\n        public string windowResult = \"\";\r\n\r\n        public ShowEJInputBox(string Header, string Text, bool AllowEmptyResult)\r\n        {\r\n            CommonUtils.FixModernWpfUI();\r\n            InitializeComponent();\r\n\r\n            FormError.Visibility = Visibility.Collapsed;\r\n\r\n            _Header = Header;\r\n            _Text = Text;\r\n            _AllowEmptyResult = AllowEmptyResult;\r\n\r\n            this.Title = Header;\r\n            FormText.Text = Text;\r\n        }\r\n\r\n        private void OKButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            if (FormAnswer.Text.Length == 0 && _AllowEmptyResult == false)\r\n            {\r\n                FormError.Text = \"Please input value\";\r\n                FormError.Visibility = Visibility.Visible;\r\n            }\r\n            else\r\n            {\r\n                windowResult = FormAnswer.Text;\r\n                DialogResult = true;\r\n            }\r\n        }\r\n\r\n        private void CancelButton_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            DialogResult = false;\r\n        }\r\n\r\n        private void FormAnswer_TextChanged(object sender, TextChangedEventArgs e)\r\n        {\r\n            if (_AllowEmptyResult == false)\r\n            {\r\n                if(FormAnswer.Text.Length > 0 && FormError.Visibility == Visibility.Visible)\r\n                {\r\n                    FormError.Visibility = Visibility.Collapsed;\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "EasyJobPSTools/app.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<configuration>\r\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.8\"/></startup></configuration>\r\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>."
  },
  {
    "path": "README.md",
    "content": "# <img src=\"assets/icon.png\" height=\"42\" width=\"42\"/> EasyJob\n\n<a href=\"https://img.shields.io/github/license/akshinmustafayev/EasyJob\">\n  <img src=\"https://img.shields.io/github/license/akshinmustafayev/EasyJob\" alt=\"License\" />\n</a>\n<a href=\"https://img.shields.io/tokei/lines/github/akshinmustafayev/EasyJob\">\n  <img src=\"https://img.shields.io/tokei/lines/github/akshinmustafayev/EasyJob\" alt=\"Total lines\" />\n</a>\n<a href=\"https://img.shields.io/github/downloads/akshinmustafayev/EasyJob/total\">\n  <img src=\"https://img.shields.io/github/downloads/akshinmustafayev/EasyJob/total\" alt=\"Downloads\" />\n</a>\n<a href=\"https://img.shields.io/github/stars/akshinmustafayev/EasyJob?style=social\">\n  <img alt=\"GitHub repo file count\" src=\"https://img.shields.io/github/stars/akshinmustafayev/EasyJob?style=social\">\n</a>\n<a href=\"https://img.shields.io/github/contributors/akshinmustafayev/EasyJob\">\n  <img alt=\"GitHub repo file count\" src=\"https://img.shields.io/github/contributors/akshinmustafayev/EasyJob\">\n</a>\n\n\n## :newspaper: Description\n\nEasyJob - keep and execute your PowerShell and BAT scripts from one interface\n\n\n## :eye_speech_bubble: Overview\n![image](https://user-images.githubusercontent.com/29357955/138738649-e80dc995-5bfb-423d-9822-6427540f0b46.png)\n\n![image](https://user-images.githubusercontent.com/29357955/138327363-072fe889-745d-4f57-b8df-7ce567258191.png)\n\n![image](https://user-images.githubusercontent.com/29357955/138327384-740485f3-1a0a-4717-81a0-75f209207c32.png)\n\n![image](https://user-images.githubusercontent.com/29357955/136707408-518324f0-1de3-4b66-9d77-ed186d25c1fe.png)\n\n\n## :abacus: Features\n* _Remove_, _Edit_ or _Copy_ button from the GUI by right mouse click on it and then select item in the context menu. Settings are automatically will be saved to your config.json file.\n\n![image](https://raw.githubusercontent.com/akshinmustafayev/EasyJob/main/ej/feature1_1_9_0.png)\n\n\n* _Remove_, _Rename_ or _Add_ tab from the GUI by right mouse click on it and then select Remove Tab in the context menu. Settings are automatically will be saved to your config.json file.\n\n![image](https://raw.githubusercontent.com/akshinmustafayev/EasyJob/main/ej/feature2_1_1_5.png)\n\n\n* _Add_ or _Paste_ button from the GUI by right mouse click on button bar.\n\n![image](https://raw.githubusercontent.com/akshinmustafayev/EasyJob/main/ej/feature3_1_1_9_0.PNG)\n\n\n* Reorder Tabs from the _Settings->Workflow->Reorder_ tabs window\n* Add Tabs from the _Settings->Workflow->Add tab_ window\n* Rename Tabs from the _Settings->Workflow->Remove current tab_ window\n* Remove Tabs from the _Settings->Workflow->Rename current tab_ window\n* Remove Add buttons from the _Settings->Workflow->Add button to current_ tab window\n* Reorder buttons from the _Settings->Workflow->Reorder buttons in current_ tab window\n* Change application settings from the _Settings->Configuration_ window\n* Colored console support\n\n\n## :red_circle: Color tags support\n\nThere are 14 available default tags which you may want to use\n1. <img src=\"ej/color_tags/tag01.png\" style=\"height:18px;width:18px;\"> __\\c01EJ__ Some text __/c01EJ__\n```PowerShell\nWrite-Host \"\\c01EJColor with tag 01/c01EJ\"\n```\n2. <img src=\"ej/color_tags/tag02.png\" style=\"height:18px;width:18px;\"> __\\c02EJ__ Some text __/c02EJ__\n```PowerShell\nWrite-Host \"\\c02EJColor with tag 02/c02EJ\"\n```\n3. <img src=\"ej/color_tags/tag03.png\" style=\"height:18px;width:18px;\"> __\\c03EJ__ Some text __/c03EJ__\n```PowerShell\nWrite-Host \"\\c03EJColor with tag 03/c03EJ\"\n```\n4. <img src=\"ej/color_tags/tag04.png\" style=\"height:18px;width:18px;\"> __\\c04EJ__ Some text __/c04EJ__\n```PowerShell\nWrite-Host \"\\c04EJColor with tag 04/c04EJ\"\n```\n5. <img src=\"ej/color_tags/tag05.png\" style=\"height:18px;width:18px;\"> __\\c05EJ__ Some text __/c05EJ__\n```PowerShell\nWrite-Host \"\\c05EJColor with tag 05/c05EJ\"\n```\n6. <img src=\"ej/color_tags/tag06.png\" style=\"height:18px;width:18px;\"> __\\c06EJ__ Some text __/c06EJ__\n```PowerShell\nWrite-Host \"\\c06EJColor with tag 06/c06EJ\"\n```\n7. <img src=\"ej/color_tags/tag07.png\" style=\"height:18px;width:18px;\"> __\\c07EJ__ Some text __/c07EJ__\n```PowerShell\nWrite-Host \"\\c07EJColor with tag 07/c07EJ\"\n```\n8. <img src=\"ej/color_tags/tag08.png\" style=\"height:18px;width:18px;\"> __\\c08EJ__ Some text __/c08EJ__\n```PowerShell\nWrite-Host \"\\c08EJColor with tag 08/c08EJ\"\n```\n9. <img src=\"ej/color_tags/tag09.png\" style=\"height:18px;width:18px;\"> __\\c09EJ__ Some text __/c09EJ__\n```PowerShell\nWrite-Host \"\\c09EJColor with tag 09/c09EJ\"\n```\n10. <img src=\"ej/color_tags/tag10.png\" style=\"height:18px;width:18px;\"> __\\c10EJ__ Some text __/c10EJ__\n```PowerShell\nWrite-Host \"\\c10EJColor with tag 10/c10EJ\"\n```\n11. <img src=\"ej/color_tags/tag11.png\" style=\"height:18px;width:18px;\"> __\\c11EJ__ Some text __/c11EJ__\n```PowerShell\nWrite-Host \"\\c11EJColor with tag 11/c11EJ\"\n```\n12. <img src=\"ej/color_tags/tag12.png\" style=\"height:18px;width:18px;\"> __\\c12EJ__ Some text __/c12EJ__\n```PowerShell\nWrite-Host \"\\c12EJColor with tag 12/c12EJ\"\n```\n13. <img src=\"ej/color_tags/tag13.png\" style=\"height:18px;width:18px;\"> __\\c13EJ__ Some text __/c13EJ__\n```PowerShell\nWrite-Host \"\\c13EJColor with tag 13/c13EJ\"\n```\n13. <img src=\"ej/color_tags/tag14.png\" style=\"height:18px;width:18px;\"> __\\c14EJ__ Some text __/c14EJ__\n```PowerShell\nWrite-Host \"\\c14EJColor with tag 14/c14EJ\"\n```\n\nYou can use tags inside other tags as well. Examples:\n```PowerShell\nWrite-Host \"\\c14EJColor with \\c12EJsome inside tag/c12EJ tag 14/c14EJ\"\nWrite-Host \"\\c02EJColor with \\c09EJsome inside tag/c09EJ tag 14/c02EJ\"\nWrite-Host \"\\c02EJAnother \\c04EJexample/c04EJ with \\c08EJsome/c08EJ other inner blocks/c02EJ\"\n```\n\nIf you dont want to use tags, you can use HTML code inside your Write-Host. Examples:\n```PowerShell\nWrite-Host \"<span style=`\"color:red;`\">Some error alert!</span>\"\nWrite-Host \"<span style=`\"color:#FF0008;`\">Some other color!</span>\"\nWrite-Host \"<span style=`\"color:#4CFF00;`\">Some other color!</span>\"\n```\n\n\n## :hammer: EasyJobPSTools\n\nEasyJobPSTools - is a PowerShell Module which enables Graphic features for your scripts.\n\nYou can read more about it [Here](https://github.com/akshinmustafayev/EasyJobPSTools)\n\n## :gear: Configuration\n\nConfiguration could be done from config.json file located with the app executable.\n\nHere is an example:\n\n```\n{\n  \"default_powershell_path\": \"C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\",\n  \"default_cmd_path\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\",\n  \"powershell_arguments\": \"\",\n  \"console_background\": \"Black\",\n  \"console_foreground\": \"White\",\n  \"console_ignore_color_tags\": false,\n  \"clear_events_when_reload\": true,\n  \"restrictions\": {\n    \"block_tabs_remove\": false,\n    \"block_buttons_remove\": false,\n    \"block_tabs_add\": false,\n    \"block_buttons_add\": false,\n    \"block_buttons_reorder\": false,\n    \"block_buttons_edit\": false,\n    \"block_tabs_rename\": false,\n    \"block_buttons_paste\": false,\n    \"block_buttons_copy\": false,\n    \"hide_menu_item_file_reload_config\": false,\n    \"hide_menu_item_file_open_app_folder\": false,\n    \"hide_menu_item_file_clear_events_list\": false,\n    \"hide_menu_item_settings\": false,\n    \"hide_menu_item_settings_workflow\": false,\n    \"hide_menu_item_settings_workflow_reorder_tabs\": false,\n    \"hide_menu_item_settings_workflow_add_tab\": false,\n    \"hide_menu_item_settings_workflow_remove_current_tab\": false,\n    \"hide_menu_item_settings_workflow_rename_current_tab\": false,\n    \"hide_menu_item_settings_workflow_add_button_to_current_tab\": false,\n    \"hide_menu_item_settings_workflow_reorder_buttons_in_current_tab\": false,\n    \"hide_menu_item_settings_configuration\": false,\n    \"hide_menu_item_help\": false,\n    \"hide_menu_item_help_troubleshooting\": false,\n    \"hide_menu_item_help_colortags\": false,\n    \"hide_menu_item_help_about\": false\n  },\n  \"tabs\": [\n    {\n      \"ID\": \"2e5feab0-527c-451c-b83c-d838d22dacac\",\n      \"header\": \"Common actions\",\n      \"buttons\": [\n        {\n          \"Id\": \"01bf5871-442e-4f73-91a3-fa13855b609c\",\n          \"text\": \"test01\",\n          \"description\": \"Some test script\",\n          \"script\": \"scripts\\\\common\\\\test01.ps1\",\n          \"scriptpathtype\": \"relative\",\n          \"scripttype\": \"powershell\",\n          \"arguments\": []\n        },\n        {\n          \"Id\": \"9cdc38fa-fc32-4a9d-be78-cd2bfe264422\",\n          \"text\": \"Bat script\",\n          \"description\": \"Some BAT script\",\n          \"script\": \"scripts\\\\test02.bat\",\n          \"scriptpathtype\": \"relative\",\n          \"scripttype\": \"bat\",\n          \"arguments\": []\n        },\n        {\n          \"Id\": \"5ec086d9-7987-43ef-84fb-1d8481b05aea\",\n          \"text\": \"Absolute path script\",\n          \"description\": \"\",\n          \"script\": \"C:\\\\scripts\\\\absolute_script.ps1\",\n          \"scriptpathtype\": \"absolute\",\n          \"scripttype\": \"powershell\",\n          \"arguments\": []\n        },\n        {\n          \"Id\": \"c28abef3-494c-48f5-96d8-a5788ced1a23\",\n          \"text\": \"test04\",\n          \"description\": \"Some test 04 script with arguments\",\n          \"script\": \"scripts\\\\common\\\\test04.ps1\",\n          \"scriptpathtype\": \"relative\",\n          \"scripttype\": \"powershell\",\n          \"arguments\": [\n            {\n              \"argument_question\": \"What is your name?\",\n              \"argument_answer\": \"\"\n            },\n            {\n              \"argument_question\": \"What is your surname\",\n              \"argument_answer\": \"\"\n            },\n            {\n              \"argument_question\": \"No, really what is your name?\",\n              \"argument_answer\": \"\"\n            }\n          ]\n        }\n      ]\n    },\n    {\n      \"ID\": \"42f71e1a-32b9-4c16-8c7d-256cd589c52e\",\n      \"header\": \"Second Tab\",\n      \"buttons\": [\n        {\n          \"Id\": \"3476554c-77b1-4abd-914e-ab1db866fc5f\",\n          \"text\": \"And this is button too\",\n          \"description\": \"no description\",\n          \"script\": \"scripts\\\\some_button_script.ps1\",\n          \"scriptpathtype\": \"relative\",\n          \"scripttype\": \"powershell\",\n          \"arguments\": []\n        }\n      ]\n    }\n  ]\n}\n```\n\n_Note 1: Do not specify argument_answer value, since it will be ignored when executing script_\n\n_Note 2: ID my be any other random GUID number. You may not specify it, application will regenerate it after changes if it is absent._\n\n\n## :triangular_flag_on_post: Easy access\n_CTRL+Left Mouse Click_ on the button will open folder where script attached to the button is located\n\n_SHIFT+Left Mouse Click_ on the button will open the script attached to the button with your default ps1 text editor\n\n## :electric_plug: Compilation\n\n1. Download and install Visual Studio 2022\n2. Open project in Visual Studio and build it\n\n## :dart: Contributing\n\nContribution is very much appreciated. Hope that this tool might be useful for you!\n\nThanks to the contributors:\n\n<a href=\"https://github.com/akshinmustafayev/EasyJob/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=akshinmustafayev/EasyJob\" />\n</a>\n\n"
  },
  {
    "path": "WpfRichText/AttachedProperties/RichTextboxAssistant.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Documents;\nusing System.Windows.Controls;\nusing System.IO;\nusing System.Windows.Input;\nusing System.Windows.Markup;\nusing System.Windows.Data;\n\nnamespace WpfRichText\n{\n\t/// <summary></summary>\n\tpublic static class RichTextBoxAssistant\n    {\n\t\t/// <summary></summary>\n\t\tpublic static readonly DependencyProperty BoundDocument =\n           DependencyProperty.RegisterAttached(\"BoundDocument\", typeof(string), typeof(RichTextBoxAssistant),\n           new FrameworkPropertyMetadata(null,\n               FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,\n               OnBoundDocumentChanged)\n               );\n\n        private static void OnBoundDocumentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            RichTextBox box = d as RichTextBox;\n\n            if (box == null)\n                return;\n\n            RemoveEventHandler(box);\n\n            string newXAML = GetBoundDocument(d);\n\n            box.Document.Blocks.Clear();\n\n            if (!string.IsNullOrEmpty(newXAML))\n            {\n                using (MemoryStream xamlMemoryStream = new MemoryStream(Encoding.UTF8.GetBytes(newXAML)))\n                {\n                    ParserContext parser = new ParserContext();\n                    parser.XmlnsDictionary.Add(\"\", \"http://schemas.microsoft.com/winfx/2006/xaml/presentation\");\n                    parser.XmlnsDictionary.Add(\"x\", \"http://schemas.microsoft.com/winfx/2006/xaml\");\n                    //FlowDocument doc = new FlowDocument();\n                    Section section = XamlReader.Load(xamlMemoryStream, parser) as Section;\n\n                    box.Document.Blocks.Add(section);\n\n                }\n            }\n\n            AttachEventHandler(box);\n\n        }\n\n        private static void RemoveEventHandler(RichTextBox box)\n        {\n            Binding binding = BindingOperations.GetBinding(box, BoundDocument);\n\n            if (binding != null)\n            {\n                if (binding.UpdateSourceTrigger == UpdateSourceTrigger.Default ||\n                    binding.UpdateSourceTrigger == UpdateSourceTrigger.LostFocus)\n                {\n\n                    box.LostFocus -= HandleLostFocus;\n                }\n                else\n                {\n                    box.TextChanged -= HandleTextChanged;\n                }\n            }\n        }\n\n        private static void AttachEventHandler(RichTextBox box)\n        {\n            Binding binding = BindingOperations.GetBinding(box, BoundDocument);\n\n            if (binding != null)\n            {\n                if (binding.UpdateSourceTrigger == UpdateSourceTrigger.Default ||\n                    binding.UpdateSourceTrigger == UpdateSourceTrigger.LostFocus)\n                {\n\n                    box.LostFocus += HandleLostFocus;\n                }\n                else\n                {\n                    box.TextChanged += HandleTextChanged;\n                }\n            }\n        }\n\n        private static void HandleLostFocus(object sender, RoutedEventArgs e)\n        {\n            RichTextBox box = sender as RichTextBox;\n\n            TextRange tr = new TextRange(box.Document.ContentStart, box.Document.ContentEnd);\n\n            using (MemoryStream ms = new MemoryStream())\n            {\n                tr.Save(ms, DataFormats.Xaml);\n\t\t\t\tstring xamlText = Encoding.UTF8.GetString(ms.ToArray());\n                SetBoundDocument(box, xamlText);\n            }\n        }\n\n        private static void HandleTextChanged(object sender, RoutedEventArgs e)\n        {\n            // TODO: TextChanged is currently not working!\n            RichTextBox box = sender as RichTextBox;\n\n            TextRange tr = new TextRange(box.Document.ContentStart,\n                               box.Document.ContentEnd);\n\n            using (MemoryStream ms = new MemoryStream())\n            {\n                tr.Save(ms, DataFormats.Xaml);\n\t\t\t\tstring xamlText = Encoding.UTF8.GetString(ms.ToArray());\n                SetBoundDocument(box, xamlText);\n            }\n        }\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"dependencyObject\"></param>\n\t\t/// <returns></returns>\n        public static string GetBoundDocument(DependencyObject dependencyObject)\n        {\n\t\t\tif (dependencyObject != null)\n\t\t\t{\n\t\t\t\tvar html = dependencyObject.GetValue(BoundDocument) as string;\n\t\t\t\tvar xaml = string.Empty;\n\n\t\t\t\tif (!string.IsNullOrEmpty(html))\n\t\t\t\t\txaml = HtmlToXamlConverter.ConvertHtmlToXaml(html, false);\n\n\t\t\t\treturn xaml;\n\t\t\t}\n\t\t\treturn string.Empty;\n        }\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"dependencyObject\"></param>\n\t\t/// <param name=\"value\"></param>\n\t\tpublic static void SetBoundDocument(DependencyObject dependencyObject, string value)\n        {\n\t\t\tif (dependencyObject != null)\n\t\t\t{\n\t\t\t\tvar xaml = value;\n\t\t\t\tvar html = HtmlFromXamlConverter.ConvertXamlToHtml(xaml, false);\n\t\t\t\tdependencyObject.SetValue(BoundDocument, html);\n\t\t\t}\n        }\n    }\n\n \n}"
  },
  {
    "path": "WpfRichText/Commands/CommandReference.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace WpfRichText\n{\n    /// <summary>\n    /// This class facilitates associating a key binding in XAML markup to a command\n    /// defined in a View Model by exposing a Command dependency property.\n    /// The class derives from Freezable to work around a limitation in WPF when data-binding from XAML.\n    /// </summary>\n    public class CommandReference : Freezable, ICommand\n    {\n\t\t/// <summary></summary>\n        public CommandReference()\n        {\n            // Blank\n        }\n\n\t\t/// <summary></summary>\n        public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(CommandReference), new PropertyMetadata(new PropertyChangedCallback(OnCommandChanged)));\n\n\t\t/// <summary></summary>\n        public ICommand Command\n        {\n            get { return (ICommand)GetValue(CommandProperty); }\n            set { SetValue(CommandProperty, value); }\n        }\n\n        #region ICommand Members\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"parameter\"></param>\n\t\t/// <returns></returns>\n        public bool CanExecute(object parameter)\n        {\n            if (Command != null)\n                return Command.CanExecute(parameter);\n            return false;\n        }\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"parameter\"></param>\n        public void Execute(object parameter)\n        {\n            Command.Execute(parameter);\n        }\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n        public event EventHandler CanExecuteChanged;\n\n        private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            CommandReference commandReference = d as CommandReference;\n            ICommand oldCommand = e.OldValue as ICommand;\n            ICommand newCommand = e.NewValue as ICommand;\n\n            if (oldCommand != null)\n            {\n                oldCommand.CanExecuteChanged -= commandReference.CanExecuteChanged;\n            }\n            if (newCommand != null)\n            {\n                newCommand.CanExecuteChanged += commandReference.CanExecuteChanged;\n            }\n        }\n\n        #endregion\n\n        #region Freezable\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <returns></returns>\n        protected override Freezable CreateInstanceCore()\n        {\n            throw new NotImplementedException();\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "WpfRichText/Commands/DelegateCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace WpfRichText\n{\n    /// <summary>\n    ///     This class allows delegating the commanding logic to methods passed as parameters,\n    ///     and enables a View to bind commands to objects that are not part of the element tree.\n    /// </summary>\n    public class DelegateCommand : ICommand\n    {\n        #region Constructors\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action executeMethod)\n            : this(executeMethod, null, false)\n        {\n        }\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)\n            : this(executeMethod, canExecuteMethod, false)\n        {\n        }\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod, bool isAutomaticRequeryDisabled)\n        {\n            if (executeMethod == null)\n            {\n                throw new ArgumentNullException(\"executeMethod\");\n            }\n\n            _executeMethod = executeMethod;\n            _canExecuteMethod = canExecuteMethod;\n            _isAutomaticRequeryDisabled = isAutomaticRequeryDisabled;\n        }\n\n        #endregion\n\n        #region Public Methods\n\n        /// <summary>\n        ///     Method to determine if the command can be executed\n        /// </summary>\n        public bool CanExecute()\n        {\n            if (_canExecuteMethod != null)\n            {\n                return _canExecuteMethod();\n            }\n            return true;\n        }\n\n        /// <summary>\n        ///     Execution of the command\n        /// </summary>\n        public void Execute()\n        {\n            if (_executeMethod != null)\n            {\n                _executeMethod();\n            }\n        }\n\n        /// <summary>\n        ///     Property to enable or disable CommandManager's automatic requery on this command\n        /// </summary>\n        public bool IsAutomaticRequeryDisabled\n        {\n            get\n            {\n                return _isAutomaticRequeryDisabled;\n            }\n            set\n            {\n                if (_isAutomaticRequeryDisabled != value)\n                {\n                    if (value)\n                    {\n                        CommandManagerHelper.RemoveHandlersFromRequerySuggested(_canExecuteChangedHandlers);\n                    }\n                    else\n                    {\n                        CommandManagerHelper.AddHandlersToRequerySuggested(_canExecuteChangedHandlers);\n                    }\n                    _isAutomaticRequeryDisabled = value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Raises the CanExecuteChaged event\n        /// </summary>\n        public void RaiseCanExecuteChanged()\n\t\t{\n\t\t\tOnCanExecuteChanged();\n\t\t}\n\n        /// <summary>\n        ///     Protected virtual method to raise CanExecuteChanged event\n        /// </summary>\n        protected virtual void OnCanExecuteChanged()\n        {\n            CommandManagerHelper.CallWeakReferenceHandlers(_canExecuteChangedHandlers);\n        }\n\n        #endregion\n\n        #region ICommand Members\n\n        /// <summary>\n        ///     ICommand.CanExecuteChanged implementation\n        /// </summary>\n        public event EventHandler CanExecuteChanged\n        {\n            add\n            {\n                if (!_isAutomaticRequeryDisabled)\n                {\n                    CommandManager.RequerySuggested += value;\n                }\n                CommandManagerHelper.AddWeakReferenceHandler(ref _canExecuteChangedHandlers, value, 2);\n            }\n            remove\n            {\n                if (!_isAutomaticRequeryDisabled)\n                {\n                    CommandManager.RequerySuggested -= value;\n                }\n                CommandManagerHelper.RemoveWeakReferenceHandler(_canExecuteChangedHandlers, value);\n            }\n        }\n\n        bool ICommand.CanExecute(object parameter)\n        {\n            return CanExecute();\n        }\n\n        void ICommand.Execute(object parameter)\n        {\n            Execute();\n        }\n\n        #endregion\n\n        #region Data\n\n        private readonly Action _executeMethod = null;\n        private readonly Func<bool> _canExecuteMethod = null;\n        private bool _isAutomaticRequeryDisabled = false;\n        private List<WeakReference> _canExecuteChangedHandlers;\n\n        #endregion\n    }\n\n    /// <summary>\n    ///     This class allows delegating the commanding logic to methods passed as parameters,\n    ///     and enables a View to bind commands to objects that are not part of the element tree.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of the parameter passed to the delegates</typeparam>\n    public class DelegateCommand<T> : ICommand\n    {\n        #region Constructors\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action<T> executeMethod)\n            : this(executeMethod, null, false)\n        {\n        }\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod)\n            : this(executeMethod, canExecuteMethod, false)\n        {\n        }\n\n        /// <summary>\n        ///     Constructor\n        /// </summary>\n        public DelegateCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod, bool isAutomaticRequeryDisabled)\n        {\n            if (executeMethod == null)\n            {\n                throw new ArgumentNullException(\"executeMethod\");\n            }\n\n            _executeMethod = executeMethod;\n            _canExecuteMethod = canExecuteMethod;\n            _isAutomaticRequeryDisabled = isAutomaticRequeryDisabled;\n        }\n\n        #endregion\n\n        #region Public Methods\n\n        /// <summary>\n        ///     Method to determine if the command can be executed\n        /// </summary>\n        public bool CanExecute(T parameter)\n        {\n            if (_canExecuteMethod != null)\n            {\n                return _canExecuteMethod(parameter);\n            }\n            return true;\n        }\n\n        /// <summary>\n        ///     Execution of the command\n        /// </summary>\n        public void Execute(T parameter)\n        {\n            if (_executeMethod != null)\n            {\n                _executeMethod(parameter);\n            }\n        }\n\n        /// <summary>\n        ///     Raises the CanExecuteChaged event\n        /// </summary>\n        public void RaiseCanExecuteChanged()\n        {\n            OnCanExecuteChanged();\n        }\n\n        /// <summary>\n        ///     Protected virtual method to raise CanExecuteChanged event\n        /// </summary>\n        protected virtual void OnCanExecuteChanged()\n        {\n            CommandManagerHelper.CallWeakReferenceHandlers(_canExecuteChangedHandlers);\n        }\n\n        /// <summary>\n        ///     Property to enable or disable CommandManager's automatic requery on this command\n        /// </summary>\n        public bool IsAutomaticRequeryDisabled\n        {\n            get\n            {\n                return _isAutomaticRequeryDisabled;\n            }\n            set\n            {\n                if (_isAutomaticRequeryDisabled != value)\n                {\n                    if (value)\n                    {\n                        CommandManagerHelper.RemoveHandlersFromRequerySuggested(_canExecuteChangedHandlers);\n                    }\n                    else\n                    {\n                        CommandManagerHelper.AddHandlersToRequerySuggested(_canExecuteChangedHandlers);\n                    }\n                    _isAutomaticRequeryDisabled = value;\n                }\n            }\n        }\n\n        #endregion\n\n        #region ICommand Members\n\n        /// <summary>\n        ///     ICommand.CanExecuteChanged implementation\n        /// </summary>\n        public event EventHandler CanExecuteChanged\n        {\n            add\n            {\n                if (!_isAutomaticRequeryDisabled)\n                {\n                    CommandManager.RequerySuggested += value;\n                }\n                CommandManagerHelper.AddWeakReferenceHandler(ref _canExecuteChangedHandlers, value, 2);\n            }\n            remove\n            {\n                if (!_isAutomaticRequeryDisabled)\n                {\n                    CommandManager.RequerySuggested -= value;\n                }\n                CommandManagerHelper.RemoveWeakReferenceHandler(_canExecuteChangedHandlers, value);\n            }\n        }\n\n        bool ICommand.CanExecute(object parameter)\n        {\n            // if T is of value type and the parameter is not\n            // set yet, then return false if CanExecute delegate\n            // exists, else return true\n            if (parameter == null &&\n                typeof(T).IsValueType)\n            {\n                return (_canExecuteMethod == null);\n            }\n            return CanExecute((T)parameter);\n        }\n\n        void ICommand.Execute(object parameter)\n        {\n            Execute((T)parameter);\n        }\n\n        #endregion\n\n        #region Data\n\n        private readonly Action<T> _executeMethod = null;\n        private readonly Func<T, bool> _canExecuteMethod = null;\n        private bool _isAutomaticRequeryDisabled = false;\n        private List<WeakReference> _canExecuteChangedHandlers;\n\n        #endregion\n    }\n\n    /// <summary>\n    ///     This class contains methods for the CommandManager that help avoid memory leaks by\n    ///     using weak references.\n    /// </summary>\n    internal static class CommandManagerHelper\n    {\n        internal static void CallWeakReferenceHandlers(List<WeakReference> handlers)\n        {\n            if (handlers != null)\n            {\n                // Take a snapshot of the handlers before we call out to them since the handlers\n                // could cause the array to me modified while we are reading it.\n\n                EventHandler[] callees = new EventHandler[handlers.Count];\n                int count = 0;\n\n                for (int i = handlers.Count - 1; i >= 0; i--)\n                {\n                    WeakReference reference = handlers[i];\n                    EventHandler handler = reference.Target as EventHandler;\n                    if (handler == null)\n                    {\n                        // Clean up old handlers that have been collected\n                        handlers.RemoveAt(i);\n                    }\n                    else\n                    {\n                        callees[count] = handler;\n                        count++;\n                    }\n                }\n\n                // Call the handlers that we snapshotted\n                for (int i = 0; i < count; i++)\n                {\n                    EventHandler handler = callees[i];\n                    handler(null, EventArgs.Empty);\n                }\n            }\n        }\n\n        internal static void AddHandlersToRequerySuggested(List<WeakReference> handlers)\n        {\n            if (handlers != null)\n            {\n                foreach (WeakReference handlerRef in handlers)\n                {\n                    EventHandler handler = handlerRef.Target as EventHandler;\n                    if (handler != null)\n                    {\n                        CommandManager.RequerySuggested += handler;\n                    }\n                }\n            }\n        }\n\n        internal static void RemoveHandlersFromRequerySuggested(List<WeakReference> handlers)\n        {\n            if (handlers != null)\n            {\n                foreach (WeakReference handlerRef in handlers)\n                {\n                    EventHandler handler = handlerRef.Target as EventHandler;\n                    if (handler != null)\n                    {\n                        CommandManager.RequerySuggested -= handler;\n                    }\n                }\n            }\n        }\n\n\t\t//internal static void AddWeakReferenceHandler(ref List<WeakReference> handlers, EventHandler handler)\n\t\t//{\n\t\t//\tAddWeakReferenceHandler(ref handlers, handler, -1);\n\t\t//}\n\n        internal static void AddWeakReferenceHandler(ref List<WeakReference> handlers, EventHandler handler, int defaultListSize)\n        {\n            if (handlers == null)\n            {\n                handlers = (defaultListSize > 0 ? new List<WeakReference>(defaultListSize) : new List<WeakReference>());\n            }\n\n            handlers.Add(new WeakReference(handler));\n        }\n\n        internal static void RemoveWeakReferenceHandler(List<WeakReference> handlers, EventHandler handler)\n        {\n            if (handlers != null)\n            {\n                for (int i = handlers.Count - 1; i >= 0; i--)\n                {\n                    WeakReference reference = handlers[i];\n                    EventHandler existingHandler = reference.Target as EventHandler;\n                    if ((existingHandler == null) || (existingHandler == handler))\n                    {\n                        // Clean up old handlers that have been collected\n                        // in addition to the handler that is to be removed.\n                        handlers.RemoveAt(i);\n                    }\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "WpfRichText/Controls/RichTextEditor.xaml",
    "content": "﻿<UserControl\n\t\t\t xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n\t\t\t xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n\t\t\t xmlns:xt=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n\t\t\t xmlns:asis=\"clr-namespace:WpfRichText\" \n\t\t\txmlns:Themes=\"clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic\" \n\t\t\tx:Class=\"WpfRichText.RichTextEditor\" x:Name=\"uxRichTextEditor\">\n\t\n\t<Grid Background=\"{Binding BorderBrush, ElementName=uxRichTextEditor}\">\n        <RichTextBox x:Name=\"mainRTB\" \n\t\t\tAcceptsTab=\"True\" \n\t\t\tasis:RichTextBoxAssistant.BoundDocument=\"{Binding Text, ElementName=uxRichTextEditor}\" \n\t\t\tMinHeight=\"100\" \n\t\t\tIsReadOnly=\"{Binding IsReadOnly, ElementName=uxRichTextEditor}\" \n\t\t\tBackground=\"{Binding Background, ElementName=uxRichTextEditor}\"\n\t\t\tForeground=\"{Binding Foreground, ElementName=uxRichTextEditor}\"\n\t\t\tBorderBrush=\"{Binding BorderBrush, ElementName=uxRichTextEditor}\" \n\t\t\tBorderThickness=\"{Binding BorderThickness, ElementName=uxRichTextEditor}\" \n            FontFamily=\"Consolas\"/>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "WpfRichText/Controls/RichTextEditor.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\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 WpfRichText\n{\n    /// <summary>\n    /// Interaction logic for BindableRichTextbox.xaml\n    /// </summary>\n    public partial class RichTextEditor : UserControl\n    {\n\t\t/// <summary></summary>\n\t\tpublic static readonly DependencyProperty TextProperty =\n\t\t  DependencyProperty.Register(\"Text\", typeof(string), typeof(RichTextEditor),\n\t\t  new PropertyMetadata(string.Empty));\n\n\t\t/// <summary></summary>\n\t\tpublic RichTextEditor()\n        {\n            InitializeComponent();\n\t\t}\n\n\t\t/// <summary></summary>\n\t\tpublic string Text\n\t\t{\n\t\t\tget { return GetValue(TextProperty) as string; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tSetValue(TextProperty, value);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "WpfRichText/WpfRichText.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\r\n  <PropertyGroup>\r\n    <TargetFramework>net5.0-windows</TargetFramework>\r\n    <OutputType>Library</OutputType>\r\n    <SccProjectName></SccProjectName>\r\n    <SccLocalPath></SccLocalPath>\r\n    <SccAuxPath></SccAuxPath>\r\n    <SccProvider></SccProvider>\r\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\r\n    <UseWPF>true</UseWPF>\r\n    <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>\r\n  </PropertyGroup>\r\n\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|AnyCPU'\">\r\n\t<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|AnyCPU'\">\r\n\t<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <AppDesigner Include=\"Properties\\\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <PackageReference Include=\"Microsoft.CSharp\" Version=\"4.7.0\" />\r\n    <PackageReference Include=\"System.Data.DataSetExtensions\" Version=\"4.5.0\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "WpfRichText/WpfRichText.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 16\r\nVisualStudioVersion = 16.0.31624.102\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"WpfRichText\", \"WpfRichText\\WpfRichText.csproj\", \"{78147C43-DB7B-4571-BC7A-E7F0075B4B78}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tDebug|Mixed Platforms = Debug|Mixed Platforms\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\t\tRelease|Mixed Platforms = Release|Mixed Platforms\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Release|Mixed Platforms.Build.0 = Release|Any CPU\r\n\t\t{78147C43-DB7B-4571-BC7A-E7F0075B4B78}.Release|x86.ActiveCfg = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {1ADBABE2-7721-42E2-AE94-7B66D165C486}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlCssParser.cs",
    "content": "//---------------------------------------------------------------------------\r\n// \r\n// File: HtmlXamlConverter.cs\r\n//\r\n// Copyright (C) Microsoft Corporation.  All rights reserved.\r\n//\r\n// Description: Prototype for Html - Xaml conversion \r\n//\r\n//---------------------------------------------------------------------------\r\n\r\n\r\nusing System;\r\nusing System.Collections;\r\nusing System.Collections.Generic;\r\nusing System.Diagnostics;\r\nusing System.Globalization;\r\nusing System.Text;\r\nusing System.Xml;\r\n\r\nnamespace WpfRichText\r\n{\r\n    internal static class HtmlCssParser\r\n    {\r\n        // .................................................................\r\n        //\r\n        // Processing CSS Attributes\r\n        //\r\n        // .................................................................\r\n\r\n\t\tinternal static void GetElementPropertiesFromCssAttributes(XmlElement htmlElement, string elementName, CssStylesheet stylesheet, Hashtable localProperties, List<XmlElement> sourceContext)\r\n        {\r\n            string styleFromStylesheet = stylesheet.GetStyle(elementName, sourceContext);\r\n\r\n            string styleInline = HtmlToXamlConverter.GetAttribute(htmlElement, \"style\");\r\n\r\n            // Combine styles from stylesheet and from inline attribute.\r\n            // The order is important - the latter styles will override the former.\r\n            string style = styleFromStylesheet != null ? styleFromStylesheet : null;\r\n            if (styleInline != null)\r\n            {\r\n                style = style == null ? styleInline : (style + \";\" + styleInline);\r\n            }\r\n\r\n            // Apply local style to current formatting properties\r\n            if (style != null)\r\n            {\r\n                string[] styleValues = style.Split(';');\r\n                for (int i = 0; i < styleValues.Length; i++)\r\n                {\r\n                    string[] styleNameValue;\r\n\r\n                    styleNameValue = styleValues[i].Split(':');\r\n                    if (styleNameValue.Length == 2)\r\n                    {\r\n                        string styleName = styleNameValue[0].Trim().ToLower(CultureInfo.InvariantCulture);\r\n\t\t\t\t\t\tstring styleValue = HtmlToXamlConverter.UnQuote(styleNameValue[1].Trim()).ToLower(CultureInfo.InvariantCulture);\r\n                        int nextIndex = 0;\r\n\r\n                        switch (styleName)\r\n                        {\r\n                            case \"font\":\r\n                                ParseCssFont(styleValue, localProperties);\r\n                                break;\r\n                            case \"font-family\":\r\n                                ParseCssFontFamily(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"font-size\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, \"font-size\", /*mustBeNonNegative:*/true);\r\n                                break;\r\n                            case \"font-style\":\r\n                                ParseCssFontStyle(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"font-weight\":\r\n                                ParseCssFontWeight(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"font-variant\":\r\n                                ParseCssFontVariant(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"line-height\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, \"line-height\", /*mustBeNonNegative:*/true);\r\n                                break;\r\n                            case \"word-spacing\":\r\n                                //  Implement word-spacing conversion\r\n                                break;\r\n                            case \"letter-spacing\":\r\n                                //  Implement letter-spacing conversion\r\n                                break;\r\n                            case \"color\":\r\n                                ParseCssColor(styleValue, ref nextIndex, localProperties, \"color\");\r\n                                break;\r\n\r\n                            case \"text-decoration\":\r\n                                ParseCssTextDecoration(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n\r\n                            case \"text-transform\":\r\n                                ParseCssTextTransform(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n\r\n                            case \"background-color\":\r\n                                ParseCssColor(styleValue, ref nextIndex, localProperties, \"background-color\");\r\n                                break;\r\n                            case \"background\":\r\n                                // TODO: need to parse composite background property\r\n                                ParseCssBackground(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n\r\n                            case \"text-align\":\r\n                                ParseCssTextAlign(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"vertical-align\":\r\n                                ParseCssVerticalAlign(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"text-indent\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, \"text-indent\", /*mustBeNonNegative:*/false);\r\n                                break;\r\n\r\n                            case \"width\":\r\n                            case \"height\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, styleName, /*mustBeNonNegative:*/true);\r\n                                break;\r\n\r\n                            case \"margin\": // top/right/bottom/left\r\n                                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, styleName);\r\n                                break;\r\n                            case \"margin-top\":\r\n                            case \"margin-right\":\r\n                            case \"margin-bottom\":\r\n                            case \"margin-left\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, styleName, /*mustBeNonNegative:*/true);\r\n                                break;\r\n\r\n                            case \"padding\":\r\n                                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, styleName);\r\n                                break;\r\n                            case \"padding-top\":\r\n                            case \"padding-right\":\r\n                            case \"padding-bottom\":\r\n                            case \"padding-left\":\r\n                                ParseCssSize(styleValue, ref nextIndex, localProperties, styleName, /*mustBeNonNegative:*/true);\r\n                                break;\r\n\r\n                            case \"border\":\r\n                                ParseCssBorder(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"border-style\":\r\n                            case \"border-width\":\r\n                            case \"border-color\":\r\n                                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, styleName);\r\n                                break;\r\n                            case \"border-top\":\r\n                            case \"border-right\":\r\n                            case \"border-left\":\r\n                            case \"border-bottom\":\r\n                                //  Parse css border style\r\n                                break;\r\n\r\n                            // NOTE: css names for elementary border styles have side indications in the middle (top/bottom/left/right)\r\n                            // In our internal notation we intentionally put them at the end - to unify processing in ParseCssRectangleProperty method\r\n                            case \"border-top-style\":\r\n                            case \"border-right-style\":\r\n                            case \"border-left-style\":\r\n                            case \"border-bottom-style\":\r\n                            case \"border-top-color\":\r\n                            case \"border-right-color\":\r\n                            case \"border-left-color\":\r\n                            case \"border-bottom-color\":\r\n                            case \"border-top-width\":\r\n                            case \"border-right-width\":\r\n                            case \"border-left-width\":\r\n                            case \"border-bottom-width\":\r\n                                //  Parse css border style\r\n                                break;\r\n\r\n                            case \"display\":\r\n                                //  Implement display style conversion\r\n                                break;\r\n\r\n                            case \"float\":\r\n                                ParseCssFloat(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n                            case \"clear\":\r\n                                ParseCssClear(styleValue, ref nextIndex, localProperties);\r\n                                break;\r\n\r\n                            default:\r\n                                break;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Parsing CSS - Lexical Helpers\r\n        //\r\n        // .................................................................\r\n\r\n        // Skips whitespaces in style values\r\n        private static void ParseWhiteSpace(string styleValue, ref int nextIndex)\r\n        {\r\n            while (nextIndex < styleValue.Length && Char.IsWhiteSpace(styleValue[nextIndex]))\r\n            {\r\n                nextIndex++;\r\n            }\r\n        }\r\n\r\n        // Checks if the following character matches to a given word and advances nextIndex\r\n        // by the word's length in case of success.\r\n        // Otherwise leaves nextIndex in place (except for possible whitespaces).\r\n        // Returns true or false depending on success or failure of matching.\r\n        private static bool ParseWord(string word, string styleValue, ref int nextIndex)\r\n        {\r\n            ParseWhiteSpace(styleValue, ref nextIndex);\r\n\r\n            for (int i = 0; i < word.Length; i++)\r\n            {\r\n                if (!(nextIndex + i < styleValue.Length && word[i] == styleValue[nextIndex + i]))\r\n                {\r\n                    return false;\r\n                }\r\n            }\r\n\r\n            if (nextIndex + word.Length < styleValue.Length && Char.IsLetterOrDigit(styleValue[nextIndex + word.Length]))\r\n            {\r\n                return false;\r\n            }\r\n\r\n            nextIndex += word.Length;\r\n            return true;\r\n        }\r\n\r\n        // CHecks whether the following character sequence matches to one of the given words,\r\n        // and advances the nextIndex to matched word length.\r\n        // Returns null in case if there is no match or the word matched.\r\n        private static string ParseWordEnumeration(string[] words, string styleValue, ref int nextIndex)\r\n        {\r\n            for (int i = 0; i < words.Length; i++)\r\n            {\r\n                if (ParseWord(words[i], styleValue, ref nextIndex))\r\n                {\r\n                    return words[i];\r\n                }\r\n            }\r\n\r\n            return null;\r\n        }\r\n\r\n        private static void ParseWordEnumeration(string[] words, string styleValue, ref int nextIndex, Hashtable localProperties, string attributeName)\r\n        {\r\n            string attributeValue = ParseWordEnumeration(words, styleValue, ref nextIndex);\r\n            if (attributeValue != null)\r\n            {\r\n                localProperties[attributeName] = attributeValue;\r\n            }\r\n        }\r\n\r\n        private static string ParseCssSize(string styleValue, ref int nextIndex, bool mustBeNonNegative)\r\n        {\r\n            ParseWhiteSpace(styleValue, ref nextIndex);\r\n\r\n            int startIndex = nextIndex;\r\n\r\n            // Parse optional munis sign\r\n            if (nextIndex < styleValue.Length && styleValue[nextIndex] == '-')\r\n            {\r\n                nextIndex++;\r\n            }\r\n\r\n            if (nextIndex < styleValue.Length && Char.IsDigit(styleValue[nextIndex]))\r\n            {\r\n                while (nextIndex < styleValue.Length && (Char.IsDigit(styleValue[nextIndex]) || styleValue[nextIndex] == '.'))\r\n                {\r\n                    nextIndex++;\r\n                }\r\n\r\n                string number = styleValue.Substring(startIndex, nextIndex - startIndex);\r\n\r\n                string unit = ParseWordEnumeration(_fontSizeUnits, styleValue, ref nextIndex);\r\n                if (unit == null)\r\n                {\r\n                    unit = \"px\"; // Assuming pixels by default\r\n                }\r\n\r\n                if (mustBeNonNegative && styleValue[startIndex] == '-')\r\n                {\r\n                    return \"0\";\r\n                }\r\n                else\r\n                {\r\n                    return number + unit;\r\n                }\r\n            }\r\n\r\n            return null;\r\n        }\r\n\r\n        private static void ParseCssSize(string styleValue, ref int nextIndex, Hashtable localValues, string propertyName, bool mustBeNonNegative)\r\n        {\r\n            string length = ParseCssSize(styleValue, ref nextIndex, mustBeNonNegative);\r\n            if (length != null)\r\n            {\r\n                localValues[propertyName] = length;\r\n            }\r\n        }\r\n\r\n        private static readonly string[] _colors = new string[]\r\n            {\r\n                \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\", \"bisque\", \"black\", \"blanchedalmond\",\r\n                \"blue\", \"blueviolet\", \"brown\", \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\",\r\n                \"cornflowerblue\", \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\", \"darkgray\",\r\n                \"darkgreen\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\", \"darkorange\", \"darkorchid\", \"darkred\",\r\n                \"darksalmon\", \"darkseagreen\", \"darkslateblue\", \"darkslategray\", \"darkturquoise\", \"darkviolet\", \"deeppink\",\r\n                \"deepskyblue\", \"dimgray\", \"dodgerblue\", \"firebrick\", \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\",\r\n                \"ghostwhite\", \"gold\", \"goldenrod\", \"gray\", \"green\", \"greenyellow\", \"honeydew\", \"hotpink\", \"indianred\",\r\n                \"indigo\", \"ivory\", \"khaki\", \"lavender\", \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\r\n                \"lightcyan\", \"lightgoldenrodyellow\", \"lightgreen\", \"lightgrey\", \"lightpink\", \"lightsalmon\", \"lightseagreen\",\r\n                \"lightskyblue\", \"lightslategray\", \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\", \r\n                \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\", \"mediumseagreen\", \"mediumslateblue\",\r\n                \"mediumspringgreen\", \"mediumturquoise\", \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\r\n                \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\", \"orchid\", \"palegoldenrod\",\r\n                \"palegreen\", \"paleturquoise\", \"palevioletred\", \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\r\n                \"purple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\", \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\",\r\n                \"sienna\", \"silver\", \"skyblue\", \"slateblue\", \"slategray\", \"snow\", \"springgreen\", \"steelblue\", \"tan\", \"teal\",\r\n                \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\", \"whitesmoke\", \"yellow\", \"yellowgreen\",\r\n            };\r\n\r\n        private static readonly string[] _systemColors = new string[]\r\n            {\r\n                \"activeborder\", \"activecaption\", \"appworkspace\", \"background\", \"buttonface\", \"buttonhighlight\", \"buttonshadow\",\r\n                \"buttontext\", \"captiontext\", \"graytext\", \"highlight\", \"highlighttext\", \"inactiveborder\", \"inactivecaption\",\r\n                \"inactivecaptiontext\", \"infobackground\", \"infotext\", \"menu\", \"menutext\", \"scrollbar\", \"threeddarkshadow\",\r\n                \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"window\", \"windowframe\", \"windowtext\",\r\n            };\r\n\r\n        private static string ParseCssColor(string styleValue, ref int nextIndex)\r\n        {\r\n            //  Implement color parsing\r\n            // rgb(100%,53.5%,10%)\r\n            // rgb(255,91,26)\r\n            // #FF5B1A\r\n            // black | silver | gray | ... | aqua\r\n            // transparent - for background-color\r\n            ParseWhiteSpace(styleValue, ref nextIndex);\r\n\r\n            string color = null;\r\n\r\n            if (nextIndex < styleValue.Length)\r\n            {\r\n                int startIndex = nextIndex;\r\n                char character = styleValue[nextIndex];\r\n\r\n                if (character == '#')\r\n                {\r\n                    nextIndex++;\r\n                    while (nextIndex < styleValue.Length)\r\n                    {\r\n\t\t\t\t\t\tcharacter = Char.ToUpper(styleValue[nextIndex], CultureInfo.InvariantCulture);\r\n                        if (!('0' <= character && character <= '9' || 'A' <= character && character <= 'F'))\r\n                        {\r\n                            break;\r\n                        }\r\n                        nextIndex++;\r\n                    }\r\n                    if (nextIndex > startIndex + 1)\r\n                    {\r\n                        color = styleValue.Substring(startIndex, nextIndex - startIndex);\r\n                    }\r\n                }\r\n\t\t\t\telse if (styleValue.Substring(nextIndex, 3).ToLower(CultureInfo.InvariantCulture) == \"rbg\")\r\n                {\r\n                    //  Implement real rgb() color parsing\r\n                    while (nextIndex < styleValue.Length && styleValue[nextIndex] != ')')\r\n                    {\r\n                        nextIndex++;\r\n                    }\r\n                    if (nextIndex < styleValue.Length)\r\n                    {\r\n                        nextIndex++; // to skip ')'\r\n                    }\r\n                    color = \"gray\"; // return bogus color\r\n                }\r\n                else if (Char.IsLetter(character))\r\n                {\r\n                    color = ParseWordEnumeration(_colors, styleValue, ref nextIndex);\r\n                    if (color == null)\r\n                    {\r\n                        color = ParseWordEnumeration(_systemColors, styleValue, ref nextIndex);\r\n                        if (color != null)\r\n                        {\r\n                            //  Implement smarter system color converions into real colors\r\n                            color = \"black\";\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            return color;\r\n        }\r\n\r\n        private static void ParseCssColor(string styleValue, ref int nextIndex, Hashtable localValues, string propertyName)\r\n        {\r\n            string color = ParseCssColor(styleValue, ref nextIndex);\r\n            if (color != null)\r\n            {\r\n                localValues[propertyName] = color;\r\n            }\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS font Property\r\n        //\r\n        // .................................................................\r\n\r\n        // CSS has five font properties: font-family, font-style, font-variant, font-weight, font-size.\r\n        // An aggregated \"font\" property lets you specify in one action all the five in combination\r\n        // with additional line-height property.\r\n        // \r\n        // font-family: [<family-name>,]* [<family-name> | <generic-family>]\r\n        //    generic-family: serif | sans-serif | monospace | cursive | fantasy\r\n        //       The list of families sets priorities to choose fonts;\r\n        //       Quotes not allowed around generic-family names\r\n        // font-style: normal | italic | oblique\r\n        // font-variant: normal | small-caps\r\n        // font-weight: normal | bold | bolder | lighter | 100 ... 900 |\r\n        //    Default is \"normal\", normal==400\r\n        // font-size: <absolute-size> | <relative-size> | <length> | <percentage>\r\n        //    absolute-size: xx-small | x-small | small | medium | large | x-large | xx-large\r\n        //    relative-size: larger | smaller\r\n        //    length: <point> | <pica> | <ex> | <em> | <points> | <millimeters> | <centimeters> | <inches>\r\n        //    Default: medium\r\n        // font: [ <font-style> || <font-variant> || <font-weight ]? <font-size> [ / <line-height> ]? <font-family>\r\n\r\n        private static readonly string[] _fontGenericFamilies = new string[] { \"serif\", \"sans-serif\", \"monospace\", \"cursive\", \"fantasy\" };\r\n        private static readonly string[] _fontStyles = new string[] { \"normal\", \"italic\", \"oblique\" };\r\n        private static readonly string[] _fontVariants = new string[] { \"normal\", \"small-caps\" };\r\n        private static readonly string[] _fontWeights = new string[] { \"normal\", \"bold\", \"bolder\", \"lighter\", \"100\", \"200\", \"300\", \"400\", \"500\", \"600\", \"700\", \"800\", \"900\" };\r\n        private static readonly string[] _fontAbsoluteSizes = new string[] { \"xx-small\", \"x-small\", \"small\", \"medium\", \"large\", \"x-large\", \"xx-large\" };\r\n        private static readonly string[] _fontRelativeSizes = new string[] { \"larger\", \"smaller\" };\r\n        private static readonly string[] _fontSizeUnits = new string[] { \"px\", \"mm\", \"cm\", \"in\", \"pt\", \"pc\", \"em\", \"ex\", \"%\" };\r\n\r\n        // Parses CSS string fontStyle representing a value for css font attribute\r\n        private static void ParseCssFont(string styleValue, Hashtable localProperties)\r\n        {\r\n            int nextIndex = 0;\r\n\r\n            ParseCssFontStyle(styleValue, ref nextIndex, localProperties);\r\n            ParseCssFontVariant(styleValue, ref nextIndex, localProperties);\r\n            ParseCssFontWeight(styleValue, ref nextIndex, localProperties);\r\n\r\n            ParseCssSize(styleValue, ref nextIndex, localProperties, \"font-size\", /*mustBeNonNegative:*/true);\r\n\r\n            ParseWhiteSpace(styleValue, ref nextIndex);\r\n            if (nextIndex < styleValue.Length && styleValue[nextIndex] == '/')\r\n            {\r\n                nextIndex++;\r\n                ParseCssSize(styleValue, ref nextIndex, localProperties, \"line-height\", /*mustBeNonNegative:*/true);\r\n            }\r\n\r\n            ParseCssFontFamily(styleValue, ref nextIndex, localProperties);\r\n        }\r\n\r\n        private static void ParseCssFontStyle(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_fontStyles, styleValue, ref nextIndex, localProperties, \"font-style\");\r\n        }\r\n\r\n        private static void ParseCssFontVariant(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_fontVariants, styleValue, ref nextIndex, localProperties, \"font-variant\");\r\n        }\r\n\r\n        private static void ParseCssFontWeight(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_fontWeights, styleValue, ref nextIndex, localProperties, \"font-weight\");\r\n        }\r\n\r\n        private static void ParseCssFontFamily(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            string fontFamilyList = null;\r\n\r\n            while (nextIndex < styleValue.Length)\r\n            {\r\n                // Try generic-family\r\n                string fontFamily = ParseWordEnumeration(_fontGenericFamilies, styleValue, ref nextIndex);\r\n\r\n                if (fontFamily == null)\r\n                {\r\n                    // Try quoted font family name\r\n                    if (nextIndex < styleValue.Length && (styleValue[nextIndex] == '\"' || styleValue[nextIndex] == '\\''))\r\n                    {\r\n                        char quote = styleValue[nextIndex];\r\n\r\n                        nextIndex++;\r\n\r\n                        int startIndex = nextIndex;\r\n\r\n                        while (nextIndex < styleValue.Length && styleValue[nextIndex] != quote)\r\n                        {\r\n                            nextIndex++;\r\n                        }\r\n\r\n                        fontFamily = '\"' + styleValue.Substring(startIndex, nextIndex - startIndex) + '\"';\r\n                    }\r\n\r\n                    if (fontFamily == null)\r\n                    {\r\n                        // Try unquoted font family name\r\n                        int startIndex = nextIndex;\r\n                        while (nextIndex < styleValue.Length && styleValue[nextIndex] != ',' && styleValue[nextIndex] != ';')\r\n                        {\r\n                            nextIndex++;\r\n                        }\r\n\r\n                        if (nextIndex > startIndex)\r\n                        {\r\n                            fontFamily = styleValue.Substring(startIndex, nextIndex - startIndex).Trim();\r\n                            if (fontFamily.Length == 0)\r\n                            {\r\n                                fontFamily = null;\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n\r\n                ParseWhiteSpace(styleValue, ref nextIndex);\r\n                if (nextIndex < styleValue.Length && styleValue[nextIndex] == ',')\r\n                {\r\n                    nextIndex++;\r\n                }\r\n\r\n                if (fontFamily != null)\r\n                {\r\n                    //  css font-family can contein a list of names. We only consider the first name from the list. Need a decision what to do with remaining names\r\n                    // fontFamilyList = (fontFamilyList == null) ? fontFamily : fontFamilyList + \",\" + fontFamily;\r\n                    if (fontFamilyList == null && fontFamily.Length > 0)\r\n                    {\r\n                        if (fontFamily[0] == '\"' || fontFamily[0] == '\\'')\r\n                        {\r\n                            // Unquote the font family name\r\n                            fontFamily = fontFamily.Substring(1, fontFamily.Length - 2);\r\n                        }\r\n                        else\r\n                        {\r\n                            // Convert generic css family name\r\n                        }\r\n                        fontFamilyList = fontFamily;\r\n                    }\r\n                }\r\n                else\r\n                {\r\n                    break;\r\n                }\r\n            }\r\n\r\n            if (fontFamilyList != null)\r\n            {\r\n                localProperties[\"font-family\"] = fontFamilyList;\r\n            }\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS list-style Property\r\n        //\r\n        // .................................................................\r\n\r\n        // list-style: [ <list-style-type> || <list-style-position> || <list-style-image> ]\r\n\r\n        private static readonly string[] _listStyleTypes = new string[] { \"disc\", \"circle\", \"square\", \"decimal\", \"lower-roman\", \"upper-roman\", \"lower-alpha\", \"upper-alpha\", \"none\" };\r\n        private static readonly string[] _listStylePositions = new string[] { \"inside\", \"outside\" };\r\n\r\n\t\tprivate static void ParseCssListStyle(string styleValue, Hashtable localProperties)\r\n\t\t{\r\n\t\t\tint nextIndex = 0;\r\n\r\n\t\t\twhile (nextIndex < styleValue.Length)\r\n\t\t\t{\r\n\t\t\t\tstring listStyleType = ParseCssListStyleType(styleValue, ref nextIndex);\r\n\t\t\t\tif (listStyleType != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalProperties[\"list-style-type\"] = listStyleType;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstring listStylePosition = ParseCssListStylePosition(styleValue, ref nextIndex);\r\n\t\t\t\t\tif (listStylePosition != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlocalProperties[\"list-style-position\"] = listStylePosition;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstring listStyleImage = ParseCssListStyleImage(styleValue, ref nextIndex);\r\n\t\t\t\t\t\tif (listStyleImage != null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlocalProperties[\"list-style-image\"] = listStyleImage;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// TODO: Process unrecognized list style value\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tprivate static string ParseCssListStyleType(string styleValue, ref int nextIndex)\r\n\t\t{\r\n\t\t\treturn ParseWordEnumeration(_listStyleTypes, styleValue, ref nextIndex);\r\n\t\t}\r\n\r\n\t\tprivate static string ParseCssListStylePosition(string styleValue, ref int nextIndex)\r\n\t\t{\r\n\t\t\treturn ParseWordEnumeration(_listStylePositions, styleValue, ref nextIndex);\r\n\t\t}\r\n\r\n\t\tprivate static string ParseCssListStyleImage(string styleValue, ref int nextIndex)\r\n\t\t{\r\n\t\t\t// TODO: Implement URL parsing for images\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS text-decorations Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _textDecorations = new string[] { \"none\", \"underline\", \"overline\", \"line-through\", \"blink\" };\r\n\r\n        private static void ParseCssTextDecoration(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            // Set default text-decorations:none;\r\n            for (int i = 1; i < _textDecorations.Length; i++)\r\n            {\r\n                localProperties[\"text-decoration-\" + _textDecorations[i]] = \"false\";\r\n            }\r\n\r\n            // Parse list of decorations values\r\n            while (nextIndex < styleValue.Length)\r\n            {\r\n                string decoration = ParseWordEnumeration(_textDecorations, styleValue, ref nextIndex);\r\n                if (decoration == null || decoration == \"none\")\r\n                {\r\n                    break;\r\n                }\r\n                localProperties[\"text-decoration-\" + decoration] = \"true\";\r\n            }\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS text-transform Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _textTransforms = new string[] { \"none\", \"capitalize\", \"uppercase\", \"lowercase\" };\r\n\r\n        private static void ParseCssTextTransform(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_textTransforms, styleValue, ref nextIndex, localProperties, \"text-transform\");\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS text-align Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _textAligns = new string[] { \"left\", \"right\", \"center\", \"justify\" };\r\n\r\n        private static void ParseCssTextAlign(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_textAligns, styleValue, ref nextIndex, localProperties, \"text-align\");\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS vertical-align Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _verticalAligns = new string[] { \"baseline\", \"sub\", \"super\", \"top\", \"text-top\", \"middle\", \"bottom\", \"text-bottom\" };\r\n\r\n        private static void ParseCssVerticalAlign(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            //  Parse percentage value for vertical-align style\r\n            ParseWordEnumeration(_verticalAligns, styleValue, ref nextIndex, localProperties, \"vertical-align\");\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS float Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _floats = new string[] { \"left\", \"right\", \"none\" };\r\n\r\n        private static void ParseCssFloat(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_floats, styleValue, ref nextIndex, localProperties, \"float\");\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS clear Property\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _clears = new string[] { \"none\", \"left\", \"right\", \"both\" };\r\n\r\n        private static void ParseCssClear(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            ParseWordEnumeration(_clears, styleValue, ref nextIndex, localProperties, \"clear\");\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS margin and padding Properties\r\n        //\r\n        // .................................................................\r\n\r\n        // Generic method for parsing any of four-values properties, such as margin, padding, border-width, border-style, border-color\r\n        private static bool ParseCssRectangleProperty(string styleValue, ref int nextIndex, Hashtable localProperties, string propertyName)\r\n        {\r\n            // CSS Spec: \r\n            // If only one value is set, then the value applies to all four sides;\r\n            // If two or three values are set, then missinng value(s) are taken fromm the opposite side(s).\r\n            // The order they are applied is: top/right/bottom/left\r\n\r\n            Debug.Assert(propertyName == \"margin\" || propertyName == \"padding\" || propertyName == \"border-width\" || propertyName == \"border-style\" || propertyName == \"border-color\");\r\n\r\n            string value = propertyName == \"border-color\" ? ParseCssColor(styleValue, ref nextIndex) : propertyName == \"border-style\" ? ParseCssBorderStyle(styleValue, ref nextIndex) : ParseCssSize(styleValue, ref nextIndex, /*mustBeNonNegative:*/true);\r\n            if (value != null)\r\n            {\r\n                localProperties[propertyName + \"-top\"] = value;\r\n                localProperties[propertyName + \"-bottom\"] = value;\r\n                localProperties[propertyName + \"-right\"] = value;\r\n                localProperties[propertyName + \"-left\"] = value;\r\n                value = propertyName == \"border-color\" ? ParseCssColor(styleValue, ref nextIndex) : propertyName == \"border-style\" ? ParseCssBorderStyle(styleValue, ref nextIndex) : ParseCssSize(styleValue, ref nextIndex, /*mustBeNonNegative:*/true);\r\n                if (value != null)\r\n                {\r\n                    localProperties[propertyName + \"-right\"] = value;\r\n                    localProperties[propertyName + \"-left\"] = value;\r\n                    value = propertyName == \"border-color\" ? ParseCssColor(styleValue, ref nextIndex) : propertyName == \"border-style\" ? ParseCssBorderStyle(styleValue, ref nextIndex) : ParseCssSize(styleValue, ref nextIndex, /*mustBeNonNegative:*/true);\r\n                    if (value != null)\r\n                    {\r\n                        localProperties[propertyName + \"-bottom\"] = value;\r\n                        value = propertyName == \"border-color\" ? ParseCssColor(styleValue, ref nextIndex) : propertyName == \"border-style\" ? ParseCssBorderStyle(styleValue, ref nextIndex) : ParseCssSize(styleValue, ref nextIndex, /*mustBeNonNegative:*/true);\r\n                        if (value != null)\r\n                        {\r\n                            localProperties[propertyName + \"-left\"] = value;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                return true;\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS border Properties\r\n        //\r\n        // .................................................................\r\n\r\n        // border: [ <border-width> || <border-style> || <border-color> ]\r\n\r\n        private static void ParseCssBorder(string styleValue, ref int nextIndex, Hashtable localProperties)\r\n        {\r\n            while (\r\n                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, \"border-width\") ||\r\n                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, \"border-style\") ||\r\n                ParseCssRectangleProperty(styleValue, ref nextIndex, localProperties, \"border-color\"))\r\n            {\r\n            }\r\n        }\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS border-style Propertie\r\n        //\r\n        // .................................................................\r\n\r\n        private static readonly string[] _borderStyles = new string[] { \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"groove\", \"ridge\", \"inset\", \"outset\" };\r\n\r\n        private static string ParseCssBorderStyle(string styleValue, ref int nextIndex)\r\n        {\r\n            return ParseWordEnumeration(_borderStyles, styleValue, ref nextIndex);\r\n        }\r\n\r\n\r\n        // .................................................................\r\n        //\r\n        //  What are these definitions doing here:\r\n        //\r\n        // .................................................................\r\n\r\n        private static string[] _blocks = new string[] { \"block\", \"inline\", \"list-item\", \"none\" };\r\n\r\n        // .................................................................\r\n        //\r\n        // Pasring CSS Background Properties\r\n        //\r\n        // .................................................................\r\n\r\n        private static void ParseCssBackground(string styleValue, ref int nextIndex, Hashtable localValues)\r\n        {\r\n            //  Implement parsing background attribute\r\n        }\r\n    }\r\n\r\n\r\n    internal class CssStylesheet\r\n    {\r\n        // Constructor\r\n        public CssStylesheet(XmlElement htmlElement)\r\n        {\r\n            if (htmlElement != null)\r\n            {\r\n                this.DiscoverStyleDefinitions(htmlElement);\r\n            }\r\n        }\r\n\r\n        // Recursively traverses an html tree, discovers STYLE elements and creates a style definition table\r\n        // for further cascading style application\r\n        public void DiscoverStyleDefinitions(XmlElement htmlElement)\r\n        {\r\n\t\t\tif (htmlElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"link\")\r\n            {\r\n                return;\r\n                //  Add LINK elements processing for included stylesheets\r\n                // <LINK href=\"http://sc.msn.com/global/css/ptnr/orange.css\" type=text/css \\r\\nrel=stylesheet>\r\n            }\r\n\r\n\t\t\tif (htmlElement.LocalName.ToLower(CultureInfo.InvariantCulture) != \"style\")\r\n            {\r\n                // This is not a STYLE element. Recurse into it\r\n                for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\r\n                {\r\n\t\t\t\t\tif (htmlChildNode is XmlElement)\r\n                    {\r\n\t\t\t\t\t\tthis.DiscoverStyleDefinitions((XmlElement)htmlChildNode);\r\n                    }\r\n                }\r\n                return;\r\n            }\r\n\r\n            // Add style definitions from this style.\r\n\r\n            // Collect all text from this style definition\r\n            StringBuilder stylesheetBuffer = new StringBuilder();\r\n\r\n            for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\r\n            {\r\n                if (htmlChildNode is XmlText || htmlChildNode is XmlComment)\r\n                {\r\n                    stylesheetBuffer.Append(RemoveComments(htmlChildNode.Value));\r\n                }\r\n            }\r\n\r\n            // CssStylesheet has the following syntactical structure:\r\n            //     @import declaration;\r\n            //     selector { definition }\r\n            // where \"selector\" is one of: \".classname\", \"tagname\"\r\n            // It can contain comments in the following form: /*...*/\r\n\r\n            int nextCharacterIndex = 0;\r\n            while (nextCharacterIndex < stylesheetBuffer.Length)\r\n            {\r\n                // Extract selector\r\n                int selectorStart = nextCharacterIndex;\r\n                while (nextCharacterIndex < stylesheetBuffer.Length && stylesheetBuffer[nextCharacterIndex] != '{')\r\n                {\r\n                    // Skip declaration directive starting from @\r\n                    if (stylesheetBuffer[nextCharacterIndex] == '@')\r\n                    {\r\n                        while (nextCharacterIndex < stylesheetBuffer.Length && stylesheetBuffer[nextCharacterIndex] != ';')\r\n                        {\r\n                            nextCharacterIndex++;\r\n                        }\r\n                        selectorStart = nextCharacterIndex + 1;\r\n                    }\r\n                    nextCharacterIndex++;\r\n                }\r\n\r\n                if (nextCharacterIndex < stylesheetBuffer.Length)\r\n                {\r\n                    // Extract definition\r\n                    int definitionStart = nextCharacterIndex;\r\n                    while (nextCharacterIndex < stylesheetBuffer.Length && stylesheetBuffer[nextCharacterIndex] != '}')\r\n                    {\r\n                        nextCharacterIndex++;\r\n                    }\r\n\r\n                    // Define a style\r\n                    if (nextCharacterIndex - definitionStart > 2)\r\n                    {\r\n                        this.AddStyleDefinition(\r\n                            stylesheetBuffer.ToString(selectorStart, definitionStart - selectorStart),\r\n                            stylesheetBuffer.ToString(definitionStart + 1, nextCharacterIndex - definitionStart - 2));\r\n                    }\r\n\r\n                    // Skip closing brace\r\n                    if (nextCharacterIndex < stylesheetBuffer.Length)\r\n                    {\r\n                        Debug.Assert(stylesheetBuffer[nextCharacterIndex] == '}');\r\n                        nextCharacterIndex++;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // Returns a string with all c-style comments replaced by spaces\r\n        private string RemoveComments(string text)\r\n        {\r\n            int commentStart = text.IndexOf(\"/*\", StringComparison.OrdinalIgnoreCase);\r\n            if (commentStart < 0)\r\n            {\r\n                return text;\r\n            }\r\n\r\n            int commentEnd = text.IndexOf(\"*/\", commentStart + 2, StringComparison.OrdinalIgnoreCase);\r\n            if (commentEnd < 0)\r\n            {\r\n                return text.Substring(0, commentStart);\r\n            }\r\n\r\n            return text.Substring(0, commentStart) + \" \" + RemoveComments(text.Substring(commentEnd + 2));\r\n        }\r\n\r\n\r\n        public void AddStyleDefinition(string selector, string definition)\r\n        {\r\n            // Notrmalize parameter values\r\n\t\t\tselector = selector.Trim().ToLower(CultureInfo.InvariantCulture);\r\n\t\t\tdefinition = definition.Trim().ToLower(CultureInfo.InvariantCulture);\r\n            if (selector.Length == 0 || definition.Length == 0)\r\n            {\r\n                return;\r\n            }\r\n\r\n            if (_styleDefinitions == null)\r\n            {\r\n                _styleDefinitions = new List<StyleDefinition>();\r\n            }\r\n\r\n            string[] simpleSelectors = selector.Split(',');\r\n\r\n            for (int i = 0; i < simpleSelectors.Length; i++)\r\n            {\r\n                string simpleSelector = simpleSelectors[i].Trim();\r\n                if (simpleSelector.Length > 0)\r\n                {\r\n                    _styleDefinitions.Add(new StyleDefinition(simpleSelector, definition));\r\n                }\r\n            }\r\n        }\r\n\r\n        public string GetStyle(string elementName, List<XmlElement> sourceContext)\r\n        {\r\n            Debug.Assert(sourceContext.Count > 0);\r\n            Debug.Assert(elementName == sourceContext[sourceContext.Count - 1].LocalName);\r\n\r\n            //  Add id processing for style selectors\r\n            if (_styleDefinitions != null)\r\n            {\r\n                for (int i = _styleDefinitions.Count - 1; i >= 0;  i--)\r\n                {\r\n                    string selector = _styleDefinitions[i].Selector;\r\n\r\n                    string[] selectorLevels = selector.Split(' ');\r\n\r\n                    int indexInSelector = selectorLevels.Length - 1;\r\n                    //int indexInContext = sourceContext.Count - 1;\r\n                    string selectorLevel = selectorLevels[indexInSelector].Trim();\r\n\r\n                    if (MatchSelectorLevel(selectorLevel, sourceContext[sourceContext.Count - 1]))\r\n                    {\r\n                        return _styleDefinitions[i].Definition;\r\n                    }\r\n                }\r\n            }\r\n\r\n            return null;\r\n        }\r\n\r\n        private static bool MatchSelectorLevel(string selectorLevel, XmlElement xmlElement)\r\n        {\r\n            if (selectorLevel.Length == 0)\r\n            {\r\n                return false;\r\n            }\r\n\r\n            int indexOfDot = selectorLevel.IndexOf('.');\r\n            int indexOfPound = selectorLevel.IndexOf('#');\r\n\r\n            string selectorClass = null;\r\n            string selectorId = null;\r\n            string selectorTag = null;\r\n            if (indexOfDot >= 0)\r\n            {\r\n                if (indexOfDot > 0)\r\n                {\r\n                    selectorTag = selectorLevel.Substring(0, indexOfDot);\r\n                }\r\n                selectorClass = selectorLevel.Substring(indexOfDot + 1);\r\n            }\r\n            else if (indexOfPound >= 0)\r\n            {\r\n                if (indexOfPound > 0)\r\n                {\r\n                    selectorTag = selectorLevel.Substring(0, indexOfPound);\r\n                }\r\n                selectorId = selectorLevel.Substring(indexOfPound + 1);\r\n            }\r\n            else\r\n            {\r\n                selectorTag = selectorLevel;\r\n            }\r\n\r\n            if (selectorTag != null && selectorTag != xmlElement.LocalName)\r\n            {\r\n                return false;\r\n            }\r\n\r\n            if (selectorId != null && HtmlToXamlConverter.GetAttribute(xmlElement, \"id\") != selectorId)\r\n            {\r\n                return false;\r\n            }\r\n\r\n            if (selectorClass != null && HtmlToXamlConverter.GetAttribute(xmlElement, \"class\") != selectorClass)\r\n            {\r\n                return false;\r\n            }\r\n\r\n            return true;\r\n        }\r\n\r\n        private class StyleDefinition\r\n        {\r\n            public StyleDefinition(string selector, string definition)\r\n            {\r\n                this.Selector = selector;\r\n                this.Definition = definition;\r\n            }\r\n\r\n            public string Selector;\r\n\r\n            public string Definition;\r\n        }\r\n\r\n        private List<StyleDefinition> _styleDefinitions;\r\n    }\r\n}\r\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlFromXamlConverter.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlFromXamlConverter.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Prototype for Xaml - Html conversion \n//\n//---------------------------------------------------------------------------\n\n\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\n\nnamespace WpfRichText\n{\n    /// <summary>\n    /// HtmlToXamlConverter is a static class that takes an HTML string\n    /// and converts it into XAML\n    /// </summary>\n    internal static class HtmlFromXamlConverter\n    {\n        // ---------------------------------------------------------------------\n        //\n        // Internal Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Methods\n        internal static string ConvertXamlToHtml(string xamlString)\n        {\n            return ConvertXamlToHtml(xamlString, true);\n        }\n        /// <summary>\n        /// Main entry point for Xaml-to-Html converter.\n        /// Converts a xaml string into html string.\n        /// </summary>\n\t\t/// <param name=\"xamlString\">Xaml strinng to convert.</param>\n\t\t/// <param name=\"asFlowDocument\"></param>\n\t\t/// <returns>\n        /// Html string produced from a source xaml.\n        /// </returns>\n        internal static string ConvertXamlToHtml(string xamlString, bool asFlowDocument)\n        {\n            StringBuilder htmlStringBuilder;\n            XmlTextWriter htmlWriter;\n\n            if (!asFlowDocument)\n            {\n                xamlString = \"<FlowDocument>\" + xamlString + \"</FlowDocument>\";\n            }\n\n\t\t\t\tusing (XmlTextReader xamlReader = new XmlTextReader(new StringReader(xamlString)))\n\t\t\t\t{\n\t\t\t\t\thtmlStringBuilder = new StringBuilder(100);\n\t\t\t\t\tusing (StringWriter htmlStringWiter = new StringWriter(htmlStringBuilder, CultureInfo.InvariantCulture))\n\t\t\t\t\t{\n\t\t\t\t\t\thtmlWriter = new XmlTextWriter(htmlStringWiter);\n\n\t\t\t\t\t\tif (!WriteFlowDocument(xamlReader, htmlWriter))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstring htmlString = htmlStringBuilder.ToString();\n\t\t\t\t\treturn htmlString;\n\t\t\t\t}\n        }\n\n        #endregion Internal Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Methods\n        /// <summary>\n        /// Processes a root level element of XAML (normally it's FlowDocument element).\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// XmlTextReader for a source xaml.\n        /// </param>\n        /// <param name=\"htmlWriter\">\n        /// XmlTextWriter producing resulting html\n        /// </param>\n        private static bool WriteFlowDocument(XmlTextReader xamlReader, XmlTextWriter htmlWriter)\n        {\n            if (!ReadNextToken(xamlReader))\n            {\n                // Xaml content is empty - nothing to convert\n                return false;\n            }\n\n            if (xamlReader.NodeType != XmlNodeType.Element || xamlReader.Name != \"FlowDocument\")\n            {\n                // Root FlowDocument elemet is missing\n                return false;\n            }\n\n            // Create a buffer StringBuilder for collecting css properties for inline STYLE attributes\n            // on every element level (it will be re-initialized on every level).\n            StringBuilder inlineStyle = new StringBuilder();\n\n            htmlWriter.WriteStartElement(\"HTML\");\n            htmlWriter.WriteStartElement(\"BODY\");\n\n            WriteFormattingProperties(xamlReader, htmlWriter, inlineStyle);\n\n            WriteElementContent(xamlReader, htmlWriter, inlineStyle);\n\n            htmlWriter.WriteEndElement();\n            htmlWriter.WriteEndElement();\n\n            return true;\n        }\n\n        /// <summary>\n        /// Reads attributes of the current xaml element and converts\n        /// them into appropriate html attributes or css styles.\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// XmlTextReader which is expected to be at XmlNodeType.Element\n        /// (opening element tag) position.\n        /// The reader will remain at the same level after function complete.\n        /// </param>\n        /// <param name=\"htmlWriter\">\n        /// XmlTextWriter for output html, which is expected to be in\n        /// after WriteStartElement state.\n        /// </param>\n        /// <param name=\"inlineStyle\">\n        /// String builder for collecting css properties for inline STYLE attribute.\n        /// </param>\n        private static void WriteFormattingProperties(XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle)\n        {\n            Debug.Assert(xamlReader.NodeType == XmlNodeType.Element);\n\n            // Clear string builder for the inline style\n            inlineStyle.Remove(0, inlineStyle.Length);\n\n            if (!xamlReader.HasAttributes)\n            {\n                return;\n            }\n\n            bool borderSet = false;\n\n            while (xamlReader.MoveToNextAttribute())\n            {\n                string css = null;\n\n                switch (xamlReader.Name)\n                {\n                    // Character fomatting properties\n                    // ------------------------------\n                    case \"Background\":\n                        css = \"background-color:\" + ParseXamlColor(xamlReader.Value) + \";\";\n                        break;\n                    case \"FontFamily\":\n                        css = \"font-family:\" + xamlReader.Value + \";\";\n                        break;\n                    case \"FontStyle\":\n                        css = \"font-style:\" + xamlReader.Value.ToLower(CultureInfo.InvariantCulture) + \";\";\n                        break;\n                    case \"FontWeight\":\n\t\t\t\t\t\tcss = \"font-weight:\" + xamlReader.Value.ToLower(CultureInfo.InvariantCulture) + \";\";\n                        break;\n                    case \"FontStretch\":\n                        break;\n                    case \"FontSize\":\n                        css = \"font-size:\" + xamlReader.Value + \";\";\n                        break;\n                    case \"Foreground\":\n                        css = \"color:\" + ParseXamlColor(xamlReader.Value) + \";\";\n                        break;\n                    case \"TextDecorations\":\n                        css = \"text-decoration:underline;\";\n                        break;\n                    case \"TextEffects\":\n                        break;\n                    case \"Emphasis\":\n                        break;\n                    case \"StandardLigatures\":\n                        break;\n                    case \"Variants\":\n                        break;\n                    case \"Capitals\":\n                        break;\n                    case \"Fraction\":\n                        break;\n\n                    // Paragraph formatting properties\n                    // -------------------------------\n                    case \"Padding\":\n                        css = \"padding:\" + ParseXamlThickness(xamlReader.Value) + \";\";\n                        break;\n                    case \"Margin\":\n                        css = \"margin:\" + ParseXamlThickness(xamlReader.Value) + \";\";\n                        break;\n                    case \"BorderThickness\":\n                        css = \"border-width:\" + ParseXamlThickness(xamlReader.Value) + \";\";\n                        borderSet = true;\n                        break;\n                    case \"BorderBrush\":\n                        css = \"border-color:\" + ParseXamlColor(xamlReader.Value) + \";\";\n                        borderSet = true;\n                        break;\n                    case \"LineHeight\":\n                        break;\n                    case \"TextIndent\":\n                        css = \"text-indent:\" + xamlReader.Value + \";\";\n                        break;\n                    case \"TextAlignment\":\n                        css = \"text-align:\" + xamlReader.Value + \";\";\n                        break;\n                    case \"IsKeptTogether\":\n                        break;\n                    case \"IsKeptWithNext\":\n                        break;\n                    case \"ColumnBreakBefore\":\n                        break;\n                    case \"PageBreakBefore\":\n                        break;\n                    case \"FlowDirection\":\n                        break;\n\n                    // Table attributes\n                    // ----------------\n                    case \"Width\":\n                        css = \"width:\" + xamlReader.Value + \";\";\n                        break;\n                    case \"ColumnSpan\":\n                        htmlWriter.WriteAttributeString(\"COLSPAN\", xamlReader.Value);\n                        break;\n                    case \"RowSpan\":\n                        htmlWriter.WriteAttributeString(\"ROWSPAN\", xamlReader.Value);\n                        break;\n\n\t\t\t\t\t// Hyperlink Attributes\n\t\t\t\t\tcase \"NavigateUri\" :\n\t\t\t\t\t\thtmlWriter.WriteAttributeString(\"HREF\", xamlReader.Value);\n\t\t\t\t\t\tbreak;\n                }\n\n                if (css != null)\n                {\n                    inlineStyle.Append(css);\n                }\n            }\n\n            if (borderSet)\n            {\n                inlineStyle.Append(\"border-style:solid;mso-element:para-border-div;\");\n            }\n\n            // Return the xamlReader back to element level\n            xamlReader.MoveToElement();\n            Debug.Assert(xamlReader.NodeType == XmlNodeType.Element);\n        }\n\n        private static string ParseXamlColor(string color)\n        {\n            if (color.StartsWith(\"#\", StringComparison.OrdinalIgnoreCase))\n            {\n                // Remove transparancy value\n                color = \"#\" + color.Substring(3);\n            }\n            return color;\n        }\n\n        private static string ParseXamlThickness(string thickness)\n        {\n            string[] values = thickness.Split(',');\n\n            for (int i = 0; i < values.Length; i++)\n            {\n                double value;\n\t\t\t\tif (double.TryParse(values[i], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out value))\n                {\n                    values[i] = Math.Ceiling(value).ToString(CultureInfo.InvariantCulture);\n                }\n                else\n                {\n                    values[i] = \"1\";\n                }\n            }\n\n            string cssThickness;\n            switch (values.Length)\n            {\n                case 1:\n                    cssThickness = thickness;\n                    break;\n                case 2:\n                    cssThickness = values[1] + \" \" + values[0];\n                    break;\n                case 4:\n                    cssThickness = values[1] + \" \" + values[2] + \" \" + values[3] + \" \" + values[0];\n                    break;\n                default:\n                    cssThickness = values[0];\n                    break;\n            }\n\n            return cssThickness;\n        }\n\n        /// <summary>\n        /// Reads a content of current xaml element, converts it\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// XmlTextReader which is expected to be at XmlNodeType.Element\n        /// (opening element tag) position.\n        /// </param>\n        /// <param name=\"htmlWriter\">\n        /// May be null, in which case we are skipping the xaml element;\n        /// witout producing any output to html.\n        /// </param>\n        /// <param name=\"inlineStyle\">\n        /// StringBuilder used for collecting css properties for inline STYLE attribute.\n        /// </param>\n        private static void WriteElementContent(XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle)\n        {\n            Debug.Assert(xamlReader.NodeType == XmlNodeType.Element);\n\n            bool elementContentStarted = false;\n\n            if (xamlReader.IsEmptyElement)\n            {\n                if (htmlWriter != null && !elementContentStarted && inlineStyle.Length > 0)\n                {\n                    // Output STYLE attribute and clear inlineStyle buffer.\n                    htmlWriter.WriteAttributeString(\"STYLE\", inlineStyle.ToString());\n                    inlineStyle.Remove(0, inlineStyle.Length);\n                }\n                elementContentStarted = true;\n            }\n            else\n            {\n                while (ReadNextToken(xamlReader) && xamlReader.NodeType != XmlNodeType.EndElement)\n                {\n                    switch (xamlReader.NodeType)\n                    {\n                        case XmlNodeType.Element:\n                            if (xamlReader.Name.Contains(\".\"))\n                            {\n                                AddComplexProperty(xamlReader, inlineStyle);\n                            }\n                            else\n                            {\n                                if (htmlWriter != null && !elementContentStarted && inlineStyle.Length > 0)\n                                {\n                                    // Output STYLE attribute and clear inlineStyle buffer.\n                                    htmlWriter.WriteAttributeString(\"STYLE\", inlineStyle.ToString());\n                                    inlineStyle.Remove(0, inlineStyle.Length);\n                                }\n                                elementContentStarted = true;\n                                WriteElement(xamlReader, htmlWriter, inlineStyle);\n                            }\n                            Debug.Assert(xamlReader.NodeType == XmlNodeType.EndElement || xamlReader.NodeType == XmlNodeType.Element && xamlReader.IsEmptyElement);\n                            break;\n                        case XmlNodeType.Comment:\n                            if (htmlWriter != null)\n                            {\n                                if (!elementContentStarted && inlineStyle.Length > 0)\n                                {\n                                    htmlWriter.WriteAttributeString(\"STYLE\", inlineStyle.ToString());\n                                }\n                                htmlWriter.WriteComment(xamlReader.Value);\n                            }\n                            elementContentStarted = true;\n                            break;\n                        case XmlNodeType.CDATA:\n                        case XmlNodeType.Text:\n                        case XmlNodeType.SignificantWhitespace:\n                            if (htmlWriter != null)\n                            {\n                                if (!elementContentStarted && inlineStyle.Length > 0)\n                                {\n                                    htmlWriter.WriteAttributeString(\"STYLE\", inlineStyle.ToString());\n                                }\n                                htmlWriter.WriteString(xamlReader.Value);\n                            }\n                            elementContentStarted = true;\n                            break;\n                    }\n                }\n\n                Debug.Assert(xamlReader.NodeType == XmlNodeType.EndElement);\n            }\n        }\n\n        /// <summary>\n        /// Conberts an element notation of complex property into\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// On entry this XmlTextReader must be on Element start tag;\n        /// on exit - on EndElement tag.\n        /// </param>\n        /// <param name=\"inlineStyle\">\n        /// StringBuilder containing a value for STYLE attribute.\n        /// </param>\n        private static void AddComplexProperty(XmlTextReader xamlReader, StringBuilder inlineStyle)\n        {\n            Debug.Assert(xamlReader.NodeType == XmlNodeType.Element);\n\n            if (inlineStyle != null && xamlReader.Name.EndsWith(\".TextDecorations\", StringComparison.OrdinalIgnoreCase))\n            {\n                inlineStyle.Append(\"text-decoration:underline;\");\n            }\n\n            // Skip the element representing the complex property\n            WriteElementContent(xamlReader, /*htmlWriter:*/null, /*inlineStyle:*/null);\n        }\n\n        /// <summary>\n        /// Converts a xaml element into an appropriate html element.\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// On entry this XmlTextReader must be on Element start tag;\n        /// on exit - on EndElement tag.\n        /// </param>\n        /// <param name=\"htmlWriter\">\n        /// May be null, in which case we are skipping xaml content\n        /// without producing any html output\n        /// </param>\n        /// <param name=\"inlineStyle\">\n        /// StringBuilder used for collecting css properties for inline STYLE attributes on every level.\n        /// </param>\n        private static void WriteElement(XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle)\n        {\n            Debug.Assert(xamlReader.NodeType == XmlNodeType.Element);\n\n            if (htmlWriter == null)\n            {\n                // Skipping mode; recurse into the xaml element without any output\n                WriteElementContent(xamlReader, /*htmlWriter:*/null, null);\n            }\n            else\n            {\n                string htmlElementName = null;\n\n                switch (xamlReader.Name)\n                {\n                    case \"Run\" :\n                    case \"Span\":\n                        htmlElementName = \"SPAN\";\n                        break;\n                    case \"InlineUIContainer\":\n                        htmlElementName = \"SPAN\";\n                        break;\n                    case \"Bold\":\n                        htmlElementName = \"B\";\n                        break;\n                    case \"Italic\" :\n                        htmlElementName = \"I\";\n                        break;\n                    case \"Paragraph\" :\n                        htmlElementName = \"P\";\n                        break;\n                    case \"BlockUIContainer\":\n                        htmlElementName = \"DIV\";\n                        break;\n                    case \"Section\":\n                        htmlElementName = \"DIV\";\n                        break;\n                    case \"Table\":\n                        htmlElementName = \"TABLE\";\n                        break;\n                    case \"TableColumn\":\n                        htmlElementName = \"COL\";\n                        break;\n                    case \"TableRowGroup\" :\n                        htmlElementName = \"TBODY\";\n                        break;\n                    case \"TableRow\" :\n                        htmlElementName = \"TR\";\n                        break;\n                    case \"TableCell\" :\n                        htmlElementName = \"TD\";\t\t\t\t\t\t\n                        break;\n                    case \"List\" :\n                        string marker = xamlReader.GetAttribute(\"MarkerStyle\");\n                        if (marker == null || marker == \"None\" || marker == \"Disc\" || marker == \"Circle\" || marker == \"Square\" || marker == \"Box\")\n\t\t\t\t\t\t\thtmlElementName = \"UL\";\n\t\t\t\t\t\telse\n                            htmlElementName = \"OL\";\n                        break;\n                    case \"ListItem\" :\n                        htmlElementName = \"LI\";\n                        break;\n\t\t\t\t\tcase \"Hyperlink\" :\n\t\t\t\t\t\thtmlElementName = \"A\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"LineBreak\" :\n\t\t\t\t\t\thtmlWriter.WriteRaw(\"<BR />\");\n\t\t\t\t\t\tbreak;\n                    default :\n                        htmlElementName = null; // Ignore the element\n                        break;\n                }\n\n                if (htmlWriter != null && !String.IsNullOrEmpty(htmlElementName))\n                {\n                    htmlWriter.WriteStartElement(htmlElementName);\n\n                    WriteFormattingProperties(xamlReader, htmlWriter, inlineStyle);\n\n                    WriteElementContent(xamlReader, htmlWriter, inlineStyle);\n\n                    htmlWriter.WriteEndElement();\n                }\n                else\n                {\n                    // Skip this unrecognized xaml element\n                    WriteElementContent(xamlReader, /*htmlWriter:*/null, null);\n                }\n            }\n        }\n\n        // Reader advance helpers\n\t\t// ----------------------\n\t\t\t\t \n        /// <summary>\n        /// Reads several items from xamlReader skipping all non-significant stuff.\n        /// </summary>\n        /// <param name=\"xamlReader\">\n        /// XmlTextReader from tokens are being read.\n        /// </param>\n        /// <returns>\n        /// True if new token is available; false if end of stream reached.\n        /// </returns>\n\t\tprivate static bool ReadNextToken(XmlReader xamlReader)\n\t\t{\n\t\t\twhile (xamlReader.Read())\n\t\t\t{\n\t\t\t\tDebug.Assert(xamlReader.ReadState == ReadState.Interactive, \"Reader is expected to be in Interactive state (\" + xamlReader.ReadState + \")\");\n\t\t\t\tswitch (xamlReader.NodeType)\n\t\t\t\t{\n\t\t\t\t    case XmlNodeType.Element: \n\t\t\t\t    case XmlNodeType.EndElement:\n\t\t\t\t    case XmlNodeType.None:\n\t\t\t\t    case XmlNodeType.CDATA:\n\t\t\t\t    case XmlNodeType.Text:\n\t\t\t\t    case XmlNodeType.SignificantWhitespace:\n\t\t\t\t\t    return true;\n\n\t\t\t\t    case XmlNodeType.Whitespace:\n\t\t\t\t\t    if (xamlReader.XmlSpace == XmlSpace.Preserve)\n\t\t\t\t\t    {\n\t\t\t\t\t\t    return true;\n\t\t\t\t\t    }\n\t\t\t\t\t    // ignore insignificant whitespace\n\t\t\t\t\t    break;\n\n\t\t\t\t    case XmlNodeType.EndEntity:\n\t\t\t\t    case XmlNodeType.EntityReference:\n                        //  Implement entity reading\n\t\t\t\t\t    //xamlReader.ResolveEntity();\n\t\t\t\t\t    //xamlReader.Read();\n\t\t\t\t\t    //ReadChildNodes( parent, parentBaseUri, xamlReader, positionInfo);\n                        break; // for now we ignore entities as insignificant stuff\n\n                    case XmlNodeType.Comment:\n                        return true;\n                    case XmlNodeType.ProcessingInstruction:\n\t\t\t\t    case XmlNodeType.DocumentType:\n\t\t\t\t    case XmlNodeType.XmlDeclaration:\n\t\t\t\t    default:\n\t\t\t\t\t    // Ignorable stuff\n\t\t\t\t\t    break;\n\t\t\t\t}\n            }\n            return false;\n        }\n\n        #endregion Private Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Fields\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Fields\n\n        #endregion Private Fields\n    }\n}\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlLexicalAnalyzer.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlLexicalAnalyzer.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Lexical analyzer for Html-to-Xaml converter\n//\n//---------------------------------------------------------------------------\n\nusing System;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Collections;\nusing System.Text;\n\nnamespace WpfRichText\n{\n    /// <summary>\n    /// lexical analyzer class\n    /// recognizes tokens as groups of characters separated by arbitrary amounts of whitespace\n    /// also classifies tokens according to type\n    /// </summary>\n    internal class HtmlLexicalAnalyzer : IDisposable\n    {\n        // ---------------------------------------------------------------------\n        //\n        // Constructors\n        //\n        // ---------------------------------------------------------------------\n\n        #region Constructors\n\n        /// <summary>\n        /// initializes the _inputStringReader member with the string to be read\n        /// also sets initial values for _nextCharacterCode and _nextTokenType\n        /// </summary>\n        /// <param name=\"inputTextString\">\n        /// text string to be parsed for xml content\n        /// </param>\n        internal HtmlLexicalAnalyzer(string inputTextString)\n        {\n            _inputStringReader = new StringReader(inputTextString);\n            _nextCharacterCode = 0;\n            _nextCharacter = ' ';\n            _lookAheadCharacterCode = _inputStringReader.Read();\n            _lookAheadCharacter = (char)_lookAheadCharacterCode;\n            _previousCharacter = ' ';\n            _ignoreNextWhitespace = false;\n            _nextToken = new StringBuilder(100);\n            _nextTokenType = HtmlTokenType.Text;\n            // read the first character so we have some value for the NextCharacter property\n            this.GetNextCharacter();\n        }\n\n        #endregion Constructors\n\n        // ---------------------------------------------------------------------\n        //\n        // Internal methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Methods\n\n        /// <summary>\n        /// retrieves next recognizable token from input string \n        /// and identifies its type\n        /// if no valid token is found, the output parameters are set to null\n        /// if end of stream is reached without matching any token, token type\n        /// paramter is set to EOF\n        /// </summary>\n        internal void GetNextContentToken()\n        {\n            Debug.Assert(_nextTokenType != HtmlTokenType.EOF);\n            _nextToken.Length = 0;\n            if (this.IsAtEndOfStream)\n            {\n                _nextTokenType = HtmlTokenType.EOF;\n                return;\n            }\n\n            if (this.IsAtTagStart)\n            {\n                this.GetNextCharacter();\n\n                if (this.NextCharacter == '/')\n                {\n                    _nextToken.Append(\"</\");\n                    _nextTokenType = HtmlTokenType.ClosingTagStart;\n\n                    // advance\n                    this.GetNextCharacter();\n                    _ignoreNextWhitespace = false; // Whitespaces after closing tags are significant\n                }\n                else\n                {\n                    _nextTokenType = HtmlTokenType.OpeningTagStart;\n                    _nextToken.Append(\"<\");\n                    _ignoreNextWhitespace = true; // Whitespaces after opening tags are insignificant\n                }\n            }\n            else if (this.IsAtDirectiveStart)\n            {\n                // either a comment or CDATA\n                this.GetNextCharacter();\n                if (_lookAheadCharacter == '[')\n                {\n                    // cdata\n                    this.ReadDynamicContent();\n                }\n                else if (_lookAheadCharacter == '-')\n                {\n                    this.ReadComment();\n                }\n                else\n                {\n                    // neither a comment nor cdata, should be something like DOCTYPE\n                    // skip till the next tag ender\n                    this.ReadUnknownDirective();\n                }\n            }\n            else\n            {\n                // read text content, unless you encounter a tag\n                _nextTokenType = HtmlTokenType.Text;\n                while (!this.IsAtTagStart && !this.IsAtEndOfStream && !this.IsAtDirectiveStart)\n                {\n                    if (this.NextCharacter == '<' && !this.IsNextCharacterEntity && _lookAheadCharacter == '?')\n                    {\n                        // ignore processing directive\n                        this.SkipProcessingDirective();\n                    }\n                    else\n                    {\n                        if (this.NextCharacter <= ' ')\n                        {\n                            //  Respect xml:preserve or its equivalents for whitespace processing\n                            if (_ignoreNextWhitespace)\n                            {\n                                // Changed by Akshin\n                                _nextToken.Append(' ');\n                                // Ignore repeated whitespaces\n                            }\n                            else\n                            {\n                                // Treat any control character sequence as one whitespace\n                                _nextToken.Append(' ');\n                            }\n                            _ignoreNextWhitespace = true; // and keep ignoring the following whitespaces\n                        }\n                        else\n                        {\n                            _nextToken.Append(this.NextCharacter);\n                            _ignoreNextWhitespace = false;\n                        }\n                        this.GetNextCharacter();\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Unconditionally returns a token which is one of: TagEnd, EmptyTagEnd, Name, Atom or EndOfStream\n        /// Does not guarantee token reader advancing.\n        /// </summary>\n        internal void GetNextTagToken()\n        {\n            _nextToken.Length = 0;\n            if (this.IsAtEndOfStream)\n            {\n                _nextTokenType = HtmlTokenType.EOF;\n                return;\n            }\n\n            this.SkipWhiteSpace();\n\n            if (this.NextCharacter == '>' && !this.IsNextCharacterEntity)\n            {\n                // &gt; should not end a tag, so make sure it's not an entity\n                _nextTokenType = HtmlTokenType.TagEnd;\n                _nextToken.Append('>');\n                this.GetNextCharacter();\n                // Note: _ignoreNextWhitespace must be set appropriately on tag start processing\n            }\n            else if (this.NextCharacter == '/' && _lookAheadCharacter == '>')\n            {\n                // could be start of closing of empty tag\n                _nextTokenType = HtmlTokenType.EmptyTagEnd;\n                _nextToken.Append(\"/>\");\n                this.GetNextCharacter();\n                this.GetNextCharacter();\n                _ignoreNextWhitespace = false; // Whitespace after no-scope tags are sifnificant\n            }\n            else if (IsGoodForNameStart(this.NextCharacter))\n            {\n                _nextTokenType = HtmlTokenType.Name;\n\n                // starts a name\n                // we allow character entities here\n                // we do not throw exceptions here if end of stream is encountered\n                // just stop and return whatever is in the token\n                // if the parser is not expecting end of file after this it will call\n                // the get next token function and throw an exception\n                while (IsGoodForName(this.NextCharacter) && !this.IsAtEndOfStream)\n                {\n                    _nextToken.Append(this.NextCharacter);\n                    this.GetNextCharacter();\n                }\n            }\n            else\n            {\n                // Unexpected type of token for a tag. Reprot one character as Atom, expecting that HtmlParser will ignore it.\n                _nextTokenType = HtmlTokenType.Atom;\n                _nextToken.Append(this.NextCharacter);\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// Unconditionally returns equal sign token. Even if there is no\n        /// real equal sign in the stream, it behaves as if it were there.\n        /// Does not guarantee token reader advancing.\n        /// </summary>\n        internal void GetNextEqualSignToken()\n        {\n            Debug.Assert(_nextTokenType != HtmlTokenType.EOF);\n            _nextToken.Length = 0;\n\n            _nextToken.Append('=');\n            _nextTokenType = HtmlTokenType.EqualSign;\n\n            this.SkipWhiteSpace();\n\n            if (this.NextCharacter == '=')\n            {\n                // '=' is not in the list of entities, so no need to check for entities here\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// Unconditionally returns an atomic value for an attribute\n        /// Even if there is no appropriate token it returns Atom value\n        /// Does not guarantee token reader advancing.\n        /// </summary>\n        internal void GetNextAtomToken()\n        {\n            Debug.Assert(_nextTokenType != HtmlTokenType.EOF);\n            _nextToken.Length = 0;\n\n            this.SkipWhiteSpace();\n\n            _nextTokenType = HtmlTokenType.Atom;\n\n            if ((this.NextCharacter == '\\'' || this.NextCharacter == '\"') && !this.IsNextCharacterEntity)\n            {\n                char startingQuote = this.NextCharacter;\n                this.GetNextCharacter();\n\n                // Consume all characters between quotes\n                while (!(this.NextCharacter == startingQuote && !this.IsNextCharacterEntity) && !this.IsAtEndOfStream)\n                {\n                    _nextToken.Append(this.NextCharacter);\n                    this.GetNextCharacter();\n                }\n                if (this.NextCharacter == startingQuote)\n                {\n                    this.GetNextCharacter();\n                }\n\n                // complete the quoted value\n                // NOTE: our recovery here is different from IE's\n                // IE keeps reading until it finds a closing quote or end of file\n                // if end of file, it treats current value as text\n                // if it finds a closing quote at any point within the text, it eats everything between the quotes\n                // TODO: Suggestion:\n                // however, we could stop when we encounter end of file or an angle bracket of any kind\n                // and assume there was a quote there\n                // so the attribute value may be meaningless but it is never treated as text\n            }\n            else\n            {\n                while (!this.IsAtEndOfStream && !Char.IsWhiteSpace(this.NextCharacter) && this.NextCharacter != '>')\n                {\n                    _nextToken.Append(this.NextCharacter);\n                    this.GetNextCharacter();\n                }\n            }\n        }\n\n        #endregion Internal Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Internal Properties\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Properties\n\n        internal HtmlTokenType NextTokenType\n        {\n            get\n            {\n                return _nextTokenType;\n            }\n        }\n\n        internal string NextToken\n        {\n            get\n            {\n                return _nextToken.ToString();\n            }\n        }\n\n        #endregion Internal Properties\n\n        // ---------------------------------------------------------------------\n        //\n        // Private methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Methods\n\n        /// <summary>\n        /// Advances a reading position by one character code\n        /// and reads the next availbale character from a stream.\n        /// This character becomes available as NextCharacter property.\n        /// </summary>\n        /// <remarks>\n        /// Throws InvalidOperationException if attempted to be called on EndOfStream\n        /// condition.\n        /// </remarks>\n        private void GetNextCharacter()\n        {\n            if (_nextCharacterCode == -1)\n            {\n                throw new InvalidOperationException(\"GetNextCharacter method called at the end of a stream\");\n            }\n\n            _previousCharacter = _nextCharacter;\n\n            _nextCharacter = _lookAheadCharacter;\n            _nextCharacterCode = _lookAheadCharacterCode;\n            // next character not an entity as of now\n            _isNextCharacterEntity = false;\n\n            this.ReadLookAheadCharacter();\n\n            if (_nextCharacter == '&')\n            {\n                if (_lookAheadCharacter == '#')\n                {\n                    // numeric entity - parse digits - &#DDDDD;\n                    int entityCode;\n                    entityCode = 0;\n                    this.ReadLookAheadCharacter();\n\n                    // largest numeric entity is 7 characters\n                    for (int i = 0; i < 7 && Char.IsDigit(_lookAheadCharacter); i++)\n                    {\n                        entityCode = 10 * entityCode + (_lookAheadCharacterCode - (int)'0');\n                        this.ReadLookAheadCharacter();\n                    }\n                    if (_lookAheadCharacter == ';')\n                    {\n                        // correct format - advance\n                        this.ReadLookAheadCharacter();\n                        _nextCharacterCode = entityCode;\n\n                        // if this is out of range it will set the character to '?'\n                        _nextCharacter = (char)_nextCharacterCode;\n\n                        // as far as we are concerned, this is an entity\n                        _isNextCharacterEntity = true;\n                    }\n                    else\n                    {\n                        // not an entity, set next character to the current lookahread character\n                        // we would have eaten up some digits\n                        _nextCharacter = _lookAheadCharacter;\n                        _nextCharacterCode = _lookAheadCharacterCode;\n                        this.ReadLookAheadCharacter();\n                        _isNextCharacterEntity = false;\n                    }\n                }\n                else if (Char.IsLetter(_lookAheadCharacter))\n                {\n                    // entity is written as a string\n                    string entity = \"\";\n\n                    // maximum length of string entities is 10 characters\n                    for (int i = 0; i < 10 && (Char.IsLetter(_lookAheadCharacter) || Char.IsDigit(_lookAheadCharacter)); i++)\n                    {\n                        entity += _lookAheadCharacter;\n                        this.ReadLookAheadCharacter();\n                    }\n                    if (_lookAheadCharacter == ';')\n                    {\n                        // advance\n                        this.ReadLookAheadCharacter();\n\n                        if (HtmlSchema.IsEntity(entity))\n                        {\n                            _nextCharacter = HtmlSchema.EntityCharacterValue(entity);\n                            _nextCharacterCode = (int)_nextCharacter;\n                            _isNextCharacterEntity = true;\n                        }\n                        else\n                        {\n                            // just skip the whole thing - invalid entity\n                            // move on to the next character\n                            _nextCharacter = _lookAheadCharacter;\n                            _nextCharacterCode = _lookAheadCharacterCode;\n                            this.ReadLookAheadCharacter();\n\n                            // not an entity\n                            _isNextCharacterEntity = false;\n                        }\n                    }\n                    else\n                    {\n                        // skip whatever we read after the ampersand\n                        // set next character and move on\n                        _nextCharacter = _lookAheadCharacter;\n                        this.ReadLookAheadCharacter();\n                        _isNextCharacterEntity = false;\n                    }\n                }\n            }\n        }\n\n        private void ReadLookAheadCharacter()\n        {\n\t\t\t_lookAheadCharacterCode = _inputStringReader.Read();\n\t\t\tif (_lookAheadCharacterCode != -1)\n            {\n                _lookAheadCharacter = (char)_lookAheadCharacterCode;\n            }\n        }\n\n        /// <summary>\n        /// skips whitespace in the input string\n        /// leaves the first non-whitespace character available in the NextCharacter property\n        /// this may be the end-of-file character, it performs no checking \n        /// </summary>\n        private void SkipWhiteSpace()\n        {\n            // TODO: handle character entities while processing comments, cdata, and directives\n            // TODO: SUGGESTION: we could check if lookahead and previous characters are entities also\n            while (true)\n            {\n                if (_nextCharacter == '<' && (_lookAheadCharacter == '?' || _lookAheadCharacter == '!'))\n                {\n                    this.GetNextCharacter();\n\n                    if (_lookAheadCharacter == '[')\n                    {\n                        // Skip CDATA block and DTDs(?)\n                        while (!this.IsAtEndOfStream && !(_previousCharacter == ']' && _nextCharacter == ']' && _lookAheadCharacter == '>'))\n                        {\n                            this.GetNextCharacter();\n                        }\n                        if (_nextCharacter == '>')\n                        {\n                            this.GetNextCharacter();\n                        }\n                    }\n                    else\n                    {\n                        // Skip processing instruction, comments\n                        while (!this.IsAtEndOfStream && _nextCharacter != '>')\n                        {\n                            this.GetNextCharacter();\n                        }\n                        if (_nextCharacter == '>')\n                        {\n                            this.GetNextCharacter();\n                        }\n                    }\n                }\n\n\n                if (!Char.IsWhiteSpace(this.NextCharacter))\n                {\n                    break;\n                }\n\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// checks if a character can be used to start a name\n        /// if this check is true then the rest of the name can be read\n        /// </summary>\n        /// <param name=\"character\">\n        /// character value to be checked\n        /// </param>\n        /// <returns>\n        /// true if the character can be the first character in a name\n        /// false otherwise\n        /// </returns>\n        private static bool IsGoodForNameStart(char character)\n        {\n            return character == '_' || Char.IsLetter(character);\n        }\n\n        /// <summary>\n        /// checks if a character can be used as a non-starting character in a name\n        /// uses the IsExtender and IsCombiningCharacter predicates to see\n        /// if a character is an extender or a combining character\n        /// </summary>\n        /// <param name=\"character\">\n        /// character to be checked for validity in a name\n        /// </param>\n        /// <returns>\n        /// true if the character can be a valid part of a name\n        /// </returns>\n        private static bool IsGoodForName(char character)\n        {\n            // we are not concerned with escaped characters in names\n            // we assume that character entities are allowed as part of a name\n            return \n                HtmlLexicalAnalyzer.IsGoodForNameStart(character) || \n                character == '.' || \n                character == '-' || \n                character == ':' ||\n                Char.IsDigit(character) || \n                IsCombiningCharacter(character) || \n                IsExtender(character);\n        }\n\n        /// <summary>\n        /// identifies a character as being a combining character, permitted in a name\n        /// TODO: only a placeholder for now but later to be replaced with comparisons against\n        /// the list of combining characters in the XML documentation\n        /// </summary>\n        /// <param name=\"character\">\n        /// character to be checked\n        /// </param>\n        /// <returns>\n        /// true if the character is a combining character, false otherwise\n        /// </returns>\n        private static bool IsCombiningCharacter(char character)\n        {\n            // TODO: put actual code with checks against all combining characters here\n            return false;\n        }\n\n        /// <summary>\n        /// identifies a character as being an extender, permitted in a name\n        /// TODO: only a placeholder for now but later to be replaced with comparisons against\n        /// the list of extenders in the XML documentation\n        /// </summary>\n        /// <param name=\"character\">\n        /// character to be checked\n        /// </param>\n        /// <returns>\n        /// true if the character is an extender, false otherwise\n        /// </returns>\n        private static bool IsExtender(char character)\n        {\n            // TODO: put actual code with checks against all extenders here\n            return false;\n        }\n\n        /// <summary>\n        /// skips dynamic content starting with  ![ and ending with ]\n        /// </summary>\n        private void ReadDynamicContent()\n        {\n            // verify that we are at dynamic content, which may include CDATA\n            Debug.Assert(_previousCharacter == '<' && _nextCharacter == '!' && _lookAheadCharacter == '[');\n\n            // Let's treat this as empty text\n            _nextTokenType = HtmlTokenType.Text;\n            _nextToken.Length = 0;\n\n            // advance twice, once to get the lookahead character and then to reach the start of the cdata\n            this.GetNextCharacter();\n            this.GetNextCharacter();\n            \n            // NOTE: 10/12/2004: modified this function to check when called if's reading CDATA or something else\n            // some directives may start with a <![ and then have some data and they will just end with a ]>\n            // this function is modified to stop at the sequence ]> and not ]]>\n            // this means that CDATA and anything else expressed in their own set of [] within the <! [...]>\n            // directive cannot contain a ]> sequence. However it is doubtful that cdata could contain such\n            // sequence anyway, it probably stops at the first ]\n            while (!(_nextCharacter == ']' && _lookAheadCharacter == '>') && !this.IsAtEndOfStream)\n            {\n                // advance\n                this.GetNextCharacter();\n            }\n\n            if (!this.IsAtEndOfStream)\n            {\n                // advance, first to the last >\n                this.GetNextCharacter();\n\n                // then advance past it to the next character after processing directive\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// skips comments starting with !- and ending with --\n        /// NOTE: 10/06/2004: processing changed, will now skip anything starting with\n        /// the !-  sequence and ending in ! or -, because in practice many html pages do not\n        /// use the full comment specifying conventions\n        /// </summary>\n        private void ReadComment()\n        {\n            // verify that we are at a comment\n            Debug.Assert(_previousCharacter == '<' && _nextCharacter == '!' && _lookAheadCharacter == '-');\n\n            // Initialize a token\n            _nextTokenType = HtmlTokenType.Comment;\n            _nextToken.Length = 0;\n\n            // advance to the next character, so that to be at the start of comment value\n            this.GetNextCharacter(); // get first '-'\n            this.GetNextCharacter(); // get second '-'\n            this.GetNextCharacter(); // get first character of comment content\n \n            while (true)\n            {\n                // Read text until end of comment\n                // Note that in many actual html pages comments end with \"!>\" (while xml standard is \"-->\")\n                while (!this.IsAtEndOfStream && !(_nextCharacter == '-' && _lookAheadCharacter == '-' || _nextCharacter == '!' && _lookAheadCharacter == '>'))\n                {\n                    _nextToken.Append(this.NextCharacter);\n                    this.GetNextCharacter();\n                }\n\n                // Finish comment reading\n                this.GetNextCharacter();\n                if (_previousCharacter == '-' && _nextCharacter == '-' && _lookAheadCharacter == '>')\n                {\n                    // Standard comment end. Eat it and exit the loop\n                    this.GetNextCharacter(); // get '>'\n                    break;\n                }\n                else if (_previousCharacter == '!' && _nextCharacter == '>')\n                {\n                    // Nonstandard but possible comment end - '!>'. Exit the loop\n                    break;\n                }\n                else\n                {\n                    // Not an end. Save character and continue continue reading\n                    _nextToken.Append(_previousCharacter);\n                    continue;\n                }\n            }\n\n            // Read end of comment combination\n            if (_nextCharacter == '>')\n            {\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// skips past unknown directives that start with ! but are not comments or Cdata\n        /// ignores content of such directives until the next  character\n        /// applies to directives such as DOCTYPE, etc that we do not presently support\n        /// </summary>\n        private void ReadUnknownDirective()\n        {\n            // verify that we are at an unknown directive\n            Debug.Assert(_previousCharacter == '<' && _nextCharacter == '!' && !(_lookAheadCharacter == '-' || _lookAheadCharacter == '['));\n\n            // Let's treat this as empty text\n            _nextTokenType = HtmlTokenType.Text;\n            _nextToken.Length = 0;\n\n            // advance to the next character\n            this.GetNextCharacter();\n\n            // skip to the first tag end we find\n            while (!(_nextCharacter == '>' && !IsNextCharacterEntity) && !this.IsAtEndOfStream)\n            {\n                this.GetNextCharacter();\n            }\n\n            if (!this.IsAtEndOfStream)\n            {\n                // advance past the tag end\n                this.GetNextCharacter();\n            }\n        }\n\n        /// <summary>\n        /// skips processing directives starting with the characters ? and ending with ?\n        /// NOTE: 10/14/2004: IE also ends processing directives with a />, so this function is\n        /// being modified to recognize that condition as well\n        /// </summary>\n        private void SkipProcessingDirective()\n        {\n            // verify that we are at a processing directive\n            Debug.Assert(_nextCharacter == '<' && _lookAheadCharacter == '?');\n\n            // advance twice, once to get the lookahead character and then to reach the start of the drective\n            this.GetNextCharacter();\n            this.GetNextCharacter();\n\n            while (!((_nextCharacter == '?' || _nextCharacter == '/') && _lookAheadCharacter == '>') && !this.IsAtEndOfStream)\n            {\n                // advance\n                // we don't need to check for entities here because '?' is not an entity\n                // and even though > is an entity there is no entity processing when reading lookahead character\n                this.GetNextCharacter();\n            }\n\n            if (!this.IsAtEndOfStream)\n            {\n                // advance, first to the last >\n                this.GetNextCharacter();\n\n                // then advance past it to the next character after processing directive\n                this.GetNextCharacter();\n            }\n        }\n\n        #endregion Private Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Properties\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Properties\n\n        private char NextCharacter\n        {\n            get\n            {\n                return _nextCharacter;\n            }\n        }\n\n        private bool IsAtEndOfStream\n        {\n            get\n            {\n                return _nextCharacterCode == -1;\n            }\n        }\n\n        private bool IsAtTagStart\n        {\n            get\n            {\n                return _nextCharacter == '<' && (_lookAheadCharacter == '/' || IsGoodForNameStart(_lookAheadCharacter)) && !_isNextCharacterEntity;\n            }\n        }\n\n        private bool IsAtTagEnd\n        {\n            // check if at end of empty tag or regular tag\n            get\n            {\n                return (_nextCharacter == '>' || (_nextCharacter == '/' && _lookAheadCharacter == '>')) && !_isNextCharacterEntity;\n            }\n        }\n\n        private bool IsAtDirectiveStart\n        {\n            get\n            {\n                return (_nextCharacter == '<' && _lookAheadCharacter == '!' && !this.IsNextCharacterEntity);\n            }\n        }\n\n        private bool IsNextCharacterEntity\n        {\n            // check if next character is an entity\n            get\n            {\n                return _isNextCharacterEntity;\n            }\n        }\n\n        #endregion Private Properties\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Fields\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Fields\n\n        // string reader which will move over input text\n        private StringReader _inputStringReader = null;\n        // next character code read from input that is not yet part of any token\n        // and the character it represents\n        private int _nextCharacterCode;\n        private char _nextCharacter;\n        private int _lookAheadCharacterCode;\n        private char _lookAheadCharacter;\n        private char _previousCharacter;\n        private bool _ignoreNextWhitespace;\n        private bool _isNextCharacterEntity;\n\n        // store token and type in local variables before copying them to output parameters\n        StringBuilder _nextToken;\n        HtmlTokenType _nextTokenType;\n\n        #endregion Private Fields\n\n\t\tprivate bool isDisposing = false;\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(isDisposing);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\tif (!disposing)\n\t\t\t{\n\t\t\t\tisDisposing = true;\n\n\t\t\t\tif (this._inputStringReader != null)\n\t\t\t\t{\n\t\t\t\t\tthis._inputStringReader.Dispose();\n\t\t\t\t\tthis._inputStringReader = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlParser.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlParser.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Parser for Html-to-Xaml converter\n//\n//---------------------------------------------------------------------------\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization; // StringBuilder\nusing System.Text;\nusing System.Xml;\n\n// important TODOS: \n// TODO 1. Start tags: The ParseXmlElement function has been modified to be called after both the \n// angle bracket < and element name have been read, instead of just the < bracket and some valid name character, \n// previously the case. This change was made so that elements with optional closing tags could read a new\n// element's start tag and decide whether they were required to close. However, there is a question of whether to\n// handle this in the parser or lexical analyzer. It is currently handled in the parser - the lexical analyzer still\n// recognizes a start tag opener as a '<' + valid name start char; it is the parser that reads the actual name. \n// this is correct behavior assuming that the name is a valid html name, because the lexical analyzer should not know anything\n// about optional closing tags, etc. UPDATED: 10/13/2004: I am updating this to read the whole start tag of something \n// that is not an HTML, treat it as empty, and add it to the tree. That way the converter will know it's there, but\n// it will hvae no content. We could also partially recover by trying to look up and match names if they are similar\n// TODO 2. Invalid element names: However, it might make sense to give the lexical analyzer the ability to identify\n// a valid html element name and not return something as a start tag otherwise. For example, if we type <good>, should\n// the lexical analyzer return that it has found the start of an element when this is not the case in HTML? But this will\n// require implementing a lookahead token in the lexical analyzer so that it can treat an invalid element name as text. One \n// character of lookahead will not be enough.\n// TODO 3. Attributes: The attribute recovery is poor when reading attribute values in quotes - if no closing quotes are found,\n// the lexical analyzer just keeps reading and if it eventually reaches the end of file, it would have just skipped everything.\n// There are a couple of ways to deal with this: 1) stop reading attributes when we encounter a '>' character - this doesn't allow\n// the '>' character to be used in attribute values, but it can still be used as an entity. 2) Maintain a HTML-specific list\n// of attributes and their values that each html element can take, and if we find correct attribute namesand values for an\n// element we use them regardless of the quotes, this way we could just ignore something invalid. One more option: 3) Read ahead\n// in the quoted value and if we find an end of file, we can return to where we were and process as text. However this requires\n// a lot of lookahead and a resettable reader.\n// TODO 4: elements with optional closing tags: For elements with optional closing tags, we always close the element if we find\n// that one of it's ancestors has closed. This condition may be too broad and we should develop a better heuristic. We should also\n// improve the heuristics for closing certain elements when the next element starts\n// TODO 5. Nesting: Support for unbalanced nesting, e.g. <b> <i> </b> </i>: this is not presently supported. To support it we may need\n// to maintain two xml elements, one the element that represents what has already been read and another represents what we are presently reading.\n// Then if we encounter an unbalanced nesting tag we could close the element that was supposed to close, save the current element\n// and store it in the list of already-read content, and then open a new element to which all tags that are currently open\n// can be applied. Is there a better way to do this? Should we do it at all?\n// TODO 6. Elements with optional starting tags: there are 4 such elements in the HTML 4 specification - html, tbody, body and head.\n// The current recovery doesn;t do anything for any of these elements except the html element, because it's not critical - head\n// and body elementscan be contained within html element, and tbody is contained within table. To extend this for XHTML \n// extensions, and to recover in case other elements are missing start tags, we would need to insert an extra recursive call\n// to ParseXmlElement for the missing start tag. It is suggested to do this by giving ParseXmlElement an argument that specifies\n// a name to use. If this argument is null, it  assumes its name is the next token from the lexical analyzer and continues\n// exactly as it does now. However, if the argument contains a valid html element name then it takes that value as its name\n// and continues as before. This way, if the next token is the element that should actually be its child, it will see\n// the name in the next step and initiate a recursive call. We would also need to add some logic in the loop for when a start tag\n// is found - if the start tag is not compatible with current context and indicates that a start tag has been missed, then we\n// can initiate the extra recursive call and give it the name of the missed start tag. The issues are when to insert this logic,\n// and if we want to support it over multiple missing start tags. If we insert it at the time a start tag is read in element\n// text,  then we can support only one missing start tag, since the extra call will read the next start tag and make a recursive\n// call without checking the context. This is a conceptual problem, and the check should be made just before a recursive call,\n// with the choice being whether we should supply an element name as argument, or leave it as NULL and read from the input\n// TODO 7: Context: Is it appropriate to keep track of context here? For example, should we only expect td, tr elements when\n// reading a table and ignore them otherwise? This may be too much of a load on the parser, I think it's better if the converter\n// deals with it\n\n\nnamespace WpfRichText\n{\n    /// <summary>\n    /// HtmlParser class accepts a string of possibly badly formed Html, parses it and returns a string\n    /// of well-formed Html that is as close to the original string in content as possible\n    /// </summary>\n\n    internal class HtmlParser : IDisposable\n    {\n        // ---------------------------------------------------------------------\n        //\n        // Constructors\n        //\n        // ---------------------------------------------------------------------\n\n        #region Constructors\n\n        /// <summary>\n        /// Constructor. Initializes the _htmlLexicalAnalayzer element with the given input string\n        /// </summary>\n        /// <param name=\"inputString\">\n        /// string to parsed into well-formed Html\n        /// </param>\n        private HtmlParser(string inputString)\n        {\n            // Create an output xml document\n            _document = new XmlDocument();\n\n            // initialize open tag stack\n            _openedElements = new Stack<XmlElement>();\n\n            _pendingInlineElements = new Stack<XmlElement>();\n\n            // initialize lexical analyzer\n            _htmlLexicalAnalyzer = new HtmlLexicalAnalyzer(inputString);\n\n            // get first token from input, expecting text\n            _htmlLexicalAnalyzer.GetNextContentToken();\n        }\n\n        #endregion Constructors\n\n        // ---------------------------------------------------------------------\n        //\n        // Internal Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Methods\n\n        /// <summary>\n        /// Instantiates an HtmlParser element and calls the parsing function on the given input string\n        /// </summary>\n        /// <param name=\"htmlString\">\n        /// Input string of pssibly badly-formed Html to be parsed into well-formed Html\n        /// </param>\n        /// <returns>\n        /// XmlElement rep\n        /// </returns>\n        internal static XmlElement ParseHtml(string htmlString)\n        {\n\t\t\tusing (HtmlParser htmlParser = new HtmlParser(htmlString))\n\t\t\t{\n\n\t\t\t\tXmlElement htmlRootElement = htmlParser.ParseHtmlContent();\n\n\t\t\t\treturn htmlRootElement;\n\t\t\t}\n        }\n\n        // .....................................................................\n        //\n        // Html Header on Clipboard\n        //\n        // .....................................................................\n\n        // Html header structure.\n        //      Version:1.0\n        //      StartHTML:000000000\n        //      EndHTML:000000000\n        //      StartFragment:000000000\n        //      EndFragment:000000000\n        //      StartSelection:000000000\n        //      EndSelection:000000000\n        internal const string HtmlHeader = \"Version:1.0\\r\\nStartHTML:{0:D10}\\r\\nEndHTML:{1:D10}\\r\\nStartFragment:{2:D10}\\r\\nEndFragment:{3:D10}\\r\\nStartSelection:{4:D10}\\r\\nEndSelection:{5:D10}\\r\\n\";\n        internal const string HtmlStartFragmentComment = \"<!--StartFragment-->\";\n        internal const string HtmlEndFragmentComment = \"<!--EndFragment-->\";\n\n        /// <summary>\n        /// Extracts Html string from clipboard data by parsing header information in htmlDataString\n        /// </summary>\n        /// <param name=\"htmlDataString\">\n        /// String representing Html clipboard data. This includes Html header\n        /// </param>\n        /// <returns>\n        /// String containing only the Html data part of htmlDataString, without header\n        /// </returns>\n        internal static string ExtractHtmlFromClipboardData(string htmlDataString)\n        {\n            int startHtmlIndex = htmlDataString.IndexOf(\"StartHTML:\", StringComparison.OrdinalIgnoreCase);\n            if (startHtmlIndex < 0)\n            {\n                return \"ERROR: Urecognized html header\";\n            }\n            // TODO: We assume that indices represented by strictly 10 zeros (\"0123456789\".Length),\n            // which could be wrong assumption. We need to implement more flrxible parsing here\n            startHtmlIndex = Int32.Parse(htmlDataString.Substring(startHtmlIndex + \"StartHTML:\".Length, \"0123456789\".Length), CultureInfo.InvariantCulture);\n            if (startHtmlIndex < 0 || startHtmlIndex > htmlDataString.Length)\n            {\n                return \"ERROR: Urecognized html header\";\n            }\n\n            int endHtmlIndex = htmlDataString.IndexOf(\"EndHTML:\", StringComparison.OrdinalIgnoreCase);\n            if (endHtmlIndex < 0)\n            {\n                return \"ERROR: Urecognized html header\";\n            }\n            // TODO: We assume that indices represented by strictly 10 zeros (\"0123456789\".Length),\n            // which could be wrong assumption. We need to implement more flrxible parsing here\n\t\t\tendHtmlIndex = Int32.Parse(htmlDataString.Substring(endHtmlIndex + \"EndHTML:\".Length, \"0123456789\".Length), CultureInfo.InvariantCulture);\n            if (endHtmlIndex > htmlDataString.Length)\n            {\n                endHtmlIndex = htmlDataString.Length;\n            }\n\n            return htmlDataString.Substring(startHtmlIndex, endHtmlIndex - startHtmlIndex);\n        }\n\n        /// <summary>\n        /// Adds Xhtml header information to Html data string so that it can be placed on clipboard\n        /// </summary>\n        /// <param name=\"htmlString\">\n        /// Html string to be placed on clipboard with appropriate header\n        /// </param>\n        /// <returns>\n        /// String wrapping htmlString with appropriate Html header\n        /// </returns>\n        internal static string AddHtmlClipboardHeader(string htmlString)\n        {\n            StringBuilder stringBuilder = new StringBuilder();\n\n            // each of 6 numbers is represented by \"{0:D10}\" in the format string\n            // must actually occupy 10 digit positions (\"0123456789\")\n            int startHTML = HtmlHeader.Length + 6 * (\"0123456789\".Length - \"{0:D10}\".Length);\n            int endHTML = startHTML + htmlString.Length;\n\t\t\tint startFragment = htmlString.IndexOf(HtmlStartFragmentComment, 0, StringComparison.OrdinalIgnoreCase);\n            if (startFragment >= 0)\n            {\n                startFragment = startHTML + startFragment + HtmlStartFragmentComment.Length;\n            }\n            else\n            {\n                startFragment = startHTML;\n            }\n            int endFragment = htmlString.IndexOf(HtmlEndFragmentComment, 0, StringComparison.OrdinalIgnoreCase);\n            if (endFragment >= 0)\n            {\n                endFragment = startHTML + endFragment;\n            }\n            else\n            {\n                endFragment = endHTML;\n            }\n\n            // Create HTML clipboard header string\n\t\t\tstringBuilder.AppendFormat(CultureInfo.InvariantCulture,HtmlHeader, startHTML, endHTML, startFragment, endFragment, startFragment, endFragment);\n\n            // Append HTML body.\n            stringBuilder.Append(htmlString);\n\n            return stringBuilder.ToString();\n        }\n\n        #endregion Internal Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Methods\n\n        private static void InvariantAssert(bool condition, string message)\n        {\n            if (!condition)\n            {\n                throw new ArgumentOutOfRangeException(\"Assertion error: \" + message);\n            }\n        }\n\n        /// <summary>\n        /// Parses the stream of html tokens starting\n        /// from the name of top-level element.\n        /// Returns XmlElement representing the top-level\n        /// html element\n        /// </summary>\n        private XmlElement ParseHtmlContent()\n        {\n            // Create artificial root elelemt to be able to group multiple top-level elements\n            // We create \"html\" element which may be a duplicate of real HTML element, which is ok, as HtmlConverter will swallow it painlessly..\n            XmlElement htmlRootElement = _document.CreateElement(\"html\", XhtmlNamespace);\n            OpenStructuringElement(htmlRootElement);\n\n            while (_htmlLexicalAnalyzer.NextTokenType != HtmlTokenType.EOF)\n            {\n                if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.OpeningTagStart)\n                {\n                    _htmlLexicalAnalyzer.GetNextTagToken();\n                    if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.Name)\n                    {\n\t\t\t\t\t\tstring htmlElementName = _htmlLexicalAnalyzer.NextToken.ToLower(CultureInfo.InvariantCulture);\n                        _htmlLexicalAnalyzer.GetNextTagToken();\n\n                        // Create an element\n                        XmlElement htmlElement = _document.CreateElement(htmlElementName, XhtmlNamespace);\n\n                        // Parse element attributes\n                        ParseAttributes(htmlElement);\n\n                        if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.EmptyTagEnd || HtmlSchema.IsEmptyElement(htmlElementName))\n                        {\n                            // It is an element without content (because of explicit slash or based on implicit knowledge aboout html)\n                            AddEmptyElement(htmlElement);\n                        }\n                        else if (HtmlSchema.IsInlineElement(htmlElementName))\n                        {\n                            // Elements known as formatting are pushed to some special\n                            // pending stack, which allows them to be transferred\n                            // over block tags - by doing this we convert\n                            // overlapping tags into normal heirarchical element structure.\n                            OpenInlineElement(htmlElement);\n                        }\n                        else if (HtmlSchema.IsBlockElement(htmlElementName) || HtmlSchema.IsKnownOpenableElement(htmlElementName))\n                        {\n                            // This includes no-scope elements\n                            OpenStructuringElement(htmlElement);\n                        }\n                        else\n                        {\n                            // Do nothing. Skip the whole opening tag.\n                            // Ignoring all unknown elements on their start tags.\n                            // Thus we will ignore them on closinng tag as well.\n                            // Anyway we don't know what to do withthem on conversion to Xaml.\n                        }\n                    }\n                    else\n                    {\n                        // Note that the token following opening angle bracket must be a name - lexical analyzer must guarantee that.\n                        // Otherwise - we skip the angle bracket and continue parsing the content as if it is just text.\n                        //  Add the following asserion here, right? or output \"<\" as a text run instead?:\n                        // InvariantAssert(false, \"Angle bracket without a following name is not expected\");\n                    }\n                }\n                else if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.ClosingTagStart)\n                {\n                    _htmlLexicalAnalyzer.GetNextTagToken();\n                    if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.Name)\n                    {\n\t\t\t\t\t\tstring htmlElementName = _htmlLexicalAnalyzer.NextToken.ToLower(CultureInfo.InvariantCulture);\n\n                        // Skip the name token. Assume that the following token is end of tag,\n                        // but do not check this. If it is not true, we simply ignore one token\n                        // - this is our recovery from bad xml in this case.\n                        _htmlLexicalAnalyzer.GetNextTagToken();\n\n                        CloseElement(htmlElementName);\n                    }\n                }\n                else if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.Text)\n                {\n                    AddTextContent(_htmlLexicalAnalyzer.NextToken);\n                }\n                else if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.Comment)\n                {\n                    AddComment(_htmlLexicalAnalyzer.NextToken);\n                }\n\n                _htmlLexicalAnalyzer.GetNextContentToken();\n            }\n\n            // Get rid of the artificial root element\n            if (htmlRootElement.FirstChild is XmlElement &&\n                htmlRootElement.FirstChild == htmlRootElement.LastChild &&\n\t\t\t\thtmlRootElement.FirstChild.LocalName.ToLower(CultureInfo.InvariantCulture) == \"html\")\n            {\n                htmlRootElement = (XmlElement)htmlRootElement.FirstChild;\n            }\n\n            return htmlRootElement;\n        }\n\n        private XmlElement CreateElementCopy(XmlElement htmlElement)\n        {\n            XmlElement htmlElementCopy = _document.CreateElement(htmlElement.LocalName, XhtmlNamespace);\n            for (int i = 0; i < htmlElement.Attributes.Count; i++)\n            {\n                XmlAttribute attribute = htmlElement.Attributes[i];\n                htmlElementCopy.SetAttribute(attribute.Name, attribute.Value);\n            }\n            return htmlElementCopy;\n        }\n\n        private void AddEmptyElement(XmlElement htmlEmptyElement)\n        {\n            InvariantAssert(_openedElements.Count > 0, \"AddEmptyElement: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n            XmlElement htmlParent = _openedElements.Peek();\n            htmlParent.AppendChild(htmlEmptyElement);\n        }\n\n        private void OpenInlineElement(XmlElement htmlInlineElement)\n        {\n            _pendingInlineElements.Push(htmlInlineElement);\n        }\n\n        // Opens structurig element such as Div or Table etc.\n        private void OpenStructuringElement(XmlElement htmlElement)\n        {\n            // Close all pending inline elements\n            // All block elements are considered as delimiters for inline elements\n            // which forces all inline elements to be closed and re-opened in the following\n            // structural element (if any).\n            // By doing that we guarantee that all inline elements appear only within most nested blocks\n            if (HtmlSchema.IsBlockElement(htmlElement.LocalName))\n            {\n                while (_openedElements.Count > 0 && HtmlSchema.IsInlineElement(_openedElements.Peek().LocalName))\n                {\n                    XmlElement htmlInlineElement = _openedElements.Pop();\n                    InvariantAssert(_openedElements.Count > 0, \"OpenStructuringElement: stack of opened elements cannot become empty here\");\n\n                    _pendingInlineElements.Push(CreateElementCopy(htmlInlineElement));\n                }\n            }\n\n            // Add this block element to its parent\n            if (_openedElements.Count > 0)\n            {\n                XmlElement htmlParent = _openedElements.Peek();\n\n                // Check some known block elements for auto-closing (LI and P)\n                if (HtmlSchema.ClosesOnNextElementStart(htmlParent.LocalName, htmlElement.LocalName))\n                {\n                    _openedElements.Pop();\n                    htmlParent = _openedElements.Count > 0 ? _openedElements.Peek() : null;\n                }\n\n                if (htmlParent != null)\n                {\n                    // NOTE:\n                    // Actually we never expect null - it would mean two top-level P or LI (without a parent).\n                    // In such weird case we will loose all paragraphs except the first one...\n                    htmlParent.AppendChild(htmlElement);\n                }\n            }\n\n            // Push it onto a stack\n            _openedElements.Push(htmlElement);\n        }\n\n        private bool IsElementOpened(string htmlElementName)\n        {\n            foreach (XmlElement openedElement in _openedElements)\n            {\n                if (openedElement.LocalName == htmlElementName)\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        private void CloseElement(string htmlElementName)\n        {\n            // Check if the element is opened and already added to the parent\n            InvariantAssert(_openedElements.Count > 0, \"CloseElement: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n\n            // Check if the element is opened and still waiting to be added to the parent\n            if (_pendingInlineElements.Count > 0 && _pendingInlineElements.Peek().LocalName == htmlElementName)\n            {\n                // Closing an empty inline element.\n                // Note that HtmlConverter will skip empty inlines, but for completeness we keep them here on parser level.\n                XmlElement htmlInlineElement = _pendingInlineElements.Pop();\n                InvariantAssert(_openedElements.Count > 0, \"CloseElement: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n                XmlElement htmlParent = _openedElements.Peek();\n                htmlParent.AppendChild(htmlInlineElement);\n                return;\n            }\n            else if (IsElementOpened(htmlElementName))\n            {\n                while (_openedElements.Count > 1) // we never pop the last element - the artificial root\n                {\n                    // Close all unbalanced elements.\n                    XmlElement htmlOpenedElement = _openedElements.Pop();\n\n                    if (htmlOpenedElement.LocalName == htmlElementName)\n                    {\n                        return;\n                    }\n\n                    if (HtmlSchema.IsInlineElement(htmlOpenedElement.LocalName))\n                    {\n                        // Unbalances Inlines will be transfered to the next element content\n                        _pendingInlineElements.Push(CreateElementCopy(htmlOpenedElement));\n                    }\n                }\n            }\n\n            // If element was not opened, we simply ignore the unbalanced closing tag\n            return;\n        }\n\n        private void AddTextContent(string textContent)\n        {\n            OpenPendingInlineElements();\n\n            InvariantAssert(_openedElements.Count > 0, \"AddTextContent: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n\n            XmlElement htmlParent = _openedElements.Peek();\n            XmlText textNode = _document.CreateTextNode(textContent);\n            htmlParent.AppendChild(textNode);\n        }\n\n        private void AddComment(string comment)\n        {\n            OpenPendingInlineElements();\n\n            InvariantAssert(_openedElements.Count > 0, \"AddComment: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n\n            XmlElement htmlParent = _openedElements.Peek();\n            XmlComment xmlComment = _document.CreateComment(comment);\n            htmlParent.AppendChild(xmlComment);\n        }\n\n        // Moves all inline elements pending for opening to actual document\n        // and adds them to current open stack.\n        private void OpenPendingInlineElements()\n        {\n            if (_pendingInlineElements.Count > 0)\n            {\n                XmlElement htmlInlineElement = _pendingInlineElements.Pop();\n\n                OpenPendingInlineElements();\n\n                InvariantAssert(_openedElements.Count > 0, \"OpenPendingInlineElements: Stack of opened elements cannot be empty, as we have at least one artificial root element\");\n\n                XmlElement htmlParent = _openedElements.Peek();\n                htmlParent.AppendChild(htmlInlineElement);\n                _openedElements.Push(htmlInlineElement);\n            }\n        }\n\n        private void ParseAttributes(XmlElement xmlElement)\n        {\n            while (_htmlLexicalAnalyzer.NextTokenType != HtmlTokenType.EOF && //\n                _htmlLexicalAnalyzer.NextTokenType != HtmlTokenType.TagEnd && //\n                _htmlLexicalAnalyzer.NextTokenType != HtmlTokenType.EmptyTagEnd)\n            {\n                // read next attribute (name=value)\n                if (_htmlLexicalAnalyzer.NextTokenType == HtmlTokenType.Name)\n                {\n                    string attributeName = _htmlLexicalAnalyzer.NextToken;\n                    _htmlLexicalAnalyzer.GetNextEqualSignToken();\n\n                    _htmlLexicalAnalyzer.GetNextAtomToken();\n\n                    string attributeValue = _htmlLexicalAnalyzer.NextToken;\n                    xmlElement.SetAttribute(attributeName, attributeValue);\n                }\n                _htmlLexicalAnalyzer.GetNextTagToken();\n            }\n        }\n\n        #endregion Private Methods\n\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Fields\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Fields\n\n        internal const string XhtmlNamespace = \"http://www.w3.org/1999/xhtml\";\n\n        private HtmlLexicalAnalyzer _htmlLexicalAnalyzer = null;\n\n        // document from which all elements are created\n        private XmlDocument _document;\n\n        // stack for open elements\n        Stack<XmlElement> _openedElements;\n        Stack<XmlElement> _pendingInlineElements;\n\n        #endregion Private Fields\n\n\t\tprivate bool isDisposing = false;\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(isDisposing);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\tif (!disposing)\n\t\t\t{\n\t\t\t\tisDisposing = true;\n\n\t\t\t\tif (this._htmlLexicalAnalyzer != null)\n\t\t\t\t{\n\t\t\t\t\tthis._htmlLexicalAnalyzer.Dispose();\n\t\t\t\t\tthis._htmlLexicalAnalyzer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlSchema.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlSchema.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Static information about HTML structure\n//\n//---------------------------------------------------------------------------\n\nnamespace WpfRichText\n{\n\tusing System.Collections;\n\tusing System.Diagnostics;\n\tusing System.Globalization;\n\n    /// <summary>\n    /// HtmlSchema class\n    /// maintains static information about HTML structure\n    /// can be used by HtmlParser to check conditions under which an element starts or ends, etc.\n    /// </summary>\n    internal static class HtmlSchema\n    {\n        // ---------------------------------------------------------------------\n        //\n        // Constructors\n        //\n        // ---------------------------------------------------------------------\n\n        #region Constructors\n\n        /// <summary>\n        /// static constructor, initializes the ArrayLists\n        /// that hold the elements in various sub-components of the schema\n        /// e.g _htmlEmptyElements, etc.\n        /// </summary>\n        static HtmlSchema()\n        {\n            // initializes the list of all html elements\n            InitializeInlineElements();\n\n            InitializeBlockElements();\n\n            InitializeOtherOpenableElements();\n\n            // initialize empty elements list\n            InitializeEmptyElements();\n\n            // initialize list of elements closing on the outer element end\n            InitializeElementsClosingOnParentElementEnd();\n\n            // initalize list of elements that close when a new element starts\n            InitializeElementsClosingOnNewElementStart();\n\n            // Initialize character entities\n            InitializeHtmlCharacterEntities();\n        }\n\n        #endregion Constructors;\n\n        // ---------------------------------------------------------------------\n        //\n        // Internal Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Methods\n\n        /// <summary>\n        /// returns true when xmlElementName corresponds to empty element \n        /// </summary>\n        /// <param name=\"xmlElementName\">\n        /// string representing name to test\n        /// </param>\n        internal static bool IsEmptyElement(string xmlElementName)\n        {\n            // convert to lowercase before we check\n            // because element names are not case sensitive\n\t\t\treturn _htmlEmptyElements.Contains(xmlElementName.ToLower(CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// returns true if xmlElementName represents a block formattinng element.\n        /// It used in an algorithm of transferring inline elements over block elements\n        /// in HtmlParser\n        /// </summary>\n        /// <param name=\"xmlElementName\"></param>\n        /// <returns></returns>\n        internal static bool IsBlockElement(string xmlElementName)\n        {\n            return _htmlBlockElements.Contains(xmlElementName);\n        }\n\n        /// <summary>\n        /// returns true if the xmlElementName represents an inline formatting element\n        /// </summary>\n        /// <param name=\"xmlElementName\"></param>\n        /// <returns></returns>\n        internal static bool IsInlineElement(string xmlElementName)\n        {\n            return _htmlInlineElements.Contains(xmlElementName);\n        }\n\n        /// <summary>\n        /// It is a list of known html elements which we\n        /// want to allow to produce bt HTML parser,\n        /// but don'tt want to act as inline, block or no-scope.\n        /// Presence in this list will allow to open\n        /// elements during html parsing, and adding the\n        /// to a tree produced by html parser.\n        /// </summary>\n        internal static bool IsKnownOpenableElement(string xmlElementName)\n        {\n            return _htmlOtherOpenableElements.Contains(xmlElementName);\n        }\n\n        /// <summary>\n        /// returns true when xmlElementName closes when the outer element closes\n        /// this is true of elements with optional start tags\n        /// </summary>\n        /// <param name=\"xmlElementName\">\n        /// string representing name to test\n        /// </param>\n        internal static bool ClosesOnParentElementEnd(string xmlElementName)\n        {\n            // convert to lowercase when testing\n\t\t\treturn _htmlElementsClosingOnParentElementEnd.Contains(xmlElementName.ToLower(CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// returns true if the current element closes when the new element, whose name has just been read, starts\n        /// </summary>\n        /// <param name=\"currentElementName\">\n        /// string representing current element name\n        /// </param>\n\t\t/// <param name=\"nextElementName\"></param>\n\t\t/// string representing name of the next element that will start\n        internal static bool ClosesOnNextElementStart(string currentElementName, string nextElementName)\n        {\n\t\t\tDebug.Assert(currentElementName == currentElementName.ToLower(CultureInfo.InvariantCulture));\n            switch (currentElementName)\n            {\n                case \"colgroup\":\n                    return _htmlElementsClosingColgroup.Contains(nextElementName) && HtmlSchema.IsBlockElement(nextElementName);\n                case \"dd\":\n                    return _htmlElementsClosingDD.Contains(nextElementName) && HtmlSchema.IsBlockElement(nextElementName);\n                case \"dt\":\n                    return _htmlElementsClosingDT.Contains(nextElementName) && HtmlSchema.IsBlockElement(nextElementName);\n                case \"li\":\n                    return _htmlElementsClosingLI.Contains(nextElementName);\n                case \"p\":\n                    return HtmlSchema.IsBlockElement(nextElementName);\n                case \"tbody\":\n                    return _htmlElementsClosingTbody.Contains(nextElementName);\n                case \"tfoot\":\n                    return _htmlElementsClosingTfoot.Contains(nextElementName);\n                case \"thead\":\n                    return _htmlElementsClosingThead.Contains(nextElementName);\n                case \"tr\":\n                    return _htmlElementsClosingTR.Contains(nextElementName);\n                case \"td\":\n                    return _htmlElementsClosingTD.Contains(nextElementName);\n                case \"th\":\n                    return _htmlElementsClosingTH.Contains(nextElementName);\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// returns true if the string passed as argument is an Html entity name\n        /// </summary>\n        /// <param name=\"entityName\">\n        /// string to be tested for Html entity name \n        /// </param>\n        internal static bool IsEntity(string entityName)\n        {\n            // we do not convert entity strings to lowercase because these names are case-sensitive\n            if (_htmlCharacterEntities.Contains(entityName))\n            {\n                return true;\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// returns the character represented by the entity name string which is passed as an argument, if the string is an entity name\n        /// as specified in _htmlCharacterEntities, returns the character value of 0 otherwise \n        /// </summary>\n        /// <param name=\"entityName\">\n        /// string representing entity name whose character value is desired\n        /// </param>\n        internal static char EntityCharacterValue(string entityName)\n        {\n            if (_htmlCharacterEntities.Contains(entityName))\n            {\n                return (char) _htmlCharacterEntities[entityName];\n            }\n            else\n            {\n                return (char)0;\n            }\n        }\n\n        #endregion Internal Methods\n\n        \n        // ---------------------------------------------------------------------\n        //\n        //  Internal Properties\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Properties\n\n        #endregion Internal Indexers\n\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Methods\n        //\n        // ---------------------------------------------------------------------\n\n\n        #region Private Methods\n\n        private static void InitializeInlineElements()\n        {\n            _htmlInlineElements = new ArrayList();\n            _htmlInlineElements.Add(\"a\");\n            _htmlInlineElements.Add(\"abbr\");\n            _htmlInlineElements.Add(\"acronym\");\n            _htmlInlineElements.Add(\"address\");\n            _htmlInlineElements.Add(\"b\");\n            _htmlInlineElements.Add(\"bdo\"); // ???\n            _htmlInlineElements.Add(\"big\");\n            _htmlInlineElements.Add(\"button\");\n            _htmlInlineElements.Add(\"code\");\n            _htmlInlineElements.Add(\"del\"); // deleted text\n            _htmlInlineElements.Add(\"dfn\");\n            _htmlInlineElements.Add(\"em\");\n            _htmlInlineElements.Add(\"font\");\n            _htmlInlineElements.Add(\"i\");\n            _htmlInlineElements.Add(\"ins\"); // inserted text\n            _htmlInlineElements.Add(\"kbd\"); // text to entered by a user\n            _htmlInlineElements.Add(\"label\");\n            _htmlInlineElements.Add(\"legend\"); // ???\n            _htmlInlineElements.Add(\"q\"); // short inline quotation\n            _htmlInlineElements.Add(\"s\"); // strike-through text style\n            _htmlInlineElements.Add(\"samp\"); // Specifies a code sample\n            _htmlInlineElements.Add(\"small\");\n            _htmlInlineElements.Add(\"span\");\n            _htmlInlineElements.Add(\"strike\");\n            _htmlInlineElements.Add(\"strong\");\n            _htmlInlineElements.Add(\"sub\");\n            _htmlInlineElements.Add(\"sup\");\n            _htmlInlineElements.Add(\"u\");\n            _htmlInlineElements.Add(\"var\"); // indicates an instance of a program variable\n        }\n\n        private static void InitializeBlockElements()\n        {\n            _htmlBlockElements = new ArrayList();\n\n            _htmlBlockElements.Add(\"blockquote\");\n            _htmlBlockElements.Add(\"body\");\n            _htmlBlockElements.Add(\"caption\");\n            _htmlBlockElements.Add(\"center\");\n            _htmlBlockElements.Add(\"cite\");\n            _htmlBlockElements.Add(\"dd\");\n            _htmlBlockElements.Add(\"dir\"); //  treat as UL element\n            _htmlBlockElements.Add(\"div\");\n            _htmlBlockElements.Add(\"dl\");\n            _htmlBlockElements.Add(\"dt\");\n            _htmlBlockElements.Add(\"form\"); // Not a block according to XHTML spec\n            _htmlBlockElements.Add(\"h1\");\n            _htmlBlockElements.Add(\"h2\");\n            _htmlBlockElements.Add(\"h3\");\n            _htmlBlockElements.Add(\"h4\");\n            _htmlBlockElements.Add(\"h5\");\n            _htmlBlockElements.Add(\"h6\");\n            _htmlBlockElements.Add(\"html\");\n            _htmlBlockElements.Add(\"li\");\n            _htmlBlockElements.Add(\"menu\"); //  treat as UL element\n            _htmlBlockElements.Add(\"ol\");\n            _htmlBlockElements.Add(\"p\");\n            _htmlBlockElements.Add(\"pre\"); // Renders text in a fixed-width font\n            _htmlBlockElements.Add(\"table\");\n            _htmlBlockElements.Add(\"tbody\");\n            _htmlBlockElements.Add(\"td\");\n            _htmlBlockElements.Add(\"textarea\");\n            _htmlBlockElements.Add(\"tfoot\");\n            _htmlBlockElements.Add(\"th\");\n            _htmlBlockElements.Add(\"thead\");\n            _htmlBlockElements.Add(\"tr\");\n            _htmlBlockElements.Add(\"tt\");\n            _htmlBlockElements.Add(\"ul\");\n        }\n\n        /// <summary>\n        /// initializes _htmlEmptyElements with empty elements in HTML 4 spec at\n        /// http://www.w3.org/TR/REC-html40/index/elements.html\n        /// </summary>\n        private static void InitializeEmptyElements()\n        {\n            // Build a list of empty (no-scope) elements \n            // (element not requiring closing tags, and not accepting any content)\n            _htmlEmptyElements = new ArrayList();\n            _htmlEmptyElements.Add(\"area\");\n            _htmlEmptyElements.Add(\"base\");\n            _htmlEmptyElements.Add(\"basefont\");\n            _htmlEmptyElements.Add(\"br\");\n            _htmlEmptyElements.Add(\"col\");\n            _htmlEmptyElements.Add(\"frame\");\n            _htmlEmptyElements.Add(\"hr\");\n            _htmlEmptyElements.Add(\"img\");\n            _htmlEmptyElements.Add(\"input\");\n            _htmlEmptyElements.Add(\"isindex\");\n            _htmlEmptyElements.Add(\"link\");\n            _htmlEmptyElements.Add(\"meta\");\n            _htmlEmptyElements.Add(\"param\");\n        }\n        \n        private static void InitializeOtherOpenableElements()\n        {\n            // It is a list of known html elements which we\n            // want to allow to produce bt HTML parser,\n            // but don'tt want to act as inline, block or no-scope.\n            // Presence in this list will allow to open\n            // elements during html parsing, and adding the\n            // to a tree produced by html parser.\n            _htmlOtherOpenableElements = new ArrayList();\n            _htmlOtherOpenableElements.Add(\"applet\");\n            _htmlOtherOpenableElements.Add(\"base\");\n            _htmlOtherOpenableElements.Add(\"basefont\");\n            _htmlOtherOpenableElements.Add(\"colgroup\");\n            _htmlOtherOpenableElements.Add(\"fieldset\");\n            //_htmlOtherOpenableElements.Add(\"form\"); --> treated as block\n            _htmlOtherOpenableElements.Add(\"frameset\");\n            _htmlOtherOpenableElements.Add(\"head\");\n            _htmlOtherOpenableElements.Add(\"iframe\");\n            _htmlOtherOpenableElements.Add(\"map\");\n            _htmlOtherOpenableElements.Add(\"noframes\");\n            _htmlOtherOpenableElements.Add(\"noscript\");\n            _htmlOtherOpenableElements.Add(\"object\");\n            _htmlOtherOpenableElements.Add(\"optgroup\");\n            _htmlOtherOpenableElements.Add(\"option\");\n            _htmlOtherOpenableElements.Add(\"script\");\n            _htmlOtherOpenableElements.Add(\"select\");\n            _htmlOtherOpenableElements.Add(\"style\");\n            _htmlOtherOpenableElements.Add(\"title\");\n        }\n\n        /// <summary>\n        /// initializes _htmlElementsClosingOnParentElementEnd with the list of HTML 4 elements for which closing tags are optional\n        /// we assume that for any element for which closing tags are optional, the element closes when it's outer element\n        /// (in which it is nested) does\n        /// </summary>\n        private static void InitializeElementsClosingOnParentElementEnd()\n        {\n            _htmlElementsClosingOnParentElementEnd = new ArrayList();\n            _htmlElementsClosingOnParentElementEnd.Add(\"body\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"colgroup\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"dd\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"dt\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"head\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"html\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"li\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"p\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"tbody\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"td\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"tfoot\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"thead\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"th\");\n            _htmlElementsClosingOnParentElementEnd.Add(\"tr\");\n        }\n\n        private static void InitializeElementsClosingOnNewElementStart()\n        {\n            _htmlElementsClosingColgroup = new ArrayList();\n            _htmlElementsClosingColgroup.Add(\"colgroup\");\n            _htmlElementsClosingColgroup.Add(\"tr\");\n            _htmlElementsClosingColgroup.Add(\"thead\");\n            _htmlElementsClosingColgroup.Add(\"tfoot\");\n            _htmlElementsClosingColgroup.Add(\"tbody\");\n\n            _htmlElementsClosingDD = new ArrayList();\n            _htmlElementsClosingDD.Add(\"dd\");\n            _htmlElementsClosingDD.Add(\"dt\");\n            // TODO: dd may end in other cases as well - if a new \"p\" starts, etc.\n            // TODO: these are the basic \"legal\" cases but there may be more recovery\n\n            _htmlElementsClosingDT = new ArrayList();\n            _htmlElementsClosingDD.Add(\"dd\");\n            _htmlElementsClosingDD.Add(\"dt\");\n            // TODO: dd may end in other cases as well - if a new \"p\" starts, etc.\n            // TODO: these are the basic \"legal\" cases but there may be more recovery\n\n            _htmlElementsClosingLI = new ArrayList();\n            _htmlElementsClosingLI.Add(\"li\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingTbody = new ArrayList();\n            _htmlElementsClosingTbody.Add(\"tbody\");\n            _htmlElementsClosingTbody.Add(\"thead\");\n            _htmlElementsClosingTbody.Add(\"tfoot\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingTR = new ArrayList();\n            // NOTE: tr should not really close on a new thead\n            // because if there are rows before a thead, it is assumed to be in tbody, whose start tag is optional\n            // and thead can't come after tbody\n            // however, if we do encounter this, it's probably best to end the row and ignore the thead or treat\n            // it as part of the table\n            _htmlElementsClosingTR.Add(\"thead\");\n            _htmlElementsClosingTR.Add(\"tfoot\");\n            _htmlElementsClosingTR.Add(\"tbody\");\n            _htmlElementsClosingTR.Add(\"tr\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingTD = new ArrayList();\n            _htmlElementsClosingTD.Add(\"td\");\n            _htmlElementsClosingTD.Add(\"th\");\n            _htmlElementsClosingTD.Add(\"tr\");\n            _htmlElementsClosingTD.Add(\"tbody\");\n            _htmlElementsClosingTD.Add(\"tfoot\");\n            _htmlElementsClosingTD.Add(\"thead\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingTH = new ArrayList();\n            _htmlElementsClosingTH.Add(\"td\");\n            _htmlElementsClosingTH.Add(\"th\");\n            _htmlElementsClosingTH.Add(\"tr\");\n            _htmlElementsClosingTH.Add(\"tbody\");\n            _htmlElementsClosingTH.Add(\"tfoot\");\n            _htmlElementsClosingTH.Add(\"thead\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingThead = new ArrayList();\n            _htmlElementsClosingThead.Add(\"tbody\");\n            _htmlElementsClosingThead.Add(\"tfoot\");\n            // TODO: more complex recovery\n\n            _htmlElementsClosingTfoot = new ArrayList();\n            _htmlElementsClosingTfoot.Add(\"tbody\");\n            // although thead comes before tfoot, we add it because if it is found the tfoot should close\n            // and some recovery processing be done on the thead\n            _htmlElementsClosingTfoot.Add(\"thead\");\n            // TODO: more complex recovery\n        }\n\n        /// <summary>\n        /// initializes _htmlCharacterEntities hashtable with the character corresponding to entity names\n        /// </summary>\n        private static void InitializeHtmlCharacterEntities()\n        {\n            _htmlCharacterEntities = new Hashtable();\n            _htmlCharacterEntities[\"Aacute\"] = (char)193;\n            _htmlCharacterEntities[\"aacute\"] = (char)225;\n            _htmlCharacterEntities[\"Acirc\"] = (char)194;\n            _htmlCharacterEntities[\"acirc\"] = (char)226;\n            _htmlCharacterEntities[\"acute\"] = (char)180;\n            _htmlCharacterEntities[\"AElig\"] = (char)198;\n            _htmlCharacterEntities[\"aelig\"] = (char)230;\n            _htmlCharacterEntities[\"Agrave\"] = (char)192;\n            _htmlCharacterEntities[\"agrave\"] = (char)224;\n            _htmlCharacterEntities[\"alefsym\"] = (char)8501;\n            _htmlCharacterEntities[\"Alpha\"] = (char)913;\n            _htmlCharacterEntities[\"alpha\"] = (char)945;\n            _htmlCharacterEntities[\"amp\"] = (char)38;\n            _htmlCharacterEntities[\"and\"] = (char)8743;\n            _htmlCharacterEntities[\"ang\"] = (char)8736;\n            _htmlCharacterEntities[\"Aring\"] = (char)197;\n            _htmlCharacterEntities[\"aring\"] = (char)229;\n            _htmlCharacterEntities[\"asymp\"] = (char)8776;\n            _htmlCharacterEntities[\"Atilde\"] = (char)195;\n            _htmlCharacterEntities[\"atilde\"] = (char)227;\n            _htmlCharacterEntities[\"Auml\"] = (char)196;\n            _htmlCharacterEntities[\"auml\"] = (char)228;\n            _htmlCharacterEntities[\"bdquo\"] = (char)8222;\n            _htmlCharacterEntities[\"Beta\"] = (char)914;\n            _htmlCharacterEntities[\"beta\"] = (char)946;\n            _htmlCharacterEntities[\"brvbar\"] = (char)166;\n            _htmlCharacterEntities[\"bull\"] = (char)8226;\n            _htmlCharacterEntities[\"cap\"] = (char)8745;\n            _htmlCharacterEntities[\"Ccedil\"] = (char)199;\n            _htmlCharacterEntities[\"ccedil\"] = (char)231;\n            _htmlCharacterEntities[\"cent\"] = (char)162;\n            _htmlCharacterEntities[\"Chi\"] = (char)935;\n            _htmlCharacterEntities[\"chi\"] = (char)967;\n            _htmlCharacterEntities[\"circ\"] = (char)710;\n            _htmlCharacterEntities[\"clubs\"] = (char)9827;\n            _htmlCharacterEntities[\"cong\"] = (char)8773;\n            _htmlCharacterEntities[\"copy\"] = (char)169;\n            _htmlCharacterEntities[\"crarr\"] = (char)8629;\n            _htmlCharacterEntities[\"cup\"] = (char)8746;\n            _htmlCharacterEntities[\"curren\"] = (char)164;\n            _htmlCharacterEntities[\"dagger\"] = (char)8224;\n            _htmlCharacterEntities[\"Dagger\"] = (char)8225;\n            _htmlCharacterEntities[\"darr\"] = (char)8595;\n            _htmlCharacterEntities[\"dArr\"] = (char)8659;\n            _htmlCharacterEntities[\"deg\"] = (char)176;\n            _htmlCharacterEntities[\"Delta\"] = (char)916;\n            _htmlCharacterEntities[\"delta\"] = (char)948;\n            _htmlCharacterEntities[\"diams\"] = (char)9830;\n            _htmlCharacterEntities[\"divide\"] = (char)247;\n            _htmlCharacterEntities[\"Eacute\"] = (char)201;\n            _htmlCharacterEntities[\"eacute\"] = (char)233;\n            _htmlCharacterEntities[\"Ecirc\"] = (char)202;\n            _htmlCharacterEntities[\"ecirc\"] = (char)234;\n            _htmlCharacterEntities[\"Egrave\"] = (char)200;\n            _htmlCharacterEntities[\"egrave\"] = (char)232;\n            _htmlCharacterEntities[\"empty\"] = (char)8709;\n            _htmlCharacterEntities[\"emsp\"] = (char)8195;\n            _htmlCharacterEntities[\"ensp\"] = (char)8194;\n            _htmlCharacterEntities[\"Epsilon\"] = (char)917;\n            _htmlCharacterEntities[\"epsilon\"] = (char)949;\n            _htmlCharacterEntities[\"equiv\"] = (char)8801;\n            _htmlCharacterEntities[\"Eta\"] = (char)919;\n            _htmlCharacterEntities[\"eta\"] = (char)951;\n            _htmlCharacterEntities[\"ETH\"] = (char)208;\n            _htmlCharacterEntities[\"eth\"] = (char)240;\n            _htmlCharacterEntities[\"Euml\"] = (char)203;\n            _htmlCharacterEntities[\"euml\"] = (char)235;\n            _htmlCharacterEntities[\"euro\"] = (char)8364;\n            _htmlCharacterEntities[\"exist\"] = (char)8707;\n            _htmlCharacterEntities[\"fnof\"] = (char)402;\n            _htmlCharacterEntities[\"forall\"] = (char)8704;\n            _htmlCharacterEntities[\"frac12\"] = (char)189;\n            _htmlCharacterEntities[\"frac14\"] = (char)188;\n            _htmlCharacterEntities[\"frac34\"] = (char)190;\n            _htmlCharacterEntities[\"frasl\"] = (char)8260;\n            _htmlCharacterEntities[\"Gamma\"] = (char)915;\n            _htmlCharacterEntities[\"gamma\"] = (char)947;\n            _htmlCharacterEntities[\"ge\"] = (char)8805;\n            _htmlCharacterEntities[\"gt\"] = (char)62;\n            _htmlCharacterEntities[\"harr\"] = (char)8596;\n            _htmlCharacterEntities[\"hArr\"] = (char)8660;\n            _htmlCharacterEntities[\"hearts\"] = (char)9829;\n            _htmlCharacterEntities[\"hellip\"] = (char)8230;\n            _htmlCharacterEntities[\"Iacute\"] = (char)205;\n            _htmlCharacterEntities[\"iacute\"] = (char)237;\n            _htmlCharacterEntities[\"Icirc\"] = (char)206;\n            _htmlCharacterEntities[\"icirc\"] = (char)238;\n            _htmlCharacterEntities[\"iexcl\"] = (char)161;\n            _htmlCharacterEntities[\"Igrave\"] = (char)204;\n            _htmlCharacterEntities[\"igrave\"] = (char)236;\n            _htmlCharacterEntities[\"image\"] = (char)8465;\n            _htmlCharacterEntities[\"infin\"] = (char)8734;\n            _htmlCharacterEntities[\"int\"] = (char)8747;\n            _htmlCharacterEntities[\"Iota\"] = (char)921;\n            _htmlCharacterEntities[\"iota\"] = (char)953;\n            _htmlCharacterEntities[\"iquest\"] = (char)191;\n            _htmlCharacterEntities[\"isin\"] = (char)8712;\n            _htmlCharacterEntities[\"Iuml\"] = (char)207;\n            _htmlCharacterEntities[\"iuml\"] = (char)239;\n            _htmlCharacterEntities[\"Kappa\"] = (char)922;\n            _htmlCharacterEntities[\"kappa\"] = (char)954;\n            _htmlCharacterEntities[\"Lambda\"] = (char)923;\n            _htmlCharacterEntities[\"lambda\"] = (char)955;\n            _htmlCharacterEntities[\"lang\"] = (char)9001;\n            _htmlCharacterEntities[\"laquo\"] = (char)171;\n            _htmlCharacterEntities[\"larr\"] = (char)8592;\n            _htmlCharacterEntities[\"lArr\"] = (char)8656;\n            _htmlCharacterEntities[\"lceil\"] = (char)8968;\n            _htmlCharacterEntities[\"ldquo\"] = (char)8220;\n            _htmlCharacterEntities[\"le\"] = (char)8804;\n            _htmlCharacterEntities[\"lfloor\"] = (char)8970;\n            _htmlCharacterEntities[\"lowast\"] = (char)8727;\n            _htmlCharacterEntities[\"loz\"] = (char)9674;\n            _htmlCharacterEntities[\"lrm\"] = (char)8206;\n            _htmlCharacterEntities[\"lsaquo\"] = (char)8249;\n            _htmlCharacterEntities[\"lsquo\"] = (char)8216;\n            _htmlCharacterEntities[\"lt\"] = (char)60;\n            _htmlCharacterEntities[\"macr\"] = (char)175;\n            _htmlCharacterEntities[\"mdash\"] = (char)8212;\n            _htmlCharacterEntities[\"micro\"] = (char)181;\n            _htmlCharacterEntities[\"middot\"] = (char)183;\n            _htmlCharacterEntities[\"minus\"] = (char)8722;\n            _htmlCharacterEntities[\"Mu\"] = (char)924;\n            _htmlCharacterEntities[\"mu\"] = (char)956;\n            _htmlCharacterEntities[\"nabla\"] = (char)8711;\n            _htmlCharacterEntities[\"nbsp\"] = (char)160;\n            _htmlCharacterEntities[\"ndash\"] = (char)8211;\n            _htmlCharacterEntities[\"ne\"] = (char)8800;\n            _htmlCharacterEntities[\"ni\"] = (char)8715;\n            _htmlCharacterEntities[\"not\"] = (char)172;\n            _htmlCharacterEntities[\"notin\"] = (char)8713;\n            _htmlCharacterEntities[\"nsub\"] = (char)8836;\n            _htmlCharacterEntities[\"Ntilde\"] = (char)209;\n            _htmlCharacterEntities[\"ntilde\"] = (char)241;\n            _htmlCharacterEntities[\"Nu\"] = (char)925;\n            _htmlCharacterEntities[\"nu\"] = (char)957;\n            _htmlCharacterEntities[\"Oacute\"] = (char)211;\n            _htmlCharacterEntities[\"ocirc\"] = (char)244;\n            _htmlCharacterEntities[\"OElig\"] = (char)338;\n            _htmlCharacterEntities[\"oelig\"] = (char)339;\n            _htmlCharacterEntities[\"Ograve\"] = (char)210;\n            _htmlCharacterEntities[\"ograve\"] = (char)242;\n            _htmlCharacterEntities[\"oline\"] = (char)8254;\n            _htmlCharacterEntities[\"Omega\"] = (char)937;\n            _htmlCharacterEntities[\"omega\"] = (char)969;\n            _htmlCharacterEntities[\"Omicron\"] = (char)927;\n            _htmlCharacterEntities[\"omicron\"] = (char)959;\n            _htmlCharacterEntities[\"oplus\"] = (char)8853;\n            _htmlCharacterEntities[\"or\"] = (char)8744;\n            _htmlCharacterEntities[\"ordf\"] = (char)170;\n            _htmlCharacterEntities[\"ordm\"] = (char)186;\n            _htmlCharacterEntities[\"Oslash\"] = (char)216;\n            _htmlCharacterEntities[\"oslash\"] = (char)248;\n            _htmlCharacterEntities[\"Otilde\"] = (char)213;\n            _htmlCharacterEntities[\"otilde\"] = (char)245;\n            _htmlCharacterEntities[\"otimes\"] = (char)8855;\n            _htmlCharacterEntities[\"Ouml\"] = (char)214;\n            _htmlCharacterEntities[\"ouml\"] = (char)246;\n            _htmlCharacterEntities[\"para\"] = (char)182;\n            _htmlCharacterEntities[\"part\"] = (char)8706;\n            _htmlCharacterEntities[\"permil\"] = (char)8240;\n            _htmlCharacterEntities[\"perp\"] = (char)8869;\n            _htmlCharacterEntities[\"Phi\"] = (char)934;\n            _htmlCharacterEntities[\"phi\"] = (char)966;\n            _htmlCharacterEntities[\"pi\"] = (char)960;\n            _htmlCharacterEntities[\"piv\"] = (char)982;\n            _htmlCharacterEntities[\"plusmn\"] = (char)177;\n            _htmlCharacterEntities[\"pound\"] = (char)163;\n            _htmlCharacterEntities[\"prime\"] = (char)8242;\n            _htmlCharacterEntities[\"Prime\"] = (char)8243;\n            _htmlCharacterEntities[\"prod\"] = (char)8719;\n            _htmlCharacterEntities[\"prop\"] = (char)8733;\n            _htmlCharacterEntities[\"Psi\"] = (char)936;\n            _htmlCharacterEntities[\"psi\"] = (char)968;\n            _htmlCharacterEntities[\"quot\"] = (char)34;\n            _htmlCharacterEntities[\"radic\"] = (char)8730;\n            _htmlCharacterEntities[\"rang\"] = (char)9002;\n            _htmlCharacterEntities[\"raquo\"] = (char)187;\n            _htmlCharacterEntities[\"rarr\"] = (char)8594;\n            _htmlCharacterEntities[\"rArr\"] = (char)8658;\n            _htmlCharacterEntities[\"rceil\"] = (char)8969;\n            _htmlCharacterEntities[\"rdquo\"] = (char)8221;\n            _htmlCharacterEntities[\"real\"] = (char)8476;\n            _htmlCharacterEntities[\"reg\"] = (char)174;\n            _htmlCharacterEntities[\"rfloor\"] = (char)8971;\n            _htmlCharacterEntities[\"Rho\"] = (char)929;\n            _htmlCharacterEntities[\"rho\"] = (char)961;\n            _htmlCharacterEntities[\"rlm\"] = (char)8207;\n            _htmlCharacterEntities[\"rsaquo\"] = (char)8250;\n            _htmlCharacterEntities[\"rsquo\"] = (char)8217;\n            _htmlCharacterEntities[\"sbquo\"] = (char)8218;\n            _htmlCharacterEntities[\"Scaron\"] = (char)352;\n            _htmlCharacterEntities[\"scaron\"] = (char)353;\n            _htmlCharacterEntities[\"sdot\"] = (char)8901;\n            _htmlCharacterEntities[\"sect\"] = (char)167;\n            _htmlCharacterEntities[\"shy\"] = (char)173;\n            _htmlCharacterEntities[\"Sigma\"] = (char)931;\n            _htmlCharacterEntities[\"sigma\"] = (char)963;\n            _htmlCharacterEntities[\"sigmaf\"] = (char)962;\n            _htmlCharacterEntities[\"sim\"] = (char)8764;\n            _htmlCharacterEntities[\"spades\"] = (char)9824;\n            _htmlCharacterEntities[\"sub\"] = (char)8834;\n            _htmlCharacterEntities[\"sube\"] = (char)8838;\n            _htmlCharacterEntities[\"sum\"] = (char)8721;\n            _htmlCharacterEntities[\"sup\"] = (char)8835;\n            _htmlCharacterEntities[\"sup1\"] = (char)185;\n            _htmlCharacterEntities[\"sup2\"] = (char)178;\n            _htmlCharacterEntities[\"sup3\"] = (char)179;\n            _htmlCharacterEntities[\"supe\"] = (char)8839;\n            _htmlCharacterEntities[\"szlig\"] = (char)223;\n            _htmlCharacterEntities[\"Tau\"] = (char)932;\n            _htmlCharacterEntities[\"tau\"] = (char)964;\n            _htmlCharacterEntities[\"there4\"] = (char)8756;\n            _htmlCharacterEntities[\"Theta\"] = (char)920;\n            _htmlCharacterEntities[\"theta\"] = (char)952;\n            _htmlCharacterEntities[\"thetasym\"] = (char)977;\n            _htmlCharacterEntities[\"thinsp\"] = (char)8201;\n            _htmlCharacterEntities[\"THORN\"] = (char)222;\n            _htmlCharacterEntities[\"thorn\"] = (char)254;\n            _htmlCharacterEntities[\"tilde\"] = (char)732;\n            _htmlCharacterEntities[\"times\"] = (char)215;\n            _htmlCharacterEntities[\"trade\"] = (char)8482;\n            _htmlCharacterEntities[\"Uacute\"] = (char)218;\n            _htmlCharacterEntities[\"uacute\"] = (char)250;\n            _htmlCharacterEntities[\"uarr\"] = (char)8593;\n            _htmlCharacterEntities[\"uArr\"] = (char)8657;\n            _htmlCharacterEntities[\"Ucirc\"] = (char)219;\n            _htmlCharacterEntities[\"ucirc\"] = (char)251;\n            _htmlCharacterEntities[\"Ugrave\"] = (char)217;\n            _htmlCharacterEntities[\"ugrave\"] = (char)249;\n            _htmlCharacterEntities[\"uml\"] = (char)168;\n            _htmlCharacterEntities[\"upsih\"] = (char)978;\n            _htmlCharacterEntities[\"Upsilon\"] = (char)933;\n            _htmlCharacterEntities[\"upsilon\"] = (char)965;\n            _htmlCharacterEntities[\"Uuml\"] = (char)220;\n            _htmlCharacterEntities[\"uuml\"] = (char)252;\n            _htmlCharacterEntities[\"weierp\"] = (char)8472;\n            _htmlCharacterEntities[\"Xi\"] = (char)926;\n            _htmlCharacterEntities[\"xi\"] = (char)958;\n            _htmlCharacterEntities[\"Yacute\"] = (char)221;\n            _htmlCharacterEntities[\"yacute\"] = (char)253;\n            _htmlCharacterEntities[\"yen\"] = (char)165;\n            _htmlCharacterEntities[\"Yuml\"] = (char)376;\n            _htmlCharacterEntities[\"yuml\"] = (char)255;\n            _htmlCharacterEntities[\"Zeta\"] = (char)918;\n            _htmlCharacterEntities[\"zeta\"] = (char)950;\n            _htmlCharacterEntities[\"zwj\"] = (char)8205;\n            _htmlCharacterEntities[\"zwnj\"] = (char)8204;\n        }\n\n        #endregion Private Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Fields\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Fields\n\n        // html element names\n        // this is an array list now, but we may want to make it a hashtable later for better performance\n        private static ArrayList _htmlInlineElements;\n\n        private static ArrayList _htmlBlockElements;\n\n        private static ArrayList _htmlOtherOpenableElements;\n\n        // list of html empty element names\n        private static ArrayList _htmlEmptyElements;\n\n        // names of html elements for which closing tags are optional, and close when the outer nested element closes\n        private static ArrayList _htmlElementsClosingOnParentElementEnd;\n\n        // names of elements that close certain optional closing tag elements when they start\n        \n        // names of elements closing the colgroup element\n        private static ArrayList _htmlElementsClosingColgroup;\n\n        // names of elements closing the dd element\n        private static ArrayList _htmlElementsClosingDD;\n\n        // names of elements closing the dt element\n        private static ArrayList _htmlElementsClosingDT;\n\n        // names of elements closing the li element\n        private static ArrayList _htmlElementsClosingLI;\n\n        // names of elements closing the tbody element\n        private static ArrayList _htmlElementsClosingTbody;\n\n        // names of elements closing the td element\n        private static ArrayList _htmlElementsClosingTD;\n\n        // names of elements closing the tfoot element\n        private static ArrayList _htmlElementsClosingTfoot;\n\n        // names of elements closing the thead element\n        private static ArrayList _htmlElementsClosingThead;\n\n        // names of elements closing the th element\n        private static ArrayList _htmlElementsClosingTH;\n\n        // names of elements closing the tr element\n        private static ArrayList _htmlElementsClosingTR;\n\n        // html character entities hashtable\n        private static Hashtable _htmlCharacterEntities;\n\n        #endregion Private Fields\n    }\n}\n\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlToXamlConverter.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlXamlConverter.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Prototype for Html - Xaml conversion \n//\n//---------------------------------------------------------------------------\n\nusing System;\nusing System.Xml;\nusing System.Diagnostics;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Documents;\nusing System.Globalization;\r\n\r\nnamespace WpfRichText\n{\r\n    /// <summary>\n    /// HtmlToXamlConverter is a static class that takes an HTML string\n    /// and converts it into XAML\n    /// </summary>\n    public static class HtmlToXamlConverter\n    {\n        // ---------------------------------------------------------------------\n        //\n        // Internal Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Internal Methods\n\n        /// <summary>\n        /// Converts an html string into xaml string.\n        /// </summary>\n        /// <param name=\"htmlString\">\n        /// Input html which may be badly formated xml.\n        /// </param>\n        /// <param name=\"asFlowDocument\">\n        /// true indicates that we need a FlowDocument as a root element;\n        /// false means that Section or Span elements will be used\n        /// dependeing on StartFragment/EndFragment comments locations.\n        /// </param>\n        /// <returns>\n        /// Well-formed xml representing XAML equivalent for the input html string.\n        /// </returns>\n        public static string ConvertHtmlToXaml(string htmlString, bool asFlowDocument)\n        {\n            // Create well-formed Xml from Html string\n            XmlElement htmlElement = HtmlParser.ParseHtml(htmlString);\n\n            // Decide what name to use as a root\n            string rootElementName = asFlowDocument ? HtmlToXamlConverter.XamlFlowDocument : HtmlToXamlConverter.XamlSection;\n\n            // Create an XmlDocument for generated xaml\n            XmlDocument xamlTree = new XmlDocument();\n            XmlElement xamlFlowDocumentElement = xamlTree.CreateElement(null, rootElementName, _xamlNamespace);\n\n            // Extract style definitions from all STYLE elements in the document\n            CssStylesheet stylesheet = new CssStylesheet(htmlElement);\n\n            // Source context is a stack of all elements - ancestors of a parentElement\n            List<XmlElement> sourceContext = new List<XmlElement>(10);\n\n            // Clear fragment parent\n            InlineFragmentParentElement = null;\n\n            // convert root html element\n            AddBlock(xamlFlowDocumentElement, htmlElement, new Hashtable(), stylesheet, sourceContext);\n\n            // In case if the selected fragment is inline, extract it into a separate Span wrapper\n            if (!asFlowDocument)\n            {\n                xamlFlowDocumentElement = ExtractInlineFragment(xamlFlowDocumentElement);\n            }\n\n            // Return a string representing resulting Xaml\n            xamlFlowDocumentElement.SetAttribute(\"xml:space\", \"preserve\");\n            string xaml = xamlFlowDocumentElement.OuterXml;\n\n            return xaml;\n        }\n\n        /// <summary>\n        /// Returns a value for an attribute by its name (ignoring casing)\n        /// </summary>\n        /// <param name=\"element\">\n        /// XmlElement in which we are trying to find the specified attribute\n        /// </param>\n        /// <param name=\"attributeName\">\n        /// String representing the attribute name to be searched for\n        /// </param>\n        /// <returns></returns>\n        internal static string GetAttribute(XmlElement element, string attributeName)\n        {\n\t\t\tif (!String.IsNullOrEmpty(attributeName) && element != null)\n\t\t\t{\n\t\t\t\tattributeName = attributeName.ToLower(CultureInfo.InvariantCulture);\n\n\t\t\t\tforeach (XmlAttribute item in element.Attributes)\n\t\t\t\t\tif (item.Name.ToLower(CultureInfo.InvariantCulture) == attributeName)\n\t\t\t\t\t\treturn item.Value;\n\n\t\t\t\t//for (int i = 0; i < element.Attributes.Count; i++)\n\t\t\t\t//{\n\t\t\t\t//\tif (element.Attributes[i].Name.ToLower(CultureInfo.InvariantCulture) == attributeName)\n\t\t\t\t//\t{\n\t\t\t\t//\t\treturn element.Attributes[i].Value;\n\t\t\t\t//\t}\n\t\t\t\t//}\n\t\t\t}\n\n            return null;\n        }\n\n        /// <summary>\n        /// Returns string extracted from quotation marks\n        /// </summary>\n        /// <param name=\"value\">\n        /// String representing value enclosed in quotation marks\n        /// </param>\n        internal static string UnQuote(string value)\n        {\n            if (value.StartsWith(\"\\\"\", StringComparison.OrdinalIgnoreCase) && value.EndsWith(\"\\\"\", StringComparison.OrdinalIgnoreCase) || value.StartsWith(\"'\", StringComparison.OrdinalIgnoreCase) && value.EndsWith(\"'\", StringComparison.OrdinalIgnoreCase))\n            {\n                value = value.Substring(1, value.Length - 2).Trim();\n            }\n            return value;\n        }\n\n        #endregion Internal Methods\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Methods\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Methods\n\n        /// <summary>\n        /// Analyzes the given htmlElement expecting it to be converted\n        /// into some of xaml Block elements and adds the converted block\n        /// to the children collection of xamlParentElement.\n        /// \n        /// Analyzes the given XmlElement htmlElement, recognizes it as some HTML element\n        /// and adds it as a child to a xamlParentElement.\n        /// In some cases several following siblings of the given htmlElement\n        /// will be consumed too (e.g. LIs encountered without wrapping UL/OL, \n        /// which must be collected together and wrapped into one implicit List element).\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// Parent xaml element, to which new converted element will be added\n        /// </param>\n\t\t/// <param name=\"htmlNode\">\n        /// Source html element subject to convert to xaml.\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// Properties inherited from an outer context.\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        /// <returns>\n        /// Last processed html node. Normally it should be the same htmlElement\n        /// as was passed as a paramater, but in some irregular cases\n        /// it could one of its following siblings.\n        /// The caller must use this node to get to next sibling from it.\n        /// </returns>\n        private static XmlNode AddBlock(XmlElement xamlParentElement, XmlNode htmlNode, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            if (htmlNode is XmlComment)\n            {\n                DefineInlineFragmentParent((XmlComment)htmlNode, /*xamlParentElement:*/null);\n            }\n            else if (htmlNode is XmlText)\n            {\n                htmlNode = AddImplicitParagraph(xamlParentElement, htmlNode, inheritedProperties, stylesheet, sourceContext);\n            }\n            else if (htmlNode is XmlElement)\n            {\n                // Identify element name\n                XmlElement htmlElement = (XmlElement)htmlNode;\n\n                string htmlElementName = htmlElement.LocalName; // Keep the name case-sensitive to check xml names\n                string htmlElementNamespace = htmlElement.NamespaceURI;\n\n                if (htmlElementNamespace != HtmlParser.XhtmlNamespace)\n                {\n                    // Non-html element. skip it\n                    // Isn't it too agressive? What if this is just an error in html tag name?\n                    // TODO: Consider skipping just a wparrer in recursing into the element tree,\n                    // which may produce some garbage though coming from xml fragments.\n                    return htmlElement;\n                }\n\n                // Put source element to the stack\n                sourceContext.Add(htmlElement);\n\n                // Convert the name to lowercase, because html elements are case-insensitive\n\t\t\t\thtmlElementName = htmlElementName.ToLower(CultureInfo.InvariantCulture);\n\n                // Switch to an appropriate kind of processing depending on html element name\n                switch (htmlElementName)\n                {\n                    // Sections:\n                    case \"html\":\n                    case \"body\":\n                    case \"div\":\n                    case \"form\": // not a block according to xhtml spec\n                    case \"pre\": // Renders text in a fixed-width font\n                    case \"blockquote\":\n                    case \"caption\":\n                    case \"center\":\n                    case \"cite\":\n                        AddSection(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n\n                    // Paragraphs:\n                    case \"p\":\n                    case \"h1\":\n                    case \"h2\":\n                    case \"h3\":\n                    case \"h4\":\n                    case \"h5\":\n                    case \"h6\":\n                    case \"nsrtitle\":\n                    case \"textarea\":\n                    case \"dd\": // ???\n                    case \"dl\": // ???\n                    case \"dt\": // ???\n                    case \"tt\": // ???\n                        AddParagraph(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n\n                    case \"ol\":\n                    case \"ul\":\n                    case \"dir\": //  treat as UL element\n                    case \"menu\": //  treat as UL element\n                        // List element conversion\n                        AddList(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n                    case \"li\":\n                        // LI outside of OL/UL\n                        // Collect all sibling LIs, wrap them into a List and then proceed with the element following the last of LIs\n                        htmlNode = AddOrphanListItems(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n\n                    case \"img\":\n                        // TODO: Add image processing\n                        AddImage(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n\n                    case \"table\":\n                        // hand off to table parsing function which will perform special table syntax checks\n                        AddTable(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n\n                    case \"tbody\":\n                    case \"tfoot\":\n                    case \"thead\":\n                    case \"tr\":\n                    case \"td\":\n                    case \"th\":\n                        // Table stuff without table wrapper\n                        // TODO: add special-case processing here for elements that should be within tables when the\n                        // parent element is NOT a table. If the parent element is a table they can be processed normally.\n                        // we need to compare against the parent element here, we can't just break on a switch\n                        goto default; // Thus we will skip this element as unknown, but still recurse into it.\n\n                    case \"style\": // We already pre-processed all style elements. Ignore it now\n                    case \"meta\":\n                    case \"head\":\n                    case \"title\":\n                    case \"script\":\n                        // Ignore these elements\n                        break;\n\n                    default:\n                        // Wrap a sequence of inlines into an implicit paragraph\n                        htmlNode = AddImplicitParagraph(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n                }\n\n                // Remove the element from the stack\n                Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlElement);\n                sourceContext.RemoveAt(sourceContext.Count - 1);\n            }\n\n            // Return last processed node\n            return htmlNode;\n        }\n\n        // .............................................................\n        //\n        // Line Breaks\n        //\n        // .............................................................\n\n        private static void AddBreak(XmlElement xamlParentElement, string htmlElementName)\n        {\n            // Create new xaml element corresponding to this html element\n            XmlElement xamlLineBreak = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.Xaml_LineBreak, _xamlNamespace);\n            xamlParentElement.AppendChild(xamlLineBreak);\n            if (htmlElementName == \"hr\")\n            {\n                XmlText xamlHorizontalLine = xamlParentElement.OwnerDocument.CreateTextNode(\"----------------------\");\n                xamlParentElement.AppendChild(xamlHorizontalLine);\n                xamlLineBreak = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.Xaml_LineBreak, _xamlNamespace);\n                xamlParentElement.AppendChild(xamlLineBreak);\n            }\n        }\n\n        // .............................................................\n        //\n        // Text Flow Elements\n        //\n        // .............................................................\n\n        /// <summary>\n        /// Generates Section or Paragraph element from DIV depending whether it contains any block elements or not\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// XmlElement representing Xaml parent to which the converted element should be added\n        /// </param>\n        /// <param name=\"htmlElement\">\n        /// XmlElement representing Html element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// properties inherited from parent context\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\">\n        /// true indicates that a content added by this call contains at least one block element\n        /// </param>\n        private static void AddSection(XmlElement xamlParentElement, XmlElement htmlElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Analyze the content of htmlElement to decide what xaml element to choose - Section or Paragraph.\n            // If this Div has at least one block child then we need to use Section, otherwise use Paragraph\n            bool htmlElementContainsBlocks = false;\n            for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n            {\n                if (htmlChildNode is XmlElement)\n                {\n\t\t\t\t\tstring htmlChildName = ((XmlElement)htmlChildNode).LocalName.ToLower(CultureInfo.InvariantCulture);\n                    if (HtmlSchema.IsBlockElement(htmlChildName))\n                    {\n                        htmlElementContainsBlocks = true;\n                        break;\n                    }\n                }\n            }\n\n            if (!htmlElementContainsBlocks)\n            {\n                // The Div does not contain any block elements, so we can treat it as a Paragraph\n                AddParagraph(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n            }\n            else\n            {\n                // The Div has some nested blocks, so we treat it as a Section\n\n                // Create currentProperties as a compilation of local and inheritedProperties, set localProperties\n                Hashtable localProperties;\n                Hashtable currentProperties = GetElementProperties(htmlElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n                // Create a XAML element corresponding to this html element\n                XmlElement xamlElement = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.XamlSection, _xamlNamespace);\n                ApplyLocalProperties(xamlElement, localProperties, /*isBlock:*/true);\n\n                // Decide whether we can unwrap this element as not having any formatting significance.\n                if (!xamlElement.HasAttributes)\n                {\n                    // This elements is a group of block elements whitout any additional formatting.\n                    // We can add blocks directly to xamlParentElement and avoid\n                    // creating unnecessary Sections nesting.\n                    xamlElement = xamlParentElement;\n                }\n\n                // Recurse into element subtree\n                for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode != null ? htmlChildNode.NextSibling : null)\n                {\n                    htmlChildNode = AddBlock(xamlElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n                }\n\n                // Add the new element to the parent.\n                if (xamlElement != xamlParentElement)\n                {\n                    xamlParentElement.AppendChild(xamlElement);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Generates Paragraph element from P, H1-H7, Center etc.\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// XmlElement representing Xaml parent to which the converted element should be added\n        /// </param>\n        /// <param name=\"htmlElement\">\n        /// XmlElement representing Html element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// properties inherited from parent context\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\">\n        /// true indicates that a content added by this call contains at least one block element\n        /// </param>\n        private static void AddParagraph(XmlElement xamlParentElement, XmlElement htmlElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Create currentProperties as a compilation of local and inheritedProperties, set localProperties\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            // Create a XAML element corresponding to this html element\n            XmlElement xamlElement = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.Xaml_Paragraph, _xamlNamespace);\n            ApplyLocalProperties(xamlElement, localProperties, /*isBlock:*/true);\n\n            // Recurse into element subtree\n            for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n            {\n                AddInline(xamlElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n            }\n\n            // Add the new element to the parent.\n            xamlParentElement.AppendChild(xamlElement);\n        }\n\n        /// <summary>\n        /// Creates a Paragraph element and adds all nodes starting from htmlNode\n        /// converted to appropriate Inlines.\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// XmlElement representing Xaml parent to which the converted element should be added\n        /// </param>\n        /// <param name=\"htmlNode\">\n        /// XmlNode starting a collection of implicitly wrapped inlines.\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// properties inherited from parent context\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\">\n        /// true indicates that a content added by this call contains at least one block element\n        /// </param>\n        /// <returns>\n        /// The last htmlNode added to the implicit paragraph\n        /// </returns>\n        private static XmlNode AddImplicitParagraph(XmlElement xamlParentElement, XmlNode htmlNode, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Collect all non-block elements and wrap them into implicit Paragraph\n            XmlElement xamlParagraph = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.Xaml_Paragraph, _xamlNamespace);\n            XmlNode lastNodeProcessed = null;\n            while (htmlNode != null)\n            {\n                if (htmlNode is XmlComment)\n                {\n                    DefineInlineFragmentParent((XmlComment)htmlNode, /*xamlParentElement:*/null);\n                }\n                else if (htmlNode is XmlText)\n                {\n                    if (htmlNode.Value.Trim().Length > 0)\n                    {\n                        AddTextRun(xamlParagraph, htmlNode.Value);\n                    }\n                }\n                else if (htmlNode is XmlElement)\n                {\n\t\t\t\t\tstring htmlChildName = ((XmlElement)htmlNode).LocalName.ToLower(CultureInfo.InvariantCulture);\n                    if (HtmlSchema.IsBlockElement(htmlChildName))\n                    {\n                        // The sequence of non-blocked inlines ended. Stop implicit loop here.\n                        break;\n                    }\n                    else\n                    {\n                        AddInline(xamlParagraph, (XmlElement)htmlNode, inheritedProperties, stylesheet, sourceContext);\n                    }\n                }\n\n                // Store last processed node to return it at the end\n                lastNodeProcessed = htmlNode;\n                htmlNode = htmlNode.NextSibling;\n            }\n\n            // Add the Paragraph to the parent\n            // If only whitespaces and commens have been encountered,\n            // then we have nothing to add in implicit paragraph; forget it.\n            if (xamlParagraph.FirstChild != null)\n            {\n                xamlParentElement.AppendChild(xamlParagraph);\n            }\n\n            // Need to return last processed node\n            return lastNodeProcessed;\n        }\n\n        // .............................................................\n        //\n        // Inline Elements\n        //\n        // .............................................................\n\n        private static void AddInline(XmlElement xamlParentElement, XmlNode htmlNode, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            if (htmlNode is XmlComment)\n            {\n                DefineInlineFragmentParent((XmlComment)htmlNode, xamlParentElement);\n            }\n            else if (htmlNode is XmlText)\n            {\n                AddTextRun(xamlParentElement, htmlNode.Value);\n            }\n            else if (htmlNode is XmlElement)\n            {\n                XmlElement htmlElement = (XmlElement)htmlNode;\n\n                // Check whether this is an html element\n                if (htmlElement.NamespaceURI != HtmlParser.XhtmlNamespace)\n                {\n                    return; // Skip non-html elements\n                }\n\n                // Identify element name\n\t\t\t\tstring htmlElementName = htmlElement.LocalName.ToLower(CultureInfo.InvariantCulture);\n\n                // Put source element to the stack\n                sourceContext.Add(htmlElement);\n\n                switch (htmlElementName)\n                {\n                    case \"a\":\n                        AddHyperlink(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n                    case \"img\":\n                        AddImage(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        break;\n                    case \"br\":\n                    case \"hr\":\n                        AddBreak(xamlParentElement, htmlElementName);\n                        break;\n                    default:\n                        if (HtmlSchema.IsInlineElement(htmlElementName) || HtmlSchema.IsBlockElement(htmlElementName))\n                        {\n                            // Note: actually we do not expect block elements here,\n                            // but if it happens to be here, we will treat it as a Span.\n\n                            AddSpanOrRun(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n                        }\n                        break;\n                }\n                // Ignore all other elements non-(block/inline/image)\n\n                // Remove the element from the stack\n                Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlElement);\n                sourceContext.RemoveAt(sourceContext.Count - 1);\n            }\n        }\n\n        private static void AddSpanOrRun(XmlElement xamlParentElement, XmlElement htmlElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Decide what XAML element to use for this inline element.\n            // Check whether it contains any nested inlines\n            bool elementHasChildren = false;\n            for (XmlNode htmlNode = htmlElement.FirstChild; htmlNode != null; htmlNode = htmlNode.NextSibling)\n            {\n                if (htmlNode is XmlElement)\n                {\n\t\t\t\t\tstring htmlChildName = ((XmlElement)htmlNode).LocalName.ToLower(CultureInfo.InvariantCulture);\n                    if (HtmlSchema.IsInlineElement(htmlChildName) || HtmlSchema.IsBlockElement(htmlChildName) || \n                        htmlChildName == \"img\" || htmlChildName == \"br\" || htmlChildName == \"hr\")\n                    {\n                        elementHasChildren = true;\n                        break;\n                    }\n                }\n            }\n\n            string xamlElementName = elementHasChildren ? HtmlToXamlConverter.XamlSpan : HtmlToXamlConverter.XamlRun;\n\n            // Create currentProperties as a compilation of local and inheritedProperties, set localProperties\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            // Create a XAML element corresponding to this html element\n            XmlElement xamlElement = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/xamlElementName, _xamlNamespace);\n            ApplyLocalProperties(xamlElement, localProperties, /*isBlock:*/false);\n\n            // Recurse into element subtree\n            for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n            {\n                AddInline(xamlElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n            }\n\n            // Add the new element to the parent.\n            xamlParentElement.AppendChild(xamlElement);\n        }\n\n        // Adds a text run to a xaml tree\n        private static void AddTextRun(XmlElement xamlElement, string textData)\n        {\n            // Remove control characters\n            for (int i = 0; i < textData.Length; i++)\n            {\n                if (Char.IsControl(textData[i]))\n                {\n                    textData = textData.Remove(i--, 1);  // decrement i to compensate for character removal\n                }\n            }\n\n            // Replace No-Breaks by spaces (160 is a code of &nbsp; entity in html)\n            //  This is a work around the bug in Avalon which does not render nbsp.\n            textData = textData.Replace((char)160, ' ');\n\n            if (textData.Length > 0)\n            {\n                xamlElement.AppendChild(xamlElement.OwnerDocument.CreateTextNode(textData));\n            }\n        }\n\n        private static void AddHyperlink(XmlElement xamlParentElement, XmlElement htmlElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Convert href attribute into NavigateUri and TargetName\n            string href = GetAttribute(htmlElement, \"href\");\n            if (href == null)\n            {\n                // When href attribute is missing - ignore the hyperlink\n                AddSpanOrRun(xamlParentElement, htmlElement, inheritedProperties, stylesheet, sourceContext);\n            }\n            else\n            {\n                // Create currentProperties as a compilation of local and inheritedProperties, set localProperties\n                Hashtable localProperties;\n                Hashtable currentProperties = GetElementProperties(htmlElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n                // Create a XAML element corresponding to this html element\n                XmlElement xamlElement = xamlParentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.XamlHyperlink, _xamlNamespace);\n                ApplyLocalProperties(xamlElement, localProperties, /*isBlock:*/false);\n\n                string[] hrefParts = href.Split(new char[] { '#' });\n                if (hrefParts.Length > 0 && hrefParts[0].Trim().Length > 0)\n                {\n                    xamlElement.SetAttribute(HtmlToXamlConverter.XamlHyperlinkNavigateUri, hrefParts[0].Trim());\n                }\n                if (hrefParts.Length == 2 && hrefParts[1].Trim().Length > 0)\n                {\n                    xamlElement.SetAttribute(HtmlToXamlConverter.XamlHyperlinkTargetName, hrefParts[1].Trim());\n                }\n\n                // Recurse into element subtree\n                for (XmlNode htmlChildNode = htmlElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n                {\n                    AddInline(xamlElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n                }\n\n                // Add the new element to the parent.\n                xamlParentElement.AppendChild(xamlElement);\n            }\n        }\n\n        // Stores a parent xaml element for the case when selected fragment is inline.\n        private static XmlElement InlineFragmentParentElement;\n\n        // Called when html comment is encountered to store a parent element\n        // for the case when the fragment is inline - to extract it to a separate\n        // Span wrapper after the conversion.\n        private static void DefineInlineFragmentParent(XmlComment htmlComment, XmlElement xamlParentElement)\n        {\n            if (htmlComment.Value == \"StartFragment\")\n            {\n                InlineFragmentParentElement = xamlParentElement;\n            }\n            else if (htmlComment.Value == \"EndFragment\")\n            {\n                if (InlineFragmentParentElement == null && xamlParentElement != null)\n                {\n                    // Normally this cannot happen if comments produced by correct copying code\n                    // in Word or IE, but when it is produced manually then fragment boundary\n                    // markers can be inconsistent. In this case StartFragment takes precedence,\n                    // but if it is not set, then we get the value from EndFragment marker.\n                    InlineFragmentParentElement = xamlParentElement;\n                }\n            }\n        }\n\n        // Extracts a content of an element stored as InlineFragmentParentElement\n        // into a separate Span wrapper.\n        // Note: when selected content does not cross paragraph boundaries,\n        // the fragment is marked within\n        private static XmlElement ExtractInlineFragment(XmlElement xamlFlowDocumentElement)\n        {\n            if (InlineFragmentParentElement != null)\n            {\n                if (InlineFragmentParentElement.LocalName == HtmlToXamlConverter.XamlSpan)\n                {\n                    xamlFlowDocumentElement = InlineFragmentParentElement;\n                }\n                else\n                {\n                    xamlFlowDocumentElement = xamlFlowDocumentElement.OwnerDocument.CreateElement(/*prefix:*/null, /*localName:*/HtmlToXamlConverter.XamlSpan, _xamlNamespace);\n                    while (InlineFragmentParentElement.FirstChild != null)\n                    {\n                        XmlNode copyNode = InlineFragmentParentElement.FirstChild;\n                        InlineFragmentParentElement.RemoveChild(copyNode);\n                        xamlFlowDocumentElement.AppendChild(copyNode);\n                    }\n                }\n            }\n\n            return xamlFlowDocumentElement;\n        }\n\n        // .............................................................\n        //\n        // Images\n        //\n        // .............................................................\n\n        private static void AddImage(XmlElement xamlParentElement, XmlElement htmlElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            //  Implement images\n        }\n\n        // .............................................................\n        //\n        // Lists\n        //\n        // .............................................................\n\n        /// <summary>\n        /// Converts Html ul or ol element into Xaml list element. During conversion if the ul/ol element has any children \n        /// that are not li elements, they are ignored and not added to the list element\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// XmlElement representing Xaml parent to which the converted element should be added\n        /// </param>\n        /// <param name=\"htmlListElement\">\n        /// XmlElement representing Html ul/ol element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// properties inherited from parent context\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        private static void AddList(XmlElement xamlParentElement, XmlElement htmlListElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n\t\t\tstring htmlListElementName = htmlListElement.LocalName.ToLower(CultureInfo.InvariantCulture);\n\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlListElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            // Create Xaml List element\n            XmlElement xamlListElement = xamlParentElement.OwnerDocument.CreateElement(null, XamlList, _xamlNamespace);\n\n            // Set default list markers\n            if (htmlListElementName == \"ol\")\n            {\n                // Ordered list\n                xamlListElement.SetAttribute(HtmlToXamlConverter.XamlListMarkerStyle, Xaml_List_MarkerStyle_Decimal);\n            }\n            else\n            {\n                // Unordered list - all elements other than OL treated as unordered lists\n                xamlListElement.SetAttribute(HtmlToXamlConverter.XamlListMarkerStyle, Xaml_List_MarkerStyle_Disc);\n            }\n\n            // Apply local properties to list to set marker attribute if specified\n            // TODO: Should we have separate list attribute processing function?\n            ApplyLocalProperties(xamlListElement, localProperties, /*isBlock:*/true);\n\n            // Recurse into list subtree\n            for (XmlNode htmlChildNode = htmlListElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n            {\n\t\t\t\tif (htmlChildNode is XmlElement && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"li\")\n                {\n                    sourceContext.Add((XmlElement)htmlChildNode);\n                    AddListItem(xamlListElement, (XmlElement)htmlChildNode, currentProperties, stylesheet, sourceContext);\n                    Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlChildNode);\n                    sourceContext.RemoveAt(sourceContext.Count - 1);\n                }\n                else\n                {\n                    // Not an li element. Add it to previous ListBoxItem\n                    //  We need to append the content to the end\n                    // of a previous list item.\n                }\n            }\n\n            // Add the List element to xaml tree - if it is not empty\n            if (xamlListElement.HasChildNodes)\n            {\n                xamlParentElement.AppendChild(xamlListElement);\n            }\n        }\n\n        /// <summary>\n        /// If li items are found without a parent ul/ol element in Html string, creates xamlListElement as their parent and adds\n        /// them to it. If the previously added node to the same xamlParentElement was a List, adds the elements to that list.\n        /// Otherwise, we create a new xamlListElement and add them to it. Elements are added as long as li elements appear sequentially.\n        /// The first non-li or text node stops the addition.\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// Parent element for the list\n        /// </param>\n        /// <param name=\"htmlLIElement\">\n        /// Start Html li element without parent list\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// Properties inherited from parent context\n        /// </param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        /// <returns>\n        /// XmlNode representing the first non-li node in the input after one or more li's have been processed.\n        /// </returns>\n        private static XmlElement AddOrphanListItems(XmlElement xamlParentElement, XmlElement htmlLIElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n\t\t\tDebug.Assert(htmlLIElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"li\");\n\n            XmlElement lastProcessedListItemElement = null;\n\n            // Find out the last element attached to the xamlParentElement, which is the previous sibling of this node\n            XmlNode xamlListItemElementPreviousSibling = xamlParentElement.LastChild;\n            XmlElement xamlListElement;\n            if (xamlListItemElementPreviousSibling != null && xamlListItemElementPreviousSibling.LocalName == XamlList)\n            {\n                // Previously added Xaml element was a list. We will add the new li to it\n                xamlListElement = (XmlElement)xamlListItemElementPreviousSibling;\n            }\n            else\n            {\n                // No list element near. Create our own.\n                xamlListElement = xamlParentElement.OwnerDocument.CreateElement(null, XamlList, _xamlNamespace);\n                xamlParentElement.AppendChild(xamlListElement);\n            }\n\n            XmlNode htmlChildNode = htmlLIElement;\n\t\t\tstring htmlChildNodeName = htmlChildNode == null ? null : htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture);\n\n            //  Current element properties missed here.\n            //currentProperties = GetElementProperties(htmlLIElement, inheritedProperties, out localProperties, stylesheet);\n\n            // Add li elements to the parent xamlListElement we created as long as they appear sequentially\n            // Use properties inherited from xamlParentElement for context \n            while (htmlChildNode != null && htmlChildNodeName == \"li\")\n            {\n                AddListItem(xamlListElement, (XmlElement)htmlChildNode, inheritedProperties, stylesheet, sourceContext);\n                lastProcessedListItemElement = (XmlElement)htmlChildNode;\n                htmlChildNode = htmlChildNode.NextSibling;\n\t\t\t\thtmlChildNodeName = htmlChildNode == null ? null : htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture);\n            }\n\n            return lastProcessedListItemElement;\n        }\n\n        /// <summary>\n        /// Converts htmlLIElement into Xaml ListItem element, and appends it to the parent xamlListElement\n        /// </summary>\n        /// <param name=\"xamlListElement\">\n        /// XmlElement representing Xaml List element to which the converted td/th should be added\n        /// </param>\n        /// <param name=\"htmlLIElement\">\n        /// XmlElement representing Html li element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// Properties inherited from parent context\n        /// </param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n\t\tprivate static void AddListItem(XmlElement xamlListElement, XmlElement htmlLIElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Parameter validation\n            Debug.Assert(xamlListElement != null);\n            Debug.Assert(xamlListElement.LocalName == XamlList);\n            Debug.Assert(htmlLIElement != null);\n\t\t\tDebug.Assert(htmlLIElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"li\");\n            Debug.Assert(inheritedProperties != null);\n\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlLIElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            XmlElement xamlListItemElement = xamlListElement.OwnerDocument.CreateElement(null, Xaml_ListItem, _xamlNamespace);\n\n            // TODO: process local properties for li element\n\n            // Process children of the ListItem\n            for (XmlNode htmlChildNode = htmlLIElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode != null ? htmlChildNode.NextSibling : null)\n            {\n                htmlChildNode = AddBlock(xamlListItemElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n            }\n\n            // Add resulting ListBoxItem to a xaml parent\n            xamlListElement.AppendChild(xamlListItemElement);\n        }\n\n        // .............................................................\n        //\n        // Tables\n        //\n        // .............................................................\n\n        /// <summary>\n        /// Converts htmlTableElement to a Xaml Table element. Adds tbody elements if they are missing so\n        /// that a resulting Xaml Table element is properly formed.\n        /// </summary>\n        /// <param name=\"xamlParentElement\">\n        /// Parent xaml element to which a converted table must be added.\n        /// </param>\n        /// <param name=\"htmlTableElement\">\n        /// XmlElement reprsenting the Html table element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// Hashtable representing properties inherited from parent context. \n        /// </param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        private static void AddTable(XmlElement xamlParentElement, XmlElement htmlTableElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Parameter validation\n\t\t\tDebug.Assert(htmlTableElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"table\");\n            Debug.Assert(xamlParentElement != null);\n            Debug.Assert(inheritedProperties != null);\n\n            // Create current properties to be used by children as inherited properties, set local properties\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlTableElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            // TODO: process localProperties for tables to override defaults, decide cell spacing defaults\n\n            // Check if the table contains only one cell - we want to take only its content\n            XmlElement singleCell = GetCellFromSingleCellTable(htmlTableElement);\n\n            if (singleCell != null)\n            {\n                //  Need to push skipped table elements onto sourceContext\n                sourceContext.Add(singleCell);\n\n                // Add the cell's content directly to parent\n                for (XmlNode htmlChildNode = singleCell.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode != null ? htmlChildNode.NextSibling : null)\n                {\n                    htmlChildNode = AddBlock(xamlParentElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n                }\n\n                Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == singleCell);\n                sourceContext.RemoveAt(sourceContext.Count - 1);\n            }\n            else\n            {\n                // Create xamlTableElement\n                XmlElement xamlTableElement = xamlParentElement.OwnerDocument.CreateElement(null, Xaml_Table, _xamlNamespace);\n\n                // Analyze table structure for column widths and rowspan attributes\n                ArrayList columnStarts = AnalyzeTableStructure(htmlTableElement, stylesheet);\n\n                // Process COLGROUP & COL elements\n                AddColumnInformation(htmlTableElement, xamlTableElement, columnStarts, currentProperties, stylesheet, sourceContext);\n\n                // Process table body - TBODY and TR elements\n                XmlNode htmlChildNode = htmlTableElement.FirstChild;\n\n                while (htmlChildNode != null)\n                {\n\t\t\t\t\tstring htmlChildName = htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture);\n\n                    // Process the element\n                    if (htmlChildName == \"tbody\" || htmlChildName == \"thead\" || htmlChildName == \"tfoot\")\n                    {\n                        //  Add more special processing for TableHeader and TableFooter\n                        XmlElement xamlTableBodyElement = xamlTableElement.OwnerDocument.CreateElement(null, Xaml_TableRowGroup, _xamlNamespace);\n                        xamlTableElement.AppendChild(xamlTableBodyElement);\n\n                        sourceContext.Add((XmlElement)htmlChildNode);\n\n                        // Get properties of Html tbody element\n                        Hashtable tbodyElementLocalProperties;\n                        Hashtable tbodyElementCurrentProperties = GetElementProperties((XmlElement)htmlChildNode, currentProperties, out tbodyElementLocalProperties, stylesheet, sourceContext);\n                        // TODO: apply local properties for tbody\n\n                        // Process children of htmlChildNode, which is tbody, for tr elements\n                        AddTableRowsToTableBody(xamlTableBodyElement, htmlChildNode.FirstChild, tbodyElementCurrentProperties, columnStarts, stylesheet, sourceContext);\n                        if (xamlTableBodyElement.HasChildNodes)\n                        {\n                            xamlTableElement.AppendChild(xamlTableBodyElement);\n                            // else: if there is no TRs in this TBody, we simply ignore it\n                        }\n\n                        Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlChildNode);\n                        sourceContext.RemoveAt(sourceContext.Count - 1);\n\n                        htmlChildNode = htmlChildNode.NextSibling;\n                    }\n                    else if (htmlChildName == \"tr\")\n                    {\n                        // Tbody is not present, but tr element is present. Tr is wrapped in tbody\n                        XmlElement xamlTableBodyElement = xamlTableElement.OwnerDocument.CreateElement(null, Xaml_TableRowGroup, _xamlNamespace);\n\n                        // We use currentProperties of xamlTableElement when adding rows since the tbody element is artificially created and has \n                        // no properties of its own\n\n                        htmlChildNode = AddTableRowsToTableBody(xamlTableBodyElement, htmlChildNode, currentProperties, columnStarts, stylesheet, sourceContext);\n                        if (xamlTableBodyElement.HasChildNodes)\n                        {\n                            xamlTableElement.AppendChild(xamlTableBodyElement);\n                        }\n                    }\n                    else\n                    {\n                        // Element is not tbody or tr. Ignore it.\n                        // TODO: add processing for thead, tfoot elements and recovery for td elements\n                        htmlChildNode = htmlChildNode.NextSibling;\n                    }\n                }\n\n                if (xamlTableElement.HasChildNodes)\n                {\n                    xamlParentElement.AppendChild(xamlTableElement);\n                }\n            }\n        }\n\n        private static XmlElement GetCellFromSingleCellTable(XmlElement htmlTableElement)\n        {\n            XmlElement singleCell = null;\n\n            for (XmlNode tableChild = htmlTableElement.FirstChild; tableChild != null; tableChild = tableChild.NextSibling)\n            {\n\t\t\t\tstring elementName = tableChild.LocalName.ToLower(CultureInfo.InvariantCulture);\n                if (elementName == \"tbody\" || elementName == \"thead\" || elementName == \"tfoot\")\n                {\n                    if (singleCell != null)\n                    {\n                        return null;\n                    }\n                    for (XmlNode tbodyChild = tableChild.FirstChild; tbodyChild != null; tbodyChild = tbodyChild.NextSibling)\n                    {\n\t\t\t\t\t\tif (tbodyChild.LocalName.ToLower(CultureInfo.InvariantCulture) == \"tr\")\n                        {\n                            if (singleCell != null)\n                            {\n                                return null;\n                            }\n                            for (XmlNode trChild = tbodyChild.FirstChild; trChild != null; trChild = trChild.NextSibling)\n                            {\n\t\t\t\t\t\t\t\tstring cellName = trChild.LocalName.ToLower(CultureInfo.InvariantCulture);\n                                if (cellName == \"td\" || cellName == \"th\")\n                                {\n                                    if (singleCell != null)\n                                    {\n                                        return null;\n                                    }\n                                    singleCell = (XmlElement)trChild;\n                                }\n                            }\n                        }\n                    }\n                }\n\t\t\t\telse if (tableChild.LocalName.ToLower(CultureInfo.InvariantCulture) == \"tr\")\n                {\n                    if (singleCell != null)\n                    {\n                        return null;\n                    }\n                    for (XmlNode trChild = tableChild.FirstChild; trChild != null; trChild = trChild.NextSibling)\n                    {\n\t\t\t\t\t\tstring cellName = trChild.LocalName.ToLower(CultureInfo.InvariantCulture);\n                        if (cellName == \"td\" || cellName == \"th\")\n                        {\n                            if (singleCell != null)\n                            {\n                                return null;\n                            }\n                            singleCell = (XmlElement)trChild;\n                        }\n                    }\n                }\n            }\n\n            return singleCell;\n        }\n\n        /// <summary>\n        /// Processes the information about table columns - COLGROUP and COL html elements.\n        /// </summary>\n        /// <param name=\"htmlTableElement\">\n        /// XmlElement representing a source html table.\n        /// </param>\n        /// <param name=\"xamlTableElement\">\n        /// XmlElement repesenting a resulting xaml table.\n        /// </param>\n        /// <param name=\"columnStartsAllRows\">\n        /// Array of doubles - column start coordinates.\n        /// Can be null, which means that column size information is not available\n        /// and we must use source colgroup/col information.\n        /// In case wneh it's not null, we will ignore source colgroup/col information.\n        /// </param>\n        /// <param name=\"currentProperties\"></param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        private static void AddColumnInformation(XmlElement htmlTableElement, XmlElement xamlTableElement, ArrayList columnStartsAllRows, Hashtable currentProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Add column information\n            if (columnStartsAllRows != null)\n            {\n                // We have consistent information derived from table cells; use it\n                // The last element in columnStarts represents the end of the table\n                for (int columnIndex = 0; columnIndex < columnStartsAllRows.Count - 1; columnIndex++)\n                {\n                    XmlElement xamlColumnElement;\n\n                    xamlColumnElement = xamlTableElement.OwnerDocument.CreateElement(null, Xaml_TableColumn, _xamlNamespace);\n\t\t\t\t\txamlColumnElement.SetAttribute(Xaml_Width, ((double)columnStartsAllRows[columnIndex + 1] - (double)columnStartsAllRows[columnIndex]).ToString(CultureInfo.InvariantCulture));\n                    xamlTableElement.AppendChild(xamlColumnElement);\n                }\n            }\n            else\n            {\n                // We do not have consistent information from table cells;\n                // Translate blindly colgroups from html.                \n                for (XmlNode htmlChildNode = htmlTableElement.FirstChild; htmlChildNode != null; htmlChildNode = htmlChildNode.NextSibling)\n                {\n\t\t\t\t\tif (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"colgroup\")\n                    {\n                        // TODO: add column width information to this function as a parameter and process it\n                        AddTableColumnGroup(xamlTableElement, (XmlElement)htmlChildNode, currentProperties, stylesheet, sourceContext);\n                    }\n\t\t\t\t\telse if (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"col\")\n                    {\n                        AddTableColumn(xamlTableElement, (XmlElement)htmlChildNode, currentProperties, stylesheet, sourceContext);\n                    }\n                    else if (htmlChildNode is XmlElement)\n                    {\n                        // Some element which belongs to table body. Stop column loop.\n                        break;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Converts htmlColgroupElement into Xaml TableColumnGroup element, and appends it to the parent\n        /// xamlTableElement\n        /// </summary>\n        /// <param name=\"xamlTableElement\">\n        /// XmlElement representing Xaml Table element to which the converted column group should be added\n        /// </param>\n        /// <param name=\"htmlColgroupElement\">\n        /// XmlElement representing Html colgroup element to be converted\n\t\t/// </param>\n        /// <param name=\"inheritedProperties\">\n        /// Properties inherited from parent context\n        /// </param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        private static void AddTableColumnGroup(XmlElement xamlTableElement, XmlElement htmlColgroupElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlColgroupElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            // TODO: process local properties for colgroup\n\n            // Process children of colgroup. Colgroup may contain only col elements.\n            for (XmlNode htmlNode = htmlColgroupElement.FirstChild; htmlNode != null; htmlNode = htmlNode.NextSibling)\n            {\n\t\t\t\tif (htmlNode is XmlElement && htmlNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"col\")\n                {\n                    AddTableColumn(xamlTableElement, (XmlElement)htmlNode, currentProperties, stylesheet, sourceContext);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Converts htmlColElement into Xaml TableColumn element, and appends it to the parent\n        /// xamlTableColumnGroupElement\n        /// </summary>\n        /// <param name=\"xamlTableElement\"></param>\n        /// <param name=\"htmlColElement\">\n        /// XmlElement representing Html col element to be converted\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// properties inherited from parent context\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        private static void AddTableColumn(XmlElement xamlTableElement, XmlElement htmlColElement, Hashtable inheritedProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            Hashtable localProperties;\n            Hashtable currentProperties = GetElementProperties(htmlColElement, inheritedProperties, out localProperties, stylesheet, sourceContext);\n\n            XmlElement xamlTableColumnElement = xamlTableElement.OwnerDocument.CreateElement(null, Xaml_TableColumn, _xamlNamespace);\n\n            // TODO: process local properties for TableColumn element\n\n            // Col is an empty element, with no subtree \n            xamlTableElement.AppendChild(xamlTableColumnElement);\n        }\n\n        /// <summary>\n        /// Adds TableRow elements to xamlTableBodyElement. The rows are converted from Html tr elements that\n        /// may be the children of an Html tbody element or an Html table element with tbody missing\n        /// </summary>\n        /// <param name=\"xamlTableBodyElement\">\n        /// XmlElement representing Xaml TableRowGroup element to which the converted rows should be added\n        /// </param>\n        /// <param name=\"htmlTRStartNode\">\n        /// XmlElement representing the first tr child of the tbody element to be read\n        /// </param>\n        /// <param name=\"currentProperties\">\n        /// Hashtable representing current properties of the tbody element that are generated and applied in the\n        /// AddTable function; to be used as inheritedProperties when adding tr elements\n        /// </param>\n        /// <param name=\"columnStarts\"></param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        /// <returns>\n        /// XmlNode representing the current position of the iterator among tr elements\n        /// </returns>\n        private static XmlNode AddTableRowsToTableBody(XmlElement xamlTableBodyElement, XmlNode htmlTRStartNode, Hashtable currentProperties, ArrayList columnStarts, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Parameter validation\n            Debug.Assert(xamlTableBodyElement.LocalName == Xaml_TableRowGroup);\n            Debug.Assert(currentProperties != null);\n\n            // Initialize child node for iteratimg through children to the first tr element\n            XmlNode htmlChildNode = htmlTRStartNode;\n            ArrayList activeRowSpans = null;\n            if (columnStarts != null)\n            {\n                activeRowSpans = new ArrayList();\n                InitializeActiveRowSpans(activeRowSpans, columnStarts.Count);\n            }\n\n\t\t\twhile (htmlChildNode != null && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) != \"tbody\")\n            {\n                if (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"tr\")\n                {\n                    XmlElement xamlTableRowElement = xamlTableBodyElement.OwnerDocument.CreateElement(null, Xaml_TableRow, _xamlNamespace);\n\n                    sourceContext.Add((XmlElement)htmlChildNode);\n\n                    // Get tr element properties\n                    Hashtable trElementLocalProperties;\n                    Hashtable trElementCurrentProperties = GetElementProperties((XmlElement)htmlChildNode, currentProperties, out trElementLocalProperties, stylesheet, sourceContext);\n                    // TODO: apply local properties to tr element\n\n                    AddTableCellsToTableRow(xamlTableRowElement, htmlChildNode.FirstChild, trElementCurrentProperties, columnStarts, activeRowSpans, stylesheet, sourceContext);\n                    if (xamlTableRowElement.HasChildNodes)\n                    {\n                        xamlTableBodyElement.AppendChild(xamlTableRowElement);\n                    }\n\n                    Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlChildNode);\n                    sourceContext.RemoveAt(sourceContext.Count - 1);\n\n                    // Advance\n                    htmlChildNode = htmlChildNode.NextSibling;\n                    \n                }\n                else if (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"td\")\n                {\n                    // Tr element is not present. We create one and add td elements to it\n                    XmlElement xamlTableRowElement = xamlTableBodyElement.OwnerDocument.CreateElement(null, Xaml_TableRow, _xamlNamespace);\n                    \n                    // This is incorrect formatting and the column starts should not be set in this case\n                    Debug.Assert(columnStarts == null);\n\n                    htmlChildNode = AddTableCellsToTableRow(xamlTableRowElement, htmlChildNode, currentProperties, columnStarts, activeRowSpans, stylesheet, sourceContext);\n                    if (xamlTableRowElement.HasChildNodes)\n                    {\n                        xamlTableBodyElement.AppendChild(xamlTableRowElement);\n                    }\n                }\n                else \n                {\n                    // Not a tr or td  element. Ignore it.\n                    // TODO: consider better recovery here\n                    htmlChildNode = htmlChildNode.NextSibling;\n                }\n            }\n            return htmlChildNode;\n        }\n\n        /// <summary>\n        /// Adds TableCell elements to xamlTableRowElement.\n        /// </summary>\n        /// <param name=\"xamlTableRowElement\">\n        /// XmlElement representing Xaml TableRow element to which the converted cells should be added\n        /// </param>\n        /// <param name=\"htmlTDStartNode\">\n        /// XmlElement representing the child of tr or tbody element from which we should start adding td elements\n        /// </param>\n        /// <param name=\"currentProperties\">\n        /// properties of the current html tr element to which cells are to be added\n        /// </param>\n\t\t/// <param name=\"activeRowSpans\"></param>\n\t\t/// <param name=\"columnStarts\"></param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        /// <returns>\n        /// XmlElement representing the current position of the iterator among the children of the parent Html tbody/tr element\n        /// </returns>\n        private static XmlNode AddTableCellsToTableRow(XmlElement xamlTableRowElement, XmlNode htmlTDStartNode, Hashtable currentProperties, ArrayList columnStarts, ArrayList activeRowSpans, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // parameter validation\n            Debug.Assert(xamlTableRowElement.LocalName == Xaml_TableRow);\n            Debug.Assert(currentProperties != null);\n            if (columnStarts != null)\n            {\n                Debug.Assert(activeRowSpans.Count == columnStarts.Count);\n            }\n\n            XmlNode htmlChildNode = htmlTDStartNode;\n            double columnStart = 0;\n            double columnWidth = 0;\n            int columnIndex = 0;\n            int columnSpan = 0;\n\n            while (htmlChildNode != null && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) != \"tr\" && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) != \"tbody\" && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) != \"thead\" && htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) != \"tfoot\")\n            {\n                if (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"td\" || htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"th\")\n                {\n                    XmlElement xamlTableCellElement = xamlTableRowElement.OwnerDocument.CreateElement(null, Xaml_TableCell, _xamlNamespace);\n\n                    sourceContext.Add((XmlElement)htmlChildNode);\n\n                    Hashtable tdElementLocalProperties;\n                    Hashtable tdElementCurrentProperties = GetElementProperties((XmlElement)htmlChildNode, currentProperties, out tdElementLocalProperties, stylesheet, sourceContext);\n\n                    // TODO: determine if localProperties can be used instead of htmlChildNode in this call, and if they can,\n                    // make necessary changes and use them instead.\n                    ApplyPropertiesToTableCellElement((XmlElement)htmlChildNode, xamlTableCellElement);\n\n                    if (columnStarts != null)\n                    {\n                        Debug.Assert(columnIndex < columnStarts.Count - 1);\n                        while (columnIndex < activeRowSpans.Count && (int)activeRowSpans[columnIndex] > 0)\n                        {\n                            activeRowSpans[columnIndex] = (int)activeRowSpans[columnIndex] - 1;\n                            Debug.Assert((int)activeRowSpans[columnIndex] >= 0);\n                            columnIndex++;\n                        }\n                        Debug.Assert(columnIndex < columnStarts.Count - 1);\n                        columnStart = (double)columnStarts[columnIndex];\n                        columnWidth = GetColumnWidth((XmlElement)htmlChildNode);\n                        columnSpan = CalculateColumnSpan(columnIndex, columnWidth, columnStarts);\n                        int rowSpan = GetRowSpan((XmlElement)htmlChildNode);\n\n                        // Column cannot have no span\n                        Debug.Assert(columnSpan > 0);\n                        Debug.Assert(columnIndex + columnSpan < columnStarts.Count);\n\n                        xamlTableCellElement.SetAttribute(Xaml_TableCell_ColumnSpan, columnSpan.ToString());\n                        \n                        // Apply row span\n                        for (int spannedColumnIndex = columnIndex; spannedColumnIndex < columnIndex + columnSpan; spannedColumnIndex++)\n                        {\n                            Debug.Assert(spannedColumnIndex < activeRowSpans.Count);\n                            activeRowSpans[spannedColumnIndex] = (rowSpan - 1);\n                            Debug.Assert((int)activeRowSpans[spannedColumnIndex] >= 0);\n                        }\n\n                        columnIndex = columnIndex + columnSpan;\n                    }\n\n                    AddDataToTableCell(xamlTableCellElement, htmlChildNode.FirstChild, tdElementCurrentProperties, stylesheet, sourceContext);\n                    if (xamlTableCellElement.HasChildNodes)\n                    {\n                        xamlTableRowElement.AppendChild(xamlTableCellElement);\n                    }\n\n                    Debug.Assert(sourceContext.Count > 0 && sourceContext[sourceContext.Count - 1] == htmlChildNode);\n                    sourceContext.RemoveAt(sourceContext.Count - 1);\n\n                    htmlChildNode = htmlChildNode.NextSibling;\n                }\n                else\n                {\n                    // Not td element. Ignore it.\n                    // TODO: Consider better recovery\n                    htmlChildNode = htmlChildNode.NextSibling;\n                }\n            }\n            return htmlChildNode;\n        }\n\n        /// <summary>\n        /// adds table cell data to xamlTableCellElement\n        /// </summary>\n        /// <param name=\"xamlTableCellElement\">\n        /// XmlElement representing Xaml TableCell element to which the converted data should be added\n        /// </param>\n        /// <param name=\"htmlDataStartNode\">\n        /// XmlElement representing the start element of data to be added to xamlTableCellElement\n        /// </param>\n        /// <param name=\"currentProperties\">\n        /// Current properties for the html td/th element corresponding to xamlTableCellElement\n        /// </param>\n\t\t/// <param name=\"sourceContext\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        private static void AddDataToTableCell(XmlElement xamlTableCellElement, XmlNode htmlDataStartNode, Hashtable currentProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Parameter validation\n            Debug.Assert(xamlTableCellElement.LocalName == Xaml_TableCell);\n            Debug.Assert(currentProperties != null);\n\n            for (XmlNode htmlChildNode = htmlDataStartNode; htmlChildNode != null; htmlChildNode = htmlChildNode != null ? htmlChildNode.NextSibling : null)\n            {\n                // Process a new html element and add it to the td element\n                htmlChildNode = AddBlock(xamlTableCellElement, htmlChildNode, currentProperties, stylesheet, sourceContext);\n            }\n        }\n\n        /// <summary>\n        /// Performs a parsing pass over a table to read information about column width and rowspan attributes. This information\n        /// is used to determine the starting point of each column. \n        /// </summary>\n        /// <param name=\"htmlTableElement\">\n        /// XmlElement representing Html table whose structure is to be analyzed\n        /// </param>\n\t\t/// <param name=\"stylesheet\"></param>\n        /// <returns>\n        /// ArrayList of type double which contains the function output. If analysis is successful, this ArrayList contains\n        /// all the points which are the starting position of any column in the table, ordered from left to right.\n        /// In case if analisys was impossible we return null.\n        /// </returns>\n        private static ArrayList AnalyzeTableStructure(XmlElement htmlTableElement, CssStylesheet stylesheet)\n        {\n            // Parameter validation\n            Debug.Assert(htmlTableElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"table\");\n            if (!htmlTableElement.HasChildNodes)\n            {\n                return null;\n            }\n\n            bool columnWidthsAvailable = true;\n\n            ArrayList columnStarts = new ArrayList();\n            ArrayList activeRowSpans = new ArrayList();\n            Debug.Assert(columnStarts.Count == activeRowSpans.Count);\n\n            XmlNode htmlChildNode = htmlTableElement.FirstChild;\n            double tableWidth = 0;  // Keep track of table width which is the width of its widest row\n\n            // Analyze tbody and tr elements\n            while (htmlChildNode != null && columnWidthsAvailable)\n            {\n                Debug.Assert(columnStarts.Count == activeRowSpans.Count);\n\n                switch (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture))\n                {\n                    case \"tbody\":\n                        // Tbody element, we should analyze its children for trows\n                        double tbodyWidth = AnalyzeTbodyStructure((XmlElement)htmlChildNode, columnStarts, activeRowSpans, tableWidth, stylesheet);\n                        if (tbodyWidth > tableWidth)\n                        {\n                            // Table width must be increased to supported newly added wide row\n                            tableWidth = tbodyWidth;\n                        }\n                        else if (tbodyWidth == 0)\n                        {\n                            // Tbody analysis may return 0, probably due to unprocessable format. \n                            // We should also fail.\n                            columnWidthsAvailable = false; // interrupt the analisys\n                        }\n                        break;\n                    case \"tr\":\n                        // Table row. Analyze column structure within row directly\n                        double trWidth = AnalyzeTRStructure((XmlElement)htmlChildNode, columnStarts, activeRowSpans, tableWidth, stylesheet);\n                        if (trWidth > tableWidth)\n                        {\n                            tableWidth = trWidth;\n                        }\n                        else if (trWidth == 0)\n                        {\n                            columnWidthsAvailable = false; // interrupt the analisys\n                        }\n                        break;\n                    case \"td\":\n                        // Incorrect formatting, too deep to analyze at this level. Return null.\n                        // TODO: implement analysis at this level, possibly by creating a new tr\n                        columnWidthsAvailable = false; // interrupt the analisys\n                        break;\n                    default:\n                        // Element should not occur directly in table. Ignore it.\n                        break;\n                }\n\n                htmlChildNode = htmlChildNode.NextSibling;\n            }\n\n            if (columnWidthsAvailable)\n            {\n                // Add an item for whole table width\n                columnStarts.Add(tableWidth);\n                VerifyColumnStartsAscendingOrder(columnStarts);\n            }\n            else\n            {\n                columnStarts = null;\n            }\n\n            return columnStarts;\n        }\n\n        /// <summary>\n        /// Performs a parsing pass over a tbody to read information about column width and rowspan attributes. Information read about width\n        /// attributes is stored in the reference ArrayList parameter columnStarts, which contains a list of all starting\n        /// positions of all columns in the table, ordered from left to right. Row spans are taken into consideration when \n        /// computing column starts\n        /// </summary>\n        /// <param name=\"htmlTbodyElement\">\n        /// XmlElement representing Html tbody whose structure is to be analyzed\n        /// </param>\n        /// <param name=\"columnStarts\">\n        /// ArrayList of type double which contains the function output. If analysis fails, this parameter is set to null\n        /// </param>\n        /// <param name=\"tableWidth\">\n        /// Current width of the table. This is used to determine if a new column when added to the end of table should\n        /// come after the last column in the table or is actually splitting the last column in two. If it is only splitting\n        /// the last column it should inherit row span for that column\n        /// </param>\n\t\t/// <param name=\"activeRowSpans\"></param>\n\t\t/// <param name=\"stylesheet\"></param>\n        /// <returns>\n        /// Calculated width of a tbody.\n        /// In case of non-analizable column width structure return 0;\n        /// </returns>\n        private static double AnalyzeTbodyStructure(XmlElement htmlTbodyElement, ArrayList columnStarts, ArrayList activeRowSpans, double tableWidth, CssStylesheet stylesheet)\n        {\n            // Parameter validation\n            Debug.Assert(htmlTbodyElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"tbody\");\n            Debug.Assert(columnStarts != null);\n\n            double tbodyWidth = 0;\n            bool columnWidthsAvailable = true;\n\n            if (!htmlTbodyElement.HasChildNodes)\n            {\n                return tbodyWidth;\n            }\n\n            // Set active row spans to 0 - thus ignoring row spans crossing tbody boundaries\n            ClearActiveRowSpans(activeRowSpans);\n\n            XmlNode htmlChildNode = htmlTbodyElement.FirstChild;\n          \n            // Analyze tr elements\n            while (htmlChildNode != null && columnWidthsAvailable)\n            {\n                switch (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture))\n                {\n                    case \"tr\":\n                        double trWidth = AnalyzeTRStructure((XmlElement)htmlChildNode, columnStarts, activeRowSpans, tbodyWidth, stylesheet);\n                        if (trWidth > tbodyWidth)\n                        {\n                            tbodyWidth = trWidth;\n                        }\n                        break;\n                    case \"td\":\n                        columnWidthsAvailable = false; // interrupt the analisys\n                        break;\n                    default:\n                        break;\n                }\n                htmlChildNode = htmlChildNode.NextSibling;\n            }\n\n            // Set active row spans to 0 - thus ignoring row spans crossing tbody boundaries\n            ClearActiveRowSpans(activeRowSpans);\n\n            return columnWidthsAvailable ? tbodyWidth : 0;\n        }\n\n        /// <summary>\n        /// Performs a parsing pass over a tr element to read information about column width and rowspan attributes.  \n        /// </summary>\n        /// <param name=\"htmlTRElement\">\n        /// XmlElement representing Html tr element whose structure is to be analyzed\n        /// </param>\n        /// <param name=\"columnStarts\">\n        /// ArrayList of type double which contains the function output. If analysis is successful, this ArrayList contains\n        /// all the points which are the starting position of any column in the tr, ordered from left to right. If analysis fails,\n        /// the ArrayList is set to null\n        /// </param>\n        /// <param name=\"activeRowSpans\">\n        /// ArrayList representing all columns currently spanned by an earlier row span attribute. These columns should\n        /// not be used for data in this row. The ArrayList actually contains notation for all columns in the table, if the\n        /// active row span is set to 0 that column is not presently spanned but if it is > 0 the column is presently spanned\n        /// </param>\n        /// <param name=\"tableWidth\">\n        /// Double value representing the current width of the table.\n        /// Return 0 if analisys was insuccessful.\n        /// </param>\n\t\t/// <param name=\"stylesheet\"></param>\n        private static double AnalyzeTRStructure(XmlElement htmlTRElement, ArrayList columnStarts, ArrayList activeRowSpans, double tableWidth, CssStylesheet stylesheet)\n        {\n            double columnWidth;\n\n            // Parameter validation\n            Debug.Assert(htmlTRElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"tr\");\n            Debug.Assert(columnStarts != null);\n            Debug.Assert(activeRowSpans != null);\n            Debug.Assert(columnStarts.Count == activeRowSpans.Count);\n\n            if (!htmlTRElement.HasChildNodes)\n            {\n                return 0;\n            }\n\n            bool columnWidthsAvailable = true;\n\n            double columnStart = 0; // starting position of current column\n            XmlNode htmlChildNode = htmlTRElement.FirstChild;\n            int columnIndex = 0;\n            double trWidth = 0;\n\n            // Skip spanned columns to get to real column start\n            if (columnIndex < activeRowSpans.Count)\n            {\n                Debug.Assert((double)columnStarts[columnIndex] >= columnStart);\n                if ((double)columnStarts[columnIndex] == columnStart)\n                {\n                    // The new column may be in a spanned area\n                    while (columnIndex < activeRowSpans.Count && (int)activeRowSpans[columnIndex] > 0)\n                    {\n                        activeRowSpans[columnIndex] = (int)activeRowSpans[columnIndex] - 1;\n                        Debug.Assert((int)activeRowSpans[columnIndex] >= 0);\n                        columnIndex++;\n                        columnStart = (double)columnStarts[columnIndex];\n                    }\n                }\n            }\n\n            while (htmlChildNode != null && columnWidthsAvailable)\n            {\n                Debug.Assert(columnStarts.Count == activeRowSpans.Count);\n\n                VerifyColumnStartsAscendingOrder(columnStarts);\n\n                switch (htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture))\n                {\n                    case \"td\":\n                        Debug.Assert(columnIndex <= columnStarts.Count);\n                        if (columnIndex < columnStarts.Count)\n                        {\n                            Debug.Assert(columnStart <= (double)columnStarts[columnIndex]);\n                            if (columnStart < (double)columnStarts[columnIndex])\n                            {\n                                columnStarts.Insert(columnIndex, columnStart);\n                                // There can be no row spans now - the column data will appear here\n                                // Row spans may appear only during the column analysis\n                                activeRowSpans.Insert(columnIndex, 0);\n                            }\n                        }\n                        else\n                        {\n                            // Column start is greater than all previous starts. Row span must still be 0 because\n                            // we are either adding after another column of the same row, in which case it should not inherit\n                            // the previous column's span. Otherwise we are adding after the last column of some previous\n                            // row, and assuming the table widths line up, we should not be spanned by it. If there is\n                            // an incorrect tbale structure where a columns starts in the middle of a row span, we do not\n                            // guarantee correct output\n                            columnStarts.Add(columnStart);\n                            activeRowSpans.Add(0);\n                        }\n                        columnWidth = GetColumnWidth((XmlElement)htmlChildNode);\n                        if (columnWidth != -1)\n                        {\n                            int nextColumnIndex;\n                            int rowSpan = GetRowSpan((XmlElement)htmlChildNode);\n\n                            nextColumnIndex = GetNextColumnIndex(columnIndex, columnWidth, columnStarts, activeRowSpans);\n                            if (nextColumnIndex != -1)\n                            {\n                                // Entire column width can be processed without hitting conflicting row span. This means that\n                                // column widths line up and we can process them\n                                Debug.Assert(nextColumnIndex <= columnStarts.Count);\n\n                                // Apply row span to affected columns\n                                for (int spannedColumnIndex = columnIndex; spannedColumnIndex < nextColumnIndex; spannedColumnIndex++)\n                                {\n                                    activeRowSpans[spannedColumnIndex] = rowSpan - 1;\n                                    Debug.Assert((int)activeRowSpans[spannedColumnIndex] >= 0);\n                                }\n\n                                columnIndex = nextColumnIndex;\n\n                                // Calculate columnsStart for the next cell\n                                columnStart = columnStart + columnWidth;\n\n                                if (columnIndex < activeRowSpans.Count)\n                                {\n                                    Debug.Assert((double)columnStarts[columnIndex] >= columnStart);\n                                    if ((double)columnStarts[columnIndex] == columnStart)\n                                    {\n                                        // The new column may be in a spanned area\n                                        while (columnIndex < activeRowSpans.Count && (int)activeRowSpans[columnIndex] > 0)\n                                        {\n                                            activeRowSpans[columnIndex] = (int)activeRowSpans[columnIndex] - 1;\n                                            Debug.Assert((int)activeRowSpans[columnIndex] >= 0);\n                                            columnIndex++;\n                                            columnStart = (double)columnStarts[columnIndex];\n                                        }\n                                    }\n                                    // else: the new column does not start at the same time as a pre existing column\n                                    // so we don't have to check it for active row spans, it starts in the middle\n                                    // of another column which has been checked already by the GetNextColumnIndex function\n                                }\n                            }\n                            else\n                            {\n                                // Full column width cannot be processed without a pre existing row span.\n                                // We cannot analyze widths\n                                columnWidthsAvailable = false;\n                            }\n                        }\n                        else\n                        {\n                            // Incorrect column width, stop processing\n                            columnWidthsAvailable = false;\n                        }\n                        break;\n                    default:\n                        break;\n                }\n\n                htmlChildNode = htmlChildNode.NextSibling;\n            }\n\n            // The width of the tr element is the position at which it's last td element ends, which is calculated in\n            // the columnStart value after each td element is processed\n            if (columnWidthsAvailable)\n            {\n                trWidth = columnStart;\n            }\n            else\n            {\n                trWidth = 0;\n            }\n\n            return trWidth;\n        }\n\n        /// <summary>\n        /// Gets row span attribute from htmlTDElement. Returns an integer representing the value of the rowspan attribute.\n        /// Default value if attribute is not specified or if it is invalid is 1\n        /// </summary>\n        /// <param name=\"htmlTDElement\">\n        /// Html td element to be searched for rowspan attribute\n        /// </param>\n        private static int GetRowSpan(XmlElement htmlTDElement)\n        {\n            string rowSpanAsString;\n            int rowSpan;\n\n            rowSpanAsString = GetAttribute((XmlElement)htmlTDElement, \"rowspan\");\n            if (rowSpanAsString != null)\n            {\n                if (!Int32.TryParse(rowSpanAsString, out rowSpan))\n                {\n                    // Ignore invalid value of rowspan; treat it as 1\n                    rowSpan = 1;\n                }\n            }\n            else\n            {\n                // No row span, default is 1\n                rowSpan = 1;\n            }\n            return rowSpan;\n        }\n\n        /// <summary>\n        /// Gets index at which a column should be inseerted into the columnStarts ArrayList. This is\n        /// decided by the value columnStart. The columnStarts ArrayList is ordered in ascending order.\n        /// Returns an integer representing the index at which the column should be inserted\n        /// </summary>\n\t\t/// <param name=\"columnStarts\">\n        /// Array list representing starting coordinates of all columns in the table\n        /// </param>\n\t\t/// <param name=\"columnWidth\">\n        /// </param>\n        /// <param name=\"columnIndex\">\n        /// Int representing the current column index. This acts as a clue while finding the insertion index.\n        /// If the value of columnStarts at columnIndex is the same as columnStart, then this position alrady exists\n        /// in the array and we can jsut return columnIndex.\n        /// </param>\n\t\t/// <param name=\"activeRowSpans\"></param>\n        /// <returns></returns>\n        private static int GetNextColumnIndex(int columnIndex, double columnWidth, ArrayList columnStarts, ArrayList activeRowSpans)\n        {\n            double columnStart;\n            int spannedColumnIndex;\n\n            // Parameter validation\n            Debug.Assert(columnStarts != null);\n            Debug.Assert(0 <= columnIndex && columnIndex <= columnStarts.Count);\n            Debug.Assert(columnWidth > 0);\n\n            columnStart = (double)columnStarts[columnIndex];\n            spannedColumnIndex = columnIndex + 1;\n\n            while (spannedColumnIndex < columnStarts.Count && (double)columnStarts[spannedColumnIndex] < columnStart + columnWidth && spannedColumnIndex != -1)\n            {\n                if ((int)activeRowSpans[spannedColumnIndex] > 0)\n                {\n                    // The current column should span this area, but something else is already spanning it\n                    // Not analyzable\n                    spannedColumnIndex = -1;\n                }\n                else\n                {\n                    spannedColumnIndex++;\n                }\n            }\n\n            return spannedColumnIndex;\n        }\n\n        \n        /// <summary>\n        /// Used for clearing activeRowSpans array in the beginning/end of each tbody\n        /// </summary>\n        /// <param name=\"activeRowSpans\">\n        /// ArrayList representing currently active row spans\n        /// </param>\n        private static void ClearActiveRowSpans(ArrayList activeRowSpans)\n        {\n            for (int columnIndex = 0; columnIndex < activeRowSpans.Count; columnIndex++)\n            {\n                activeRowSpans[columnIndex] = 0;\n            }\n        }\n\n        /// <summary>\n        /// Used for initializing activeRowSpans array in the before adding rows to tbody element\n        /// </summary>\n        /// <param name=\"activeRowSpans\">\n        /// ArrayList representing currently active row spans\n        /// </param>\n        /// <param name=\"count\">\n        /// Size to be give to array list\n        /// </param>\n        private static void InitializeActiveRowSpans(ArrayList activeRowSpans, int count)\n        {\n            for (int columnIndex = 0; columnIndex < count; columnIndex++)\n            {\n                activeRowSpans.Add(0);\n            }\n        }\n\n\n        /// <summary>\n        /// Calculates width of next TD element based on starting position of current element and it's width, which\n        /// is calculated byt he function\n        /// </summary>\n        /// <param name=\"htmlTDElement\">\n        /// XmlElement representing Html td element whose width is to be read\n        /// </param>\n        /// <param name=\"columnStart\">\n        /// Starting position of current column\n        /// </param>\n        private static double GetNextColumnStart(XmlElement htmlTDElement, double columnStart)\n        {\n            double columnWidth;\n            double nextColumnStart;\n            \n            // Parameter validation\n\t\t\tDebug.Assert(htmlTDElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"td\" || htmlTDElement.LocalName.ToLower(CultureInfo.InvariantCulture) == \"th\");\n            Debug.Assert(columnStart >= 0);\n\n            nextColumnStart = -1;  // -1 indicates inability to calculate columnStart width\n\n            columnWidth = GetColumnWidth(htmlTDElement);\n\n            if (columnWidth == -1)\n            {\n                nextColumnStart = -1;\n            }\n            else\n            {\n                nextColumnStart = columnStart + columnWidth;\n            }\n\n            return nextColumnStart;\n        }\n\n\n        private static double GetColumnWidth(XmlElement htmlTDElement)\n        {\n            string columnWidthAsString;\n            double columnWidth;\n\n            columnWidthAsString = null;\n            columnWidth = -1;\n\n            // Get string valkue for the width\n            columnWidthAsString = GetAttribute(htmlTDElement, \"width\");\n            if (columnWidthAsString == null)\n            {\n                columnWidthAsString = GetCssAttribute(GetAttribute(htmlTDElement, \"style\"), \"width\");\n            }\n\n            // We do not allow column width to be 0, if specified as 0 we will fail to record it\n            if (!TryGetLengthValue(columnWidthAsString, out columnWidth) || columnWidth == 0)\n            {\n                columnWidth = -1;\n            }\n            return columnWidth;\n        }\n\n        /// <summary>\n        /// Calculates column span based the column width and the widths of all other columns. Returns an integer representing \n        /// the column span\n        /// </summary>\n        /// <param name=\"columnIndex\">\n        /// Index of the current column\n        /// </param>\n        /// <param name=\"columnWidth\">\n        /// Width of the current column\n        /// </param>\n        /// <param name=\"columnStarts\">\n        /// ArrayList repsenting starting coordinates of all columns\n        /// </param>\n        private static int CalculateColumnSpan(int columnIndex, double columnWidth, ArrayList columnStarts)\n        {\n            // Current status of column width. Indicates the amount of width that has been scanned already\n            double columnSpanningValue;\n            int columnSpanningIndex;\n            int columnSpan;\n            double subColumnWidth; // Width of the smallest-grain columns in the table\n\n            Debug.Assert(columnStarts != null);\n            Debug.Assert(columnIndex < columnStarts.Count - 1);\n            Debug.Assert((double)columnStarts[columnIndex] >= 0);\n            Debug.Assert(columnWidth > 0);\n\n            columnSpanningIndex = columnIndex;\n            columnSpanningValue = 0;\n            columnSpan = 0;\n            subColumnWidth = 0;\n\n            while (columnSpanningValue <  columnWidth && columnSpanningIndex < columnStarts.Count - 1)\n            {\n                subColumnWidth = (double)columnStarts[columnSpanningIndex + 1] - (double)columnStarts[columnSpanningIndex];\n                Debug.Assert(subColumnWidth > 0);\n                columnSpanningValue += subColumnWidth;\n                columnSpanningIndex++;\n            }\n\n            // Now, we have either covered the width we needed to cover or reached the end of the table, in which\n            // case the column spans all the columns until the end\n            columnSpan = columnSpanningIndex - columnIndex;\n            Debug.Assert(columnSpan > 0);\n\n            return columnSpan;\n        }\n\n        /// <summary>\n        /// Verifies that values in columnStart, which represent starting coordinates of all columns, are arranged\n        /// in ascending order\n        /// </summary>\n        /// <param name=\"columnStarts\">\n        /// ArrayList representing starting coordinates of all columns\n        /// </param>\n        private static void VerifyColumnStartsAscendingOrder(ArrayList columnStarts)\n        {\n            Debug.Assert(columnStarts != null);\n\n            double columnStart;\n\n            columnStart = -0.01;\n\n            for (int columnIndex = 0; columnIndex < columnStarts.Count; columnIndex++)\n            {\n                Debug.Assert(columnStart < (double)columnStarts[columnIndex]);\n                columnStart = (double)columnStarts[columnIndex];\n            }\n        }\n\n        // .............................................................\n        //\n        // Attributes and Properties\n        //\n        // .............................................................\n\n        /// <summary>\n        /// Analyzes local properties of Html element, converts them into Xaml equivalents, and applies them to xamlElement\n        /// </summary>\n        /// <param name=\"xamlElement\">\n        /// XmlElement representing Xaml element to which properties are to be applied\n        /// </param>\n        /// <param name=\"localProperties\">\n        /// Hashtable representing local properties of Html element that is converted into xamlElement\n        /// </param>\n\t\t/// <param name=\"isBlock\"></param>\n        private static void ApplyLocalProperties(XmlElement xamlElement, Hashtable localProperties, bool isBlock)\n        {\n            bool marginSet = false;\n            string marginTop = \"0\";\n            string marginBottom = \"0\";\n            string marginLeft = \"0\";\n            string marginRight = \"0\";\n\n            bool paddingSet = false;\n            string paddingTop = \"0\";\n            string paddingBottom = \"0\";\n            string paddingLeft = \"0\";\n            string paddingRight = \"0\";\n\n            string borderColor = null;\n\n            bool borderThicknessSet = false;\n            string borderThicknessTop = \"0\";\n            string borderThicknessBottom = \"0\";\n            string borderThicknessLeft = \"0\";\n            string borderThicknessRight = \"0\";\n\n            IDictionaryEnumerator propertyEnumerator = localProperties.GetEnumerator();\n            while (propertyEnumerator.MoveNext())\n            {\n                switch ((string)propertyEnumerator.Key)\n                {\n                    case \"font-family\":\n                        //  Convert from font-family value list into xaml FontFamily value\n                        xamlElement.SetAttribute(Xaml_FontFamily, (string)propertyEnumerator.Value);\n                        break;\n                    case \"font-style\":\n                        xamlElement.SetAttribute(Xaml_FontStyle, (string)propertyEnumerator.Value);\n                        break;\n                    case \"font-variant\":\n                        //  Convert from font-variant into xaml property\n                        break;\n                    case \"font-weight\":\n                        xamlElement.SetAttribute(Xaml_FontWeight, (string)propertyEnumerator.Value);\n                        break;\n                    case \"font-size\":\n                        //  Convert from css size into FontSize\n                        xamlElement.SetAttribute(Xaml_FontSize, (string)propertyEnumerator.Value);\n                        break;\n                    case \"color\":\n                        SetPropertyValue(xamlElement, TextElement.ForegroundProperty, (string)propertyEnumerator.Value);\n                        break;\n                    case \"background-color\":\n                        SetPropertyValue(xamlElement, TextElement.BackgroundProperty, (string)propertyEnumerator.Value);\n                        break;\n                    case \"text-decoration-underline\":\n                        if (!isBlock)\n                        {\n                            if ((string)propertyEnumerator.Value == \"true\")\n                            {\n                                xamlElement.SetAttribute(Xaml_TextDecorations, Xaml_TextDecorations_Underline);\n                            }\n                        }\n                        break;\n                    case \"text-decoration-none\":\n                    case \"text-decoration-overline\":\n                    case \"text-decoration-line-through\":\n                    case \"text-decoration-blink\":\n                        //  Convert from all other text-decorations values\n                        if (!isBlock)\n                        {\n                        }\n                        break;\n                    case \"text-transform\":\n                        //  Convert from text-transform into xaml property\n                        break;\n\n                    case \"text-indent\":\n                        if (isBlock)\n                        {\n                            xamlElement.SetAttribute(Xaml_TextIndent, (string)propertyEnumerator.Value);\n                        }\n                        break;\n\n                    case \"text-align\":\n                        if (isBlock)\n                        {\n                            xamlElement.SetAttribute(Xaml_TextAlignment, (string)propertyEnumerator.Value);\n                        }\n                        break;\n\n                    case \"width\":\n                    case \"height\":\n                        //  Decide what to do with width and height propeties\n                        break;\n\n                    case \"margin-top\":\n                        marginSet = true;\n                        marginTop = (string)propertyEnumerator.Value;\n                        break;\n                    case \"margin-right\":\n                        marginSet = true;\n                        marginRight = (string)propertyEnumerator.Value;\n                        break;\n                    case \"margin-bottom\":\n                        marginSet = true;\n                        marginBottom = (string)propertyEnumerator.Value;\n                        break;\n                    case \"margin-left\":\n                        marginSet = true;\n                        marginLeft = (string)propertyEnumerator.Value;\n                        break;\n\n                    case \"padding-top\":\n                        paddingSet = true;\n                        paddingTop = (string)propertyEnumerator.Value;\n                        break;\n                    case \"padding-right\":\n                        paddingSet = true;\n                        paddingRight = (string)propertyEnumerator.Value;\n                        break;\n                    case \"padding-bottom\":\n                        paddingSet = true;\n                        paddingBottom = (string)propertyEnumerator.Value;\n                        break;\n                    case \"padding-left\":\n                        paddingSet = true;\n                        paddingLeft = (string)propertyEnumerator.Value;\n                        break;\n\n                    // NOTE: css names for elementary border styles have side indications in the middle (top/bottom/left/right)\n                    // In our internal notation we intentionally put them at the end - to unify processing in ParseCssRectangleProperty method\n                    case \"border-color-top\":\n                        borderColor = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-color-right\":\n                        borderColor = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-color-bottom\":\n                        borderColor = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-color-left\":\n                        borderColor = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-style-top\":\n                    case \"border-style-right\":\n                    case \"border-style-bottom\":\n                    case \"border-style-left\":\n                        //  Implement conversion from border style\n                        break;\n                    case \"border-width-top\":\n                        borderThicknessSet = true;\n                        borderThicknessTop = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-width-right\":\n                        borderThicknessSet = true;\n                        borderThicknessRight = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-width-bottom\":\n                        borderThicknessSet = true;\n                        borderThicknessBottom = (string)propertyEnumerator.Value;\n                        break;\n                    case \"border-width-left\":\n                        borderThicknessSet = true;\n                        borderThicknessLeft = (string)propertyEnumerator.Value;\n                        break;\n\n                    case \"list-style-type\":\n                        if (xamlElement.LocalName == XamlList)\n                        {\n                            string markerStyle;\n\t\t\t\t\t\t\tswitch (((string)propertyEnumerator.Value).ToLower(CultureInfo.InvariantCulture))\n                            {\n                                case \"disc\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Disc;\n                                    break;\n                                case \"circle\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Circle;\n                                    break;\n                                case \"none\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_None;\n                                    break;\n                                case \"square\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Square;\n                                    break;\n                                case \"box\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Box;\n                                    break;\n                                case \"lower-latin\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_LowerLatin;\n                                    break;\n                                case \"upper-latin\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_UpperLatin;\n                                    break;\n                                case \"lower-roman\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_LowerRoman;\n                                    break;\n                                case \"upper-roman\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_UpperRoman;\n                                    break;\n                                case \"decimal\":\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Decimal;\n                                    break;\n                                default:\n                                    markerStyle = HtmlToXamlConverter.Xaml_List_MarkerStyle_Disc;\n                                    break;\n                            }\n                            xamlElement.SetAttribute(HtmlToXamlConverter.XamlListMarkerStyle, markerStyle);\n                        }\n                        break;\n\n                    case \"float\":\n                    case \"clear\":\n                        if (isBlock)\n                        {\n                            //  Convert float and clear properties\n                        }\n                        break;\n\n                    case \"display\":\n                        break;\n                }\n            }\n\n            if (isBlock)\n            {\n                if (marginSet)\n                {\n                    ComposeThicknessProperty(xamlElement, Xaml_Margin, marginLeft, marginRight, marginTop, marginBottom);\n                }\n\n                if (paddingSet)\n                {\n                    ComposeThicknessProperty(xamlElement, Xaml_Padding, paddingLeft, paddingRight, paddingTop, paddingBottom);\n                }\n\n                if (borderColor != null)\n                {\n                    //  We currently ignore possible difference in brush colors on different border sides. Use the last colored side mentioned\n                    xamlElement.SetAttribute(Xaml_BorderBrush, borderColor);\n                }\n\n                if (borderThicknessSet)\n                {\n                    ComposeThicknessProperty(xamlElement, Xaml_BorderThickness, borderThicknessLeft, borderThicknessRight, borderThicknessTop, borderThicknessBottom);\n                }\n            }\n        }\n\n        // Create syntactically optimized four-value Thickness\n        private static void ComposeThicknessProperty(XmlElement xamlElement, string propertyName, string left, string right, string top, string bottom)\n        {\n            // Xaml syntax:\n            // We have a reasonable interpreation for one value (all four edges), two values (horizontal, vertical),\n            // and four values (left, top, right, bottom).\n            //  switch (i) {\n            //    case 1: return new Thickness(lengths[0]);\n            //    case 2: return new Thickness(lengths[0], lengths[1], lengths[0], lengths[1]);\n            //    case 4: return new Thickness(lengths[0], lengths[1], lengths[2], lengths[3]);\n            //  }\n            string thickness;\n\n            // We do not accept negative margins\n            if (left[0] == '0' || left[0] == '-') left = \"0\";\n            if (right[0] == '0' || right[0] == '-') right = \"0\";\n            if (top[0] == '0' || top[0] == '-') top = \"0\";\n            if (bottom[0] == '0' || bottom[0] == '-') bottom = \"0\";\n\n            if (left == right && top == bottom)\n            {\n                if (left == top)\n                {\n                    thickness = left;\n                }\n                else\n                {\n                    thickness = left + \",\" + top;\n                }\n            }\n            else\n            {\n                thickness = left + \",\" + top + \",\" + right + \",\" + bottom;\n            }\n\n            //  Need safer processing for a thickness value\n            xamlElement.SetAttribute(propertyName, thickness);\n        }\n\n        private static void SetPropertyValue(XmlElement xamlElement, DependencyProperty property, string stringValue)\n        {\n            System.ComponentModel.TypeConverter typeConverter = System.ComponentModel.TypeDescriptor.GetConverter(property.PropertyType);\n            try\n            {\n                object convertedValue = typeConverter.ConvertFromInvariantString(stringValue);\n                if (convertedValue != null)\n                {\n                    xamlElement.SetAttribute(property.Name, stringValue);\n                }\n            }\n            catch(Exception)\n            {\n            }\n        }\n\n        /// <summary>\n        /// Analyzes the tag of the htmlElement and infers its associated formatted properties.\n        /// After that parses style attribute and adds all inline css styles.\n        /// The resulting style attributes are collected in output parameter localProperties.\n        /// </summary>\n        /// <param name=\"htmlElement\">\n        /// </param>\n        /// <param name=\"inheritedProperties\">\n        /// set of properties inherited from ancestor elements. Currently not used in the code. Reserved for the future development.\n        /// </param>\n        /// <param name=\"localProperties\">\n        /// returns all formatting properties defined by this element - implied by its tag, its attributes, or its css inline style\n        /// </param>\n        /// <param name=\"stylesheet\"></param>\n        /// <param name=\"sourceContext\"></param>\n        /// <returns>\n        /// returns a combination of previous context with local set of properties.\n        /// This value is not used in the current code - inntended for the future development.\n        /// </returns>\n        private static Hashtable GetElementProperties(XmlElement htmlElement, Hashtable inheritedProperties, out Hashtable localProperties, CssStylesheet stylesheet, List<XmlElement> sourceContext)\n        {\n            // Start with context formatting properties\n            Hashtable currentProperties = new Hashtable();\n            IDictionaryEnumerator propertyEnumerator = inheritedProperties.GetEnumerator();\n            while (propertyEnumerator.MoveNext())\n            {\n                currentProperties[propertyEnumerator.Key] = propertyEnumerator.Value;\n            }\n\n            // Identify element name\n\t\t\tstring elementName = htmlElement.LocalName.ToLower(CultureInfo.InvariantCulture);\n            string elementNamespace = htmlElement.NamespaceURI;\n\n            // update current formatting properties depending on element tag\n\n            localProperties = new Hashtable();\n            switch (elementName)\n            {\n                // Character formatting\n                case \"i\":\n                case \"italic\":\n                case \"em\":\n                    localProperties[\"font-style\"] = \"italic\";\n                    break;\n                case \"b\":\n                case \"bold\":\n                case \"strong\":\n                case \"dfn\":\n                    localProperties[\"font-weight\"] = \"bold\";\n                    break;\n                case \"u\":\n                case \"underline\":\n                    localProperties[\"text-decoration-underline\"] = \"true\";\n                    break;\n                case \"font\":\n                    string attributeValue = GetAttribute(htmlElement, \"face\");\n                    if (attributeValue != null)\n                    {\n                        localProperties[\"font-family\"] = attributeValue;\n                    }\n                    attributeValue = GetAttribute(htmlElement, \"size\");\n                    if (attributeValue != null)\n                    {\n\t\t\t\t\t\tdouble fontSize = double.Parse(attributeValue, CultureInfo.InvariantCulture) * (12.0 / 3.0);\n                        if (fontSize < 1.0)\n                        {\n                            fontSize = 1.0;\n                        }\n                        else if (fontSize > 1000.0)\n                        {\n                            fontSize = 1000.0;\n                        }\n\t\t\t\t\t\tlocalProperties[\"font-size\"] = fontSize.ToString(CultureInfo.InvariantCulture);\n                    }\n                    attributeValue = GetAttribute(htmlElement, \"color\");\n                    if (attributeValue != null)\n                    {\n                        localProperties[\"color\"] = attributeValue;\n                    }\n                    break;\n                case \"samp\":\n                    localProperties[\"font-family\"] = \"Courier New\"; // code sample\n                    localProperties[\"font-size\"] = Xaml_FontSize_XXSmall;\n                    localProperties[\"text-align\"] = \"Left\";\n                    break;\n                case \"sub\":\n                    break;\n                case \"sup\":\n                    break;\n\n                // Hyperlinks\n                case \"a\": // href, hreflang, urn, methods, rel, rev, title\n                    //  Set default hyperlink properties\n                    break;\n                case \"acronym\":\n                    break;\n\n                // Paragraph formatting:\n                case \"p\":\n                    //  Set default paragraph properties\n                    break;\n                case \"div\":\n                    //  Set default div properties\n                    break;\n                case \"pre\":\n                    localProperties[\"font-family\"] = \"Courier New\"; // renders text in a fixed-width font\n                    localProperties[\"font-size\"] = Xaml_FontSize_XXSmall;\n                    localProperties[\"text-align\"] = \"Left\";\n                    break;\n                case \"blockquote\":\n                    localProperties[\"margin-left\"] = \"16\";\n                    break;\n\n                case \"h1\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_XXLarge;\n                    break;\n                case \"h2\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_XLarge;\n                    break;\n                case \"h3\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_Large;\n                    break;\n                case \"h4\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_Medium;\n                    break;\n                case \"h5\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_Small;\n                    break;\n                case \"h6\":\n                    localProperties[\"font-size\"] = Xaml_FontSize_XSmall;\n                    break;\n                // List properties\n                case \"ul\":\n                    localProperties[\"list-style-type\"] = \"disc\";\n                    break;\n                case \"ol\":\n                    localProperties[\"list-style-type\"] = \"decimal\";\n                    break;\n\n                case \"table\":\n                case \"body\":\n                case \"html\":\n                    break;\n            }\n\n            // Override html defaults by css attributes - from stylesheets and inline settings\n            HtmlCssParser.GetElementPropertiesFromCssAttributes(htmlElement, elementName, stylesheet, localProperties, sourceContext);\n\n            // Combine local properties with context to create new current properties\n            propertyEnumerator = localProperties.GetEnumerator();\n            while (propertyEnumerator.MoveNext())\n            {\n                currentProperties[propertyEnumerator.Key] = propertyEnumerator.Value;\n            }\n\n            return currentProperties;\n        }\n\n        /// <summary>\n        /// Extracts a value of css attribute from css style definition.\n        /// </summary>\n        /// <param name=\"cssStyle\">\n        /// Source csll style definition\n        /// </param>\n        /// <param name=\"attributeName\">\n        /// A name of css attribute to extract\n        /// </param>\n        /// <returns>\n        /// A string rrepresentation of an attribute value if found;\n        /// null if there is no such attribute in a given string.\n        /// </returns>\n        private static string GetCssAttribute(string cssStyle, string attributeName)\n        {\n            //  This is poor man's attribute parsing. Replace it by real css parsing\n            if (cssStyle != null)\n            {\n                string[] styleValues;\n\n\t\t\t\tattributeName = attributeName.ToLower(CultureInfo.InvariantCulture);\n\n                // Check for width specification in style string\n                styleValues = cssStyle.Split(';');\n\n                for (int styleValueIndex = 0; styleValueIndex < styleValues.Length; styleValueIndex++)\n                {\n                    string[] styleNameValue;\n\n                    styleNameValue = styleValues[styleValueIndex].Split(':');\n                    if (styleNameValue.Length == 2)\n                    {\n\t\t\t\t\t\tif (styleNameValue[0].Trim().ToLower(CultureInfo.InvariantCulture) == attributeName)\n                        {\n                            return styleNameValue[1].Trim();\n                        }\n                    }\n                }\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Converts a length value from string representation to a double.\n        /// </summary>\n        /// <param name=\"lengthAsString\">\n        /// Source string value of a length.\n        /// </param>\n        /// <param name=\"length\"></param>\n        /// <returns></returns>\n        private static bool TryGetLengthValue(string lengthAsString, out double length)\n        {\n            length = Double.NaN;\n\n            if (lengthAsString != null)\n            {\n\t\t\t\tlengthAsString = lengthAsString.Trim().ToLower(CultureInfo.InvariantCulture);\n\n                // We try to convert currentColumnWidthAsString into a double. This will eliminate widths of type \"50%\", etc.\n                if (lengthAsString.EndsWith(\"pt\", StringComparison.OrdinalIgnoreCase))\n                {\n                    lengthAsString = lengthAsString.Substring(0, lengthAsString.Length - 2);\n                    if (Double.TryParse(lengthAsString, out length))\n                    {\n                        length = (length * 96.0) / 72.0; // convert from points to pixels\n                    }\n                    else\n                    {\n                        length = Double.NaN;\n                    }\n                }\n                else if (lengthAsString.EndsWith(\"px\", StringComparison.OrdinalIgnoreCase))\n                {\n                    lengthAsString = lengthAsString.Substring(0, lengthAsString.Length - 2);\n                    if (!Double.TryParse(lengthAsString, out length))\n                    {\n                        length = Double.NaN;\n                    }\n                }\n                else\n                {\n                    if (!Double.TryParse(lengthAsString, out length)) // Assuming pixels\n                    {\n                        length = Double.NaN;\n                    }\n                }\n            }\n\n            return !Double.IsNaN(length);\n        }\n\n        // .................................................................\n        //\n        // Pasring Color Attribute\n        //\n        // .................................................................\n\n        private static string GetColorValue(string colorValue)\n        {\n            // TODO: Implement color conversion\n            return colorValue;\n        }\n\n        /// <summary>\n        /// Applies properties to xamlTableCellElement based on the html td element it is converted from.\n        /// </summary>\n        /// <param name=\"htmlChildNode\">\n        /// Html td/th element to be converted to xaml\n        /// </param>\n        /// <param name=\"xamlTableCellElement\">\n        /// XmlElement representing Xaml element for which properties are to be processed\n        /// </param>\n        /// <remarks>\n        /// TODO: Use the processed properties for htmlChildNode instead of using the node itself \n        /// </remarks>\n        private static void ApplyPropertiesToTableCellElement(XmlElement htmlChildNode, XmlElement xamlTableCellElement)\n        {\n            // Parameter validation\n\t\t\tDebug.Assert(htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"td\" || htmlChildNode.LocalName.ToLower(CultureInfo.InvariantCulture) == \"th\");\n            Debug.Assert(xamlTableCellElement.LocalName == Xaml_TableCell);\n\n            // set default border thickness for xamlTableCellElement to enable gridlines\n            xamlTableCellElement.SetAttribute(Xaml_TableCell_BorderThickness, \"1,1,1,1\");\n            xamlTableCellElement.SetAttribute(Xaml_TableCell_BorderBrush, Xaml_Brushes_Black);\n            string rowSpanString = GetAttribute((XmlElement)htmlChildNode, \"rowspan\");\n            if (rowSpanString != null)\n            {\n                xamlTableCellElement.SetAttribute(Xaml_TableCell_RowSpan, rowSpanString);\n            }\n        }\n\n        #endregion Private Methods\n\n        // ----------------------------------------------------------------\n        //\n        // Internal Constants\n        //\n        // ----------------------------------------------------------------\n\n        // The constants reprtesent all Xaml names used in a conversion\n\t\t/// <summary></summary>\n        public const string XamlFlowDocument = \"FlowDocument\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlRun = \"Run\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlSpan = \"Span\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlHyperlink = \"Hyperlink\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlHyperlinkNavigateUri = \"NavigateUri\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlHyperlinkTargetName = \"TargetName\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlSection = \"Section\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlList = \"List\";\n\t\t/// <summary></summary>\n\t\tpublic const string XamlListMarkerStyle = \"MarkerStyle\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_None = \"None\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_Decimal = \"Decimal\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_Disc = \"Disc\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_Circle = \"Circle\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_Square = \"Square\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_Box = \"Box\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_LowerLatin = \"LowerLatin\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_UpperLatin = \"UpperLatin\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_LowerRoman = \"LowerRoman\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_List_MarkerStyle_UpperRoman = \"UpperRoman\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_ListItem = \"ListItem\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_LineBreak = \"LineBreak\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Paragraph = \"Paragraph\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Margin = \"Margin\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Padding = \"Padding\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_BorderBrush = \"BorderBrush\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_BorderThickness = \"BorderThickness\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Table = \"Table\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableColumn = \"TableColumn\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableRowGroup = \"TableRowGroup\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableRow = \"TableRow\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableCell = \"TableCell\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableCell_BorderThickness = \"BorderThickness\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableCell_BorderBrush = \"BorderBrush\";\n\t\t/// <summary></summary>\n        public const string Xaml_TableCell_ColumnSpan = \"ColumnSpan\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TableCell_RowSpan = \"RowSpan\";\n\t\t/// <summary></summary>\n        public const string Xaml_Width = \"Width\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Brushes_Black = \"Black\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontFamily = \"FontFamily\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize = \"FontSize\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_XXLarge = \"22pt\"; // \"XXLarge\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_XLarge = \"20pt\"; // \"XLarge\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_Large = \"18pt\"; // \"Large\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_Medium = \"16pt\"; // \"Medium\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_Small = \"12pt\"; // \"Small\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_XSmall = \"10pt\"; // \"XSmall\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontSize_XXSmall = \"8pt\"; // \"XXSmall\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontWeight = \"FontWeight\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_FontWeight_Bold = \"Bold\";\n\t\t/// <summary></summary>\n        public const string Xaml_FontStyle = \"FontStyle\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Foreground = \"Foreground\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_Background = \"Background\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TextDecorations = \"TextDecorations\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TextDecorations_Underline = \"Underline\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TextIndent = \"TextIndent\";\n\t\t/// <summary></summary>\n\t\tpublic const string Xaml_TextAlignment = \"TextAlignment\";\n\n        // ---------------------------------------------------------------------\n        //\n        // Private Fields\n        //\n        // ---------------------------------------------------------------------\n\n        #region Private Fields\n\n        static string _xamlNamespace = \"http://schemas.microsoft.com/winfx/2006/xaml/presentation\";\n\n        #endregion Private Fields\n    }\n}\n"
  },
  {
    "path": "WpfRichText/XamlToHtmlParser/HtmlTokenType.cs",
    "content": "//---------------------------------------------------------------------------\n// \n// File: HtmlTokenType.cs\n//\n// Copyright (C) Microsoft Corporation.  All rights reserved.\n//\n// Description: Definition of token types supported by HtmlLexicalAnalyzer\n//\n//---------------------------------------------------------------------------\n\nnamespace WpfRichText\n{\n    /// <summary>\n    /// types of lexical tokens for html-to-xaml converter\n    /// </summary>\n    internal enum HtmlTokenType\n    {\n        OpeningTagStart,\n        ClosingTagStart,\n        TagEnd,\n        EmptyTagEnd,\n        EqualSign,\n        Name,\n        Atom, // any attribute value not in quotes\n        Text, //text content when accepting text\n        Comment,\n        EOF,\n    }\n}\n"
  }
]